本文整理汇总了C#中System.Windows.Forms.ListBox.Add方法的典型用法代码示例。如果您正苦于以下问题:C# ListBox.Add方法的具体用法?C# ListBox.Add怎么用?C# ListBox.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ListBox
的用法示例。
在下文中一共展示了ListBox.Add方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: LoadMultiFiles
public static bool LoadMultiFiles(ref string[] files, string supExt,
ref List<MediaItem> Container, ListBox.ObjectCollection Collection, ref bool interrupt)
{
try
{
if (files != null)
{
foreach (string aElement in files)
{
if (!interrupt)
{
if (File.Exists(aElement))
{
string fileEnding = new FileInfo(aElement.ToLower()).Extension;
if (supExt.Contains(fileEnding))
{
MediaItem mItem = new MediaItem(aElement);
TagReader.Init(mItem.getFilePath);
if (TagReader.hasValidTags)
{
Container.Add(mItem);
Collection.Add(mItem.getFileName);
}
}
}
Application.DoEvents();
}
else
{
break;
}
}
}
return true;
}
catch (Exception)
{
return false;
}
}
示例3: 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;
}
示例4: 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;
}
示例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;
}
示例6: 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;
}
示例7: __msg
void __msg(ListBox.ObjectCollection list,string str)
{
if (list.Count >= 256)
list.RemoveAt(0);
list.Add(str);
}
示例8: 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);
}
}
示例9: 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);
}
}
示例10: 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;
}
示例11: addSortedItem
private void addSortedItem(object item, ListBox.ObjectCollection sorted, ListBox.ObjectCollection reverseSorted)
{
if(sortOrder == SortOrder.SORTED)
sorted.Add(item);
else
reverseSorted.Add(item);
}
示例12: FillVoiceList
public void FillVoiceList(ListBox.ObjectCollection items)
{
items.Clear();
lock (_speechSynthData._speechVoiceList)
{
foreach (SpeechVoice sV in _speechSynthData._speechVoiceList)
items.Add(sV._voiceName);
}
}
示例13: 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);
}
}
示例14: 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);
}