Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Processor"/> class.
 /// </summary>
 public Processor()
 {
     _projectManager = CoreSystem.Managers.Find(m => m.Name.Contains("ProjectManager")) as ProjectManager;
     _dataStorageManager = CoreSystem.Managers.Find(m => m.Name.Contains("DataStorageManager")) as DataStorageManager;
     _propertyManager = CoreSystem.Managers.Find(m => m.Name.Contains("PropertyManager")) as PropertyManager;
     _extensionManager = CoreSystem.Managers.Find(m => m.Name.Contains("ExtensionManager")) as ExtensionManager;
     _nexuses = new List<AsyncNanoProcessor>();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize the instance of the manager.
        /// </summary>
        /// <returns></returns>
        /// <exception cref="System.Exception">
        /// Could not initialize ToolManager!
        /// or
        /// Could not initialize DeviceManager!
        /// or
        /// Could not initialize ExtensionManager!
        /// or
        /// Could not get any plugins!
        /// </exception>
        public override bool Initialize()
        {
            try {
                Trace.WriteLine("Initialize PluginManager ...", LogCategory.Info);
                ToolManager toolManager = new ToolManager();
                DeviceManager deviceManager = new DeviceManager();
                ExtensionManager extensionManager = new ExtensionManager();

                if (toolManager.Initialize() == false)
                    throw new Exception("Could not initialize ToolManager!");

                if(deviceManager.Initialize() == false)
                    throw new Exception("Could not initialize DeviceManager!");

                if(extensionManager.Initialize() == false)
                    throw new Exception("Could not initialize ExtensionManager!");

                CoreSystem.Managers.Add(toolManager);
                CoreSystem.Managers.Add(deviceManager);
                CoreSystem.Managers.Add(extensionManager);

                if (UpdatePlugins() == false)
                    throw new Exception("Could not get any plugins!");

                return true;
            } catch (Exception ex) {
                Trace.WriteLine(ex.Message, ex.StackTrace, LogCategory.Error);
                return false;
            }
        }