public void ProvideTo(IHdumType type) { foreach (var methodKvp in Provide()) { type.AddMethod(methodKvp.Key, methodKvp.Value); } }
public HdumTypesInheritanceConflictException(IEnumerable<IHdumType> bases, IHdumType derived, IEnumerable<String> elements) : this(bases, derived, elements, "A conflict has occurred when deriving {1} from types {0}. Specify {2} explicitly.") { }
protected HdumContent(IHdumNode parent, IHdumType type) : base(parent, type) { }
protected HdumCollection(IHdumNode parent, IHdumType type, String name) : base(parent, type, name) { }
protected BaseHdumNode(IHdumNode parent, IHdumType type, String name) { _Members = new OrderedDictionary<String, IHdumNode>(); _Children = new List<IHdumNode>(); _SelfReference = this; _Parent = parent; _Root = parent != null ? parent.Root : this; _NodeType = type; _Namespace = type.Namespace; var names = _Namespace.MemberNames; var prefix = _Namespace.NamesPrefix; this[prefix + names.NameofThis] = _SelfReference; this[prefix + names.NameofParent] = _Parent; this[prefix + names.NameofRoot] = _Root; this[prefix + names.NameofType] = _NodeType; _NameNode = name != null ? _Namespace.TypeofName.CreateNode(this, name).As<IHdumName>() : null; this[prefix + names.NameofName] = _NameNode; }
protected HdumEntity(IHdumNode parent, IHdumType type, String name) : base(parent, type, name) { }
public HdumAbstractNodeTypeException(IHdumType type, String message, Exception inner) : base(String.Format(message, type.Name), inner) { AbstractType = type; }
public HdumMemberInvalidTypeException(IHdumNode node, String identifier, IHdumType type, String message, Exception inner) : base(node, identifier, String.Format(message, "{0}", type.Name), inner) { MemberType = type; }
public HdumMemberData(String identifier, IHdumType type, HdumMemberCompleter completer, Boolean runtime) : this(identifier, type, false, completer, runtime) { }
public HdumMemberData(String identifier, IHdumType type, Boolean nullable, HdumMemberCompleter completer, Boolean runtime) { Identifier = identifier; IsNullable = nullable; MemberType = type; Completer = completer; IsRuntime = runtime; }
public HdumMap(IHdumNode parent, IHdumType type, String name) : base(parent, type, name) { _ItemsSource = new OrderedDictionary<String, IHdumNode>(); _Items = _ItemsSource.Values; }
public HdumMap(IHdumNode parent, IHdumType type) : this(parent, type, null) { }
public HdumObject(IHdumNode parent, IHdumType type, String name) : base(parent, type, name) { }
public HdumObject(IHdumNode parent, IHdumType type) : base(parent, type) { }
public HdumList(IHdumNode parent, IHdumType type, String name) : base(parent, type, name) { _ItemsSource = new List<IHdumNode>(); _Items = new ReadOnlyCollection<IHdumNode>(_ItemsSource); }
public HdumTypesInheritanceConflictException(IEnumerable<IHdumType> bases, IHdumType derived, IEnumerable<String> elements, String message, Exception inner) : base(bases.First(), derived, String.Format(String.Join(", ", bases.Select(b => b.Name)), derived, String.Join(", ", elements)), inner) { Bases = bases; Elements = elements; }
public HdumMemberInvalidTypeException(IHdumNode node, String identifier, IHdumType type) : this(node, identifier, type, "The given HDUM node's member {0} isn't of required type {1}.") { }
public HdumMemberData(String identifier, IHdumType type, HdumMemberCompleter completer) : this(identifier, type, false, completer, false) { }
public HdumAbstractNodeTypeException(IHdumType type) : this(type, "Cannot create a HDUM node of abstract type {0}.") { }
ImageSource FindIconOfType(IHdumType type) { var key = type.Name; if (IconSources.ContainsKey(key)) return IconSources[key]; IHdumType deepestIdentity; deepestIdentity = type.Identities.First(); foreach (var identity in type.Identities) { if (identity == type) continue; if (identity.Identities.Contains(deepestIdentity)) deepestIdentity = identity; } if (deepestIdentity == type) throw new KeyNotFoundException("No valid HDUM type icon has been found for " + type.Name); IconSources.Add(key, FindIconOfType(deepestIdentity)); return IconSources[key]; }
protected HdumEntity(IHdumNode parent, IHdumType type) : base(parent, type) { }
public HdumTypesInheritanceException(IHdumType bas, IHdumType derived) : this(bas, derived, "A problem has occurred when deriving {1} from {0}.") { }
protected BaseHdumNode(IHdumNode parent, IHdumType type) : this(parent, type, null) { }
public HdumTypesInheritanceException(IHdumType bas, IHdumType derived, String message, Exception inner) : base(bas.Namespace, String.Format(message, bas.Name, derived.Name), inner) { Base = bas; Derived = derived; }
protected HdumCollection(IHdumNode parent, IHdumType type) : base(parent, type) { }
public HdumTypesCircularInheritanceException(IHdumType bas, IHdumType derived) : this(bas, derived, "Type {1} cannot be derived from {0}, because it would cause inheritance loop.") { }
public HdumTypesCircularInheritanceException(IHdumType bas, IHdumType derived, String message, Exception inner) : base(bas, derived, message, inner) { }
public HdumReference(IHdumNode parent, IHdumType type) : base(parent, type) { }