Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        /// <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);
        }
Esempio n. 4
0
        /// <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);
        }