Beispiel #1
0
        public IRichStringbuilder Design(IRichStringbuilder richSb)
        {
            // Visibility PropertyName: ReturnType {get;set}
            Visibility.Design(richSb);
            richSb.WriteRegular(" ");
            WriteNameHelper(richSb);
            richSb.WriteRegular(": ");
            richSb.WriteBold(ReturnType);
            bool OpenCloseBracket = Getter || Setter;
            if (OpenCloseBracket)
            {
                richSb.WriteRegular("{");
                if (Getter) richSb.WriteRegular("get;");
                if (Setter) richSb.WriteRegular("set;");
                richSb.WriteRegular("}");
            }

            if (Abstract)
                richSb.WriteItalic(" ** abstract **");

            if (Virtual)
            {
                richSb.WriteRegular(" « ");
                richSb.WriteUnderline("virtual");
                richSb.WriteRegular(" »");
            }
            if (Overrided)
                richSb.WriteBold(" !overrided");
            return richSb;
        }
Beispiel #2
0
        protected static void DrawLine(IRichStringbuilder builder, int size, bool useIntercalatedSpace, char c, bool appendLineAtTheEnd = true, bool writingHeader = false)
        {
            Action<bool, string> internalFunc = (header, data) =>
            {
                if (header) { builder.WriteBold(data); }
                else { builder.WriteRegular(data); }
            };

            if (useIntercalatedSpace)
            {
                for (int i = 0;
                     i < size;
                     internalFunc(writingHeader, (i % 2 == 0 ? "" + c : " ")), i++) ;
            }

            else
            {
                for (int i = 0;
                     i < size;
                     internalFunc(writingHeader, ("" + c)), i++) ;
            }

            if (appendLineAtTheEnd)
            {
                builder.WriteLine();
            }
        }
 protected int WriteBaseTypesUML(IRichStringbuilder richSb)
 {
     var sbuilder = BaseTypes.Aggregate(new StringBuilder(), (sb, s) => sb.Append(s + ", "));
     string baseTypes = sbuilder.Remove(sbuilder.Length - 2, 2).ToString();
     richSb.WriteBold(baseTypes);
     return sbuilder.Length;
 }
Beispiel #4
0
        public IRichStringbuilder Design(IRichStringbuilder richSb)
        {
            // Visibility MethodName(arg: Type, ...)
            // Visibility (ctor) MethodName(arg: Type, ...)

            // parameters
            Action<IRichStringbuilder> WriteArgumentsIfExist = innerSb =>  {
                innerSb.WriteRegular("(");
                if (Arguments != null && Arguments.Count > 0)
                {
                    for (int i = 0; i < Arguments.Count; i++)
                    {
                        var kvp = Arguments[i];
                        innerSb.WriteRegular(kvp.Key + ": ");
                        innerSb.WriteBold(kvp.Value);

                        if ( (i + 1) < Arguments.Count)
                            innerSb.WriteRegular(", ");
                    }
                }
                innerSb.WriteRegular(")");
            };

            Visibility.Design(richSb);
            richSb.WriteRegular(" ");
            if (Ctor) richSb.WriteRegular("(ctor)");
            richSb.WriteRegular(Name);
            WriteArgumentsIfExist(richSb);
            richSb.WriteRegular(": ");
            richSb.WriteBold(Ctor ? Name : ReturnType);
            AppendSuffix(richSb);
            AppendSuffixOverride(richSb);

            return richSb;
        }
Beispiel #5
0
 public override IRichStringbuilder Design(IRichStringbuilder richerStringBuilder)
 {
     // CONSTANT_NAME : constant_type = value
     richerStringBuilder.WriteRegular(Name + " : ");
     richerStringBuilder.WriteBold(ReturnType);
     richerStringBuilder.WriteRegular(" = ");
     richerStringBuilder.WriteItalic(InitialValue);
     return richerStringBuilder;
 }
Beispiel #6
0
        public IRichStringbuilder Design(IRichStringbuilder richSb)
        {
            // Visibility MethodName(arg: Type, ...)
            // Visibility (ctor) MethodName(arg: Type, ...)

            // parameters
            Action<IRichStringbuilder> WriteArgumentsIfExist = innerSb =>
            {
                innerSb.WriteRegular("(");
                if (Arguments != null && Arguments.Count > 0)
                {
                    for (int i = 0; i < Arguments.Count; i++)
                    {
                        var kvp = Arguments.ElementAt(i);
                        innerSb.WriteRegular(kvp.Key + ": ");
                        innerSb.WriteBold(kvp.Value);

                        if ((i + 1) < Arguments.Count)
                            innerSb.WriteRegular(", ");
                    }
                }
                innerSb.WriteRegular(")");
            };

            if( Ctor && Static )
                this.Visibility = new Visibility(Enums.VisibilityMode.@public);

            Visibility.Design(richSb);
            richSb.WriteRegular(" ");
            if (Ctor)
            {
                if (Static) { richSb.WriteRegular("(cctor)"); }
                else { richSb.WriteRegular("(ctor)"); }
            }
            WriteNameHelper(richSb);
            WriteArgumentsIfExist(richSb);
            richSb.WriteRegular(": ");
            richSb.WriteBold(Ctor ? Name : ReturnType);

            if (Abstract)
                richSb.WriteItalic(" ** abstract **");

            if (Virtual)
            {
                richSb.WriteRegular(" « ");
                richSb.WriteUnderline("virtual");
                richSb.WriteRegular(" »");
            }
            if (Overrided)
                richSb.WriteBold(" !overrided");

            return richSb;
        }
Beispiel #7
0
        public IRichStringbuilder Design(IRichStringbuilder richSb)
        {
            // Visibility Name: ReturnType readonly
            Visibility.Design(richSb);
            richSb.WriteRegular(" " + Name + ": ");
            richSb.WriteBold(ReturnType);

            if (@Readonly)
                richSb.WriteItalic(" readonly");

            AppendSuffix(richSb);
            return richSb;
        }
Beispiel #8
0
        public IRichStringbuilder Design(IRichStringbuilder richSb)
        {
            // Visibility PropertyName: ReturnType {get;set}
            Visibility.Design(richSb);
            richSb.WriteRegular(" " + Name + ": ");
            richSb.WriteBold(ReturnType);
            bool OpenCloseBracket = Getter || Setter;
            if (OpenCloseBracket)
            {
                richSb.WriteRegular("{");
                if (Getter) richSb.WriteRegular("get;");
                if (Setter) richSb.WriteRegular("set;");
                richSb.WriteRegular("}");
            }

            AppendSuffix(richSb);
            AppendSuffixOverride(richSb);
            return richSb;
        }
 protected void AppendSuffixOverride(IRichStringbuilder richSb)
 {
     if (Overrided)
         richSb.WriteBold(" !overrided");
 }