当前位置: 首页>>代码示例>>C#>>正文


C# ListBox.Clear方法代码示例

本文整理汇总了C#中System.Windows.Forms.ListBox.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# ListBox.Clear方法的具体用法?C# ListBox.Clear怎么用?C# ListBox.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ListBox的用法示例。


在下文中一共展示了ListBox.Clear方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getAllAttrs

        public int getAllAttrs(ListBox.ObjectCollection list)
        {
            list.Clear();

            if (fcat != null) {
                var attrs = fcat.GetAttributes();
                if (attrs != null) {
                    int i=0;
                    foreach(var attr in attrs) {

                        string s=attr.Alias;
                        if (convert.IsString(s)) {
                            s+="<"+attr.ValueType+">";

                            string t=attr.ToString();
                            if (convert.IsString(t)) s+=" // "+t;

                            i++;
                            list.Add(String.Format("{0}. {1}",i,s));
                        }
                    }
                }
            }

            return list.Count;
        }
开发者ID:emm274,项目名称:fcObj,代码行数:26,代码来源:fcData.cs

示例2: getAttributeListedValues

        public int getAttributeListedValues(int index1, int index2, ListBox.ObjectCollection list)
        {
            list.Clear();

            IList<FC.FeatureAttribute> attrs=null;

            if (fcat != null)

            if (index1 < 0)
                attrs = fcat.GetAttributes();
            else {
                FC.FeatureType ft = fcat.FeatureTypes.ElementAt(index1);
                if (ft != null) attrs = ft.GetAttibutes();
            }

            if (attrs != null)
            if ((index2 >= 0) && (index2 < attrs.Count)) {
                FC.FeatureAttribute attr = attrs.ElementAt(index2);

                if (attr != null) {
                    IList<FC.ListedValue> values = attr.GetListedValuesList();

                    if (values != null)
                    foreach(var v in values)
                    list.Add(v.Code+": "+v.Label);
                }
            }

             			return list.Count;
        }
开发者ID:emm274,项目名称:fcObj,代码行数:30,代码来源:fcData.cs

示例3: getFeatureTypeRoles

        public int getFeatureTypeRoles(int index, 
		                               ListBox.ObjectCollection list,
		                               List<List<string>> topoList)
        {
            list.Clear();

            if (fcat != null)
            if ((index >= 0) && (index < fcat.FeatureTypes.Count)) {
                FC.FeatureType ft = fcat.FeatureTypes.ElementAt(index);
                if (ft != null) {

                    foreach (var binding in ft.Bindings) {
                        var role = binding.PropertyType as FC.AssociationRole;

                        if (role != null)
                        if (role.IsNavigable) {

                            var dest = role.ValueType;
                            if (dest != null) {

                                string key=role.Alias;
             						string name=role.MemberName;

                                string s="";
              						if (key != null) s=key;
              						if (name.Length > 0) {
              							if (s.Length > 0) s+="/";
              							s+=name;
              						}

                                FC.AssociationRole.RoleType typ=role.Type;
                                s+="["+typ.ToString()+"]";

             						s+=" ["+dest.Code+"]";
             						s+=" ["+binding.Cardinality+"]";

             						var es = ft.ConstrainedBy.GetConstraint( typeof(AssociationRoleConstraint) ) as FC.AssociationRoleConstraint;

             						string t="";

                                if (es != null)
             						foreach(var e in es.ValidationRules)
             						if (e.AssociationRoleName == name) {
             							t=e.ОграничениеПоСемантике; break;
             						}

                                if (t.Length > 0) s+=" \""+t+"\"";

                                list.Add(s);

                                if (topoList != null) {

                                    var tmp = new List<string>();

                                    if (es != null)
             						foreach(var e in es.TopologicRules)
             						if (e.AssociationRoleName == name) {
                                        t=e.SourceGeom+","+e.TargetGeom+": "+e.ОграничениеПоТопологии;
                                        tmp.Add(t);
                                    }

                                    if (tmp.Count > 0)	topoList.Add(tmp);
                                    else				topoList.Add(null);
                                }
                            }
                        }
                    }
                }
            }

            return list.Count;
        }
开发者ID:emm274,项目名称:fcObj,代码行数:72,代码来源:fcData.cs

示例4: getFeatureTypeAttrs

        public int getFeatureTypeAttrs(int index, ListBox.ObjectCollection list)
        {
            list.Clear();

            if (fcat != null) {
                FC.FeatureType ft = fcat.FeatureTypes.ElementAt(index);

                if (ft != null) {

                    foreach (var binding in ft.Bindings) {
                        var attr = binding.PropertyType as FC.FeatureAttribute;

                        if (attr != null) {

                            string s=attr.Alias;
                            if (convert.IsString(s)) {

                                string t=attr.ValueType;
                                if (t == "Класс") {
                                    var dt = binding.GetDataType();
                                    if (dt != null) t+="-"+dt.Code;
                                }

                                s+="<"+t+">";

                                t=binding.Cardinality;
                                s+=" ["+t+"]";

                                t=attr.ToString();
                                if (convert.IsString(t)) s+=" // "+t;

                                list.Add(s);
                            }

                        }
                    }

                    list.Add("");

                    var es = ft.ConstrainedBy.GetConstraint( typeof(AttributeValueConstraint) ) as FC.AttributeValueConstraint;

                    if (es != null)
                    foreach(var e in es.ValidationRules)
                    list.Add(String.Format("<{0}>",e.ОграничениеПоСемантике));

                }

            }

            return list.Count;
        }
开发者ID:emm274,项目名称:fcObj,代码行数:51,代码来源:fcData.cs

示例5: getFeatureTypeList

        public int getFeatureTypeList(ListBox.ObjectCollection list)
        {
            list.Clear();

            if (fcat != null) {
                foreach(var ft in fcat.FeatureTypes) {
               				string s=ft.Code;
               				list.Add(s+": "+ft.TypeName);
                }
               		}

            return list.Count;
        }
开发者ID:emm274,项目名称:fcObj,代码行数:13,代码来源:fcData.cs

示例6: loadPlayList

 public static void loadPlayList(string FileName, string supExt, PlFormat format,
     ref List<MediaItem> lContainer, ListBox.ObjectCollection lCollection, ref bool interrupt)
 {
     StreamReader srr = File.OpenText(FileName);
     Regex headText = null;
     switch (format)
     {
         case PlFormat.yspl:
             headText = new Regex("#YAMP Simplified PlayList#");
             break;
         case PlFormat.m3u:
         case PlFormat.m3u8:
             headText = new Regex("#*M3U");
             break;
         case PlFormat.unsupported:
             break;
     }
     if ( headText.IsMatch( srr.ReadLine() ) )
     {
         lContainer.Clear();
         lCollection.Clear();
         string readIn;
         if (format == PlFormat.yspl)
         {
             readIn = srr.ReadLine();
         }
         //bool ok = true;
         do
         {
             readIn = srr.ReadLine();
             if (readIn != null)
             {
                 if (!readIn.Contains("#End ... Written "))
                 {
                     if (!readIn.Contains("#"))
                     {
                         if(readIn.StartsWith(@"\"))
                         {
                             readIn = Environment.GetEnvironmentVariable("%SYSTEMDRIVE%",
                                 EnvironmentVariableTarget.Machine) + readIn;
                         }
                         string[] _file = new string[] { readIn };
                         LoadMultiFiles(ref _file, supExt, ref lContainer, lCollection, ref interrupt);
                     }
                 }
                 else
                     break;
             }
             else
             {
                 break;
                 //ok = false;
             }
         }
         while (true); //(ok);
     }
     else
     {
         MBoxHelper.ShowWarnMsg("Not a valid YAMP PlayList!",
             "Error on playlist load!");
     }
     srr.Close();
 }
开发者ID:zoi,项目名称:YAMP,代码行数:63,代码来源:PLParser.cs

示例7: LoadGenericList

 private void LoadGenericList(ListBox.ObjectCollection items, List<Skill> skills)
 {
     items.Clear();
     foreach (Skill skill in skills)
     {
         string item = MyTERA.Helpers.SkillsManager.SkillsManager.SkillNameTruncateRank(skill.Name);
         items.Add(item);
     }
 }
开发者ID:Raimon93,项目名称:Multicombat,代码行数:9,代码来源:ComboManager.cs

示例8: updateListbox

 private void updateListbox(ListBox.ObjectCollection dst, List<Vector2f> src)
 {
     dst.Clear();
     string str;
     foreach(var p in src)
     {
         str = p.X.ToString() + ", " + p.Y.ToString();
         dst.Add(str);
     }
 }
开发者ID:fallahn,项目名称:xygine,代码行数:10,代码来源:MainWindow.cs

示例9: getFeatureTypes

        public int getFeatureTypes(ListBox.ObjectCollection list)
        {
            list.Clear();

            int n=fobj.FeatureCount;
            int i;

            for (i=0; i<n; i++) {

                xobj.Ifeature ft = fobj.Feature[i];

                if (ft != null)
                    list.Add(ft.acronym+": "+
                             ft.Caption);

            }

            return list.Count;
        }
开发者ID:emm274,项目名称:fcObj,代码行数:19,代码来源:objData.cs

示例10: FillVoiceList

 public void FillVoiceList(ListBox.ObjectCollection items)
 {
     items.Clear();
     lock (_speechSynthData._speechVoiceList)
     {
         foreach (SpeechVoice sV in _speechSynthData._speechVoiceList)
             items.Add(sV._voiceName);
     }
 }
开发者ID:yanterrien,项目名称:VSTalker,代码行数:9,代码来源:SpeechSynth.cs

示例11: PopulateValues

 void PopulateValues(ListBox.ObjectCollection list, int entryIndex)
 {
     if (reg == null)
         return;
     list.Clear();
     curEntry = reg.GetEntry(entryIndex);
     if (curEntry != null)
     {
         for (int i = 0; i < curEntry.Count; i++)
             list.Add(curEntry.GetValue(i).Name);
     }
 }
开发者ID:Xeeynamo,项目名称:VitaReg,代码行数:12,代码来源:ValuePicker.cs

示例12: PopulateEntries

 void PopulateEntries(ListBox.ObjectCollection list)
 {
     if (reg == null)
         return;
     list.Clear();
     for (int i = 0; i < reg.CurrentHeader.EntriesCount; i++)
         list.Add(/*i.ToString("X03") + " - " + */reg.GetEntryDesc(i).Name);
 }
开发者ID:Xeeynamo,项目名称:VitaReg,代码行数:8,代码来源:ValuePicker.cs


注:本文中的System.Windows.Forms.ListBox.Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。