• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Render

        public void Render(IController controller, string path)
        {
            //ViewData = new ViewData();

            ViewData = controller.ViewData;

            try
            {
                var html = String.Empty;

                string _path = string.Format("~/View/{0}/{1}.aspx", controller.Name, path);
                //var writer = new StringWriter();
                //controller.Context.Server.Execute(_path, controller.Context.Response.Output, true);
                //BuildManager.CreateInstanceFromVirtualPath(_path, typeof(System.Web.UI.Page));
               // controller.Context.RewritePath(_path,false);
                //var page = BuildManager.CreateInstanceFromVirtualPath(_path, typeof(Page)) as IHttpHandler;

                //PageParser.GetCompiledPageInstance(_path, controller.Context.Server.MapPath(_path), controller.Context);//.ProcessRequest(controller.Context);
                //html = writer.ToString();
                Context.Response.Clear();
                using (HtmlTextWriter htmlw = new HtmlTextWriter(Context.Response.Output))
                {

                   Context.Server.Execute(_path, htmlw, true);

                }
                Context.Response.End();

            }
            catch (System.Exception e)
            {
                controller.Context.Response.Write(e.StackTrace);
                controller.Context.Response.Write(e.ToString());
            }
        }
开发者ID:necronomicon,项目名称:mvc,代码行数:35,代码来源:View.cs


示例17: CalculateParamPoints

 /// <summary>
 ///             Calculates the param points. Implementers should return value equals or greater than
 ///             zero indicating whether the parameter can be bound successfully. The greater the value (points)
 ///             the more successful the implementation indicates to the framework
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="controller">The controller.</param>
 /// <param name="controllerContext">The controller context.</param>
 /// <param name="parameterInfo">The parameter info.</param>
 /// <returns>
 /// </returns>
 public int CalculateParamPoints(IEngineContext context, IController controller, IControllerContext controllerContext, ParameterInfo parameterInfo)
 {
     var token = context.Request[parameterName];
     if (CanConvert(parameterInfo.ParameterType, token))
         return 10;
     return 0;
 }
开发者ID:kenegozi,项目名称:openuni,代码行数:18,代码来源:BindFromAttribute.cs


示例18: UpdateContentItemAction

        public UpdateContentItemAction(IView view, IController con, ContentItem item, PropertyDescriptor property, object previousValue)
        {
            _view = view;
            _con = con;

            _state = ContentItemState.Get(item);

            var name = property.Name;
            var value = previousValue;

            if (name == "Importer")
            {
                name = "ImporterName";
                value = ((ImporterTypeDescription)value).TypeName;
            }

            if (name == "Processor")
            {
                name = "ProcessorName";
                value = ((ProcessorTypeDescription)value).TypeName;
            }

            var field = _state.GetType().GetMember(name).SingleOrDefault() as FieldInfo;
            if (field == null)
            {
                if (!_state.ProcessorParams.ContainsKey(name))
                    throw new Exception();

                _state.ProcessorParams[name] = value;
            }
            else
            {
                field.SetValue(_state, value);
            }
        }
开发者ID:KennethYap,项目名称:MonoGame,代码行数:35,代码来源:UpdateAction.cs


示例19: FrmCellPicker

 public FrmCellPicker(IController con, CellRepository repo, int idPris)
 {
     idPrisoner = idPris;
     controller = con;
     cellRepo = repo;
     InitializeComponent();
 }
开发者ID:Talshiar,项目名称:PrisonSys,代码行数:7,代码来源:FrmCellPicker.cs


示例20: Render

        public void Render (IController controller)
        {
            gl.glClearColor(0, 0, 0, 1);
            gl.glClear(gl.GL_COLOR_BUFFER_BIT);

            this.UpdateSpectrumLength(controller.PlayerData.NativeSpectrumLength);
            controller.PlayerData.GetSpectrum(this.newspec);
            this.MergeSpectrum();
            
            gl.glBegin(gl.GL_QUADS);
            
            for (int i = 0; i < this.spectrumLength; i++) {
                Color color = Color.FromHSL(120 * (1 - this.spectrum[i]), 1, 0.5f);
                
                float x1 = -1 + this.spacing * i;
                float x2 = -1 + this.spacing * (i + 1);

                float v = this.spectrum[i] * 2 - 1;

                color.Use();
                gl.glVertex2f(x1, v);
                gl.glVertex2f(x2, v);
                
                gl.glVertex2f(x2, -1);
                gl.glVertex2f(x1, -1);
            }

            gl.glEnd();
        }
开发者ID:Bamistro,项目名称:openvisualizationplatform,代码行数:29,代码来源:SpectrumAnalyzer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IControllerContext类代码示例发布时间:2022-05-24
下一篇:
C# IControlHabanero类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap