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 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 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; }
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 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(); }
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; }
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); }