/// <summary> /// Constructor /// </summary> /// <param name="token"></param> /// <param name="parent"></param> public ClassApi(JToken token, ClassApi parent) { Name = token["text"].ToString(); IndexName = Name.Replace("{", "").Replace("}", ""); Parent = parent; Resource = token["path"].ToString(); Keys.AddRange(parent.Keys); parent.SubClasses.Add(this); IsIndexed = token["text"].ToString().StartsWith("{"); if (IsIndexed) { Keys.Add(IndexName); } if (token["info"] != null) { Methods.AddRange(token["info"].Select(a => new MethodApi(a.Parent[((JProperty)a).Name], this)).ToArray()); } //tree children if (token["children"] != null) { foreach (var child in token["children"]) { new ClassApi(child, this); } } }
/// <summary> /// Слияние двух узлов. /// </summary> /// <param name="sibling">Брат, с которым происходит слияние.</param> public override void Merge(ArrayNode <T> sibling) { LeafArrayNode <T> node = (LeafArrayNode <T>)sibling; Keys.AddRange(node.Keys); Next = node.Next; }
public void SetKeys(string keys) { if (!string.IsNullOrEmpty(keys)) { Keys.AddRange(keys.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)); } }
public override void Parse(XElement definition) { UseParentDescription = TryParseBool(definition, "UseParentDescription"); DefKey = definition.Attribute("DefKey")?.Value?.ToString(); var keyString = definition.Attribute("Keys")?.Value?.ToString(); if (!string.IsNullOrWhiteSpace(keyString)) { if (!keyString.Contains('(')) { Keys.AddRange(keyString.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(e => new Tuple <string, string>(e.Trim(), "Node"))); } else { var categories = keyString.Split(new char[] { ')' }, StringSplitOptions.RemoveEmptyEntries); foreach (var categoryString in categories) { var split = categoryString.Trim().Split('('); var category = split[0].Trim(); if (category.StartsWith(",")) { category = category.Substring(1); } Keys.AddRange(split[1].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(e => new Tuple <string, string>(e.Trim(), category))); } } ListCollectionView lcv = new ListCollectionView(Keys); lcv.GroupDescriptions.Add(new PropertyGroupDescription("Item2")); ItemsSource = lcv; } }
public void Absorb(JSONObject obj) { List.AddRange(obj.List); Keys.AddRange(obj.Keys); String = obj.String; F = obj.F; B = obj.B; ObjectType = obj.ObjectType; }
/// <summary> /// Слияние двух узлов. /// </summary> /// <param name="sibling">Брат, с которым происходит слияние.</param> public override void Merge(ArrayNode <T> sibling) { InternalArrayNode <T> node = (InternalArrayNode <T>)sibling; //Спускает Separator сверху Keys.Add(node.GetFirstLeafKey()); Keys.AddRange(node.Keys); Children.AddRange(node.Children); }
public EntityRelation(string ns, string name, params string[] keys) { Namespace = ns; TableName = name; if (keys != null) { Keys.AddRange(keys); } }
public void Merge(KeySet other) { Keys.AddRange(other.Keys); if (other.HasTangents) { HasTangents = true; } }
public void Merge(KeySet other) { Keys.AddRange(other.Keys); if (other.IsInterpolated) { IsInterpolated = true; } }
/// <summary> /// Reload our list of valid keys. This could come from a file or a database /// </summary> protected void ReloadKeys() { Keys.Clear(); Keys.AddRange( new string[] { "ececb2bf-3309-4b71-a723-45a582b92af1", "6fd721a7-4377-4645-9386-6faff7e27787", "17f8fb35-1547-4584-851c-6884ef89c1fe", "f642489d-602e-4bb1-a898-baf6a160c999", "7728c5cd-5c69-449b-b4f7-573e0b66ffd9", "2f1cc887-6f3a-44b8-ba00-a67aebb80c50", "517a864d-d202-4b8f-ba4c-ce093dde08a2", "e0eea45d-ae30-4226-8d9f-efc2fbc7f164", "d0b2b8a7-645e-44f8-be05-05ea08c89869", "3c83d890-2cd4-414f-9f72-30ef3fce99f0" }); Keys.Sort(); }
internal KeyList(Endorsement[] endorsements) : this() { Keys.AddRange(endorsements.Select(endorsement => new Key(endorsement))); }