Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        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);
 }
Esempio n. 5
0
 public IEnumerable <string> GetScriptSnippetFilenames(ScriptSnippetType snippetType)
 {
     return(_snippetFileReader.GetSnippetFilenames(snippetType));
 }
Esempio n. 6
0
 public IEnumerable <string> GetSnippetFilenames(ScriptSnippetType snippetType)
 {
     return(new string[] { "file1", "file2" });
 }