亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? csharpformattingstrategy.cs

?? SharpDevelop2.0.0 c#開發免費工具
?? CS
?? 第 1 頁 / 共 2 頁
字號:
				case '}':
				case '{':
					return textArea.Document.FormattingStrategy.IndentLine(textArea, lineNr);
				case '\n':
					if (lineNr <= 0) {
						return IndentLine(textArea, lineNr);
					}
					
					string  lineAboveText = lineAbove == null ? "" : textArea.Document.GetText(lineAbove);
					//// curLine might have some text which should be added to indentation
					curLineText = "";
					if (curLine.Length > 0) {
						curLineText = textArea.Document.GetText(curLine);
					}
					
					LineSegment nextLine      = lineNr + 1 < textArea.Document.TotalNumberOfLines ? textArea.Document.GetLineSegment(lineNr + 1) : null;
					string      nextLineText  = lineNr + 1 < textArea.Document.TotalNumberOfLines ? textArea.Document.GetText(nextLine) : "";
					
					int addCursorOffset = 0;
					
					if (lineAboveText.Trim().StartsWith("#region") && NeedEndregion(textArea.Document)) {
						textArea.Document.Insert(curLine.Offset, "#endregion");
						return IndentLine(textArea, lineNr) + "#endregion".Length;
					}
					
					if (lineAbove.HighlightSpanStack != null && !lineAbove.HighlightSpanStack.IsEmpty) {
						if (!lineAbove.HighlightSpanStack.Peek().StopEOL) {	// case for /* style comments
							int index = lineAboveText.IndexOf("/*");
							if (index > 0) {
								StringBuilder indentation = new StringBuilder(GetIndentation(textArea, lineNr - 1));
								for (int i = indentation.Length; i < index; ++ i) {
									indentation.Append(' ');
								}
								//// adding curline text
								textArea.Document.Replace(curLine.Offset, curLine.Length, indentation.ToString() + " * " + curLineText);
								return indentation.Length + 3 + curLineText.Length;
							}
							
							index = lineAboveText.IndexOf("*");
							if (index > 0) {
								StringBuilder indentation = new StringBuilder(GetIndentation(textArea, lineNr - 1));
								for (int i = indentation.Length; i < index; ++ i) {
									indentation.Append(' ');
								}
								//// adding curline if present
								textArea.Document.Replace(curLine.Offset, curLine.Length, indentation.ToString() + "* " + curLineText);
								return indentation.Length + 2 + curLineText.Length;
							}
						} else { // don't handle // lines, because they're only one lined comments
							int indexAbove = lineAboveText.IndexOf("///");
							int indexNext  = nextLineText.IndexOf("///");
							if (indexAbove > 0 && (indexNext != -1 || indexAbove + 4 < lineAbove.Length)) {
								StringBuilder indentation = new StringBuilder(GetIndentation(textArea, lineNr - 1));
								for (int i = indentation.Length; i < indexAbove; ++ i) {
									indentation.Append(' ');
								}
								//// adding curline text if present
								textArea.Document.Replace(curLine.Offset, curLine.Length, indentation.ToString() + "/// " + curLineText);
								textArea.Document.UndoStack.UndoLast(2);
								return indentation.Length + 4 /*+ curLineText.Length*/;
							}
							
							if (IsInNonVerbatimString(lineAboveText, curLineText)) {
								textArea.Document.Insert(lineAbove.Offset + lineAbove.Length,
								                         "\" +");
								curLine = textArea.Document.GetLineSegment(lineNr);
								textArea.Document.Insert(curLine.Offset, "\"");
								textArea.Document.UndoStack.UndoLast(3);
								addCursorOffset = 1;
							}
						}
					}
					int result = IndentLine(textArea, lineNr) + addCursorOffset;
					if (textArea.TextEditorProperties.AutoInsertCurlyBracket) {
						string oldLineText = TextUtilities.GetLineAsString(textArea.Document, lineNr - 1);
						if (oldLineText.EndsWith("{")) {
							if (NeedCurlyBracket(textArea.Document.TextContent)) {
								textArea.Document.Insert(curLine.Offset + curLine.Length, "\n}");
								IndentLine(textArea, lineNr + 1);
							}
						}
					}
					return result;
			}
			return 0;
		}
		
		/// <summary>
		/// Checks if the cursor is inside a non-verbatim string.
		/// This method is used to check if a line break was inserted in a string.
		/// The text editor has already broken the line for us, so we just need to check
		/// the two lines.
		/// </summary>
		/// <param name="start">The part before the line break</param>
		/// <param name="end">The part after the line break</param>
		/// <returns>
		/// True, when the line break was inside a non-verbatim-string, so when
		/// start does not contain a comment, but a non-even number of ", and
		/// end contains a non-even number of " before the first comment.
		/// </returns>
		bool IsInNonVerbatimString(string start, string end)
		{
			bool inString = false;
			bool inChar = false;
			for (int i = 0; i < start.Length; ++i) {
				char c = start[i];
				if (c == '"' && !inChar) {
					if (!inString && i > 0 && start[i - 1] == '@')
						return false; // no string line break for verbatim strings
					inString = !inString;
				} else if (c == '\'' && !inString) {
					inChar = !inChar;
				}
				if (!inString && i > 0 && start[i - 1] == '/' && (c == '/' || c == '*'))
					return false;
				if (inString && start[i] == '\\')
					++i;
			}
			if (!inString) return false;
			// we are possibly in a string, or a multiline string has just ended here
			// check if the closing double quote is in end
			for (int i = 0; i < end.Length; ++i) {
				char c = end[i];
				if (c == '"' && !inChar) {
					if (!inString && i > 0 && end[i - 1] == '@')
						break; // no string line break for verbatim strings
					inString = !inString;
				} else if (c == '\'' && !inString) {
					inChar = !inChar;
				}
				if (!inString && i > 0 && end[i - 1] == '/' && (c == '/' || c == '*'))
					break;
				if (inString && end[i] == '\\')
					++i;
			}
			// return true if the string was closed properly
			return !inString;
		}
		#endregion
		
		#region SearchBracket helper functions
		static int ScanLineStart(IDocument document, int offset)
		{
			for (int i = offset - 1; i > 0; --i) {
				if (document.GetCharAt(i) == '\n')
					return i + 1;
			}
			return 0;
		}
		
		/// <summary>
		/// Gets the type of code at offset.<br/>
		/// 0 = Code,<br/>
		/// 1 = Comment,<br/>
		/// 2 = String<br/>
		/// Block comments and multiline strings are not supported.
		/// </summary>
		static int GetStartType(IDocument document, int linestart, int offset)
		{
			bool inString = false;
			bool inChar = false;
			bool verbatim = false;
			for(int i = linestart; i < offset; i++) {
				switch (document.GetCharAt(i)) {
					case '/':
						if (!inString && !inChar && i + 1 < document.TextLength) {
							if (document.GetCharAt(i + 1) == '/') {
								return 1;
							}
						}
						break;
					case '"':
						if (!inChar) {
							if (inString && verbatim) {
								if (i + 1 < document.TextLength && document.GetCharAt(i + 1) == '"') {
									++i; // skip escaped quote
									inString = false; // let the string go on
								} else {
									verbatim = false;
								}
							} else if (!inString && i > 0 && document.GetCharAt(i - 1) == '@') {
								verbatim = true;
							}
							inString = !inString;
						}
						break;
					case '\'':
						if (!inString) inChar = !inChar;
						break;
					case '\\':
						if ((inString && !verbatim) || inChar)
							++i; // skip next character
						break;
				}
			}
			return (inString || inChar) ? 2 : 0;
		}
		#endregion
		
		#region SearchBracketBackward
		public override int SearchBracketBackward(IDocument document, int offset, char openBracket, char closingBracket)
		{
			if (offset + 1 >= document.TextLength) return -1;
			// this method parses a c# document backwards to find the matching bracket
			
			// first try "quick find" - find the matching bracket if there is no string/comment in the way
			int quickResult = base.SearchBracketBackward(document, offset, openBracket, closingBracket);
			if (quickResult >= 0) return quickResult;
			
			// we need to parse the line from the beginning, so get the line start position
			int linestart = ScanLineStart(document, offset + 1);
			
			// we need to know where offset is - in a string/comment or in normal code?
			// ignore cases where offset is in a block comment
			int starttype = GetStartType(document, linestart, offset + 1);
			if (starttype != 0) {
				return -1; // start position is in a comment/string
			}
			
			// I don't see any possibility to parse a C# document backwards...
			// We have to do it forwards and push all bracket positions on a stack.
			Stack bracketStack = new Stack();
			bool  blockComment = false;
			bool  lineComment  = false;
			bool  inChar       = false;
			bool  inString     = false;
			bool  verbatim     = false;
			
			for(int i = 0; i <= offset; ++i) {
				char ch = document.GetCharAt(i);
				switch (ch) {
					case '\r':
					case '\n':
						lineComment = false;
						inChar = false;
						if (!verbatim) inString = false;
						break;
					case '/':
						if (blockComment) {
							Debug.Assert(i > 0);
							if (document.GetCharAt(i - 1) == '*') {
								blockComment = false;
							}
						}
						if (!inString && !inChar && i + 1 < document.TextLength) {
							if (!blockComment && document.GetCharAt(i + 1) == '/') {
								lineComment = true;
							}
							if (!lineComment && document.GetCharAt(i + 1) == '*') {
								blockComment = true;
							}
						}
						break;
					case '"':
						if (!(inChar || lineComment || blockComment)) {
							if (inString && verbatim) {
								if (i + 1 < document.TextLength && document.GetCharAt(i + 1) == '"') {
									++i; // skip escaped quote
									inString = false; // let the string go
								} else {
									verbatim = false;
								}
							} else if (!inString && offset > 0 && document.GetCharAt(i - 1) == '@') {
								verbatim = true;
							}
							inString = !inString;
						}
						break;
					case '\'':
						if (!(inString || lineComment || blockComment)) {
							inChar = !inChar;
						}
						break;
					case '\\':
						if ((inString && !verbatim) || inChar)
							++i; // skip next character
						break;
						default :
							if (ch == openBracket) {
							if (!(inString || inChar || lineComment || blockComment)) {
								bracketStack.Push(i);
							}
						} else if (ch == closingBracket) {
							if (!(inString || inChar || lineComment || blockComment)) {
								if (bracketStack.Count > 0)
									bracketStack.Pop();
							}
						}
						break;
				}
			}
			if (bracketStack.Count > 0) return (int)bracketStack.Pop();
			return -1;
		}
		#endregion
		
		#region SearchBracketForward
		public override int SearchBracketForward(IDocument document, int offset, char openBracket, char closingBracket)
		{
			bool inString = false;
			bool inChar   = false;
			bool verbatim = false;
			
			bool lineComment  = false;
			bool blockComment = false;
			
			if (offset < 0) return -1;
			
			// first try "quick find" - find the matching bracket if there is no string/comment in the way
			int quickResult = base.SearchBracketForward(document, offset, openBracket, closingBracket);
			if (quickResult >= 0) return quickResult;
			
			// we need to parse the line from the beginning, so get the line start position
			int linestart = ScanLineStart(document, offset);
			
			// we need to know where offset is - in a string/comment or in normal code?
			// ignore cases where offset is in a block comment
			int starttype = GetStartType(document, linestart, offset);
			if (starttype != 0) return -1; // start position is in a comment/string
			
			int brackets = 1;
			
			while (offset < document.TextLength) {
				char ch = document.GetCharAt(offset);
				switch (ch) {
					case '\r':
					case '\n':
						lineComment = false;
						inChar = false;
						if (!verbatim) inString = false;
						break;
					case '/':
						if (blockComment) {
							Debug.Assert(offset > 0);
							if (document.GetCharAt(offset - 1) == '*') {
								blockComment = false;
							}
						}
						if (!inString && !inChar && offset + 1 < document.TextLength) {
							if (!blockComment && document.GetCharAt(offset + 1) == '/') {
								lineComment = true;
							}
							if (!lineComment && document.GetCharAt(offset + 1) == '*') {
								blockComment = true;
							}
						}
						break;
					case '"':
						if (!(inChar || lineComment || blockComment)) {
							if (inString && verbatim) {
								if (offset + 1 < document.TextLength && document.GetCharAt(offset + 1) == '"') {
									++offset; // skip escaped quote
									inString = false; // let the string go
								} else {
									verbatim = false;
								}
							} else if (!inString && offset > 0 && document.GetCharAt(offset - 1) == '@') {
								verbatim = true;
							}
							inString = !inString;
						}
						break;
					case '\'':
						if (!(inString || lineComment || blockComment)) {
							inChar = !inChar;
						}
						break;
					case '\\':
						if ((inString && !verbatim) || inChar)
							++offset; // skip next character
						break;
						default :
							if (ch == openBracket) {
							if (!(inString || inChar || lineComment || blockComment)) {
								++brackets;
							}
						} else if (ch == closingBracket) {
							if (!(inString || inChar || lineComment || blockComment)) {
								--brackets;
								if (brackets == 0) {
									return offset;
								}
							}
						}
						break;
				}
				++offset;
			}
			return -1;
		}
		#endregion
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线区一区二视频| 欧美极品aⅴ影院| 亚洲va欧美va天堂v国产综合| 色婷婷综合久久久| 亚洲一区二区精品3399| 欧美精品18+| 激情丁香综合五月| 欧美激情综合网| 色中色一区二区| 日韩国产精品久久久| xnxx国产精品| 99久久精品国产一区| 亚洲午夜视频在线| 欧美videos中文字幕| 成人禁用看黄a在线| 一区二区成人在线视频| 国产激情一区二区三区四区| 日韩一区二区免费高清| 美女mm1313爽爽久久久蜜臀| 久久日韩粉嫩一区二区三区| 春色校园综合激情亚洲| 中文一区二区完整视频在线观看| 99精品桃花视频在线观看| 亚洲黄色免费网站| 欧美精品一区二区三区四区| 国产精品影视天天线| 亚洲精品日日夜夜| 91精品婷婷国产综合久久竹菊| 国产精品99久久不卡二区| 久久精品欧美一区二区三区不卡| 91在线视频播放| 午夜精品成人在线视频| 欧美日本一区二区三区四区| 国产精品69久久久久水密桃| 成人欧美一区二区三区1314| 欧美变态凌虐bdsm| 99视频一区二区三区| 久久成人羞羞网站| 国产精品国产三级国产aⅴ入口| 5月丁香婷婷综合| 国产精品一区2区| 午夜精品免费在线| 中文字幕高清一区| 在线观看亚洲精品| 国产一区二区三区不卡在线观看 | 97久久超碰国产精品电影| 亚洲高清一区二区三区| 久久综合五月天婷婷伊人| 色综合欧美在线| 成人午夜视频在线观看| 日韩中文字幕一区二区三区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 国产精品第13页| 91精品国产福利在线观看| 久久国产精品99久久人人澡| 丝袜美腿成人在线| 中文字幕精品—区二区四季| 欧美精品一区二区在线播放| 欧美在线观看18| www.欧美日韩| 久久成人麻豆午夜电影| 五月综合激情网| 中文字幕中文字幕一区二区| 中文字幕乱码一区二区免费| 日韩视频不卡中文| 欧美一区二区三区视频免费播放| 99久久免费国产| 日av在线不卡| 日本不卡视频一二三区| 亚洲精品高清在线观看| 国产精品三级av| 在线成人av网站| 91行情网站电视在线观看高清版| 99在线视频精品| 粉嫩13p一区二区三区| 国产成人一级电影| 精东粉嫩av免费一区二区三区| 免费xxxx性欧美18vr| 亚洲国产人成综合网站| 亚洲成人免费在线| 亚洲一区自拍偷拍| 亚洲一区二区三区四区的 | 亚洲视频综合在线| 国产精品无遮挡| 欧美一区二区免费观在线| 欧美日韩小视频| 色哟哟国产精品| 欧美色国产精品| 欧美视频在线观看一区二区| 欧美日本在线播放| 欧美日韩在线三区| 欧美一区二区大片| 欧美一区二区免费观在线| 精品国产不卡一区二区三区| 欧美α欧美αv大片| 国产日产欧美一区| 国产蜜臀97一区二区三区| 综合在线观看色| 悠悠色在线精品| 日韩高清国产一区在线| 美女网站视频久久| 天堂影院一区二区| 石原莉奈在线亚洲二区| 亚洲在线视频一区| 亚洲国产色一区| 免费观看久久久4p| 国产在线精品一区二区夜色| 国产一区二区三区高清播放| 免费视频一区二区| 国产一区在线精品| 成人福利电影精品一区二区在线观看| 韩国欧美国产一区| 成人高清视频免费观看| 欧美日韩欧美一区二区| 欧美天堂一区二区三区| 制服.丝袜.亚洲.中文.综合| 欧美精品一区二区三区四区 | 国产精品久久夜| 日韩毛片在线免费观看| 午夜久久久久久电影| 久久精品国产免费| 一本一道久久a久久精品| 欧美色倩网站大全免费| 日本一区二区免费在线观看视频 | 久久九九全国免费| 亚洲毛片av在线| 国产一区 二区| 91丨九色丨尤物| 欧美电影免费提供在线观看| 亚洲国产精品黑人久久久| 一区二区久久久久久| 亚洲欧美国产高清| 美女久久久精品| 欧美性大战久久久久久久| 日本一区二区不卡视频| 日韩av在线播放中文字幕| 色综合 综合色| 精品国产污污免费网站入口 | 中文字幕精品一区二区三区精品| 亚洲影视在线播放| a4yy欧美一区二区三区| 欧美不卡在线视频| 三级欧美韩日大片在线看| 国产精品亚洲午夜一区二区三区| 欧美一级爆毛片| 亚洲欧美日韩国产一区二区三区 | 欧美日韩五月天| 国产欧美日本一区二区三区| 久久99精品久久只有精品| 在线视频你懂得一区二区三区| 中文乱码免费一区二区| 美女网站在线免费欧美精品| 欧美日韩极品在线观看一区| 国产精品乱码一区二三区小蝌蚪| 韩国av一区二区| 91麻豆精品久久久久蜜臀| 亚洲高清免费观看| www.欧美亚洲| 亚洲视频资源在线| 国产成人在线色| 国产欧美精品国产国产专区 | 欧美视频在线不卡| 最新日韩在线视频| 国产二区国产一区在线观看| 2019国产精品| 麻豆国产欧美日韩综合精品二区| 91精品欧美综合在线观看最新| 日韩美女精品在线| 91麻豆免费观看| 国产精品护士白丝一区av| 国产精品一区二区在线观看不卡 | 日韩国产一区二| 欧美日韩一区二区三区四区| 有坂深雪av一区二区精品| 99精品欧美一区二区三区综合在线| 中文字幕一区二区三区四区不卡| 国产精品自在在线| 国产日韩欧美不卡| 国产精品一区专区| 成人欧美一区二区三区1314| 成人免费三级在线| 亚洲欧美日韩一区| 91在线视频网址| 日韩国产精品久久久久久亚洲| 欧美日韩国产美| 激情久久久久久久久久久久久久久久| 欧美日韩成人一区二区| 六月丁香综合在线视频| 日韩一级片在线观看| 免费观看久久久4p| 日本一区二区三区国色天香| 99久久免费国产| 日韩精彩视频在线观看| 91精品国产乱码久久蜜臀| 国产精品一级片| 国产精品理论在线观看| 欧美中文字幕不卡| 天堂一区二区在线免费观看| 久久久久久免费网| 不卡在线观看av|