/// <summary>
        ///   Constructor for the module
        /// </summary>
        public ModuleList()
        {
            try
            {
                this.InitializeComponent();

                ModuleHandler.Panel = this.stackPanel1;

                this.ImageNew.Source     = Framework.Images.GetImage("NewDocumentHS", "VS2010ImageLibrary").Source;
                this.ImageRefresh.Source = Framework.Images.GetImage("RepeatHS", "VS2010ImageLibrary").Source;
                this.Tag = Properties.Resources.Modules;

                _instance = this;

                if (Framework.Database.IsConnected() == false)
                {
                    Framework.Notification.Display(Properties.Resources.DatabaseConnectionRequired, 5000);
                    Framework.EventBus.Publish(new PreferencesEvent(this, typeof(IDatabase)));
                    return;
                }

                if (ModuleHandler.GetClient() == null)
                {
                    Framework.Notification.Display(Properties.Resources.ServerConnectionRequired, 5000);
                    Framework.EventBus.Publish(new PreferencesEvent(this, typeof(INetwork)));
                    return;
                }

                ModuleHandler.RefreshModuleFiles();
            }
            catch (Exception error)
            {
                Framework.EventBus.Publish(error);
            }
        }
Beispiel #2
0
 /// <summary>
 ///   Gets the sidebar component the module provides
 /// </summary>
 /// <returns>An instance of UserControl</returns>
 public UserControl GetSidebarControl()
 {
     return(ModuleList.GetInstance());
 }
 /// <summary>
 /// </summary>
 /// <returns></returns>
 public static ModuleList GetInstance()
 {
     return(_instance ?? (_instance = new ModuleList()));
 }