Esempio n. 1
0
        public void initTableList()
        {
            CheckedListBox.ObjectCollection items = chkTableList.Items;
            items.Add(ActionTypeTable.TABLE_NAME);
            items.Add(EventTable.TABLE_NAME);
            items.Add(MatchTable.TABLE_NAME);
            items.Add(TeamTable.TABLE_NAME);
            items.Add(TeamMatchTable.TABLE_NAME);

            chkTableList.Refresh();
        }
Esempio n. 2
0
        public void initTableList()
        {
            CheckedListBox.ObjectCollection items = chkTableList.Items;
            items.Add("competition_data");
            items.Add("match_data");
            items.Add("robot_data");
            items.Add("team_data");
            items.Add("team_match");

            chkTableList.Refresh();
        }
Esempio n. 3
0
        public void Show()
        {
            CheckedListBox.ObjectCollection items = this.hiddenNodeList.Items;

            List <object> nodesToRemove
                = new List <object> (
                      from object item in items
                      where (!this.curCategoryTypes.Contains(item.ToString()))
                      select item);

            foreach (object node in nodesToRemove)
            {
                items.Remove(node);
            }

            foreach (string type in this.curCategoryTypes)
            {
                if (!items.Contains(type))
                {
                    items.Add(type);

                    if (this.categoryTypeStatus[type])
                    {
                        this.hiddenNodeList.SetItemChecked(items.IndexOf(type), true);
                    }
                }
            }
        }
Esempio n. 4
0
        internal MsgBox_CheckBoxes(string message, string caption, List <string> DataSource, string buttonText, CBDisplayType type = CBDisplayType.GRID)
        {
            InitializeComponent();
            currentType = type;
            label1.Text = message;

            if (currentType == CBDisplayType.GRID)
            {
                for (int i = 0; i < DataSource.Count; i++)
                {
                    CheckBox checkBox = new CheckBox();
                    checkBox.Name = "CheckBox_" + i;
                    checkBox.Text = DataSource[i];
                    checkBoxes.Add(checkBox);
                }
                flowLayoutPanel1.Controls.AddRange(checkBoxes.ToArray());
                this.Size = new Size(this.Size.Width, 150 + 35 * (int)Math.Ceiling((double)(checkBoxes.Count / 3)));
            }
            else
            {
                clb = new CheckedListBox();
                CheckedListBox.ObjectCollection oc = clb.Items;
                for (int i = 0; i < DataSource.Count; i++)
                {
                    oc.Add(DataSource[i]);
                }
                clb.Dock         = DockStyle.Fill;
                clb.CheckOnClick = true;
                tableLayoutPanel1.Controls.RemoveByKey("flowLayoutPanel1");
                tableLayoutPanel1.Controls.Add(clb, 1, 1);

                this.Size = new Size(this.Size.Width, 100 + clb.Size.Height);
            }
            button1.Text = buttonText;
        }
        private void CheckedListBoxItemsInitialization()
        {
            CheckedListBox.ObjectCollection clbSortersItems = clbSorters.Items;

            for (int i = 0; i < _formModel.LoadedSorters.Count; i++)
            {
                clbSortersItems.Add(_formModel.LoadedSorters[i].ToString());
            }
        }
Esempio n. 6
0
        public static CheckedListBox.ObjectCollection UncheckedItems(this CheckedListBox lb)
        {
            var uchkItms = new CheckedListBox.ObjectCollection(lb);

            for (int i = 0; i < lb.Items.Count; i++)
            {
                if (!lb.GetItemChecked(i))
                {
                    uchkItms.Add(lb.Items[i]);
                }
            }
            return(uchkItms);
        }
        /// <summary>
        ///
        /// </summary>
        public void FillData(Dictionary <MemberModel, ClassModel> members, ClassModel cm)
        {
            String label;

            this.members = members;
            String separatorInserted = null;

            members2 = new Dictionary <String, MemberModel>();
            CheckedListBox.ObjectCollection items = checkedListBox.Items;
            Dictionary <MemberModel, ClassModel> .KeyCollection keys = members.Keys;
            items.Clear(); // Clear items...
            foreach (MemberModel member in keys)
            {
                String qname = members[member].QualifiedName;
                if (separatorInserted != qname)
                {
                    separatorInserted = qname;
                    items.Add("--- " + qname);
                }
                label = TemplateUtils.ToDeclarationString(member, TemplateUtils.GetTemplate("MethodDeclaration"));
                label = label.Replace(SnippetHelper.BOUNDARY, "")
                        .Replace(SnippetHelper.ENTRYPOINT, "")
                        .Replace(SnippetHelper.EXITPOINT, "");
                if ((member.Flags & FlagType.Getter) > 0)
                {
                    label = "get " + label;
                }
                else if ((member.Flags & FlagType.Setter) > 0)
                {
                    label = "set " + label;
                }

                items.Add(label, false);
                members2.Add(label, member);
            }
        }
Esempio n. 8
0
        /// <summary>
        ///
        /// </summary>
        public void FillData(Dictionary <MemberModel, ClassModel> members, ClassModel cm)
        {
            String label;

            this.members = members;
            String separatorInserted = null;

            members2 = new Dictionary <String, MemberModel>();
            CheckedListBox.ObjectCollection items = checkedListBox.Items;
            Dictionary <MemberModel, ClassModel> .KeyCollection keys = members.Keys;
            items.Clear(); // Clear items...
            foreach (MemberModel member in keys)
            {
                String qname = members[member].QualifiedName;
                if (separatorInserted != qname)
                {
                    separatorInserted = qname;
                    items.Add("--- " + qname);
                }
                label = member.ToDeclarationString();
                items.Add(label, false);
                members2.Add(label, member);
            }
        }
