Exemple #1
0
        void WriteStructureFooter(ILStructure s)
        {
            output.Unindent();
            switch (s.Type)
            {
            case ILStructureType.Loop:
                output.WriteLine("// end loop", TextTokenType.Comment);
                break;

            case ILStructureType.Try:
                output.WriteRightBrace();
                output.WriteSpace();
                output.WriteLine("// end .try", TextTokenType.Comment);
                break;

            case ILStructureType.Handler:
                output.WriteRightBrace();
                output.WriteSpace();
                output.WriteLine("// end handler", TextTokenType.Comment);
                break;

            case ILStructureType.Filter:
                output.WriteRightBrace();
                output.WriteSpace();
                output.WriteLine("// end filter", TextTokenType.Comment);
                break;

            default:
                throw new NotSupportedException();
            }
        }
Exemple #2
0
        protected void WriteHiddenEnd(ITextOutput output, MemberMapping memberMapping)
        {
            output.Unindent();
            var location = output.Location;

            output.WriteRightBrace();
            UpdateMemberMapping(memberMapping, location, output.Location, EndILRanges);
            output.WriteLine();
        }
Exemple #3
0
 public void CloseBrace(BraceStyle style, out TextPosition?start, out TextPosition?end)
 {
     output.Unindent();
     start = output.Location;
     output.WriteRightBrace();
     end = output.Location;
     if (braceLevelWithinType >= 0)
     {
         braceLevelWithinType--;
     }
 }
 public void CloseBrace(BraceStyle style, out TextLocation?start, out TextLocation?end)
 {
     output.Unindent();
     start = output.Location;
     output.WriteRightBrace();
     end = output.Location;
     if (nodeStack.OfType <BlockStatement>().Count() <= 1)
     {
         output.MarkFoldEnd();
     }
     if (braceLevelWithinType >= 0)
     {
         braceLevelWithinType--;
     }
 }
Exemple #5
0
		void EndKeywordBlock(ITextOutput output)
		{
			output.Unindent();
			output.WriteRightBrace();
			output.WriteLine();
		}
Exemple #6
0
 void EndKeywordBlock(ITextOutput output)
 {
     output.Unindent();
     output.WriteRightBrace();
     output.WriteLine();
 }
Exemple #7
0
        void WriteToolTip(ITextOutput output, PropertyDef prop)
        {
            var sig = prop.PropertySig;
            var md = prop.GetMethods.FirstOrDefault() ??
                    prop.SetMethods.FirstOrDefault() ??
                    prop.OtherMethods.FirstOrDefault();

            var writer = new MethodWriter(this, output, md);
            writer.WriteReturnType();
            WriteToolTip(output, prop.DeclaringType);
            output.Write('.', TextTokenType.Operator);
            var ovrMeth = md == null || md.Overrides.Count == 0 ? null : md.Overrides[0].MethodDeclaration;
            if (prop.IsIndexer()) {
                if (ovrMeth != null) {
                    WriteToolTipType(output, ovrMeth.DeclaringType, false);
                    output.Write('.', TextTokenType.Operator);
                }
                output.Write("this", TextTokenType.Keyword);
                writer.WriteGenericArguments();
                writer.WriteMethodParameterList('[', ']');
            }
            else if (ovrMeth != null && GetPropName(ovrMeth) != null) {
                WriteToolTipType(output, ovrMeth.DeclaringType, false);
                output.Write('.', TextTokenType.Operator);
                output.Write(IdentifierEscaper.Escape(GetPropName(ovrMeth)), TextTokenHelper.GetTextTokenType(prop));
            }
            else
                output.Write(IdentifierEscaper.Escape(prop.Name), TextTokenHelper.GetTextTokenType(prop));

            output.WriteSpace();
            output.WriteLeftBrace();
            if (prop.GetMethods.Count > 0) {
                output.WriteSpace();
                output.Write("get", TextTokenType.Keyword);
                output.Write(';', TextTokenType.Operator);
            }
            if (prop.SetMethods.Count > 0) {
                output.WriteSpace();
                output.Write("set", TextTokenType.Keyword);
                output.Write(';', TextTokenType.Operator);
            }
            output.WriteSpace();
            output.WriteRightBrace();
        }