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

C# ICompletionData类代码示例

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

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



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


示例16: 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.Caret.Position = textArea.Document.OffsetToPosition(insertionOffset);
            if (!(data as UserDefaultCompletionData).IsOnOverrideWindow)
            {
                int ind = data.Text.IndexOf('<');
                if (ind != -1 && data.Text.Length > ind + 1 && data.Text[ind + 1] == '>') data.Text = data.Text.Substring(0, ind);
            }
            else
                data.Text = data.Description;

            return data.InsertAction(textArea, key);
        }
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:16,代码来源:CodeCompletionProvider.cs


示例17: Contains

		/// <summary>
		/// Checks whether the specified name exists in the completion data.
		/// </summary>
		public static bool Contains(ICompletionData[] items, string name)
		{
			bool Contains = false;
			
			foreach (ICompletionData data in items) {
				if (data.Text == name) {
					Contains = true;
					break;
				}
			}
				
			return Contains;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:16,代码来源:SchemaTestFixtureBase.cs


示例18: CodeCompletionListView

		public CodeCompletionListView(ICompletionData[] completionData)
		{
			if (this.completionData != null) {
				Array.Clear(this.completionData, 0, completionData.Length);
			}
			
			Array.Sort(completionData);
			this.completionData = completionData;
			
//			this.KeyDown += new System.Windows.Forms.KeyEventHandler(OnKey);
//			SetStyle(ControlStyles.Selectable, false);
//			SetStyle(ControlStyles.UserPaint, true);
//			SetStyle(ControlStyles.DoubleBuffer, false);
		}
开发者ID:BackupTheBerlios,项目名称:ch3etah-svn,代码行数:14,代码来源:CodeCompletionListView.cs


示例19: ShowCompletionWindow

		public static CodeCompletionWindow ShowCompletionWindow(Form parent, TextEditorControl control, string fileName, ICompletionDataProvider completionDataProvider, char firstChar, bool showDeclarationWindow, bool fixedListViewWidth)
		{
            if (busy)  // DC to prevent multiple calls
            {
                "CodeCompletionWindow.ShowCompletionWindow was busy, skipping ShowCompletionWindow calculation".info();
                return null;
            }

                busy = true;
                return (CodeCompletionWindow)parent.invokeOnThread(
                    () =>
                    {
                        try
                        {

                            var tempCompletionData = new ICompletionData[] { };
                            CodeCompletionWindow codeCompletionWindow = new CodeCompletionWindow(completionDataProvider, tempCompletionData, parent, control, showDeclarationWindow, fixedListViewWidth);
                            codeCompletionWindow.CloseWhenCaretAtBeginning = firstChar == '\0';
                            codeCompletionWindow.ShowCompletionWindow();

                            O2Thread.mtaThread(         // run in on a separate thread for performance reasons
                                () =>
                                {
                                    try
                                    {
                                        ICompletionData[] completionData = completionDataProvider.GenerateCompletionData(fileName, control.ActiveTextAreaControl.TextArea, firstChar);
                                        if (completionData == null || completionData.Length == 0)
                                        {
                                            //return null;
                                        }
                                        else
                                            codeCompletionWindow.setCodeCompletionData(completionData);
                                        busy = false;
                                    }
                                    catch (Exception ex)
                                    {
                                        ex.log("in CodeCompletionWindow.ShowCompletionWindow ");
                                    }
                                });

                            return codeCompletionWindow;
                        }
                        catch (Exception ex)
                        {
                            busy = false;
                            return null;
                        }
                    });
            
		}     
开发者ID:SiGhTfOrbACQ,项目名称:O2.Platform.Projects,代码行数:50,代码来源:CodeCompletionWindow.cs


示例20: 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;
     this.guiLoaded = false;
     startOffset = control.ActiveTextAreaControl.Caret.Offset +1;
     endOffset = startOffset;
     //startOffset = -1;
     //endOffset = -1;
 }
开发者ID:pusp,项目名称:o2platform,代码行数:14,代码来源:CodeCompletionWindow.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ICompletionSession类代码示例发布时间:2022-05-24
下一篇:
C# ICompletionBroker类代码示例发布时间: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