Beispiel #1
0
        /// <summary>
        /// 在复选列表添加AIDA数据项
        /// </summary>
        /// <param name="checkedListBox"></param>
        public static void AddAIDAItems(this CheckedListBox checkedListBox, AIDADataType aIDADataType)
        {
            List <Item> items = new List <Item>();

            switch (aIDADataType)
            {
            case AIDADataType.System:
                items = AIDA64Handler.AIDA64Infos.AIDA64Info.System ?? new List <Item>();
                break;

            case AIDADataType.Temperature:
                items = AIDA64Handler.AIDA64Infos.AIDA64Info.Temperature ?? new List <Item>();
                break;

            case AIDADataType.Volt:
                items = AIDA64Handler.AIDA64Infos.AIDA64Info.Volt ?? new List <Item>();
                break;

            case AIDADataType.Power:
                items = AIDA64Handler.AIDA64Infos.AIDA64Info.Power ?? new List <Item>();
                break;
            }
            items.ForEach(t =>
            {
                if (Config.ConfigData.AIDAShownItems.Contains(t.Label))
                {
                    checkedListBox.Items.Add(t.Label, true);
                }
                else
                {
                    checkedListBox.Items.Add(t.Label, false);
                }
            });
        }
Beispiel #2
0
        /// <summary>
        /// 同步列表所有项目到<see cref="AIDAShownItems"/>中
        /// </summary>
        /// <param name="objectCollection"></param>
        /// <param name="aIDADataType"></param>
        public static void SyncAllItems(this ObjectCollection objectCollection, AIDADataType aIDADataType)
        {
            List <string> items = new List <string>();

            foreach (var item in objectCollection)
            {
                items.Add(item.ToString());
            }
            switch (aIDADataType)
            {
            case AIDADataType.System:
                Config.ConfigData.AIDAShownItems.AIDA64Data.System.Clear();
                items.ForEach(t => Config.ConfigData.AIDAShownItems.AIDA64Data.System.Add(AIDA64Handler.GetItemByLabel(t)));
                break;

            case AIDADataType.Temperature:
                Config.ConfigData.AIDAShownItems.AIDA64Data.Temperature.Clear();
                items.ForEach(t => Config.ConfigData.AIDAShownItems.AIDA64Data.Temperature.Add(AIDA64Handler.GetItemByLabel(t)));
                break;

            case AIDADataType.Volt:
                Config.ConfigData.AIDAShownItems.AIDA64Data.Volt.Clear();
                items.ForEach(t => Config.ConfigData.AIDAShownItems.AIDA64Data.Volt.Add(AIDA64Handler.GetItemByLabel(t)));
                break;

            case AIDADataType.Power:
                Config.ConfigData.AIDAShownItems.AIDA64Data.Power.Clear();
                items.ForEach(t => Config.ConfigData.AIDAShownItems.AIDA64Data.Power.Add(AIDA64Handler.GetItemByLabel(t)));
                break;
            }
        }