public int ClearNonExistRecords()
        {
            int ret = 0;

            List <Controller> controllers = this.AuthService.GetControllers().ToList();

            if (controllers.Count > 0)
            {
                ControllerActionsList reflecteds = AuthorizationValidator.ControllerActionsList;// ControllerActionsList.Create<ReflectController>(AppDomain.CurrentDomain.GetAssemblies());

                foreach (Controller controller in controllers)
                {
                    ControllerActions ca = reflecteds.FirstOrDefault((item) => String.Equals(controller.Name, item.ControllerType.Name.Replace("Controller", "")));
                    if (null != ca)
                    {
                        List <Models.Action> actions = this.AuthService.GetActionsBy(controller.ControllerId).ToList();
                        foreach (Models.Action action in actions)
                        {
                            MethodInfo mi = ca[action.Name];
                            if (null == mi)//Mesela method silindi veya ismi değiştirildi.
                            {
                                ret = this.AuthService.DeleteRecordsByControllerAction(action);
                            }
                        }
                    }
                    else
                    {
                        ret += this.AuthService.DeleteRecordsByController(controller);
                    }
                }
            }

            return(ret);
        }
コード例 #2
0
ファイル: ControllerPc.cs プロジェクト: zhfelon1/th-haruhi
 void Awake()
 {
     Instance = this;
     _actions = ControllerActions.CreateWithDefaultBindings();
     InputManager.OnActiveDeviceChanged += OnDeviceChanged;
     InputManager.OnDeviceDetached      += OnDeviceChanged;
 }
コード例 #3
0
        public static void Process_1(object argObject, ControllerActions argAction)
        {
            //based on mapping, display specific form
            foreach (ObjectMappingEntry objMapping in _ObjectMappings)
            {
                //find the right business object
                if (argObject.GetType().Name.CompareTo(
                        objMapping.BusinessObjectName) == 0)
                {
                    //find the right action
                    if (objMapping.Action == argAction)
                    {
                        //start the viewer
                        Type typeViewer = Assembly.GetExecutingAssembly().GetType(
                            objMapping.Viewer);

                        Form formViewer = (Form)Activator.CreateInstance(typeViewer);
                        formViewer.MdiParent   = _ParentForm;
                        formViewer.WindowState = FormWindowState.Maximized;
                        formViewer.Show();

                        break;
                    }
                }
            }
            return;
        }
コード例 #4
0
        public void SetHomeSensorAzimuth(decimal azimuth)
        {
            Logger.Info().Message("Set home sensor azimuth to {azimuth}", azimuth).Write();
            decimal ticksPerDegree   = DomeCircumference / 360.0m;
            decimal homeStepPosition = azimuth * ticksPerDegree;

            ControllerActions.SetHomeSensorPosition((int)homeStepPosition);
            TransitionToState(new RequestStatusState(this));
        }
コード例 #5
0
 public ActionResult Edit(ControllerActions controlleractions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(controlleractions).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(controlleractions);
 }
コード例 #6
0
ファイル: playerMove.cs プロジェクト: vbass0903/DROOO
    void Awake()
    {
        rb       = GetComponent <Rigidbody2D>();
        controls = new ControllerActions();

        controls.Gameplay.Jump.performed += ctx => Jump();

        controls.Gameplay.Move.performed += ctx => move = ctx.ReadValue <Vector2>();
        controls.Gameplay.Move.canceled  += ctx => move = Vector2.zero;
    }
コード例 #7
0
        public ActionResult Create(ControllerActions controlleractions)
        {
            if (ModelState.IsValid)
            {
                db.ControllerActions.Add(controlleractions);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(controlleractions);
        }
コード例 #8
0
        public Task SaveOrUpdateAsync(ControllerActionsModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("ControllerActions ArgumentNullException Insert Async");
            }

            ControllerActions dto = AutoMapperGenericHelper <ControllerActionsModel, ControllerActions> .Convert(model);

            _controllerActionsRepository.SaveOrUpdate(dto);

            return(Task.FromResult <object>(null));
        }
コード例 #9
0
        public RouteGenerator(
            RouteCollection routes, RequestContext requestContext,
            ControllerActions controllerActions
            )
        {
            Contract.Requires(routes != null);
            Contract.Requires(requestContext != null);
            Contract.Requires(controllerActions != null);

            _routes = routes;
            _controllerActions = controllerActions;
            _requestContext = requestContext;

            _javaScriptSerializer = new JavaScriptSerializer();
        }
コード例 #10
0
        public int ClearNonExistRecords()
        {
            int ret = 0;

            using (DbClient client = ionixFactory.CreateDbClient())
            {
                ControllerRepository controllerRepository = new ControllerRepository(client.Cmd);
                List <Controller>    controllers          = controllerRepository.Select().ToList();

                if (controllers.Count > 0)
                {
                    ActionRepository actionRepository = new ActionRepository(client.Cmd);

                    ControllerActionsList reflecteds = AuthorizationValidator.ControllerActionsList;// ControllerActionsList.Create<ReflectController>(AppDomain.CurrentDomain.GetAssemblies());

                    foreach (Controller controller in controllers)
                    {
                        ControllerActions ca = reflecteds.FirstOrDefault((item) => String.Equals(controller.Name, item.ControllerType.Name.Replace("Controller", "")));
                        if (null != ca)
                        {
                            List <Server.Models.Action> actions = actionRepository.SelectByControllerId(controller.Id).ToList();
                            foreach (Server.Models.Action action in actions)
                            {
                                MethodInfo mi = ca[action.Name];
                                if (null == mi)//Mesela method silindi veya ismi değiştirildi.
                                {
                                    ret = DeleteRecordsByControllerAction(action);
                                }
                            }
                        }
                        else
                        {
                            ret += DeleteRecordsByController(controller);
                        }
                    }
                }
            }

            return(ret);
        }
コード例 #11
0
        public static void Process(object argObject, ControllerActions argAction)
        {
            //based on mapping, display specific form
            foreach (ObjectMappingEntry objMapping in _ObjectMappings)
            {
                //find the right business object
                if (argObject.GetType().Name.CompareTo(
                        objMapping.BusinessObjectName) == 0)
                {
                    //find the right action
                    if (objMapping.Action == argAction)
                    {
                        Assembly asm = Assembly.Load(objMapping.Viewer.Substring(0,
                                                                                 objMapping.Viewer.IndexOf('.')));

                        Type typeViewer = asm.GetType(objMapping.Viewer);

                        FrameworkViewer formViewer =
                            (FrameworkViewer)Activator.CreateInstance(typeViewer);

                        if (objMapping.BusinessObjectName.EndsWith("Collection"))
                        {
                            formViewer.BusinessObjectCollection = (BusinessRules.BusinessObjectCollection)argObject;
                        }
                        else
                        {
                            formViewer.BusinessObject = (BusinessRules.BusinessObject)argObject;
                        }

                        formViewer.ViewMode  = argAction;
                        formViewer.MdiParent = _ParentForm;
                        formViewer.Show();
                        break;
                    }
                }
            }

            return;
        }
コード例 #12
0
 void Awake()
 {
     controls = new ControllerActions();
 }
コード例 #13
0
 public void SavePersistentSettings()
 {
     Logger.Info("Saving persistent settings").Write();
     ControllerActions.SavePersistentSettings();
 }
コード例 #14
0
 public void AllStop()
 {
     Log.Warn().Message("Emergency Stop requested").Write();
     ControllerActions.PerformEmergencyStop();
 }
コード例 #15
0
 public void AllStop()
 {
     Logger.Warn().Message("Emergency Stop requested").Write();
     ControllerActions.PerformEmergencyStop();
     RotatorState.HardStopRequested();
 }
コード例 #16
0
 internal void RequestHardwareStatus() => ControllerActions.RequestHardwareStatus();
コード例 #17
0
 /// <summary>
 ///     Sends configuration data to the shutter. Normally called upon Offline -> Online state
 ///     transition.
 /// </summary>
 internal void ConfigureShutter()
 {
     ControllerActions.ConfigureShutter((uint)Options.ShutterMaximumSpeed,
                                        (uint)Options.ShutterRampTime.TotalMilliseconds,
                                        Options.EnableAutoCloseOnLowBattery ? Options.ShutterLowBatteryThresholdVolts.VoltsToAdu() : 0);
 }
