• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CompletionListWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CompletionListWindow的典型用法代码示例。如果您正苦于以下问题:C# CompletionListWindow类的具体用法?C# CompletionListWindow怎么用?C# CompletionListWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CompletionListWindow类属于命名空间,在下文中一共展示了CompletionListWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
		{
			var ext = engine.Ext;
			var editor = ext.TextEditorData;
			var generator = CodeGenerator.CreateGenerator (ext.Document);
			if (ext.Project != null)
				generator.PolicyParent = ext.Project.Policies;
			var builder = engine.MDRefactoringCtx.CreateTypeSystemAstBuilder ();

			string sb = BaseExportCodeGenerator.GenerateMemberCode (engine.MDRefactoringCtx, builder, member);
			sb = sb.TrimEnd ();

			string indent = editor.GetIndentationString (editor.Caret.Location); 
			sb = sb.Replace (editor.EolMarker, editor.EolMarker + indent);

			int targetCaretPosition = sb.LastIndexOf ("throw", StringComparison.Ordinal);
			int selectionEndPosition = sb.LastIndexOf (";", StringComparison.Ordinal);

			editor.Replace (declarationBegin, editor.Caret.Offset - declarationBegin, sb);
			if (selectionEndPosition > 0) {
				targetCaretPosition += declarationBegin;
				selectionEndPosition += declarationBegin;
				editor.Caret.Offset = selectionEndPosition;
				editor.SetSelection (targetCaretPosition, selectionEndPosition);
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:26,代码来源:ProtocolCompletionData.cs


示例2: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
		{
			// insert add/remove event handler code after +=/-=
			editor.Replace (initialOffset, editor.Caret.Offset - initialOffset, this.DisplayText + (AddSemicolon ? ";" : ""));
			
			// Search opening bracket of member
			int pos = callingMember != null ? editor.Document.LocationToOffset (callingMember.BodyRegion.BeginLine, callingMember.BodyRegion.BeginColumn) : initialOffset;
			while (pos < editor.Document.TextLength && editor.Document.GetCharAt (pos) != '{') {
				pos++;
			}
			
			// Search closing bracket of member
			pos = editor.Document.GetMatchingBracketOffset (pos) + 1;
			
			pos = Math.Max (0, Math.Min (pos, editor.Document.TextLength - 1));
			
			// Insert new event handler after closing bracket
			var line = callingMember != null ? editor.Document.GetLine (callingMember.Region.BeginLine) : editor.Document.GetLineByOffset (initialOffset);
			string indent = line.GetIndentation (editor.Document);
			
			StringBuilder sb = new StringBuilder ();
			sb.Append (editor.EolMarker);
			sb.Append (editor.EolMarker);
			sb.Append (indent);
			if (callingMember != null && callingMember.IsStatic)
				sb.Append ("static ");
			sb.Append ("void ");
			int pos2 = sb.Length;
			sb.Append (this.DisplayText);
			sb.Append (' ');
			sb.Append (this.parameterList);
			sb.Append (editor.EolMarker);
			sb.Append (indent);
			sb.Append ("{");
			sb.Append (editor.EolMarker);
			sb.Append (indent);
			sb.Append (editor.Options.IndentationString);
			int cursorPos = pos + sb.Length;
			sb.Append (editor.EolMarker);
			sb.Append (indent);
			sb.Append ("}");
			editor.Insert (pos, sb.ToString ());
			editor.Caret.Offset = cursorPos;
			
			// start text link mode after insert
			List<TextLink> links = new List<TextLink> ();
			TextLink link = new TextLink ("name");
			
			link.AddLink (new TextSegment (0, this.DisplayText.Length));
			link.AddLink (new TextSegment (pos - initialOffset + pos2, this.DisplayText.Length));
			links.Add (link);
			
			var tle = new TextLinkEditMode (editor.Parent, initialOffset, links);
			tle.TextLinkMode = TextLinkMode.EditIdentifier;
			tle.SetCaretPosition = true;
			tle.SelectPrimaryLink = true;
			tle.OldMode = editor.CurrentMode;
			tle.StartMode ();
			editor.CurrentMode = tle;
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:60,代码来源:EventCreationCompletionData.cs


示例3: GetCurrentWord

		public static string GetCurrentWord (CompletionListWindow window)
		{
			int partialWordLength = window.PartialWord != null ? window.PartialWord.Length : 0;
			int replaceLength = window.CodeCompletionContext.TriggerWordLength + partialWordLength - window.InitialWordLength;
			int endOffset = Math.Min (window.CodeCompletionContext.TriggerOffset + replaceLength, window.CompletionWidget.TextLength);
			var result = window.CompletionWidget.GetText (window.CodeCompletionContext.TriggerOffset, endOffset);
			return result;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:8,代码来源:CompletionData.cs


示例4: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Ide.Editor.Extension.KeyDescriptor descriptor)
		{
			base.InsertCompletionText (window, ref ka, descriptor);
			factory.Ext.Editor.GetContent<CSharpTextEditorIndentation> ().DoReSmartIndent ();
			if (this.CompletionText.Contains ("\n")) {
				
				factory.Ext.Editor.GetContent<CSharpTextEditorIndentation> ().DoReSmartIndent (factory.Ext.Editor.GetLine (factory.Ext.Editor.CaretLine).NextLine.Offset);
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:9,代码来源:AnonymousMethodCompletionData.cs


示例5: InsertCompletionText

		public virtual void InsertCompletionText (CompletionListWindow window)
		{
			int partialWordLength = window.PartialWord != null ? window.PartialWord.Length : 0;
			
			int replaceLength = window.CodeCompletionContext.TriggerWordLength + partialWordLength - window.InitialWordLength;
			string currentWord = window.CompletionWidget.GetText (window.CodeCompletionContext.TriggerOffset, window.CodeCompletionContext.TriggerOffset + replaceLength);
			
			window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, currentWord, CompletionText);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:9,代码来源:CompletionData.cs


示例6: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
		{
			var editor = factory.Ext.Editor;
			var offset = window.CodeCompletionContext.TriggerOffset;
			using (var undo = editor.OpenUndoGroup ()) {
				base.InsertCompletionText (window, ref ka, descriptor);
				var span = nodeToCast.Span;
				var type = SafeMinimalDisplayString (targetType, semanticModel, nodeToCast.SpanStart, Ambience.LabelFormat);
				editor.ReplaceText (span.Start, span.Length, "((" + type + ")" + nodeToCast + ")");
			}
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:11,代码来源:CastCompletionData.cs


示例7: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window)
		{
			// insert add/remove event handler code after +=/-=
			editor.Replace (initialOffset, editor.Caret.Offset - initialOffset, this.DisplayText + ";");
			
			// Search opening bracket of member
			int pos = callingMember != null ? editor.Document.LocationToOffset (callingMember.BodyRegion.Start.Line, callingMember.BodyRegion.Start.Column) : initialOffset;
			while (pos < editor.Document.Length && editor.Document.GetCharAt (pos) != '{') {
				pos++;
			}
			
			// Search closing bracket of member
			pos = editor.Document.GetMatchingBracketOffset (pos) + 1;
			
			pos = Math.Max (0, Math.Min (pos, editor.Document.Length - 1));
			
			// Insert new event handler after closing bracket
			string indent = editor.Document.GetLine (callingMember.Location.Line).GetIndentation (editor.Document);
			
			StringBuilder sb = new StringBuilder ();
			sb.Append (editor.EolMarker);
			sb.Append (editor.EolMarker);
			sb.Append (indent);
			if (callingMember.IsStatic)
				sb.Append ("static ");
			sb.Append ("void ");
			int pos2 = sb.Length;
			sb.Append (this.DisplayText);sb.Append (' ');sb.Append (this.parameterList);sb.Append (editor.EolMarker);
			sb.Append (indent);sb.Append ("{");sb.Append (editor.EolMarker);
			sb.Append (indent);sb.Append (TextEditorProperties.IndentString);
			int cursorPos = pos + sb.Length;
			sb.Append (editor.EolMarker);
			sb.Append (indent);sb.Append ("}");
			editor.Insert (pos, sb.ToString ());
			editor.Caret.Offset = cursorPos;
			
			// start text link mode after insert
			List<TextLink> links = new List<TextLink> ();
			TextLink link = new TextLink ("name");
			
			link.AddLink (new Segment (0, this.DisplayText.Length));
			link.AddLink (new Segment (pos - initialOffset + pos2, this.DisplayText.Length));
			links.Add (link);
			
			CompletionTextLinkMode tle = new CompletionTextLinkMode (editor.Parent, initialOffset, links);
			tle.TriggerCodeCompletion = false;
			tle.SetCaretPosition = true;
			tle.SelectPrimaryLink = true;
			tle.OldMode = editor.CurrentMode;
			tle.StartMode ();
			editor.CurrentMode = tle;
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:52,代码来源:EventCreationCompletionData.cs


示例8: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
		{
			var buf = window.CompletionWidget;
			if (buf != null) {
				//completion context gets nulled from window as soon as we alter the buffer
				var codeCompletionContext = window.CodeCompletionContext;

				buf.Replace (buf.CaretOffset, 0, element);
					
				// Move caret into the middle of the tags
				buf.CaretOffset = codeCompletionContext.TriggerOffset + cursorOffset;
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:13,代码来源:XmlTagCompletionData.cs


示例9: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
		{
			IEditableTextBuffer buf = window.CompletionWidget as IEditableTextBuffer;
			if (buf != null) {
				using (var undo = buf.OpenUndoGroup ()) {
					buf.InsertText (buf.CursorPosition, element);
					
					// Move caret into the middle of the tags
					buf.CursorPosition = window.CodeCompletionContext.TriggerOffset + cursorOffset;
					buf.Select (buf.CursorPosition, buf.CursorPosition);
				}
			}
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:13,代码来源:XmlTagCompletionData.cs


示例10: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window)
		{
			IEditableTextBuffer buf = window.CompletionWidget as IEditableTextBuffer;
			if (buf != null) {
				buf.BeginAtomicUndo ();
				buf.InsertText (buf.CursorPosition, element);
				
				// Move caret into the middle of the tags
				buf.CursorPosition = window.CodeCompletionContext.TriggerOffset + cursorOffset;
				buf.Select (buf.CursorPosition, buf.CursorPosition);
				buf.EndAtomicUndo ();
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:13,代码来源:XmlTagCompletionData.cs


示例11: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
		{
			var editor = ext.TextEditorData;
			var generator = CodeGenerator.CreateGenerator (ext.Document);
			bool isExplicit = false;
			if (member.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
				foreach (var m in type.Members) {
					if (m.Name == member.Name && !m.ReturnType.Equals (member.ReturnType)) {
						isExplicit = true;
						break;
					}
				}
			}
			var resolvedType = type.Resolve (ext.ParsedDocument.GetTypeResolveContext (ext.Compilation, editor.Caret.Location)).GetDefinition ();
			if (ext.Project != null)
				generator.PolicyParent = ext.Project.Policies;
			var result = generator.CreateMemberImplementation (resolvedType, type, member, isExplicit);
			string sb = result.Code.TrimStart ();
			int trimStart = result.Code.Length - sb.Length;
			sb = sb.TrimEnd ();
			
			var lastRegion = result.BodyRegions.LastOrDefault ();
			var region = lastRegion == null? null
				: new CodeGeneratorBodyRegion (lastRegion.StartOffset - trimStart, lastRegion.EndOffset - trimStart);
			
			int targetCaretPosition;
			int selectionEndPosition = -1;
			if (region != null && region.IsValid) {
				targetCaretPosition = declarationBegin + region.StartOffset;
				if (region.Length > 0) {
					if (GenerateBody) {
						selectionEndPosition = declarationBegin + region.EndOffset;
					} else {
						//FIXME: if there are multiple regions, remove all of them
						sb = sb.Substring (0, region.StartOffset) + sb.Substring (region.EndOffset); 
					}
				}
			} else {
				targetCaretPosition = declarationBegin + sb.Length;
			}
			
			editor.Replace (declarationBegin, editor.Caret.Offset - declarationBegin, sb);
			if (selectionEndPosition > 0) {
				editor.Caret.Offset = selectionEndPosition;
				editor.SetSelection (targetCaretPosition, selectionEndPosition);
			} else {
				editor.Caret.Offset = targetCaretPosition;
			}
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:49,代码来源:NewOverrideCompletionData.cs


示例12: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
		{
			//insert the method name
			var buf = window.CompletionWidget;
			if (buf != null) {
				buf.Replace (window.CodeCompletionContext.TriggerOffset, buf.CaretOffset - window.CodeCompletionContext.TriggerOffset, methodInfo.Name);
			}
			
			//generate the codebehind method

			// TODO: Roslyn port.
//			if (codeBehindClassLocation != null && project != null)
//				BindingService.AddMemberToClass (project, codeBehindClass, codeBehindClassLocation, methodInfo, false);
//			else
//				BindingService.AddMemberToClass (project, codeBehindClass, codeBehindClass.Locations.First (), methodInfo, false);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:16,代码来源:SuggestedHandlerCompletionData.cs


示例13: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
		{
			//insert the method name
			MonoDevelop.Ide.Gui.Content.IEditableTextBuffer buf = window.CompletionWidget as MonoDevelop.Ide.Gui.Content.IEditableTextBuffer;
			if (buf != null) {
				using (var undo = buf.OpenUndoGroup ()) {
					buf.DeleteText (window.CodeCompletionContext.TriggerOffset, buf.CursorPosition - window.CodeCompletionContext.TriggerOffset);
					buf.InsertText (buf.CursorPosition, methodInfo.Name);
				}
			}
			
			//generate the codebehind method
			if (codeBehindClassPart != null && project != null)
				BindingService.AddMemberToClass (project, codeBehindClass.GetDefinition (), codeBehindClassPart, methodInfo, false);
			else
				BindingService.AddMemberToClass (project, codeBehindClass.GetDefinition (), codeBehindClass.GetDefinition ().Parts.First (), methodInfo, false);
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:17,代码来源:SuggestedHandlerCompletionData.cs


示例14: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
		{
			var buf = window.CompletionWidget;
			if (buf != null) {
				int deleteStartOffset = window.CodeCompletionContext.TriggerOffset;
				if (text.StartsWith (docTypeStart)) {
					int start = window.CodeCompletionContext.TriggerOffset - docTypeStart.Length;
					if (start >= 0) {
						string readback = buf.GetText (start, window.CodeCompletionContext.TriggerOffset);
						if (string.Compare (readback, docTypeStart, StringComparison.OrdinalIgnoreCase) == 0)
							deleteStartOffset -= docTypeStart.Length;
					}
				}
				
				buf.Replace (deleteStartOffset, buf.CaretOffset - deleteStartOffset, text);
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:17,代码来源:DocTypeCompletionData.cs


示例15: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window)
		{
			//insert the method name
			MonoDevelop.Ide.Gui.Content.IEditableTextBuffer buf = window.CompletionWidget as MonoDevelop.Ide.Gui.Content.IEditableTextBuffer;
			if (buf != null) {
				buf.BeginAtomicUndo ();
				buf.DeleteText (window.CodeCompletionContext.TriggerOffset, buf.CursorPosition - window.CodeCompletionContext.TriggerOffset);
				buf.InsertText (buf.CursorPosition, methodInfo.Name);
				buf.EndAtomicUndo ();
			}
			
			//generate the codebehind method
			if (codeBehindClassPart != null && project != null)
				BindingService.AddMemberToClass (project, codeBehindClass, codeBehindClassPart, methodInfo, false);
			else
				BindingService.AddMemberToClass (project, codeBehindClass, codeBehindClass, methodInfo, false);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:17,代码来源:SuggestedHandlerCompletionData.cs


示例16: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window)
		{
			CodeGenerator generator = CodeGenerator.CreateGenerator (editor.Document.MimeType, editor.Options.TabsToSpaces, editor.Options.TabSize, editor.EolMarker);
			bool isExplicit = false;
			if (member.DeclaringType.ClassType == ClassType.Interface) {
				foreach (var m in type.Members) {
					if (m.Name == member.Name && m.ReturnType.ToInvariantString () != member.ReturnType.ToInvariantString ()) {
						isExplicit = true;
						break;
					}
				}
			}
			var result = generator.CreateMemberImplementation (type, member, isExplicit);
			string sb = result.Code.TrimStart ();
			int trimStart = result.Code.Length - sb.Length;
			sb = sb.TrimEnd ();
			
			var lastRegion = result.BodyRegions.LastOrDefault ();
			var region = lastRegion == null? null
				: new CodeGeneratorBodyRegion (lastRegion.StartOffset - trimStart, lastRegion.EndOffset - trimStart);
			
			int targetCaretPosition;
			int selectionEndPosition = -1;
			if (region != null && region.IsValid) {
				targetCaretPosition = declarationBegin + region.StartOffset;
				if (region.Length > 0) {
					if (GenerateBody) {
						selectionEndPosition = declarationBegin + region.EndOffset;
					} else {
						//FIXME: if there are multiple regions, remove all of them
						sb = sb.Substring (0, region.StartOffset) + sb.Substring (region.EndOffset); 
					}
				}
			} else {
				targetCaretPosition = declarationBegin + sb.Length;
			}
			
			editor.Replace (declarationBegin, editor.Caret.Offset - declarationBegin, sb);
			if (selectionEndPosition > 0) {
				editor.Caret.Offset = selectionEndPosition;
				editor.SetSelection (targetCaretPosition, selectionEndPosition);
			} else {
				editor.Caret.Offset = targetCaretPosition;
			}
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:45,代码来源:NewOverrideCompletionData.cs


示例17: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
		{
			MonoDevelop.Ide.Gui.Content.IEditableTextBuffer buf = window.CompletionWidget as MonoDevelop.Ide.Gui.Content.IEditableTextBuffer;
			if (buf != null) {
				using (var undo = buf.OpenUndoGroup ()) {
					int deleteStartOffset = window.CodeCompletionContext.TriggerOffset;
					if (text.StartsWith (docTypeStart)) {
						int start = window.CodeCompletionContext.TriggerOffset - docTypeStart.Length;
						if (start >= 0) {
							string readback = buf.GetText (start, window.CodeCompletionContext.TriggerOffset);
							if (string.Compare (readback, docTypeStart, StringComparison.OrdinalIgnoreCase) == 0)
								deleteStartOffset -= docTypeStart.Length;
						}
					}
					
					buf.DeleteText (deleteStartOffset, buf.CursorPosition - deleteStartOffset);
					buf.InsertText (buf.CursorPosition, text);
				}
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:20,代码来源:DocTypeCompletionData.cs


示例18: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window)
		{
			MonoDevelop.Ide.Gui.Content.IEditableTextBuffer buf = window.CompletionWidget as MonoDevelop.Ide.Gui.Content.IEditableTextBuffer;
			if (buf != null) {
				buf.BeginAtomicUndo ();
				
				int deleteStartOffset = window.CodeCompletionContext.TriggerOffset;
				if (text.StartsWith (docTypeStart)) {
					int start = window.CodeCompletionContext.TriggerOffset - docTypeStart.Length;
					if (start >= 0) {
						string readback = buf.GetText (start, window.CodeCompletionContext.TriggerOffset);
						if (string.Compare (readback, docTypeStart, StringComparison.OrdinalIgnoreCase) == 0)
							deleteStartOffset -= docTypeStart.Length;
					}
				}
				
				buf.DeleteText (deleteStartOffset, buf.CursorPosition - deleteStartOffset);
				buf.InsertText (buf.CursorPosition, text);
				buf.EndAtomicUndo ();
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:21,代码来源:DocTypeCompletionData.cs


示例19: InsertCompletionText

		public override void InsertCompletionText (CompletionListWindow window)
		{
			var generator = new CSharpCodeGenerator ();
			var result = generator.CreateMemberImplementation (type, member, false);
			string sb = result.Code.TrimStart ();
			int trimStart = result.Code.Length - sb.Length;
			sb = sb.TrimEnd ();
			
			var lastRegion = result.BodyRegions.LastOrDefault ();
			var region = lastRegion == null? null
				: new CodeGeneratorBodyRegion (lastRegion.StartOffset - trimStart, lastRegion.EndOffset - trimStart);
			
			int targetCaretPosition;
			int selectionEndPosition = -1;
			if (region != null && region.IsValid) {
				targetCaretPosition = declarationBegin + region.StartOffset;
				if (region.Length > 0) {
					if (GenerateBody) {
						selectionEndPosition = declarationBegin + region.EndOffset;
					} else {
						//FIXME: if there are multiple regions, remove all of them
						sb = sb.Substring (0, region.StartOffset) + sb.Substring (region.EndOffset); 
					}
				}
			} else {
				targetCaretPosition = declarationBegin + sb.Length;
			}
			
			editor.Replace (declarationBegin, editor.Caret.Offset - declarationBegin, sb);
			if (selectionEndPosition > 0) {
				editor.Caret.Offset = selectionEndPosition;
				editor.SetSelection (targetCaretPosition, selectionEndPosition);
			} else {
				editor.Caret.Offset = targetCaretPosition;
			}
		}
开发者ID:natosha,项目名称:monodevelop,代码行数:36,代码来源:NewOverrideCompletionData.cs


示例20: PrepareShowWindow

		// ext may be null, but then parameter completion don't work
		internal static void PrepareShowWindow (CompletionTextEditorExtension ext, char firstChar, ICompletionWidget completionWidget, CodeCompletionContext completionContext)
		{
			isShowing = true;

			if (wnd == null) {
				wnd = new CompletionListWindow ();
				wnd.WordCompleted += HandleWndWordCompleted;
			}
			if (ext != null) {
				var widget = ext.Editor.GetNativeWidget<Gtk.Widget> ();
				wnd.TransientFor = widget?.Parent?.Toplevel as Gtk.Window;
			} else {
				var widget = completionWidget as Gtk.Widget;
				if (widget != null) {
					var window = widget.Toplevel as Gtk.Window;
					if (window != null)
						wnd.TransientFor = window;
				}
			}
			wnd.Extension = ext;

			wnd.InitializeListWindow (completionWidget, completionContext);
		}
开发者ID:swarkcn,项目名称:monodevelop,代码行数:24,代码来源:CompletionWindowManager.cs



注:本文中的CompletionListWindow类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Complex类代码示例发布时间:2022-05-24
下一篇:
C# CompletionItem类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap