예제 #1
0
        private void BuildOrderInformationForDirectory(string path, OrderInformation orderInfo)
        {
            var subDirectorys = Directory.EnumerateDirectories(path);
            var filePaths     = Directory.EnumerateFiles(path);
            var contents      = new List <OrderItem>();

            foreach (var directory in subDirectorys)
            {
                BuildOrderInformationForDirectory(directory, orderInfo);
                contents.Add(new OrderItem(directory, OrderItemType.Directory));
            }
            foreach (var filePath in filePaths)
            {
                if (Path.GetExtension(filePath) == ".js")
                {
                    contents.Add(new OrderItem(filePath, OrderItemType.File));
                }
            }
            orderInfo.Add(path, contents);
        }
예제 #2
0
        public AppOrdering(JavaScriptApp app, JavaScriptAppBuilderManager manager)
        {
            if (app == null)
            {
                throw new ArgumentNullException("app");
            }
            if (manager == null)
            {
                throw new ArgumentNullException("manager");
            }
            this._app              = app;
            this._manager          = manager;
            this._originalOrdering = app.OrderInformation;

            InitializeComponent();

            foreach (var directory in app.OrderInformation.Keys)
            {
                var description = directory.Replace(app.RootDirectory, app.Name);
                _fullPathDictionary.Add(description, directory);
                this.directoryList.Items.Add(description);
            }
        }