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


C# IController.Initialize方法代码示例

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


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

示例1: RegisterController

        /// <summary>
        /// Registers a controller to the system.
        /// </summary>
        /// <param name="controller"></param>
        public void RegisterController(IController controller)
        {
            List<IController> newList = new List<IController>(controllerList);

            newList.Add(controller);

            // make sure we give the controller the option to take hold on the controller host.
            controller.Initialize(HomeAutomationSystem.ControllerHost);

            controllerList = newList.ToArray();

            ControllerAdded?.Invoke(this, controller);
        }
开发者ID:moszinet,项目名称:HomeAutomation,代码行数:17,代码来源:ControllerRegistry.cs

示例2: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            _sparkle = new Sparkle("http://mediascribe.jarrod.co.nz/appcast.xml");
            _sparkle.StartLoop(true);

            UnityContainer unityContainer = new UnityContainer();
            unityContainer.RegisterType<IController, Controller>(new ContainerControlledLifetimeManager());

            //JDW NOTE: we need to set the data context BEFORE initializing the controller, since initialization
            //will perform a navigation that we need to catch in mainwindow's viewmodel... but AFTER creating the
            //the controller, since we need its reference inside the viewmodel.
            this.DataContext = new WindowHeaderViewModel(unityContainer);

            controller = unityContainer.Resolve<IController>();
            //We need to register the controller with Unity, before calling the initialize method. this is why the the logic isn't housed
            //in the controller constructor.
            controller.Initialize(this, mainTabControl, unityContainer);
        }
开发者ID:jarrodwood,项目名称:MediaScribe,代码行数:20,代码来源:MainWindow.xaml.cs

示例3: MvcForm_Load

 private void MvcForm_Load(object sender, EventArgs e)
 {
     iController = new ControllerNameList();
     iController.Initialize(new ModelNameList(),this);
 }
开发者ID:kemizrak,项目名称:public,代码行数:5,代码来源:MvcForm.cs


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