当前位置: 首页>>代码示例>>C#>>正文


C# IController类代码示例

本文整理汇总了C#中IController的典型用法代码示例。如果您正苦于以下问题:C# IController类的具体用法?C# IController怎么用?C# IController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IController类属于命名空间,在下文中一共展示了IController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AppendFrame

		public void AppendFrame(IController source)
		{
			var lg = LogGeneratorInstance();
			lg.SetSource(source);
			_log.Add(lg.GenerateLogEntry());
			Changes = true;
		}
开发者ID:ddugovic,项目名称:RASuite,代码行数:7,代码来源:Bk2Movie.cs

示例2: ReleaseController

 public void ReleaseController(IController controller)
 {
     // If the container was tracking this instance release it
     // otherwise pass it down to the default factory to release
     if (!_kernel.Release(controller))
         _defaultFactory.ReleaseController(controller);
 }
开发者ID:joshperry,项目名称:UGRaffle,代码行数:7,代码来源:NinjectControllerFactory.cs

示例3: Render

        public void Render(IController controller)
        {
            ComputeState(controller);

            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);

            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Gl.glPushMatrix();
            Gl.glLoadIdentity();

            Gl.glTranslatef(-1, -1, 0);
            Gl.glScalef((float) 2 / board.Width, (float) 2 / board.Height, 1);

            Gl.glBegin(Gl.GL_QUADS);

            foreach (var i in board) {
                if (!i.Alive)
                    continue;

                Color.FromHSL(i.Hue, 1, 0.5f).Use();

                Gl.glVertex2i(i.X    , i.Y    );
                Gl.glVertex2i(i.X + 1, i.Y    );
                Gl.glVertex2i(i.X + 1, i.Y + 1);
                Gl.glVertex2i(i.X    , i.Y + 1);
            }

            Gl.glEnd();

            Gl.glPopMatrix();
        }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:31,代码来源:GenerationalLifeVis.cs

示例4: ButtonConnection

        public ButtonConnection(IController contoller)
        {
            log.Debug(m => m("Init button connection"));

            var toggleBtn = ConnectorPin.P1Pin12.Input().PullDown();
            var backBtn = ConnectorPin.P1Pin16.Input().PullDown();
            var nextBtn = ConnectorPin.P1Pin18.Input().PullDown();

            // toggle
            toggleBtn.OnStatusChanged(state => 
            { 
                if (state)
                    contoller.TogglePlay(); 
            });

            // next
            nextBtn.OnStatusChanged(state =>
            {
                if (state)
                    contoller.PlayNext();
            });

            // previous
            backBtn.OnStatusChanged(state =>
            {
                if (state)
                    contoller.PlayPrevious();
            });

            // open connection
            _gpioConnection = new GpioConnection(toggleBtn, backBtn, nextBtn);
        }
开发者ID:mwinkler,项目名称:RaspberryPi.Musicbox,代码行数:32,代码来源:ButtonConnection.cs

示例5: ActionScene

 public ActionScene(
     IController playerOneController,
     IController playerTwoController,
     Game game,
     Texture2D theTexture,
     Texture2D backgroundTexture,
     Rectangle screenBounds,
     SpriteFont font,
     Vector2 gameoverPosition)
     : this(game, theTexture, backgroundTexture, font, gameoverPosition)
 {
     this.TwoPlayers = true;
     this._player1 = new Player(Game, ref this._actionTexture, new Vector2(x: screenBounds.Width / 3, y: 0), new Rectangle(323, 15, 30, 30), playerOneController);
     this._player1.Initialize();
     Components.Add(this._player1);
     this._scorePlayer2 = new Score(game, font, Color.Red)
                        {
                            Position =
                                new Vector2(
                                this.Game.Window.ClientBounds.Width - 200, 10)
                        };
     Components.Add(this._scorePlayer2);
     this._player2 = new Player(Game, ref this._actionTexture, new Vector2((int)(screenBounds.Width / 1.5), 0), new Rectangle(360, 17, 30, 30), playerTwoController);
     this._player2.Initialize();
     Components.Add(this._player2);
 }
