コード例 #1
0
        public void RegisterCodeCompletionBinding(string extension, ICodeCompletionBinding binding)
        {
            if (!Bindings.ContainsKey(extension))
            {
                Bindings.Add(extension, new List <ICodeCompletionBinding>());
            }

            Bindings[extension].Add(binding);
        }
コード例 #2
0
		public bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch)
		{
			string ext = Path.GetExtension(editor.FileName);
			foreach (string extension in extensions) {
				if (ext.Equals(extension, StringComparison.OrdinalIgnoreCase)) {
					if (binding == null) {
						binding = (ICodeCompletionBinding)codon.AddIn.CreateObject(codon.Properties["class"]);
					}
					return binding.HandleKeyPress(editor, ch);
				}
			}
			return false;
		}
コード例 #3
0
 private ICodeCompletionBinding[] GetCompletionBinding()
 {
     ICodeCompletionBinding[] bindings = null;
     if (_scriptLanguage == ScriptLanguage.CSharp)
     {
         bindings = new ICodeCompletionBinding[] { new CSharpCompletionBinding() }
     }
     ;
     else
     {
         bindings = new ICodeCompletionBinding[] { new VBNetCompletionBinding() }
     };
     return(bindings);
 }
コード例 #4
0
        public bool CtrlSpace(SharpDevelopTextAreaControl editor)
        {
            string ext = Path.GetExtension(editor.FileName);

            foreach (string extension in extensions)
            {
                if (ext.Equals(extension, StringComparison.OrdinalIgnoreCase))
                {
                    if (binding == null)
                    {
                        binding = (ICodeCompletionBinding)codon.AddIn.CreateObject(codon.Properties["class"]);
                    }
                    return(binding.CtrlSpace(editor));
                }
            }
            return(false);
        }
コード例 #5
0
        public bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch)
        {
            string ext = Path.GetExtension(editor.FileName);

            foreach (string extension in extensions)
            {
                if (ext.Equals(extension, StringComparison.InvariantCultureIgnoreCase))
                {
                    if (binding == null)
                    {
                        binding = (ICodeCompletionBinding)codon.AddIn.CreateObject(codon.Properties["class"]);
                    }
                    return(binding.HandleKeyPress(editor, ch));
                }
            }
            return(false);
        }
コード例 #6
0
ファイル: CodeCompletionBinding.cs プロジェクト: minskowl/MY
        public CodeCompletionKeyPressResult HandleKeyPress(ITextEditor editor, char ch)
        {
            string ext = Path.GetExtension(editor.FileName);

            foreach (string extension in extensions)
            {
                if (ext.Equals(extension, StringComparison.OrdinalIgnoreCase))
                {
                    if (binding == null)
                    {
                        binding = (ICodeCompletionBinding)codon.AddIn.CreateObject(codon.Properties["class"]);
                        if (binding == null)
                        {
                            break;
                        }
                    }
                    return(binding.HandleKeyPress(editor, ch));
                }
            }
            return(CodeCompletionKeyPressResult.None);
        }
コード例 #7
0
        bool MatchesExtension(ITextEditor editor)
        {
            string ext = Path.GetExtension(editor.FileName);

            foreach (string extension in extensions)
            {
                if (ext.Equals(extension, StringComparison.OrdinalIgnoreCase))
                {
                    if (binding == null)
                    {
                        binding = (ICodeCompletionBinding)codon.AddIn.CreateObject(codon.Properties["class"]);
                        if (binding == null)
                        {
                            return(false);
                        }
                    }
                    return(true);
                }
            }
            return(false);
        }
コード例 #8
0
 bool MatchesExtension(ITextEditor editor)
 {
     string ext = Path.GetExtension(editor.FileName);
     foreach (string extension in extensions) {
         if (ext.Equals(extension, StringComparison.OrdinalIgnoreCase)) {
             if (binding == null) {
                 binding = (ICodeCompletionBinding)codon.AddIn.CreateObject(codon.Properties["class"]);
                 if (binding == null)
                     return false;
             }
             return true;
         }
     }
     return false;
 }
コード例 #9
0
		public CodeCompletionKeyPressResult HandleKeyPress(ITextEditor editor, char ch)
		{
			string ext = Path.GetExtension(editor.FileName);
			foreach (string extension in extensions) {
				if (ext.Equals(extension, StringComparison.OrdinalIgnoreCase)) {
					if (binding == null) {
						binding = (ICodeCompletionBinding)codon.AddIn.CreateObject(codon.Properties["class"]);
						if (binding == null)
							break;
					}
					return binding.HandleKeyPress(editor, ch);
				}
			}
			return CodeCompletionKeyPressResult.None;
		}