当前位置: 首页>>代码示例>>C#>>正文


C# ICompletionData类代码示例

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


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

示例1: InsertAction

 /// <summary>
 /// Called when entry should be inserted. Forward to the insertion action of the completion data.
 /// </summary>
 public bool InsertAction(ICompletionData data, TextArea textArea, int insertionOffset, char key)
 {
     textArea.SelectionManager.SetSelection(textArea.Document.OffsetToPosition(
         Math.Min(insertionOffset - ((AEGISCompletionData)data).Expression.Length, textArea.Document.TextLength)
         ), textArea.Caret.Position);
     return data.InsertAction(textArea, key);
 }
开发者ID:scriptord3,项目名称:RagnarokNPCEditor,代码行数:10,代码来源:CodeCompletionProvider.cs

示例2: Compare

		public static int Compare(ICompletionData a, ICompletionData b) {
			if (a == null)
				throw new ArgumentNullException("a");
			if (b == null)
				throw new ArgumentNullException("b");
			return string.Compare(a.Text, b.Text, StringComparison.InvariantCultureIgnoreCase);
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:7,代码来源:ICompletionData.cs

示例3: AutoCompleteResponse

 public AutoCompleteResponse(ICompletionData d)
 {
     DisplayText = d.DisplayText;
     CompletionText = d.CompletionText;
     Description = d.Description;
     RequiredNamespaceImport = d is CompletionData ? ((CompletionData)d).RequiredNamespaceImport : (string)null;
 }
开发者ID:jchannon,项目名称:OmniSharpServer,代码行数:7,代码来源:AutoCompleteResponse.cs

示例4: GenerateCompletionData

 /// <summary>
 /// Generates the completion data. This method is called by the text editor control.
 /// </summary>
 /// <param name="fileName">the name of the file.</param>
 /// <param name="textArea">The text area.</param>
 /// <param name="charTyped">The character typed.</param>
 /// <returns>The completion data.</returns>
 public override ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped)
 {
   ICompletionData[] completionData = new ICompletionData[_texts.Length];
   for (int i = 0; i < completionData.Length; i++)
     completionData[i] = new DefaultCompletionData(_texts[i], null, _imageIndex);
   return completionData;
 }
开发者ID:sanyaade-fintechnology,项目名称:SquareOne,代码行数:14,代码来源:TextCompletionDataProvider.cs

示例5: InsertAction

        public bool InsertAction(ICompletionData data, TextArea textArea, int insertionOffset, char key)
        {
            textArea.Caret.Position = textArea.Document.OffsetToPosition(
                Math.Min(insertionOffset, textArea.Document.TextLength));

            return data.InsertAction(textArea, key);
        }
开发者ID:tormaroe,项目名称:Ping-Ring,代码行数:7,代码来源:CodeCompletionProvider.cs

示例6: AddCompletionData

 protected void AddCompletionData(ICompletionData data)
 {
     if (this._c != null)
     {
         this._c.CompletionList.CompletionData.Add(data);
     }
 }
开发者ID:almostEric,项目名称:DotNetRDF-4.0,代码行数:7,代码来源:BaseAutoCompleter.cs