开发者ID:ImaginaryDevelopment,项目名称:RockRainEnhanced,代码行数:26,代码来源:ActionScene.cs

示例6: GroupCommand

 /// <summary>
 /// Initializes a new instance of the <see cref="T:GroupCommand"/> class.
 /// </summary>
 /// <param name="controller">The controller.</param>
 /// <param name="bundle">The bundle.</param>
 public GroupCommand(IController controller, IBundle bundle)
     : base(controller)
 {
     this.Text = "Group";
     this.controller = controller;
     this.bundle = bundle;//the bundle should contain only IShape and IConnection entities!
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:12,代码来源:GroupCommand.cs

示例7: PenStyleCommand

 /// <summary>
 /// Initializes a new instance of the <see cref="T:PenStyleCommand"/> class.
 /// </summary>
 /// <param name="controller">The controller.</param>
 /// <param name="bundle">The bundle.</param>
 /// <param name="penStyle">The pen style.</param>
 public PenStyleCommand(IController controller, CollectionBase<IDiagramEntity> bundle, IPenStyle penStyle)
   : base(controller) {
   this.Text = "Fill style";
   this.controller = controller;
   this.bundle = bundle;//the bundle should contain only IShape and IConnection entities!
   this.newStyle = penStyle;
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:13,代码来源:PenStyleCommand.cs

示例8: ReleaseController

 public void ReleaseController(IController controller)
 {
     if (((ControllerBase)controller).ControllerContext.RouteData.Route is ContentRoute)
         this._cmsFactory.ReleaseController(controller);
     else
         this._factory.ReleaseController(controller);
 }
开发者ID:ralren,项目名称:htbox-website,代码行数:7,代码来源:N2CMSDelegatingControllerFactory.cs

示例9: SetUp

 public void SetUp()
 {
     controller = MockRepository.GenerateMock<IController>();
     stepUICMock = MockRepository.GenerateMock<IStepUIC>();
     controller.Stub(x => x.LoadHistory()).Return(new List<IHistoryItem>());
     shellViewModelSUT = new MainShellViewModel(controller, stepUICMock);
 }
开发者ID:dreanor,项目名称:StreamCompanion,代码行数:7,代码来源:ShellViewModelBase.UnitTest.cs

示例10: OnAfterRendering

 protected override void OnAfterRendering(IEngineContext context, IController controller,
                                          IControllerContext controllerContext){
     var mvc = MvcContext.Create((Controller) controller);
     var logname = acl.token(mvc).Replace("/", ".").Substring(1);
     var log = logger.get(logname);
     log.info(() => myapp.usrName + "\t\tAFTER_RENDER:\t" + acl.token(mvc));
 }
开发者ID:Qorpent,项目名称:comdiv.oldcore,代码行数:7,代码来源:LogFilter.cs

示例11: OpenGLWindow

    public OpenGLWindow(IController controller, double frameRate)
    {
      if (controller == null) throw new ArgumentNullException("controller");
      _controller = controller;
      _frameRate = frameRate;
      Width = controller.Width;
      Height = controller.Height;
      if (_controller.IsFullScreen)
        WindowState = WindowState.Maximized;
      Title = controller.Name;

      InitializeComponent();
      if (_controller.HasUserInterface)
      {
        if(_controller.CentralView != null)
          MainGrid.Children.Add((UIElement)_controller.CentralView);
        if (_controller.LeftView != null)
          LeftGrid.Children.Add((UIElement)_controller.LeftView);
        if (_controller.RightView != null)
          RightGrid.Children.Add((UIElement)_controller.RightView);
        if (_controller.TopView != null)
          TopGrid.Children.Add((UIElement)_controller.TopView);
        if (_controller.BottomView != null)
          BottomGrid.Children.Add((UIElement)_controller.BottomView);
        
      }
      SizeChanged += OnSizeChanged;
      KeyDown += OnKeyPress;
    }
开发者ID:dgopena,项目名称:Starter3D.Base,代码行数:29,代码来源:OpenGLWindow.xaml.cs

示例12: RenderFrame

            public override void RenderFrame (IController controller)
            {
                float[] pcm = new float[controller.PlayerData.NativePCMLength];
                controller.PlayerData.GetPCM(pcm);
    
                gl.glMatrixMode(gl.GL_MODELVIEW);
                gl.glPushMatrix();
                gl.glRotatef(this.rotation, 0, 0, -1);

                gl.glLineWidth(3);
    
                gl.glBegin(gl.GL_LINE_STRIP);
                for (int i = 0; i < pcm.Length; i++) {
                    float fi = ((float) i / pcm.Length) * 2 - 1;
                    fi *= LINE_LENGTH;
                    
                    float v = pcm[i];
                    float av = Math.Abs(v);
                    
                    gl.glColor4f(av, 0.5f + (0.5f * av), 1, 0.5f + (0.5f * av));
                    gl.glVertex2f(fi, v);
                }
                gl.glEnd();
                
                gl.glPopMatrix();
            }
开发者ID:Bamistro,项目名称:openvisualizationplatform,代码行数:26,代码来源:GlassWall.cs

示例13: Release

        public void Release(IController controller)
        {
            var types = controller.GetType()
                .GetInterfaces()
                .Where(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IController<,>))
                .Select(i => i.GetGenericArguments())
                .First();

            var controllerAccessor = Kernel.Resolve(
                typeof(ControllerAccessor<,>)
                    .MakeGenericType(
                        types.ElementAt(0),
                        types.ElementAt(1)
                    )
            ) as IControllerAccessor;

            var viewAccessor = Kernel.Resolve(
                typeof(ViewAccessor<>)
                    .MakeGenericType(
                        types.ElementAt(1)
                    )
            ) as IViewAccessor;

            if (controllerAccessor != null && viewAccessor != null)
            {
                var view = controllerAccessor.GetView(controller);
                var viewModel = controllerAccessor.GetViewModel(controller);

                Kernel.ReleaseComponent(view);
                Kernel.ReleaseComponent(viewModel);
            }

            Kernel.ReleaseComponent(controller);
        }
开发者ID:mmorton,项目名称:Flux,代码行数:34,代码来源:MicroKernelControllerLifecycleManager.cs

示例14: WebInterface

        public WebInterface(IController controller)
        {
            log.Debug(m => m("Startup webserver at '{0}'", hostUrl));

            Controller = controller;
            _server = WebApp.Start<Startup>(hostUrl);
        }
开发者ID:mwinkler,项目名称:RaspberryPi.Musicbox,代码行数:7,代码来源:WebInterface.cs

示例15: Perform

        public bool Perform(ExecuteWhen exec, IEngineContext context, IController controller, IControllerContext controllerContext)
        {
            /*
            ArrayList admins = new ArrayList();
            admins.Add("jpino");
            admins.Add("logas");
            admins.Add("lmolina");

            if (admins.Contains (context.CurrentUser.Identity.Name.ToLower()))
                return true;
            else {
                context.Flash["TypeMsg"] = "alert alert-error";
                context.Flash["Msg"] = "Error : No eres admin";

                context.Response.RedirectToUrl ("/");
                return false;
            }
            */
            if (context.CurrentUser.IsInRole ("admin"))
                return true;
            else {
                context.Flash["TypeMsg"] = "alert alert-error";
                context.Flash["Msg"] = "Error : No eres admin";

                context.Response.RedirectToUrl ("/");
                return false;
            }
        }
开发者ID:joil,项目名称:Compras,代码行数:28,代码来源:AdminFilter.cs


注:本文中的IController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。