本文整理汇总了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);
}
示例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);
}
示例3: MvcForm_Load
private void MvcForm_Load(object sender, EventArgs e)
{
iController = new ControllerNameList();
iController.Initialize(new ModelNameList(),this);
}