示例7: CodeCompletionWindow

        CodeCompletionWindow(ICompletionDataProvider completionDataProvider, ICompletionData[] completionData, Form parentForm, TextEditorControl control, bool showDeclarationWindow, bool fixedListViewWidth)
            : base(parentForm, control)
        {
            this.dataProvider = completionDataProvider;
            this.completionData = completionData;
            this.document = control.Document;
            this.showDeclarationWindow = showDeclarationWindow;
            this.fixedListViewWidth = fixedListViewWidth;

            workingScreen = Screen.GetWorkingArea(Location);
            startOffset = control.ActiveTextAreaControl.Caret.Offset + 1;
            endOffset   = startOffset;
            if (completionDataProvider.PreSelection != null) {
                startOffset -= completionDataProvider.PreSelection.Length + 1;
                endOffset--;
            }

            codeCompletionListView = new CodeCompletionListView(completionData);
            codeCompletionListView.Font = new System.Drawing.Font(FontFamily.GenericMonospace, codeCompletionListView.Font.Size);
            codeCompletionListView.ImageList = completionDataProvider.ImageList;
            codeCompletionListView.Dock = DockStyle.Fill;
            codeCompletionListView.SelectedItemChanged += new EventHandler(CodeCompletionListViewSelectedItemChanged);
            codeCompletionListView.DoubleClick += new EventHandler(CodeCompletionListViewDoubleClick);
            codeCompletionListView.Click  += new EventHandler(CodeCompletionListViewClick);
            Controls.Add(codeCompletionListView);

            if (completionData.Length > MaxListLength) {
                vScrollBar.Dock = DockStyle.Right;
                vScrollBar.Minimum = 0;
                vScrollBar.Maximum = completionData.Length - 1;
                vScrollBar.SmallChange = 1;
                vScrollBar.LargeChange = MaxListLength;
                codeCompletionListView.FirstItemChanged += new EventHandler(CodeCompletionListViewFirstItemChanged);
                Controls.Add(vScrollBar);
            }

            this.drawingSize = GetListViewSize();
            SetLocation();

            if (declarationViewWindow == null) {
                declarationViewWindow = new DeclarationViewWindow(parentForm);
            }
            SetDeclarationViewLocation();
            declarationViewWindow.ShowDeclarationViewWindow();
            declarationViewWindow.MouseMove += ControlMouseMove;
            control.Focus();
            CodeCompletionListViewSelectedItemChanged(this, EventArgs.Empty);

            if (completionDataProvider.DefaultIndex >= 0) {
                codeCompletionListView.SelectIndex(completionDataProvider.DefaultIndex);
            }

            if (completionDataProvider.PreSelection != null) {
                CaretOffsetChanged(this, EventArgs.Empty);
            }

            vScrollBar.ValueChanged += VScrollBarValueChanged;
            document.DocumentAboutToBeChanged += DocumentAboutToBeChanged;
        }
开发者ID:kanbang,项目名称:Colt,代码行数:59,代码来源:CodeCompletionWindow.cs

