Esempio n. 1
0
        public FieldDoc(Proto.Doc.field field)
        {
            this.field = field;
            string base0;

            this.Comments = MessageDoc.GetComments(field.Name, field.Description, out this.Attributes, out base0);
            if (!string.IsNullOrEmpty(base0))
            {
                throw new Exception("Base class name is unexpected for field:" + field.Name);
            }
        }
Esempio n. 2
0
        public EnumDoc(Proto.Doc.enums enums)
        {
            this.enums = enums;
            foreach (var t in enums.Values)
            {
                Values[t.Name] = new ValueDoc(t);
            }
            string base0;

            this.Comments = MessageDoc.GetComments(enums.Name, enums.Description, out this.Attributes, out base0);
            if (!string.IsNullOrEmpty(base0))
            {
                throw new Exception("Base class name is unexpected for enum value:" + enums.Name);
            }
        }
Esempio n. 3
0
 public MessageDoc(Proto.Doc.message message)
 {
     this.message = message;
     foreach (var t in message.Fields)
     {
         Fields[t.Name] = new FieldDoc(t);
     }
     this.Comments = MessageDoc.GetComments(message.Name, message.Description, out this.Attributes, out this.BaseClass);
     if (!string.IsNullOrEmpty(this.BaseClass))
     {
         this.IsDefaultBase = false;
         string s = this.BaseClass.Substring(this.BaseClass.IndexOf(':') + 1).TrimStart();
         if (s.Contains("VmBindable"))
         {
             this.IsBindableBase = true;
         }
         if (s.Contains("VmEditable"))
         {
             this.IsBindableBase = true;
             this.IsEditableBase = true;
         }
         if (s.Contains("VmValidatable") || s.Contains("VmValidatableWithSeverityAndAttributes") ||
             s.Contains("VmValidatableWithSeverity"))
         {
             this.IsBindableBase    = true;
             this.IsEditableBase    = true;
             this.IsValidatableBase = true;
         }
         if (s.Contains("ConfigObjectCommonBase"))
         {
             this.IsConfigObjectBase = true;
             this.IsBindableBase     = true;
             this.IsEditableBase     = true;
             this.IsValidatableBase  = true;
         }
         if (s.Contains("ConfigObjectVmBase"))
         {
             this.IsConfigObjectBase = true;
             this.IsBindableBase     = true;
             this.IsEditableBase     = true;
             this.IsValidatableBase  = true;
         }
         if (s.Contains("ConfigObjectVmGenSettings"))
         {
             this.IsConfigObjectBase = true;
             this.IsGenSettings      = true;
             this.IsDefaultBase      = true;
             this.IsBindableBase     = true;
             this.IsEditableBase     = true;
             this.IsValidatableBase  = true;
         }
     }
     else
     {
         this.IsDefaultBase      = true;
         this.IsConfigObjectBase = true;
         this.IsGenSettings      = true;
         this.IsBindableBase     = true;
         this.IsEditableBase     = true;
         this.IsValidatableBase  = true;
     }
 }