コード例 #1
0
ファイル: CodeSnippet.cs プロジェクト: peterschen/SMAStudio
 public CodeSnippet(CodeSnippet copy)
 {
     this.name = copy.name;
     this.description = copy.description;
     this.text = copy.text;
     this.keyword = copy.keyword;
 }
コード例 #2
0
 public CodeSnippet(CodeSnippet copy)
 {
     this.name        = copy.name;
     this.description = copy.description;
     this.text        = copy.text;
     this.keyword     = copy.keyword;
 }
コード例 #3
0
ファイル: SnippetsAgent.cs プロジェクト: peterschen/SMAStudio
        public void Start()
        {
            if (!Directory.Exists(Path.Combine(AppHelper.CachePath, "Snippets")))
            {
                Directory.CreateDirectory(Path.Combine(AppHelper.CachePath, "Snippets"));
                CreateSampleSnippets();
            }

            var files = Directory.GetFiles(Path.Combine(AppHelper.CachePath, "Snippets"), "*.snippet");

            foreach (var file in files)
            {
                var reader = new StreamReader(file);
                string snippetContent = reader.ReadToEnd();
                reader.Close();

                var snippet = new CodeSnippet();
                snippet.Name = new FileInfo(file).Name.Replace(".snippet", "");
                snippet.Text = snippetContent;
                
                _snippetsCollection.Snippets.Add(snippet);
            }
        }
コード例 #4
0
 public SnippetCompletionData(CodeSnippet snippet)
     : this()
 {
     _snippet = snippet;
     Name = _snippet.Name;
     DisplayText = Name;
 }