当前位置: 首页>>代码示例>>C#>>正文


C# UI.SaveFileDialogParams类代码示例

本文整理汇总了C#中MatterHackers.Agg.UI.SaveFileDialogParams的典型用法代码示例。如果您正苦于以下问题:C# SaveFileDialogParams类的具体用法?C# SaveFileDialogParams怎么用?C# SaveFileDialogParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SaveFileDialogParams类属于MatterHackers.Agg.UI命名空间,在下文中一共展示了SaveFileDialogParams类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveFileDialog

		public override bool SaveFileDialog(SaveFileDialogParams saveParams, SaveFileDialogDelegate callback)
		{
			WidgetForWindowsFormsAbstract.MainWindowsFormsWindow.ShowingSystemDialog = true;
			SaveFileDialogParams SaveFileDialogDialogParams = saveParams;

			SaveFileDialog saveFileDialog1 = new SaveFileDialog();

			saveFileDialog1.InitialDirectory = SaveFileDialogDialogParams.InitialDirectory;
			saveFileDialog1.Filter = saveParams.Filter;
			saveFileDialog1.FilterIndex = saveParams.FilterIndex;
			saveFileDialog1.RestoreDirectory = true;
			saveFileDialog1.AddExtension = true;
			saveFileDialog1.FileName = saveParams.FileName;

			saveFileDialog1.Title = saveParams.Title;
			saveFileDialog1.ShowHelp = false;
			saveFileDialog1.OverwritePrompt = true;
			saveFileDialog1.CheckPathExists = true;
			saveFileDialog1.SupportMultiDottedExtensions = true;
			saveFileDialog1.ValidateNames = false;

			if (saveFileDialog1.ShowDialog() == DialogResult.OK)
			{
				SaveFileDialogDialogParams.FileName = saveFileDialog1.FileName;
			}

			WidgetForWindowsFormsAbstract.MainWindowsFormsWindow.ShowingSystemDialog = false;

			UiThread.RunOnIdle(() =>
			{
				callback(saveParams);
			});

			return true;
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:35,代码来源:FileDialogPlugin.cs

示例2: SaveFileDialog

        public override Stream SaveFileDialog(ref SaveFileDialogParams saveParams)
        {
            WidgetForWindowsFormsAbstract.MainWindowsFormsWindow.ShowingSystemDialog = true;
            SaveFileDialogParams SaveFileDialogDialogParams;
            Stream SaveFileDialogStreamToSaveTo = null;
            SaveFileDialogDialogParams = saveParams;

            Stream myStream = null;
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.InitialDirectory = SaveFileDialogDialogParams.InitialDirectory;
            saveFileDialog1.Filter = saveParams.Filter;
            saveFileDialog1.FilterIndex = saveParams.FilterIndex;
            saveFileDialog1.RestoreDirectory = true;
            saveFileDialog1.AddExtension = true;
            saveFileDialog1.FileName = saveParams.FileName;

            saveFileDialog1.Title = saveParams.Title;
            saveFileDialog1.ShowHelp = false;
            saveFileDialog1.OverwritePrompt = true;
            saveFileDialog1.CheckPathExists = true;
            saveFileDialog1.SupportMultiDottedExtensions = true;
            saveFileDialog1.ValidateNames = false;

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    if ((myStream = saveFileDialog1.OpenFile()) != null)
                    {
                        SaveFileDialogDialogParams.FileName = saveFileDialog1.FileName;
                        SaveFileDialogStreamToSaveTo = myStream;
                    }
                }
                catch (Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show("Error: Could not create file for saving. Original error: " + ex.Message);
                }
            }

            WidgetForWindowsFormsAbstract.MainWindowsFormsWindow.ShowingSystemDialog = false;
            return SaveFileDialogStreamToSaveTo;
        }
开发者ID:jeske,项目名称:agg-sharp,代码行数:43,代码来源:FileDialogPlugin.cs

