public void InsertNewLine (ITextDocument editor, NewLineInsertion insertion, ref int offset)
		{
			string str = null;
			switch (insertion) {
			case NewLineInsertion.Eol:
				str = editor.GetEolMarker ();
				break;
			case NewLineInsertion.BlankLine:
				str = editor.GetEolMarker () + editor.GetEolMarker ();
				break;
			default:
				return;
		}

			editor.InsertText (offset, str);
			offset += str.Length;
		}
Beispiel #2
0
        public void InsertNewLine(ITextDocument editor, NewLineInsertion insertion, ref int offset)
        {
            string str = null;

            switch (insertion)
            {
            case NewLineInsertion.Eol:
                str = editor.GetEolMarker();
                break;

            case NewLineInsertion.BlankLine:
                str = editor.GetEolMarker() + editor.GetEolMarker();
                break;

            default:
                return;
            }

            editor.InsertText(offset, str);
            offset += str.Length;
        }
Beispiel #3
0
        public static CodeGenerator CreateGenerator(ITextDocument editor, ICompilation compilation)
        {
            MimeTypeExtensionNode node;

            if (!generators.TryGetValue(editor.MimeType, out node))
            {
                return(null);
            }

            var result = (CodeGenerator)node.CreateInstance();

            //result.UseSpaceIndent = editor.Options.TabsToSpaces;
            result.EolMarker = editor.GetEolMarker();
            //result.TabSize = editor.Options.TabSize;
            //result.Compilation = compilation;

            return(result);
        }
		public static CodeGenerator CreateGenerator (ITextDocument editor, ICompilation compilation)
		{
			MimeTypeExtensionNode node;
			if (!generators.TryGetValue (editor.MimeType, out node))
				return null;

			var result = (CodeGenerator)node.CreateInstance ();

			//result.UseSpaceIndent = editor.Options.TabsToSpaces;
			result.EolMarker = editor.GetEolMarker ();
			//result.TabSize = editor.Options.TabSize;
			//result.Compilation = compilation;

			return result;
		}