本文整理汇总了C#中IModule.Activate方法的典型用法代码示例。如果您正苦于以下问题:C# IModule.Activate方法的具体用法?C# IModule.Activate怎么用?C# IModule.Activate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IModule
的用法示例。
在下文中一共展示了IModule.Activate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Shell
public Shell()
{
// Commented below 2 lines as Logon function has been moved to ModuleSelectionPresenter.cs
// Modified By JK on 01/09/12
//LogOnKioskResponse logonResponse = new LogOnKioskResponse();
//LogonServiceClient logonproxy = null;
bool LoadApp = true;
//this.ScrollerText = string.Empty;
// System.Configuration.Configuration config;
bool showCursor = (ConfigurationManager.AppSettings["ShowCursor"] == null) ? false : Convert.ToBoolean(ConfigurationManager.AppSettings["ShowCursor"]);
if (showCursor)
this.Cursor = System.Windows.Input.Cursors.Arrow;
else
this.Cursor = System.Windows.Input.Cursors.None;
InitializeComponent();
//if (LoadApp)
//{
// // Init cash acceptor device and printer devices.
//DeviceAgent.GetInstance().Init();
//string result = Logger.GetRecentScrollers();
//if ((!string.IsNullOrEmpty(result)) &&
// (KioskAppConfig.Scrollers != result))
//{
// KioskAppConfig.Scrollers = result;
//}
moduleManager = ModuleManager.GetInstance();
currentModule = moduleManager.GetDefaultModule();
currentModule.ModuleLayoutUpdatedEvent += OnModuleLayoutUpdated;
currentModule.ModuleSelectionChangedEvent += OnModuleSelectionChanged;
currentModule.Activate();
this.BeginInit();
try
{
this.ccModule.Content = null;
this.ccModule.Content = currentModule.ShellGrid;
}
finally
{
this.EndInit();
this.UpdateLayout();
}
//}
//else
//{
// if (log.IsErrorEnabled) log.ErrorFormat("Logon not Successfull");
// Application.Current.Shutdown(1);
//}
}
示例2: OnModuleSelectionChanged
private void OnModuleSelectionChanged(ModuleSelectionChangedEventArgs obj)
{
IModule newModule;
newModule = ModuleManager.GetInstance().SwitchToModule(obj.NewModule);
if (newModule != null)
{
textBlock.Text = KioskAppConfig.GetCurrentScrollerText(obj.NewModule.ToLower().Replace("module", string.Empty));
if (KioskAppConfig.ShowScroller)
grScroller.Visibility = System.Windows.Visibility.Visible;
else
grScroller.Visibility = System.Windows.Visibility.Collapsed;
currentModule.ModuleSelectionChangedEvent -= OnModuleSelectionChanged;
currentModule.ModuleLayoutUpdatedEvent -= OnModuleLayoutUpdated;
currentModule.Deactivate();
currentModule = newModule;
currentModule.ModuleLayoutUpdatedEvent += OnModuleLayoutUpdated;
currentModule.ModuleSelectionChangedEvent += OnModuleSelectionChanged;
currentModule.Activate(obj.DispatcherAction);
this.BeginInit();
try
{
this.ccModule.Content = currentModule.ShellGrid;
}
finally
{
this.EndInit();
this.UpdateLayout();
}
}
}