Example #1
0
        public IContentType AddContentType(string typeName, IEnumerable <string> baseTypeNames)
        {
            if (typeName == null)
            {
                throw new ArgumentNullException();
            }

            string uppercaseTypeName = typeName.ToUpperInvariant();

            if (uppercaseTypeName == _unknownName)
            {
                throw new InvalidOperationException();
            }


            MockContentType type;

            if (!_contentTypes.TryGetValue(typeName, out type))
            {
                _contentTypes[typeName] = new MockContentType(typeName, new IContentType[0]);
            }
            List <IContentType> baseTypes = new List <IContentType>();

            foreach (var baseTypeName in baseTypeNames)
            {
                baseTypes.Add(AddContentType(baseTypeName, Empty));
            }
            return(type);
        }
        public IContentType AddContentType(string typeName, IEnumerable<string> baseTypeNames) {
            if (typeName == null) {
                throw new ArgumentNullException();
            }

            string uppercaseTypeName = typeName.ToUpperInvariant();
            if (uppercaseTypeName == _unknownName) {
                throw new InvalidOperationException();
            }
 

            MockContentType type;
            if (!_contentTypes.TryGetValue(typeName, out type)) {
                _contentTypes[typeName] = new MockContentType(typeName, new IContentType[0]);
            }
            List<IContentType> baseTypes = new List<IContentType>();
            foreach (var baseTypeName in baseTypeNames) {
                baseTypes.Add(AddContentType(baseTypeName, Empty));
            }
            return type;
        }
 public MockContentTypeRegistryService() {
     _contentTypes[_unknownName] = _unknownType = new MockContentType(_unknownName, new IContentType[0]);
 }
Example #4
0
 public MockContentTypeRegistryService()
 {
     _contentTypes[_unknownName] = _unknownType = new MockContentType(_unknownName, new IContentType[0]);
 }