示例#1
0
        private void AddMolkedFile(string path)
        {
            FolderView.Items.Clear();

            TreeViewItem item = new TreeViewItem()
            {
                Header = Helpers.GetFileOrFolderName(path),
                Tag    = path
            };

            item.IsExpanded = true;
            FolderView.Items.Add(item);
            this.Img_Remove.IsEnabled   = true;
            this.btn_UnMolkIt.IsEnabled = true;

            if (Img_Remove.IsEnabled == true)
            {
                Img_Remove.Source = enableRemove;
                Img_Remove.Cursor = Cursors.Hand;
            }

            ProcessLauncher dos = new ProcessLauncher(@"unmolk.exe", (data) => Console.WriteLine(data), (data) =>
            {
                this.Dispatcher.Invoke(() =>
                {
                    if (totalFilesToUnZip == 0)
                    {
                        totalFilesToUnZip++;
                        return;
                    }
                    MatchCollection matches = pathRegex.Matches(data);
                    if (matches.Count > 0)
                    {
                        string filePath = matches[0].Value.Trim();

                        TreeViewItem subItem = new TreeViewItem()
                        {
                            Header = filePath,
                            Tag    = filePath
                        };

                        item.Items.Add(subItem);
                        totalFilesToUnZip++;
                    }
                });
            });

            dos.Start($@"-l ""{path}""");
        }
示例#2
0
        public UnMolking(Grid grid_UnMolkerPage, string saveToPath, int totalFilesToUnZip, string filePath, params string[] excludeFiles)
        {
            this.saveToPath        = saveToPath;
            this.filePath          = filePath;
            this.grid_UnMolkerPage = grid_UnMolkerPage;
            this.totalFilesToUnZip = totalFilesToUnZip;
            InitializeComponent();

            string          exFileString = "\"" + string.Join("\" \"", excludeFiles) + "\"";
            ProcessLauncher dos          = new ProcessLauncher(@"unmolk.exe", ErrorDataReceived, OutputDataReceived);

            dos.Start($@"""{filePath}"" -d ""{saveToPath}""");

            txtBlock_Completed.Text = $"0/{totalFilesToUnZip}";
        }
示例#3
0
        public Molking(Grid grid_MolkerPage, string saveToPath, string[] filePaths, params string[] excludeFiles)
        {
            this.saveToPath      = saveToPath;
            this.filePaths       = filePaths;
            this.grid_MolkerPage = grid_MolkerPage;
            InitializeComponent();

            foreach (string path in filePaths)
            {
                totalFilesToZip += Helpers.GetAmountOfFiles(path);
            }

            string          exFileString = "\"" + string.Join("\" \"", excludeFiles) + "\"";
            string          filePath     = "\"" + string.Join("\" \"", filePaths) + "\"";
            ProcessLauncher dos          = new ProcessLauncher(@"molk.exe", ErrorDataReceived, OutputDataReceived);

            dos.Start($@"-r -S ""{saveToPath}"" {filePath} -x {exFileString}");

            txtBlock_Completed.Text = $"0/{totalFilesToZip}";
        }