Ejemplo 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));
        }
Ejemplo n.º 2
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);
        }