Exemplo n.º 1
0
        void PartSheetClickOnIdle(object state)
        {
            List <PrintItem> parts = QueueData.Instance.CreateReadOnlyPartList();

            if (parts.Count > 0)
            {
                SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Parts Sheet|*.pdf");

                saveParams.ActionButtonLabel = LocalizedString.Get("Save Parts Sheet");
                string saveParamsTitleLabel     = "MatterControl".Localize();
                string saveParamsTitleLabelFull = LocalizedString.Get("Save");
                saveParams.Title = string.Format("{0}: {1}", saveParamsTitleLabel, saveParamsTitleLabelFull);

                System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams);
                if (streamToSaveTo != null)
                {
                    streamToSaveTo.Close();
                }

                if (saveParams.FileName != null)
                {
                    PartsSheet currentPartsInQueue = new PartsSheet(parts, saveParams.FileName);

                    currentPartsInQueue.SaveSheets();

                    SavePartsSheetFeedbackWindow feedbackWindow = new SavePartsSheetFeedbackWindow(parts.Count, parts[0].Name, ActiveTheme.Instance.PrimaryBackgroundColor);
                    currentPartsInQueue.UpdateRemainingItems += feedbackWindow.StartingNextPart;
                    currentPartsInQueue.DoneSaving           += feedbackWindow.DoneSaving;

                    feedbackWindow.ShowAsSystemWindow();
                }
            }
        }
Exemplo n.º 2
0
        private void PartSheetClickOnIdle()
        {
#if !__ANDROID__
            List <PrintItem> parts = QueueData.Instance.CreateReadOnlyPartList(true);
            if (parts.Count > 0)
            {
                FileDialog.SaveFileDialog(
                    new SaveFileDialogParams("Save Parts Sheet|*.pdf")
                {
                    ActionButtonLabel = "Save Parts Sheet".Localize(),
                    Title             = string.Format("{0}: {1}", "MatterControl".Localize(), "Save".Localize())
                },
                    (saveParams) =>
                {
                    if (!string.IsNullOrEmpty(saveParams.FileName))
                    {
                        PartsSheet currentPartsInQueue = new PartsSheet(parts, saveParams.FileName);

                        currentPartsInQueue.SaveSheets();

                        SavePartsSheetFeedbackWindow feedbackWindow = new SavePartsSheetFeedbackWindow(parts.Count, parts[0].Name, ActiveTheme.Instance.PrimaryBackgroundColor);
                        currentPartsInQueue.UpdateRemainingItems   += feedbackWindow.StartingNextPart;
                        currentPartsInQueue.DoneSaving += feedbackWindow.DoneSaving;

                        feedbackWindow.ShowAsSystemWindow();
                    }
                });
            }
#endif
        }
Exemplo n.º 3
0
        void PartSheetClickOnIdle(object state)
        {
                        #if !__ANDROID__
            List <PrintItem> parts = QueueData.Instance.CreateReadOnlyPartList();
            if (parts.Count > 0)
            {
                string documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);

                FileDialog.SaveFileDialog(
                    new SaveFileDialogParams("Save Parts Sheet|*.pdf")
                {
                    InitialDirectory  = documentsPath,
                    ActionButtonLabel = "Save Parts Sheet".Localize(),
                    Title             = string.Format("{0}: {1}", "MatterControl".Localize(), "Save".Localize())
                },
                    (saveParams) =>
                {
                    if (saveParams.FileName != null)
                    {
                        PartsSheet currentPartsInQueue = new PartsSheet(parts, saveParams.FileName);

                        currentPartsInQueue.SaveSheets();

                        SavePartsSheetFeedbackWindow feedbackWindow = new SavePartsSheetFeedbackWindow(parts.Count, parts[0].Name, ActiveTheme.Instance.PrimaryBackgroundColor);
                        currentPartsInQueue.UpdateRemainingItems   += feedbackWindow.StartingNextPart;
                        currentPartsInQueue.DoneSaving += feedbackWindow.DoneSaving;

                        feedbackWindow.ShowAsSystemWindow();
                    }
                });
            }
                        #endif
        }
