/// <summary> /// Removes a type declaration from the model. /// </summary> /// <param name="typeDecl">The target item.</param> public void RemoveType(ITypeDeclarationModel typeDecl) { var classDecl = typeDecl as ClassDeclaration; if (classDecl != null) { if (_classes.Contains(classDecl)) { _classes.Remove(classDecl); } return; } var enumDecl = typeDecl as EnumDeclaration; if (enumDecl != null) { if (_enums.Contains(enumDecl)) { _enums.Remove(enumDecl); } return; } throw new NotImplementedException("Type removal not implemented for type of: " + typeDecl.GetType().FullName); }
/// <summary> /// Adds a new type declaration to the model. /// </summary> /// <param name="typeDecl">The target item.</param> public void AddType(ITypeDeclarationModel typeDecl) { var classDecl = typeDecl as ClassDeclaration; if (classDecl != null) { if (!_classes.Contains(classDecl)) { _classes.Add(classDecl); } return; } var enumDecl = typeDecl as EnumDeclaration; if (enumDecl != null) { if (!_enums.Contains(enumDecl)) { _enums.Add(enumDecl); } return; } throw new NotImplementedException("Type insertion not implemented for type of: " + typeDecl.GetType().FullName); }
/// <summary> /// Adds a new type declaration to the model. /// </summary> /// <param name="typeDecl">The target item.</param> public void AddType(ITypeDeclarationModel typeDecl) { var classDecl = typeDecl as ClassDeclaration; if (classDecl != null) { if (!_classes.Contains(classDecl)) _classes.Add(classDecl); return; } var enumDecl = typeDecl as EnumDeclaration; if (enumDecl != null) { if (!_enums.Contains(enumDecl)) _enums.Add(enumDecl); return; } throw new NotImplementedException("Type insertion not implemented for type of: " + typeDecl.GetType().FullName); }
/// <summary> /// Removes a type declaration from the model. /// </summary> /// <param name="typeDecl">The target item.</param> public void RemoveType(ITypeDeclarationModel typeDecl) { var classDecl = typeDecl as ClassDeclaration; if (classDecl != null) { if (_classes.Contains(classDecl)) _classes.Remove(classDecl); return; } var enumDecl = typeDecl as EnumDeclaration; if (enumDecl != null) { if (_enums.Contains(enumDecl)) _enums.Remove(enumDecl); return; } throw new NotImplementedException("Type removal not implemented for type of: " + typeDecl.GetType().FullName); }