public CodeSnippet(CodeSnippet copy) { this.name = copy.name; this.description = copy.description; this.text = copy.text; this.keyword = copy.keyword; }
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); } }
public SnippetCompletionData(CodeSnippet snippet) : this() { _snippet = snippet; Name = _snippet.Name; DisplayText = Name; }