Example #1
0
        void IUserInteractive.OnPointerPress(IPointer cursor, uint button, InputEventModifier modifiers)
        {
            // We become focused.
            if (parent is IContainer)
            {
                (parent as IContainer).Focused = this;
            }
            else
            {
                FocusChange(true);
            }

            if (this is IContainer)
            {
                // We make sure no child is focused.
                (this as IContainer).Focused = null;
            }

            OnPointerPressInternal(cursor, button, modifiers);


            Action4 <Area, IPointer, uint, InputEventModifier> t = onMousePressed;

            if (t != null)
            {
                t(this, cursor, button, modifiers);
            }
        }
Example #2
0
        private static IObjectSet ExecuteQuery(IQuery query, Action4 monitorAction)
        {
            var result = query.Execute();

            ((IInternalQuery)query).Container.WithEnvironment(monitorAction);
            return(result);
        }
Example #3
0
        internal void AddAction_4(double id, string content)
        {
            Action4 action4 = new Action4();

            action4.ID      = id;
            action4.Content = content;
            _actions_4.Add(action4);
        }
Example #4
0
            public ConsoleMethod_Action4(Action4 method, MethodDescription description) : base(description)
            {
                if (method == null)
                {
                    throw new ArgumentNullException(nameof(method));
                }

                this.method = method;
            }
Example #5
0
        void IUserInteractive.OnKeyRelease(IPointer cursor, KeyCodes code, KeyboardModifiers modifiers)
        {
            OnKeyReleaseInternal(cursor, code, modifiers);

            Action4 <Area, IPointer, KeyCodes, KeyboardModifiers> t = onKeyReleased;

            if (t != null)
            {
                t(this, cursor, code, modifiers);
            }
        }
		protected void AssertCounter(PerformanceCounter performanceCounter, Action4 action)
		{
			using (PerformanceCounter counter = performanceCounter)
			{
				Assert.AreEqual(0, counter.RawValue);

				for (int i = 0; i < 3; ++i)
				{
					action();
					Assert.AreEqual(i + 1, counter.RawValue);
				}
			}
		}
Example #7
0
        protected void AssertCounter(PerformanceCounter performanceCounter, Action4 action)
        {
            using (PerformanceCounter counter = performanceCounter)
            {
                Assert.AreEqual(0, counter.RawValue);

                for (int i = 0; i < 3; ++i)
                {
                    action();
                    Assert.AreEqual(i + 1, counter.RawValue);
                }
            }
        }
Example #8
0
    public IAction CreateAction(ACTION_ID id)
    {
        IAction Action = null;

        switch (id)
        {
        case ACTION_ID.ACTION_1: Action = new Action1(); break;

        case ACTION_ID.ACTION_2: Action = new Action2(); break;

        case ACTION_ID.ACTION_3: Action = new Action3(); break;

        case ACTION_ID.ACTION_4: Action = new Action4(); break;

        case ACTION_ID.ACTION_5: Action = new Action5(); break;

        case ACTION_ID.ACTION_6: Action = new Action6(); break;

        case ACTION_ID.ACTION_DasheBackward: Action = new ActionDashBackward(); break;

        case ACTION_ID.ACTION_DasheForward: Action = new ActionDashForward(); break;

        case ACTION_ID.ACTION_Jab: Action = new ActionJab(); break;

        case ACTION_ID.ACTION_Kick: Action = new ActionKick(); break;

        case ACTION_ID.ACTION_MoveAttack1: Action = new ActionMoveAttack1(); break;

        case ACTION_ID.ACTION_MoveAttack2: Action = new ActionMoveAttack2(); break;

        case ACTION_ID.ACTION_Punch: Action = new ActionPunch(); break;

        case ACTION_ID.ACTION_RangeAttack1: Action = new ActionRangeAttack1(); break;

        case ACTION_ID.ACTION_RangeAttack2: Action = new ActionRangeAttack2(); break;

        case ACTION_ID.ACTION_SpecialAttack1: Action = new ActionSpecialAttack1(); break;

        case ACTION_ID.ACTION_SpecialAttack2: Action = new ActionSpecialAttack2(); break;

        case ACTION_ID.ACTION_Uppercut: Action = new ActionUppercut(); break;

        default: Action = new NullAction(); break;
        }
        ControllerCenter.Instance.ActionSystem.Add((uint)(Time.realtimeSinceStartup) * 100, Action);
        return(Action);
    }
Example #9
0
 public RunnableAction(Action4 action)
 {
     _action = action;
 }
 public void WithEnvironment(Action4 action)
 {
     _server.WithEnvironment(new RunnableAction(action));
 }
Example #11
0
 public RunnableAction(Action4 action)
 {
     _action = action;
 }