示例3: SaveFileDialog

		public static bool SaveFileDialog(SaveFileDialogParams saveParams, FileDialogCreator.SaveFileDialogDelegate callback)
		{
			return FileDialogCreatorPlugin.SaveFileDialog(saveParams, (SaveFileDialogParams outputSaveParams) =>
				{
					try
					{
						if (outputSaveParams.FileName != "")
						{
							string directory = Path.GetDirectoryName(outputSaveParams.FileName);
							if (directory != null && directory != "")
							{
								lastDirectoryUsed = directory;
							}
						}
					}
					catch (Exception)
					{
					}
					callback(outputSaveParams);
				}
			);
		}
开发者ID:CNCBrasil,项目名称:agg-sharp,代码行数:22,代码来源:FileDialog.cs

示例4: SaveAs

		private void SaveAs()
		{
			SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Slice Preset|*." + configFileExtension);
			saveParams.FileName = presetNameInput.Text;

			FileDialog.SaveFileDialog(saveParams, onSaveFileSelected);
		}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:7,代码来源:SlicePresetDetailWidget.cs

示例5: DoExportExportLog_Click

		private void DoExportExportLog_Click()
		{
			SaveFileDialogParams saveParams = new SaveFileDialogParams("Save as Text|*.txt");
			saveParams.Title = "MatterControl: Terminal Log";
			saveParams.ActionButtonLabel = "Export";
			saveParams.FileName = "print_log.txt";

			FileDialog.SaveFileDialog(saveParams, onExportLogFileSelected);
		}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:9,代码来源:TerminalWidget.cs

示例6: SaveFileDialog

 public static Stream SaveFileDialog(ref SaveFileDialogParams saveParams)
 {
     return FileDialogCreatorPlugin.SaveFileDialog(ref saveParams);
 }
开发者ID:jeske,项目名称:agg-sharp,代码行数:4,代码来源:FileDialog.cs

示例7: exportSTL_Click

		private void exportSTL_Click(object sender, EventArgs mouseEvent)
		{
			UiThread.RunOnIdle(() =>
			{
				SaveFileDialogParams saveParams = new SaveFileDialogParams("Save as STL|*.stl");
				saveParams.Title = "MatterControl: Export File";
				saveParams.ActionButtonLabel = "Export";
				saveParams.FileName = printItemWrapper.Name;

				Close();
				FileDialog.SaveFileDialog(saveParams, onExportStlFileSelected);
			});
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:13,代码来源:ExportPrintItemWindow.cs

示例8: SaveStl

		private void SaveStl(SaveFileDialogParams saveParams)
		{
			try
			{
				if (!string.IsNullOrEmpty(saveParams.FileName))
				{
					string filePathToSave = saveParams.FileName;
					if (filePathToSave != null && filePathToSave != "")
					{
						string extension = Path.GetExtension(filePathToSave);
						if (extension == "")
						{
							File.Delete(filePathToSave);
							filePathToSave += ".stl";
						}
						if (Path.GetExtension(printItemWrapper.FileLocation).ToUpper() == Path.GetExtension(filePathToSave).ToUpper())
						{
							File.Copy(printItemWrapper.FileLocation, filePathToSave, true);
						}
						else
						{
							List<MeshGroup> meshGroups = MeshFileIo.Load(printItemWrapper.FileLocation);
							MeshFileIo.Save(meshGroups, filePathToSave);
						}
						ShowFileIfRequested(filePathToSave);
					}
				}
			}
			catch
			{
			}
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:32,代码来源:ExportPrintItemWindow.cs

示例9: SaveAs

        public void SaveAs()
        //Opens Save file dialog and outputs current queue as a project
        {
			string documentsPath = System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal);
			SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Project|*.mcp", initialDirectory: documentsPath);

            System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams);
            if (streamToSaveTo != null)
            {
                streamToSaveTo.Close();
                ExportToJson(saveParams.FileName);
            }
        }