Exemplo n.º 4
0
		private void PartSheetClickOnIdle(object state)
		{
#if !__ANDROID__
			List<PrintItem> parts = QueueData.Instance.CreateReadOnlyPartList();
			if (parts.Count > 0)
			{
				FileDialog.SaveFileDialog(
					new SaveFileDialogParams("Save Parts Sheet|*.pdf")
					{
						ActionButtonLabel = "Save Parts Sheet".Localize(),
						Title = string.Format("{0}: {1}", "MatterControl".Localize(), "Save".Localize())
					},
					(saveParams) =>
					{
						if (saveParams.FileName != null)
						{
							PartsSheet currentPartsInQueue = new PartsSheet(parts, saveParams.FileName);

							currentPartsInQueue.SaveSheets();

							SavePartsSheetFeedbackWindow feedbackWindow = new SavePartsSheetFeedbackWindow(parts.Count, parts[0].Name, ActiveTheme.Instance.PrimaryBackgroundColor);
							currentPartsInQueue.UpdateRemainingItems += feedbackWindow.StartingNextPart;
							currentPartsInQueue.DoneSaving += feedbackWindow.DoneSaving;

							feedbackWindow.ShowAsSystemWindow();
						}
					});
			}
#endif
		}
        void PartSheetClickOnIdle(object state)
        {
            List<PrintItem> parts = QueueData.Instance.CreateReadOnlyPartList();
            if (parts.Count > 0)
            {
				string documentsPath = System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal);
				SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Parts Sheet|*.pdf", initialDirectory: documentsPath);

				saveParams.ActionButtonLabel = LocalizedString.Get("Save Parts Sheet");
				string saveParamsTitleLabel = "MatterControl".Localize();
				string saveParamsTitleLabelFull = LocalizedString.Get ("Save");
				saveParams.Title = string.Format("{0}: {1}",saveParamsTitleLabel,saveParamsTitleLabelFull);

                System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams);
				if (streamToSaveTo != null) 
				{
					streamToSaveTo.Close ();
				}

				if (saveParams.FileName != null)
                {
                    PartsSheet currentPartsInQueue = new PartsSheet(parts, saveParams.FileName);

                    currentPartsInQueue.SaveSheets();

                    SavePartsSheetFeedbackWindow feedbackWindow = new SavePartsSheetFeedbackWindow(parts.Count, parts[0].Name, ActiveTheme.Instance.PrimaryBackgroundColor);
                    currentPartsInQueue.UpdateRemainingItems += feedbackWindow.StartingNextPart;
                    currentPartsInQueue.DoneSaving += feedbackWindow.DoneSaving;

                    feedbackWindow.ShowAsSystemWindow();
                }
            }
        }
Exemplo n.º 6
0
        void PartSheetClickOnIdle(object state)
        {
            List<PrintItem> parts = PrintQueueControl.Instance.CreateReadOnlyPartList();
            if (parts.Count > 0)
            {
                SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Parts Sheet|*.pdf");

				saveParams.ActionButtonLabel = new LocalizedString("Save Parts Sheet").Translated;
				string saveParamsTitleLbl = new LocalizedString("MatterContol").Translated;
				string saveParamsTitleLblFull = new LocalizedString ("Save").Translated;
				saveParams.Title = string.Format("{0}: {1}",saveParamsTitleLbl,saveParamsTitleLblFull);

                System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams);
				if (streamToSaveTo != null) 
				{
					streamToSaveTo.Close ();
				}

				if (saveParams.FileName != null)
                {
                    PartsSheet currentPartsInQueue = new PartsSheet(parts, saveParams.FileName);

                    currentPartsInQueue.SaveSheets();

                    SavePartsSheetFeedbackWindow feedbackWindow = new SavePartsSheetFeedbackWindow(parts.Count, parts[0].Name, ActiveTheme.Instance.PrimaryBackgroundColor);
                    currentPartsInQueue.UpdateRemainingItems += feedbackWindow.StartingNextPart;
                    currentPartsInQueue.DoneSaving += feedbackWindow.DoneSaving;

                    feedbackWindow.ShowAsSystemWindow();
                }
            }
        }