private List <PluginViewModel> GetAvailablePlugins()
        {
            List <PluginViewModel> result = new List <PluginViewModel>();

            try
            {
                IViewModelFactory factory      = new ViewModelFactory();
                PluginState[]     pluginStates = null;

                pluginStates = UserSettings.LoadSetting <PluginState[]>(UserSettings.SettingType.PluginState);

                result = pluginManager.GetPlugins()?.Select(p =>
                {
                    ArgumentCollection viewModelArgs  = new ArgumentCollection();
                    ArgumentCollection pluginInitArgs = new ArgumentCollection();

                    pluginInitArgs.Set(ArgumentCollection.ArgumentType.IsPluginMode, true);

                    if (pluginStates != null)
                    {
                        PluginState pluginState = pluginStates.FirstOrDefault(ps => String.Equals(ps.Name, p.GetPluginName()));
                        if (pluginState == null)
                        {
                            pluginState = new PluginState(p.GetPluginName(), false)
                            {
                                WindowState = p.GetDefaultWindowState()
                            }
                        }
                        ;
                        if (pluginState.WindowState == null)
                        {
                            pluginState.WindowState = p.GetDefaultWindowState();
                        }

                        pluginInitArgs.Set(ArgumentCollection.ArgumentType.PluginState, pluginState);
                        viewModelArgs.Set(ArgumentCollection.ArgumentType.RestorePlugin, pluginState.IsActive);
                    }

                    viewModelArgs.Set(ArgumentCollection.ArgumentType.Plugin, p);
                    viewModelArgs.Set(ArgumentCollection.ArgumentType.PluginArgs, pluginInitArgs);

                    PluginViewModel pluginViewModel = factory.CreateViewModel <PluginViewModel>(viewModelArgs);
                    return(pluginViewModel);
                }).ToList() ?? new List <PluginViewModel>();
            }
            catch (Exception ex)
            {
                Logger.Log(EventID.DesktopDashboard.Application.Exception, nameof(GetAvailablePlugins), ex);
            }
            finally
            {
                Logger.Log(EventID.DesktopDashboard.Application.FoundedAvailablePlugins, result.Count, String.Join(",", result.Select(p => p.Name)));
            }
            return(result);
        }
        public void Initialize(ArgumentCollection args)
        {
            if (this.Controls == null)
            {
                this.Controls = new List <IDashboardControl>();
            }

            this.Controls.Add(new ucCpuInfo());
            this.Controls.Add(new ucRamInfo());

            #region PartitionInfo

            List <System.IO.DriveInfo> partitionInfo = new List <System.IO.DriveInfo>();
            try
            {
                System.IO.DriveInfo[] allDrives = System.IO.DriveInfo.GetDrives();
                if (allDrives != null && allDrives.Length > 0)
                {
                    partitionInfo = allDrives.Where(d => d.DriveType == System.IO.DriveType.Fixed).ToList();
                }
            }
            catch (Exception ex)
            {
                Logger.Log(EventID.DIComputerPerformance.Application.Exception, "LoadingPartitionInfo", ex);
            }

            if (partitionInfo.Count > 0)
            {
                foreach (System.IO.DriveInfo diItem in partitionInfo)
                {
                    ArgumentCollection patitionInfoArgs = new ArgumentCollection();
                    patitionInfoArgs.Set(ArgumentCollection.ArgumentType.DriveInfo, diItem);
                    this.Controls.Add(new ucPartitionInfo(patitionInfoArgs));
                }
            }

            #endregion
            this.dashboardUpdateTaskCancellationTokenSource = new CancellationTokenSource();
            dashboardUpdateTask = new Task(() => DashboardUpdater(this.dashboardUpdateTaskCancellationTokenSource.Token), this.dashboardUpdateTaskCancellationTokenSource.Token, TaskCreationOptions.LongRunning);
            dashboardUpdateTask.Start();
        }