Пример #1
0
 public void ImplementInterface(
     EnvDTE.CodeType implementor,
     object @interface,
     bool fExplicit
     )
 {
     // TODO: Implement!
 }
Пример #2
0
 public AngularControllerViewModel(EnvDTE.CodeType controllerType)
 {
     this._controllerType = controllerType;
     this.EstablishDependencies();
     this.ControllerName               = Common.CamelCaseString(controllerType.Name);
     this.ControllerDependencies       = GetDependencies(false);
     this.ControllerQuotedDependencies = GetDependencies(true);
     this.EstablishSupportedHttpVerbs();
 }
 public AngularControllerViewModel(EnvDTE.CodeType controllerType)
 {
     this._controllerType = controllerType;
     this.EstablishDependencies();
     this.ControllerName = Common.CamelCaseString(controllerType.Name);
     this.ControllerDependencies = GetDependencies(false);
     this.ControllerQuotedDependencies = GetDependencies(true);
     this.EstablishSupportedHttpVerbs();
 }
 public AngularResourceViewModel(EnvDTE.CodeType controllerType)
 {
     this._controllerType = controllerType;
     this._controllerMethods = controllerType.Members
         .Cast<EnvDTE.CodeElement>().Where(ce => ce.Kind == EnvDTE.vsCMElement.vsCMElementFunction)
         .Cast<EnvDTE.CodeFunction>().Where(cf => cf.Access == EnvDTE.vsCMAccess.vsCMAccessPublic);
     this.ServiceName = CSharpToNgControllerHelpers.GetServiceName(_controllerType.Name);
     this.Methods = this._controllerMethods.Select(cf => new WebApiControllerMethodViewModel(cf));
     this.EstablishDependencies();
 }
 public AngularResourceViewModel(EnvDTE.CodeType controllerType)
 {
     this._controllerType    = controllerType;
     this._controllerMethods = controllerType.Members
                               .Cast <EnvDTE.CodeElement>().Where(ce => ce.Kind == EnvDTE.vsCMElement.vsCMElementFunction)
                               .Cast <EnvDTE.CodeFunction>().Where(cf => cf.Access == EnvDTE.vsCMAccess.vsCMAccessPublic);
     this.ServiceName = CSharpToNgControllerHelpers.GetServiceName(_controllerType.Name);
     this.Methods     = this._controllerMethods.Select(cf => new WebApiControllerMethodViewModel(cf));
     this.EstablishDependencies();
 }
 public EnvDTE.CodeElement ImplementOverride(EnvDTE.CodeElement member, EnvDTE.CodeType implementor)
 {
     throw new NotImplementedException();
 }
 public void ImplementAbstractClass(EnvDTE.CodeType implementor, object abstractClass)
 {
     // TODO: Implement!
 }
 public void ExtractInterface(EnvDTE.CodeType codeType)
 {
     throw new NotImplementedException();
 }
Пример #9
0
        // Builds a model type.
        private MType BuildMType(EnvDTE.CodeType codeType)
        {
            // Declarations
            MType mType;

            // Validates type.
            if (codeType == null)
            {
                return(TypeVoid);
            }

            // New type.
            mType          = new MType();
            mType.Name     = codeType.Name;
            mType.FullName = codeType.FullName;
            if (mType.FullName.EndsWith("?"))
            {
                mType.FullName = mType.FullName.Substring(0, mType.FullName.Length - 1);
            }

            // Checks type type.
            if (codeType.FullName.EndsWith("[]"))
            {
                mType.Type = MType.MTType.Array;
            }
            else if (codeType.FullName.StartsWith("System.Collections.Generic.List"))
            {
                mType.Type = MType.MTType.List;
            }
            else if (codeType.FullName.StartsWith("System.Threading.Tasks.Task"))
            {
                mType.Type = MType.MTType.Task;
            }
            else if (codeType.FullName.StartsWith("System.Collections.Generic.Dictionary"))
            {
                mType.Type = MType.MTType.Dictionary;
            }
            else if (codeType.FullName.StartsWith("Microsoft.Owin.IOwinContext"))
            {
                mType.Type = MType.MTType.OwinContext;
            }
            else if (codeType.FullName.StartsWith("System"))
            {
                mType.Type = MType.MTType.System;
            }
            else if (codeType.FullName == ("JsonRpc.JsonError"))
            {
                mType.Type = MType.MTType.Ignore;
            }
            else
            {
                mType.Type = MType.MTType.Custom;
            }

            // If array.
            if (mType.Type == MType.MTType.Array)
            {
                // Adds its type.
                string codeTypeName = codeType.FullName.Substring(0, codeType.FullName.Length - 2);
                mType.GenericTypes = new MType[] { BuildMTypeRef(GetCodeTypeRef(codeTypeName)) };
            }

            // If List or Task.
            if (mType.Type == MType.MTType.List || mType.Type == MType.MTType.Task)
            {
                mType.GenericTypes = GetGenerics(codeType.FullName).Select(ctr => BuildMTypeRef(ctr)).ToArray();
            }

            // If custom.
            if (mType.Type == MType.MTType.Custom)
            {
                // Finds its generics.
                mType.GenericTypes = GetGenerics(codeType.FullName).Select(ctr => BuildMTypeRef(ctr)).ToArray();

                // Checks if type has not been added.
                if (!Interfaces.Any(it => it.Name == codeType.Name))
                {
                    // Adds interface.
                    Interfaces.Add(codeType);
                }
            }

            return(mType);
        }