private static void ProcessEnum(CodeEnum element, List <IntellisenseObject> list)
        {
            IntellisenseObject data = new IntellisenseObject
            {
                Name      = element.Name,
                IsEnum    = element.Kind == vsCMElement.vsCMElementEnum,
                FullName  = element.FullName,
                Namespace = GetNamespace(element),
                Summary   = GetSummary(element)
            };

            foreach (var codeEnum in element.Members.OfType <CodeVariable>())
            {
                var prop = new IntellisenseProperty
                {
                    Name           = codeEnum.Name,
                    Summary        = GetSummary(codeEnum),
                    InitExpression = GetInitializer(codeEnum.InitExpression)
                };

                data.Properties.Add(prop);
            }

            if (data.Properties.Count > 0)
            {
                list.Add(data);
            }
        }
Exemple #2
0
 private static void WriteTypeScriptComment(IntellisenseProperty p, StringBuilder sb)
 {
     if (string.IsNullOrEmpty(p.Summary))
     {
         return;
     }
     sb.AppendLine("\t\t/** " + whitespaceTrimmer.Replace(p.Summary, "") + " */");
 }
        private static void ProcessEnum(CodeEnum element, List<IntellisenseObject> list)
        {
            IntellisenseObject data = new IntellisenseObject
            {
                Name = element.Name,
                IsEnum = element.Kind == vsCMElement.vsCMElementEnum,
                FullName = element.FullName,
                Namespace = GetNamespace(element),
                Summary = GetSummary(element)
            };

            foreach (var codeEnum in element.Members.OfType<CodeVariable>())
            {
                var prop = new IntellisenseProperty
                {
                    Name = codeEnum.Name,
                    Summary = GetSummary(codeEnum),
                    InitExpression = GetInitializer(codeEnum.InitExpression)
                };

                data.Properties.Add(prop);
            }

            if (data.Properties.Count > 0)
                list.Add(data);
        }
 private static void WriteTypeScriptComment(IntellisenseProperty p, StringBuilder sb)
 {
     if (string.IsNullOrEmpty(p.Summary)) return;
     sb.AppendLine("\t\t/** " + whitespaceTrimmer.Replace(p.Summary, "") + " */");
 }
        private static void ProcessClass(CodeClass cc, List<IntellisenseObject> list)
        {
            IntellisenseObject data = new IntellisenseObject
            {
                Name = cc.Name,
                FullName = cc.FullName,
                Properties = new List<IntellisenseProperty>()
            };

            foreach (CodeProperty property in cc.Members.OfType<CodeProperty>())
            {
                if (property.Attributes.Cast<CodeAttribute>().Any(a => a.Name == "IgnoreDataMember"))
                    continue;

                var prop = new IntellisenseProperty()
                {
                    Name = GetName(property),
                    Type = property.Type.AsString,
                    Summary = GetSummary(property)
                };

                data.Properties.Add(prop);
            }

            if (data.Properties.Count > 0)
                list.Add(data);
        }