Esempio n. 9
0
 private void LoadGDOData(string dbName, CheckedListBox.ObjectCollection items)
 {
     foreach (var aLine in File.ReadAllLines(GetGDODataPath(dbName)))
     {
         if (string.IsNullOrWhiteSpace(aLine))
         {
             continue;
         }
         var line = aLine.Trim();
         if (line.StartsWith("#"))
         {
             continue;
         }
         items.Add(line);
     }
 }
Esempio n. 10
0
 public void loadFileList()
 {
     if (Directory.Exists(this.importPath))
     {
         CheckedListBox.ObjectCollection items = chkFileList.Items;
         items.Clear();
         IEnumerable <string> files = Directory.EnumerateFiles(this.importPath, "*.xml", SearchOption.TopDirectoryOnly);
         foreach (string fileName in files)
         {
             string[] fn   = fileName.Split('\\');
             string   name = fn[fn.Length - 1];
             items.Add(name);
         }
     }
     chkFileList.Refresh();
     Console.Out.WriteLine("File List loaded");
 }
Esempio n. 11
0
        public static void SetLanguage(CheckedListBox.ObjectCollection items, Type type)
        {
            StringCollection saveKeys = new StringCollection();

            for (int idx = 0; idx < items.Count; idx++)
            {
                common.myComboBoxItem item = (common.myComboBoxItem)items[idx];
                saveKeys.Add(item.Value);
            }
            if (type == typeof(AppTypes.TimeScale))
            {
                items.Clear();
                for (int idx = 0; idx < saveKeys.Count; idx++)
                {
                    object obj = FindTimeScaleByCode(saveKeys[idx]);
                    if (obj == null)
                    {
                        continue;
                    }
                    AppTypes.TimeScale item = (AppTypes.TimeScale)obj;
                    items.Add(new common.myComboBoxItem(item.Description, item.Code));
                }
                return;
            }

            if (type == typeof(AppTypes.TradeActions))
            {
                items.Clear();
                for (int idx = 0; idx < saveKeys.Count; idx++)
                {
                    object obj = FindCodeInEnum(saveKeys[idx], typeof(AppTypes.TradeActions));
                    if (obj == null)
                    {
                        continue;
                    }
                    AppTypes.TradeActions item = (AppTypes.TradeActions)obj;
                    items.Add(new common.myComboBoxItem(AppTypes.Type2Text(item), item.ToString()));
                }
                return;
            }

            if (type == typeof(AppTypes.TimeRanges))
            {
                items.Clear();
                for (int idx = 0; idx < saveKeys.Count; idx++)
                {
                    object obj = FindCodeInEnum(saveKeys[idx], typeof(AppTypes.TimeRanges));
                    if (obj == null)
                    {
                        continue;
                    }
                    AppTypes.TimeRanges item = (AppTypes.TimeRanges)obj;
                    items.Add(new common.myComboBoxItem(AppTypes.Type2Text(item), item.ToString()));
                }
                return;
            }
            if (type == typeof(AppTypes.StrategyTypes))
            {
                items.Clear();
                for (int idx = 0; idx < saveKeys.Count; idx++)
                {
                    object obj = FindCodeInEnum(saveKeys[idx], typeof(AppTypes.StrategyTypes));
                    if (obj == null)
                    {
                        continue;
                    }
                    AppTypes.StrategyTypes item = (AppTypes.StrategyTypes)obj;
                    items.Add(new common.myComboBoxItem(AppTypes.Type2Text(item), item.ToString()));
                }
                return;
            }
            if (type == typeof(AppTypes.Sex))
            {
                items.Clear();
                for (int idx = 0; idx < saveKeys.Count; idx++)
                {
                    object obj = FindCodeInEnum(saveKeys[idx], typeof(AppTypes.Sex));
                    if (obj == null)
                    {
                        continue;
                    }
                    AppTypes.Sex item = (AppTypes.Sex)obj;
                    items.Add(new common.myComboBoxItem(AppTypes.Type2Text(item), item.ToString()));
                }
                return;
            }
            if (type == typeof(AppTypes.CommonStatus))
            {
                items.Clear();
                for (int idx = 0; idx < saveKeys.Count; idx++)
                {
                    object obj = FindCodeInEnum(saveKeys[idx], typeof(AppTypes.CommonStatus));
                    if (obj == null)
                    {
                        continue;
                    }
                    AppTypes.CommonStatus item = (AppTypes.CommonStatus)obj;
                    items.Add(new common.myComboBoxItem(AppTypes.Type2Text(item), item.ToString()));
                }
                return;
            }
            if (type == typeof(AppTypes.ChartTypes))
            {
                items.Clear();
                for (int idx = 0; idx < saveKeys.Count; idx++)
                {
                    object obj = FindCodeInEnum(saveKeys[idx], typeof(AppTypes.ChartTypes));
                    if (obj == null)
                    {
                        continue;
                    }
                    AppTypes.ChartTypes item = (AppTypes.ChartTypes)obj;
                    items.Add(new common.myComboBoxItem(AppTypes.Type2Text(item), item.ToString()));
                }
                return;
            }
            if (type == typeof(AppTypes.BizSectorTypes))
            {
                items.Clear();
                for (int idx = 0; idx < saveKeys.Count; idx++)
                {
                    object obj = FindCodeInEnum(saveKeys[idx], typeof(AppTypes.BizSectorTypes));
                    if (obj == null)
                    {
                        continue;
                    }
                    AppTypes.BizSectorTypes item = (AppTypes.BizSectorTypes)obj;
                    items.Add(new common.myComboBoxItem(AppTypes.Type2Text(item), item.ToString()));
                }
                return;
            }
        }