示例8: GenerateCompletionData

		public override ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped)
		{
			ICompletionData[] data = new ICompletionData[texts.Length];
			for (int i = 0; i < data.Length; i++) {
				data[i] = new DefaultCompletionData(texts[i], null, ClassBrowserIconService.GotoArrowIndex);
			}
			return data;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:8,代码来源:TextCompletionDataProvider.cs

示例9: CompletionListView

        /// <summary>
        /// Initializes a new instance of the <see cref="CompletionListView"/> class.
        /// </summary>
        /// <param name="completionData">The completion data.</param>
        public CompletionListView(ICompletionData[] completionData)
        {
            if (completionData == null)
            throw new ArgumentNullException("completionData");

              _fullCompletionData = completionData;
              Array.Sort(_fullCompletionData, DefaultCompletionData.Compare);
              _filteredCompletionData = new List<ICompletionData>(_fullCompletionData);
        }
开发者ID:cavaliercoder,项目名称:expression-lab,代码行数:13,代码来源:CompletionListView.cs

示例10: IdeBridgeCodeCompletionWindow

 protected IdeBridgeCodeCompletionWindow(ICompletionDataProvider completionDataProvider, ICompletionData[] completionData, Form parentForm, TextEditorControl control, bool showDeclarationWindow, bool fixedListViewWidth)
     : base(completionDataProvider, completionData, parentForm, control, showDeclarationWindow, fixedListViewWidth)
 {
     TopMost = true;
     declarationViewWindow.Dispose();
     declarationViewWindow = new DeclarationViewWindow(null);
     declarationViewWindow.TopMost = true;
     SetDeclarationViewLocation();
 }
开发者ID:emacsattic,项目名称:idebridge,代码行数:9,代码来源:IdeBridgeCodeCompletionWindow.cs

示例11: InsertAction

		public virtual bool InsertAction(ICompletionData data, TextArea textArea, int insertionOffset, char key)
		{
			if (InsertSpace) {
				textArea.Document.Insert(insertionOffset++, " ");
			}
			textArea.Caret.Position = textArea.Document.OffsetToPosition(insertionOffset);
			
			return data.InsertAction(textArea, key);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:9,代码来源:AbstractCompletionDataProvider.cs

示例12: CompareTo

 private static int CompareTo(ICompletionData a, ICompletionData b)
 {
     if (a.CompletionCategory == null && b.CompletionCategory == null)
         return 0;
     if (a.CompletionCategory == null)
         return -1;
     if (b.CompletionCategory == null)
         return 1;
     return a.CompletionCategory.CompareTo(b.CompletionCategory);
 }
开发者ID:dyxu,项目名称:vimrc,代码行数:10,代码来源:CompletionDataExtensions.cs

示例13: CodeCompletionListView

		public CodeCompletionListView(ICompletionData[] completionData)
		{
			Array.Sort(completionData, DefaultCompletionData.Compare);
			this.completionData = completionData;
			
//			this.KeyDown += new System.Windows.Forms.KeyEventHandler(OnKey);
//			SetStyle(ControlStyles.Selectable, false);
//			SetStyle(ControlStyles.UserPaint, true);
//			SetStyle(ControlStyles.DoubleBuffer, false);
		}
开发者ID:Clancey,项目名称:MonoMac.Windows.Form,代码行数:10,代码来源:CodeCompletionListView.cs

示例14: CompareTo

 public int CompareTo(ICompletionData other)
 {
     int c = this.Priority.CompareTo(other.Priority);
     if (c == 0)
     {
         return this.InsertionText.CompareTo(other.InsertionText);
     }
     else
     {
         return c;
     }
 }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:12,代码来源:BaseCompletionData.cs

示例15: CodeCompletionWindow

		CodeCompletionWindow(ICompletionDataProvider completionDataProvider, ICompletionData[] completionData, Form parentForm, TextEditorControl control, string fileName) : base(parentForm, control, fileName)
		{
			this.dataProvider = completionDataProvider;
			this.completionData = completionData;
			
			workingScreen = Screen.GetWorkingArea(Location);
			startOffset = control.ActiveTextAreaControl.Caret.Offset + 1;
			endOffset   = startOffset;
			if (completionDataProvider.PreSelection != null) {
				startOffset -= completionDataProvider.PreSelection.Length + 1;
				endOffset--;
			}
			
			codeCompletionListView = new CodeCompletionListView(completionData);
			codeCompletionListView.ImageList = completionDataProvider.ImageList;
			codeCompletionListView.Dock = DockStyle.Fill;
			codeCompletionListView.SelectedItemChanged += new EventHandler(CodeCompletionListViewSelectedItemChanged);
			codeCompletionListView.DoubleClick += new EventHandler(CodeCompletionListViewDoubleClick);
			codeCompletionListView.Click  += new EventHandler(CodeCompletionListViewClick);
			Controls.Add(codeCompletionListView);
			
			if (completionData.Length > 10) {
				vScrollBar.Dock = DockStyle.Right;
				vScrollBar.Minimum = 0;
				vScrollBar.Maximum = completionData.Length - 8;
				vScrollBar.SmallChange = 1;
				vScrollBar.LargeChange = 3;
				codeCompletionListView.FirstItemChanged += new EventHandler(CodeCompletionListViewFirstItemChanged);
				Controls.Add(vScrollBar);
			}
			
			this.drawingSize = new Size(codeCompletionListView.ItemHeight * 10, codeCompletionListView.ItemHeight * Math.Min(10, completionData.Length));
			SetLocation();
			
			if (declarationViewWindow == null) {
				declarationViewWindow = new DeclarationViewWindow(parentForm);
			}
			SetDeclarationViewLocation();
			declarationViewWindow.ShowDeclarationViewWindow();
			control.Focus();
			CodeCompletionListViewSelectedItemChanged(this, EventArgs.Empty);
			
			if (completionDataProvider.DefaultIndex >= 0) {
				codeCompletionListView.SelectIndex(completionDataProvider.DefaultIndex);
			}
			
			if (completionDataProvider.PreSelection != null) {
				CaretOffsetChanged(this, EventArgs.Empty);
			}
			
			vScrollBar.Scroll += new ScrollEventHandler(DoScroll);
		}
开发者ID:viticm,项目名称:pap2,代码行数:52,代码来源:CodeCompletionWindow.cs


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