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; }
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; } }
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; }
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; }
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; }
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; }
void __msg(ListBox.ObjectCollection list,string str) { if (list.Count >= 256) list.RemoveAt(0); list.Add(str); }
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); } }
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); } }
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; }
private void addSortedItem(object item, ListBox.ObjectCollection sorted, ListBox.ObjectCollection reverseSorted) { if(sortOrder == SortOrder.SORTED) sorted.Add(item); else reverseSorted.Add(item); }
public void FillVoiceList(ListBox.ObjectCollection items) { items.Clear(); lock (_speechSynthData._speechVoiceList) { foreach (SpeechVoice sV in _speechSynthData._speechVoiceList) items.Add(sV._voiceName); } }
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); } }
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); }