/// <summary> /// /// </summary> public CodeFunctionInfo(BaseInfo parent, CodeFunction2 method) : base(parent, method as CodeElement2) { // Can be null when an custom ActionResult has no ctor if (method == null) return; _item = method; Summary = string.Empty; _signature = method.Name; this.IsGeneric = method.IsGeneric; try { BuildComment(_item.DocComment); } catch (Exception) { } this.Access = ObjectFactory.Convert(this._item.Access); Parameters.ToList(); }
/// <summary> /// constructor /// </summary> public CodePropertyInfo(BaseInfo parent, CodeProperty2 item) : base(parent, item as CodeElement2) { this._item = item; this.Access = ObjectFactory.Convert(this._item.Access); switch (this._item.ReadWrite) { case vsCMPropertyKind.vsCMPropertyKindReadWrite: this.CanRead = true; this.CanWrite = true; break; case vsCMPropertyKind.vsCMPropertyKindReadOnly: this.CanRead = true; this.CanWrite = false; break; case vsCMPropertyKind.vsCMPropertyKindWriteOnly: this.CanRead = false; this.CanWrite = true; break; } List<ParamInfo> _parameters = new List<ParamInfo>(); int index = 0; foreach (var p in this._item.Parameters.OfType<CodeParameter2>()) { ParamInfo pinfo = ObjectFactory.Instance.CreateParameter(this, p, index++, p.DocComment); _parameters.Add(pinfo); } this.Parameters = _parameters; }
/// <summary> /// /// </summary> public CodeFieldInfo(BaseInfo parent, CodeElement item, TypeInfo type) : base(parent, item as CodeElement2) { this._item = item; this.Access = CMAccess.Public; // ObjectFactory.Convert(this._item.Access); this._type = type; }
/// <summary> /// /// </summary> public BaseInfo(BaseInfo parent, CodeElement2 item) { this.Name = item.Name; this.FullName = item.FullName; this.IsCodeType = item.IsCodeType; this.Root = parent; this.Source = item; try { this.Project = new NodeProject(item.ProjectItem.ContainingProject); this.Location = new LocationInfo(item.StartPoint, item.EndPoint); } catch (Exception) { this.Location = new LocationInfo(null, null); } this.IsArray = false; this.ElementType = null; }
/// <summary> /// Initializes a new instance of the <see cref="ClassInfo"/> class. /// </summary> /// <param name="parent"></param> /// <param name="item"></param> protected ClassInfo(BaseInfo parent, CodeElement2 item) : base(parent, item) { }
/// <summary> /// /// </summary> public CodeEventInfo(BaseInfo parent, EnvDTE80.CodeEvent item) : base(parent, item as CodeElement2) { this._item = item; this.Access = ObjectFactory.Convert(this._item.Access); }
public CodeConstructorInfo(BaseInfo parent, CodeFunction2 method) : base(parent, method) { }
/// <summary> /// /// </summary> public CodeFieldInfo(BaseInfo parent, CodeElement item) : base(parent, item as CodeElement2) { this._item = item; //this._type = type; }
/// <summary> /// /// </summary> public virtual CodePropertyInfo CreateProperty(BaseInfo parent, CodeProperty2 item) { return new CodePropertyInfo(parent, item); }
/// <summary> /// /// </summary> public virtual CodeFunctionInfo CreateMethod(BaseInfo parent, CodeFunction2 item) { return new CodeFunctionInfo(parent, item); }
/// <summary> /// /// </summary> public virtual CodeEventInfo CreateEvent(BaseInfo parent, EnvDTE80.CodeEvent item) { return new CodeEventInfo(parent, item); }
/// <summary> /// /// </summary> public virtual CodeConstructorInfo CreateConstructor(BaseInfo parent, CodeFunction2 item) { return new CodeConstructorInfo(parent, item); }
/// <summary> /// /// </summary> private void Set(CodeTypeRef type) { this._list = new List<TypeInfo>(); this._rank = 0; this._attributes = null; this._classRef = null; this.IsVoid = false; this.IsEnumerable = false; this.IsClass = false; this.MethodInfolst = null; this.EventInfolst = null; this.PropertyInfolst = null; this.type = type; switch (type.TypeKind) { case vsCMTypeRef.vsCMTypeRefArray: case vsCMTypeRef.vsCMTypeRefCodeType: case vsCMTypeRef.vsCMTypeRefBool: case vsCMTypeRef.vsCMTypeRefByte: case vsCMTypeRef.vsCMTypeRefDecimal: case vsCMTypeRef.vsCMTypeRefDouble: case vsCMTypeRef.vsCMTypeRefFloat: case vsCMTypeRef.vsCMTypeRefInt: case vsCMTypeRef.vsCMTypeRefLong: case vsCMTypeRef.vsCMTypeRefShort: case vsCMTypeRef.vsCMTypeRefVariant: case vsCMTypeRef.vsCMTypeRefChar: case vsCMTypeRef.vsCMTypeRefString: Name = type.AsString; break; case vsCMTypeRef.vsCMTypeRefVoid: Name = "void"; break; case vsCMTypeRef.vsCMTypeRefOther: case vsCMTypeRef.vsCMTypeRefPointer: case vsCMTypeRef.vsCMTypeRefObject: Name = type.AsFullName; break; } this.KindType = type.TypeKind.ToString().Substring(11); if (!(this.IsVoid = (type.TypeKind == vsCMTypeRef.vsCMTypeRefVoid))) { this.IsClass = (type.TypeKind == vsCMTypeRef.vsCMTypeRefCodeType) || type.TypeKind == vsCMTypeRef.vsCMTypeRefString; if (!this.IsClass && type.TypeKind == vsCMTypeRef.vsCMTypeRefArray) this.IsClass = (type.Rank > 0 && type.ElementType.TypeKind == vsCMTypeRef.vsCMTypeRefCodeType); else if (!this.IsClass && type.TypeKind != vsCMTypeRef.vsCMTypeRefOther) this.IsEnumerable = type.CodeType.get_IsDerivedFrom(typeof(System.Collections.IEnumerable).FullName); if (type.TypeKind == vsCMTypeRef.vsCMTypeRefCodeType) if (type.CodeType.InfoLocation != vsCMInfoLocation.vsCMInfoLocationExternal) this.project = this.type.CodeType.ProjectItem.ContainingProject; } int i = 0; Parse(Name, this, ref i); DispatchType(); OnCreated(); /* vsCMTypeRefOther, vsCMTypeRefCodeType, vsCMTypeRefArray, vsCMTypeRefVoid, vsCMTypeRefPointer, vsCMTypeRefString, vsCMTypeRefObject, vsCMTypeRefByte, vsCMTypeRefChar, vsCMTypeRefShort, vsCMTypeRefInt, vsCMTypeRefLong, vsCMTypeRefFloat, vsCMTypeRefDouble, vsCMTypeRefDecimal, vsCMTypeRefBool, vsCMTypeRefVariant */ }
/// <summary> /// /// </summary> public CodeMemberInfo(BaseInfo parent, CodeElement2 item) : base(parent, item) { Parent = parent; }