示例#1
0
        public List <string> ListFiles()
        {
            List <string> result = new List <string>();

            foreach (string searchPath in SearchPaths.Split(';'))
            {
                string       directory;
                SearchOption option;
                if (Path.GetFileName(searchPath) == "**")
                {
                    directory = Path.GetDirectoryName(searchPath);
                    option    = SearchOption.AllDirectories;
                }
                else
                {
                    directory = searchPath;
                    option    = SearchOption.TopDirectoryOnly;
                }
                foreach (string fileMask in FileMasks.Split(';'))
                {
                    foreach (string fileName in Directory.GetFiles(directory, fileMask, option))
                    {
                        string extension = Path.GetExtension(fileName);
                        if (!String.Equals(extension, ".dproj", StringComparison.InvariantCultureIgnoreCase))
                        {
                            result.Add(fileName);
                        }
                    }
                }
            }
            return(result);
        }
示例#2
0
        private void InitSearchPaths()
        {
            var paths = SearchPaths
                        .Split(';')
                        .Select(p => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, p))
                        .ToList();

            IronRubyEngine.Engine.SetSearchPaths(paths);
        }
示例#3
0
 /// <summary>
 /// Creates custom controls using the given content view.
 /// </summary>
 private void CreateControls()
 {
     try
     {
         var viewControl = Page.LoadControl(ContentViewPath) as Controls.TagAdminControl;
         if (viewControl != null)
         {
             viewControl.TagPath     = Tags;
             viewControl.SearchPaths = SearchPaths.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
             Controls.Add(viewControl);
         }
     }
     catch (Exception ex)
     {
         Logger.WriteException(ex);
         Controls.Clear();
         Controls.Add(new LiteralControl("ContentView error: " + ex.Message));
     }
 }