public IEnumerable <string> GetScriptSnippetFilenames(ScriptSnippetType snippetType) { var client = new RestClient(ServiceUrl); IRestRequest request = _restSharpHelper.CreateRequest("scriptsnippetfilenames"); request.AddQueryParameter("snippetType", snippetType.ToString()); IRestResponse response = client.Execute(request); return(_restSharpHelper.DeserializeOrThrow <List <string> >(response)); }
/// <summary> /// Filters the list box contents based on the script type and a possible search string. /// </summary> /// <param name="type">The type of the script.</param> /// <param name="filterText">The text for filtering the snippets by their names.</param> private void FilterSnippets(ScriptSnippetType type, string filterText) { // select the snipped based on the given parameter values.. IEnumerable <CodeSnippet> selectedSnippets = codeSnippets.Where( f => f.ScriptTextManipulationType == type && (filterText.Trim() == string.Empty || f.ScriptName.ToLowerInvariant().Contains(filterText.ToLowerInvariant()))); // list the script snippets to the list box.. ListScriptSnippets(selectedSnippets); }
public IEnumerable <string> GetSnippetFilenames(ScriptSnippetType snippetType) { string fullPath = Path.Combine(_configuration.ScriptSnippetDirectory, snippetType.ToString().ToLower()); IEnumerable <string> fileNames = new string[0]; if (Directory.Exists(fullPath)) { fileNames = Directory .EnumerateFiles(fullPath, "*.snippet") .Select(x => new FileInfo(x).Name); } return(fileNames); }
public IEnumerable <string> GetScriptSnippetFilenames(ScriptSnippetType snippetType) { return(SnippetFilenames); }
public IEnumerable <string> GetScriptSnippetFilenames(ScriptSnippetType snippetType) { return(_snippetFileReader.GetSnippetFilenames(snippetType)); }
public IEnumerable <string> GetSnippetFilenames(ScriptSnippetType snippetType) { return(new string[] { "file1", "file2" }); }