private void SelectLocationToExportGCode(object state)
        {
            SelectFolderDialogParams selectParams = new SelectFolderDialogParams("Select Location To Save Files");

            selectParams.ActionButtonLabel = LocalizedString.Get("Export");
            selectParams.Title             = "MatterControl: Select A Folder";

            string path = FileDialog.SelectFolderDialog(ref selectParams);

            if (path != null && path != "")
            {
                List <PrintItem> parts = QueueData.Instance.CreateReadOnlyPartList();
                if (parts.Count > 0)
                {
                    if (exportingWindow == null)
                    {
                        exportingWindow         = new ExportToFolderFeedbackWindow(parts.Count, parts[0].Name, ActiveTheme.Instance.PrimaryBackgroundColor);
                        exportingWindow.Closed += new EventHandler(ExportToFolderFeedbackWindow_Closed);
                        exportingWindow.ShowAsSystemWindow();
                    }
                    else
                    {
                        exportingWindow.BringToFront();
                    }

                    ExportToFolderProcess exportToFolderProcess = new ExportToFolderProcess(parts, path);
                    exportToFolderProcess.StartingNextPart += exportingWindow.StartingNextPart;
                    exportToFolderProcess.UpdatePartStatus += exportingWindow.UpdatePartStatus;
                    exportToFolderProcess.DoneSaving       += exportingWindow.DoneSaving;
                    exportToFolderProcess.Start();
                }
            }
        }
Exemple #2
0
        private void onSelectFolderDialog(SelectFolderDialogParams openParams)
        {
            string path = openParams.FolderPath;

            if (path != null && path != "")
            {
                List <PrintItem> parts = QueueData.Instance.CreateReadOnlyPartList(true);
                if (parts.Count > 0)
                {
                    if (exportingWindow == null)
                    {
                        exportingWindow         = new ExportToFolderFeedbackWindow(parts.Count, parts[0].Name, ActiveTheme.Instance.PrimaryBackgroundColor);
                        exportingWindow.Closed += ExportToFolderFeedbackWindow_Closed;
                        exportingWindow.ShowAsSystemWindow();
                    }
                    else
                    {
                        exportingWindow.BringToFront();
                    }

                    ExportToFolderProcess exportToFolderProcess = new ExportToFolderProcess(parts, path);
                    exportToFolderProcess.StartingNextPart += exportingWindow.StartingNextPart;
                    exportToFolderProcess.UpdatePartStatus += exportingWindow.UpdatePartStatus;
                    exportToFolderProcess.DoneSaving       += exportingWindow.DoneSaving;
                    exportToFolderProcess.Start();
                }
            }
        }