开发者ID:klewisjohnson,项目名称:MatterControl,代码行数:13,代码来源:ManifestFileHandler.cs

示例10: onExportGcodeFileSelected

		private void onExportGcodeFileSelected(SaveFileDialogParams saveParams)
		{
			if (!string.IsNullOrEmpty(saveParams.FileName))
			{
				ExportGcodeCommandLineUtility(saveParams.FileName);
			}
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:7,代码来源:ExportPrintItemWindow.cs

示例11: SaveAs

		public void SaveAs()
		{
			SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Slice Configuration".Localize() + "|*." + configFileExtension);
			saveParams.FileName = "default_settings.ini";
			FileDialog.SaveFileDialog(saveParams, onExportFileSelected);
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:6,代码来源:SettingsProfile.cs

示例12: onExportFileSelected

		private void onExportFileSelected(SaveFileDialogParams saveParams)
		{
			if (!string.IsNullOrEmpty(saveParams.FileName))
			{
				GenerateConfigFile(saveParams.FileName, false);
			}
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:7,代码来源:SettingsProfile.cs

示例13: SaveAs

        //Opens Save file dialog and outputs current queue as a project
        public void SaveAs()
        {
			string documentsPath = System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal);
			SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Project|*.zip", initialDirectory: documentsPath);

            System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams);
            if (streamToSaveTo != null)
            {
                streamToSaveTo.Close();
                ExportToProjectArchive(saveParams.FileName);
            }
        }
开发者ID:klewisjohnson,项目名称:MatterControl,代码行数:13,代码来源:ProjectFileHandler.cs

示例14: SaveStl

		private void SaveStl(SaveFileDialogParams saveParams)
		{
			try
			{
				if (!string.IsNullOrEmpty(saveParams.FileName))
				{
					string filePathToSave = saveParams.FileName;
					if (filePathToSave != null && filePathToSave != "")
					{
						string extension = Path.GetExtension(filePathToSave);
						if (extension == "")
						{
							File.Delete(filePathToSave);
							filePathToSave += ".stl";
						}
						if (Path.GetExtension(printItemWrapper.FileLocation).ToUpper() == Path.GetExtension(filePathToSave).ToUpper())
						{
							File.Copy(printItemWrapper.FileLocation, filePathToSave, true);
						}
						else
						{
							List<MeshGroup> meshGroups = MeshFileIo.Load(printItemWrapper.FileLocation);
							if (!MeshFileIo.Save(meshGroups, filePathToSave))
							{
								UiThread.RunOnIdle (() => {
									StyledMessageBox.ShowMessageBox(null, "AMF to STL conversion failed", "Couldn't save file".Localize());
								});
							}
						}
						ShowFileIfRequested(filePathToSave);
					}
				}
			}
			catch (Exception e)
			{
				UiThread.RunOnIdle (() => {
					StyledMessageBox.ShowMessageBox(null, e.Message, "Couldn't save file".Localize());
				});

			}
		}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:41,代码来源:ExportPrintItemWindow.cs

示例15: onExportLogFileSelected

		private void onExportLogFileSelected(SaveFileDialogParams saveParams)
		{
			if (saveParams.FileName != null)
			{
				string filePathToSave = saveParams.FileName;
				if (filePathToSave != null && filePathToSave != "")
				{
					try
					{
						textScrollWidget.WriteToFile(filePathToSave);
					}
					catch(UnauthorizedAccessException e)
					{
						PrinterOutputCache.Instance.PrinterLines.Add("");
						PrinterOutputCache.Instance.PrinterLines.Add(writeFaildeWaring);
						PrinterOutputCache.Instance.PrinterLines.Add(cantAccessPath.FormatWith(filePathToSave));
						PrinterOutputCache.Instance.PrinterLines.Add("");
					}
				}
			}
		}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:21,代码来源:TerminalWidget.cs


注:本文中的MatterHackers.Agg.UI.SaveFileDialogParams类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。