public override int GetHashCode() { unchecked { return(("UserDefinedClass".GetHashCode() * 397) ^ DomPath.GetHashCode()); } }
public Property(DomPath domPath, bool isNonEmpty, IFactory factory) { HasHadNonEmptyValue |= isNonEmpty; _defaultPropertyDefinitionSet = new Lazy<PropertyDefinitionSet>(CreateDefaultPropertyDefinitionSet); _domPath = domPath; _factory = factory; }
public Property(DomPath domPath, bool isNonEmpty, IFactory factory) { HasHadNonEmptyValue |= isNonEmpty; _defaultPropertyDefinitionSet = new Lazy <PropertyDefinitionSet>(CreateDefaultPropertyDefinitionSet); _domPath = domPath; _factory = factory; }
public override bool Equals(object other) { var otherUserDefinedClass = other as UserDefinedClass; if (otherUserDefinedClass == null) { return(false); } return(DomPath.Equals(otherUserDefinedClass.DomPath)); }
public DomPath GetDomPath(IFactory factory) { var split = DomPath.Split(new[] { ':' }, StringSplitOptions.RemoveEmptyEntries); var fullPath = split[0]; var typeNameDepth = int.Parse(split[1]); var domPath = factory.GetOrCreateDomPath(fullPath, typeNameDepth); return(domPath); }
public UserDefinedClass GetOrAdd(DomPath path, out bool isNew) { var isNewClass = false; var @class = _classes.GetOrAdd( path, x => { isNewClass = true; return(new UserDefinedClass(x)); }); isNew = isNewClass; return(@class); }
public DomPath GetOrCreateDomPath(string fullPath, int typeNameDepth) { if (domPaths.ContainsKey(fullPath)) { return(domPaths[fullPath]); } var domPath = new DomPath(fullPath, typeNameDepth); if (stuff.Contains(domPath.TypeName.Raw)) { throw new InvalidOperationException("Invalid metadata: more than one user defined class with identical type names."); } stuff.Add(domPath.TypeName.Raw); domPaths.Add(fullPath, domPath); return(domPath); }
public Property ToProperty(IRepository repository, IFactory factory) { var split = DomPath.Split(new[] { ':' }, StringSplitOptions.RemoveEmptyEntries); var domPath = factory.GetOrCreateDomPath(split[0], int.Parse(split[1])); var property = factory.CreateProperty(domPath, HasHadNonEmptyValue); property.CustomName = CustomName; property.InitializeDefaultPropertyDefinitionSet( propertyDefinitions => propertyDefinitions.Append(DefaultPropertyDefinitionSet.PropertyDefinitions.Select(x => x.ToPropertyDefinition(repository, factory)))); foreach (var proxySet in ExtraPropertyDefinitionSets) { var set = proxySet.ToPropertyDefinitionSet(repository, factory); property.AddOrUpdateExtraPropertyDefinitionSet(set); } return(property); }
public DomPath GetOrCreateDomPath(string fullPath) { if (domPaths.ContainsKey(fullPath)) { return(domPaths[fullPath]); } for (int i = 0;; i++) { var domPath = new DomPath(fullPath, i); if (!stuff.Contains(domPath.TypeName.Raw)) { stuff.Add(domPath.TypeName.Raw); domPaths.Add(fullPath, domPath); return(domPath); } } // If there is one that exists with the given fullPath, return it. // Start with a depth of zero. // If there is not one that exists at the current depth, create and return one at that depth // Increment depth }
public Property CreateProperty(DomPath domPath, bool isNonEmpty) { return(new Property(domPath, isNonEmpty, this)); }
protected bool Equals(DomPath other) { return(_hashCode == other._hashCode); }
public UserDefinedClass GetOrAdd(DomPath path) { return(_classes.GetOrAdd( path, x => new UserDefinedClass(x))); }
public UserDefinedClass(DomPath domPath) { _domPath = domPath; _order = _orderSeed++; }
public DomPath GetOrCreateDomPath(string fullPath) { if (domPaths.ContainsKey(fullPath)) { return domPaths[fullPath]; } for (int i = 0;; i++) { var domPath = new DomPath(fullPath, i); if (!stuff.Contains(domPath.TypeName.Raw)) { stuff.Add(domPath.TypeName.Raw); domPaths.Add(fullPath, domPath); return domPath; } } // If there is one that exists with the given fullPath, return it. // Start with a depth of zero. // If there is not one that exists at the current depth, create and return one at that depth // Increment depth }
public DomPath GetOrCreateDomPath(string fullPath, int typeNameDepth) { if (domPaths.ContainsKey(fullPath)) { return domPaths[fullPath]; } var domPath = new DomPath(fullPath, typeNameDepth); if (stuff.Contains(domPath.TypeName.Raw)) { throw new InvalidOperationException("Invalid metadata: more than one user defined class with identical type names."); } stuff.Add(domPath.TypeName.Raw); domPaths.Add(fullPath, domPath); return domPath; }
public Property CreateProperty(DomPath domPath, bool isNonEmpty) { return new Property(domPath, isNonEmpty, this); }
public UserDefinedClass GetOrAdd(DomPath path) { return _classes.GetOrAdd( path, x => new UserDefinedClass(x)); }
public UserDefinedClass GetOrAdd(DomPath path, out bool isNew) { var isNewClass = false; var @class = _classes.GetOrAdd( path, x => { isNewClass = true; return new UserDefinedClass(x); }); isNew = isNewClass; return @class; }
protected bool Equals(DomPath other) { return _hashCode == other._hashCode; }