Example #12
0
        protected Area(SerializationInfo info, StreamingContext context)
        {
            serializationOptions = (WidgetSerialization)info.GetValue("SerializeOptions", typeof(WidgetSerialization));
            zOrder      = info.GetUInt32("ZOrder");
            parent      = (IWidget)info.GetValue("Parent", typeof(IWidget));
            description = info.GetString("Description");
            containedDescriptionShowUpTime  = info.GetSingle("ContainedDescriptionShowUpTime");
            containedDescriptionPositioning = (LayoutAnchor)info.GetValue("ContainedDescriptionPositioning", typeof(LayoutAnchor));
            containedDescriptionObject      = (IDisplayObject)info.GetValue("ContainedDescriptionObject", typeof(IDisplayObject));
            anchor        = (LayoutAnchor)info.GetValue("Anchor", typeof(LayoutAnchor));
            minSize       = (GuiVector2)info.GetValue("MinSize", typeof(GuiVector2));
            maxSize       = (GuiVector2)info.GetValue("MaxSize", typeof(GuiVector2));
            preferredSize = (GuiVector2)info.GetValue("PreferredSize", typeof(GuiVector2));
            preserveRatio = info.GetBoolean("PreserveRatio");
            preferredRect = (GuiRect)info.GetValue("PreferredRect", typeof(GuiRect));
            marginLeft    = (GuiScalar)info.GetValue("MarginLeft", typeof(GuiScalar));
            marginRight   = (GuiScalar)info.GetValue("MarginRight", typeof(GuiScalar));
            marginTop     = (GuiScalar)info.GetValue("MarginTop", typeof(GuiScalar));
            marginBottom  = (GuiScalar)info.GetValue("MarginBottom", typeof(GuiScalar));

            if ((serializationOptions & WidgetSerialization.PersistAllStyles) > 0)
            {
                style = (Style)info.GetValue("Style", typeof(Style));
            }
            else if ((serializationOptions & WidgetSerialization.PersistNonThemeStyles) > 0)
            {
                style = (Style)info.GetValue("Style", typeof(Style));
            }

            if ((serializationOptions & WidgetSerialization.PersistRenderer) > 0)
            {
                renderer = (Themes.IGuiRenderer)info.GetValue("Renderer", typeof(Themes.IGuiRenderer));
            }

            if ((serializationOptions & WidgetSerialization.PersistState) > 0)
            {
                isVisible = info.GetBoolean("IsVisible");
            }

            if ((serializationOptions & WidgetSerialization.PersistAnimations) > 0)
            {
                animationState   = (StyleAnimationController)info.GetValue("StyleAnimationController", typeof(StyleAnimationController));
                activeAnimations = (List <AnimationProcess>)info.GetValue("ActiveAnimations", typeof(List <AnimationProcess>));
            }

            if ((serializationOptions & WidgetSerialization.PersistEventBindings) > 0)
            {
                onChange       = (Action <IPreChangeNotifier>)info.GetValue("OnChange", typeof(Action <IPreChangeNotifier>));
                onMouseOver    = (Action2 <Area, IPointer>)info.GetValue("OnMouseOver", typeof(Action2 <Area, IPointer>));
                onMouseLeave   = (Action2 <Area, IPointer>)info.GetValue("OnMouseLeave", typeof(Action2 <Area, IPointer>));
                onMousePressed = (Action4 <Area, IPointer, uint, InputEventModifier>)info.GetValue("OnMousePressed",
                                                                                                   typeof(Action4 <Area, IPointer, uint, InputEventModifier>));
                onMouseReleased = (Action3 <Area, IPointer, uint>)info.GetValue("OnMouseReleased", typeof(Action3 <Area, IPointer, uint>));
                onWheel         = (Action3 <Area, IPointer, float>)info.GetValue("OnWheel", typeof(Action3 <Area, IPointer, float>));
                onMouseMove     = (Action3 <Area, IPointer, Vector2f>)info.GetValue("OnMouseMove", typeof(Action3 <Area, IPointer, Vector2f>));
                onFocusGain     = (Action <Area>)info.GetValue("OnFocusGain", typeof(Action <Area>));
                onFocusLost     = (Action <Area>)info.GetValue("OnFocusLost", typeof(Action <Area>));
                onKeyPressed    = (Action5 <Area, IPointer, KeyCodes, KeyboardModifiers, InputEventModifier>)info.GetValue(
                    "OnKeyPressed", typeof(Action5 <Area, IPointer, KeyCodes, KeyboardModifiers, InputEventModifier>));
                onKeyReleased      = (Action4 <Area, IPointer, KeyCodes, KeyboardModifiers>)info.GetValue("OnKeyReleased", typeof(Action4 <Area, IPointer, KeyCodes, KeyboardModifiers>));
                onDescriptionShow  = (Action2 <Area, IWidget>)info.GetValue("OnDescriptionShow", typeof(Action2 <Area, IWidget>));
                onDescriptionHide  = (Action2 <Area, IWidget>)info.GetValue("OnDescriptionHide", typeof(Action2 <Area, IWidget>));
                onStyleStateChange = (Action3 <Area, StyleState, StyleState>)info.GetValue("OnStyleStateChange", typeof(Action3 <Area, StyleState, StyleState>));
            }
        }
Example #13
0
 /// <summary>
 /// 创建一个新的控制台方法;
 /// </summary>
 public static Method Create(Action4 method, MethodDescription description)
 {
     return(new ConsoleMethod_Action4(method, description));
 }