コード例 #18
0
    //摇杆行为绑定按键
    public static ControllerActions CreateWithDefaultBindings()
    {
        var p = new ControllerActions();

        p.Get(EControllerBtns.Debug).AddDefaultBinding(Key.F);

        //sure
        p.Get(EControllerBtns.Sure).AddDefaultBinding(Key.Return);
        p.Get(EControllerBtns.Sure).AddDefaultBinding(Key.Z);
        p.Get(EControllerBtns.Sure).AddDefaultBinding(Key.J);
        p.Get(EControllerBtns.Sure).AddDefaultBinding(InputControlType.Action1);

        //back
        p.Get(EControllerBtns.Cancel).AddDefaultBinding(Key.Escape);
        p.Get(EControllerBtns.Cancel).AddDefaultBinding(Key.X);
        p.Get(EControllerBtns.Cancel).AddDefaultBinding(Key.K);
        p.Get(EControllerBtns.Cancel).AddDefaultBinding(InputControlType.Action2);

        //pause
        p.Get(EControllerBtns.Pause).AddDefaultBinding(Key.Escape);
        p.Get(EControllerBtns.Pause).AddDefaultBinding(InputControlType.Action4);

        //shoot
        p.Get(EControllerBtns.Shoot).AddDefaultBinding(Key.Z);
        p.Get(EControllerBtns.Shoot).AddDefaultBinding(Key.J);
        p.Get(EControllerBtns.Shoot).AddDefaultBinding(InputControlType.Action1);

        //slowmove
        p.Get(EControllerBtns.SlowMove).AddDefaultBinding(Key.L);
        p.Get(EControllerBtns.SlowMove).AddDefaultBinding(Key.LeftShift);
        p.Get(EControllerBtns.SlowMove).AddDefaultBinding(InputControlType.Action3);

        //move
        p.Get(EControllerBtns.Up).AddDefaultBinding(Key.UpArrow);
        p.Get(EControllerBtns.Down).AddDefaultBinding(Key.DownArrow);
        p.Get(EControllerBtns.Left).AddDefaultBinding(Key.LeftArrow);
        p.Get(EControllerBtns.Right).AddDefaultBinding(Key.RightArrow);

        p.Get(EControllerBtns.Up).AddDefaultBinding(Key.W);
        p.Get(EControllerBtns.Down).AddDefaultBinding(Key.S);
        p.Get(EControllerBtns.Left).AddDefaultBinding(Key.A);
        p.Get(EControllerBtns.Right).AddDefaultBinding(Key.D);


        p.Get(EControllerBtns.Up).AddDefaultBinding(InputControlType.LeftStickUp);
        p.Get(EControllerBtns.Down).AddDefaultBinding(InputControlType.LeftStickDown);
        p.Get(EControllerBtns.Left).AddDefaultBinding(InputControlType.LeftStickLeft);
        p.Get(EControllerBtns.Right).AddDefaultBinding(InputControlType.LeftStickRight);

        //turn
        p.Get(EControllerBtns.TurnLeft).AddDefaultBinding(InputControlType.RightStickLeft);
        p.Get(EControllerBtns.TurnRight).AddDefaultBinding(InputControlType.RightStickRight);
        p.Get(EControllerBtns.TurnUp).AddDefaultBinding(InputControlType.RightStickUp);
        p.Get(EControllerBtns.TurnDown).AddDefaultBinding(InputControlType.RightStickDown);


        p.ListenOptions.IncludeUnknownControllers = true;
        p.ListenOptions.MaxAllowedBindings        = 4;
        //playerActions.ListenOptions.MaxAllowedBindingsPerType = 1;
        //playerActions.ListenOptions.AllowDuplicateBindingsPerSet = true;
        p.ListenOptions.UnsetDuplicateBindingsOnSet = true;
        //playerActions.ListenOptions.IncludeMouseButtons = true;
        //playerActions.ListenOptions.IncludeModifiersAsFirstClassKeys = true;
        //playerActions.ListenOptions.IncludeMouseButtons = true;
        //playerActions.ListenOptions.IncludeMouseScrollWheel = true;

        /*
         *  playerActions.ListenOptions.OnBindingFound = (action, binding) => {
         *      if (binding == new KeyBindingSource(Key.Escape))
         *      {
         *          action.StopListeningForBinding();
         *          return false;
         *      }
         *      return true;
         *  };*/


        p.ListenOptions.OnBindingAdded += (action, binding) => {
            Debug.Log("Binding added... " + binding.DeviceName + ": " + binding.Name);
        };

        p.ListenOptions.OnBindingRejected += (action, binding, reason) => {
            Debug.Log("Binding rejected... " + reason);
        };

        return(p);
    }
コード例 #19
0
ファイル: GamepadHandler.cs プロジェクト: LongJohnCoder/NMSMV
 public abstract float getAction(ControllerActions action);
コード例 #20
0
ファイル: GamepadHandler.cs プロジェクト: LongJohnCoder/NMSMV
 public int getActionButton(ControllerActions action)
 {
     return(ActionMap[action]);
 }
コード例 #21
0
ファイル: TurretGun2.cs プロジェクト: vbass0903/DROOO
 void Awake()
 {
     controls = new ControllerActions();
     controls.Gameplay.TurretFire.started += ctx => Fire();
 }
コード例 #22
0
ファイル: GamepadHandler.cs プロジェクト: LongJohnCoder/NMSMV
 public override float getAction(ControllerActions action)
 {
     return(getState((PSGamePadLayout)getActionButton(action)));
 }