daily update on 20241002 by nitload youmu, intrinsic function rebuild, syntax style arrange

This commit is contained in:
Nitload
2024-10-03 04:03:06 +08:00
parent 0979123ac0
commit 6e2f93b053
265 changed files with 26732 additions and 19058 deletions
+34 -31
View File
@@ -44,10 +44,12 @@ namespace StgSharp.MVVM.View
{
public abstract partial class ViewBase
{
public interface IViewDesigner<out TView> where TView : ViewBase
public interface IViewDesigner<out TView> where TView: ViewBase
{
abstract void CustomizedInitialize();
abstract void Initialize();
abstract bool ValidateInitializing();
@@ -55,11 +57,12 @@ namespace StgSharp.MVVM.View
}
/// <summary>
/// ViewDesigner provides descriptions of various controls in the view,
/// binds the controls to specific user actions and behaviors,
/// and describes the layout and interactions of each control.
/// ViewDesigner provides descriptions of various controls in the view, binds the controls
/// to specific user actions and behaviors, and describes the layout and interactions of
/// each control.
/// </summary>
public abstract class ViewDesigner<TView> : IViewDesigner<TView> where TView : ViewBase
public abstract class ViewDesigner<TView> : IViewDesigner<TView>
where TView: ViewBase
{
private KeyboardButtonGroup currentButtonGroup;
@@ -67,7 +70,7 @@ namespace StgSharp.MVVM.View
private List<ControllingItem> _controlList;
protected TView _binding;
public ViewDesigner(TView binding)
public ViewDesigner( TView binding )
{
_binding = binding;
_controlList = new List<ControllingItem>();
@@ -79,52 +82,52 @@ namespace StgSharp.MVVM.View
}
public CharacterLineIndexImage CreateCharacterLine(
int length, char blankFilling, PlainGeometryMesh tittle, IEnumerable<(char, PlainGeometryMesh)> charList
)
int length,
char blankFilling,
PlainGeometryMesh tittle,
IEnumerable<(char, PlainGeometryMesh)> charList )
{
CharacterLineIndexImage ret = new CharacterLineIndexImage(length, blankFilling, tittle, charList);
_controlList.Add(ret);
CharacterLineIndexImage ret = new CharacterLineIndexImage(
length, blankFilling, tittle, charList );
_controlList.Add( ret );
return ret;
}
public TriggerButton CreateKeyboardButton(
Rectangle bonding, TextureProvider defaultAnimation, bool isEnable
)
Rectangle bonding,
TextureProvider defaultAnimation,
bool isEnable )
{
TriggerButton ret = new TriggerButton();
ret.BoundingBox = bonding;
ret.Texture = defaultAnimation;
if (isEnable)
{
if( isEnable ) {
ret.IsDisabled = false;
ret.Enable();
}
else
{
} else {
ret.IsDisabled = true;
ret.Disable();
}
currentButtonGroup.AddButton(ret);
currentButtonGroup.AddButton( ret );
return ret;
}
public TButtonGroup CreateKeyboardButtonGroup<TButtonGroup>(
ITrigger leftBidning,
ITrigger rightBinding,
ITrigger upBinding,
ITrigger downBinding,
ITrigger confirmBinding
)
where TButtonGroup : KeyboardButtonGroup, new()
IClickTrigger leftBidning,
IClickTrigger rightBinding,
IClickTrigger upBinding,
IClickTrigger downBinding,
IClickTrigger confirmBinding )
where TButtonGroup: KeyboardButtonGroup, new()
{
TButtonGroup ret = new TButtonGroup();
_controlList.Add(ret);
_controlList.Add( ret );
currentButtonGroup = ret;
_binding.Responder[leftBidning] = ret.MoveLeft;
_binding.Responder[rightBinding] = ret.MoveRight;
_binding.Responder[upBinding] = ret.MoveUp;
_binding.Responder[downBinding] = ret.MoveDown;
_binding.Responder[confirmBinding] = ret.Confirm;
_binding.Responder[ leftBidning ] = ret.MoveLeft;
_binding.Responder[ rightBinding ] = ret.MoveRight;
_binding.Responder[ upBinding ] = ret.MoveUp;
_binding.Responder[ downBinding ] = ret.MoveDown;
_binding.Responder[ confirmBinding ] = ret.Confirm;
return ret;
}