• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# UI.SaveFileDialogParams类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: onExportGcodeFileSelected

		private void onExportGcodeFileSelected(SaveFileDialogParams saveParams)
		{

			if (saveParams.FileName != null)
			{

                ExportGcodeCommandLineUtility(saveParams.FileName);
         
			}
		}
开发者ID:fuding,项目名称:MatterControl,代码行数:10,代码来源:ExportPrintItemWindow.cs


示例17: ExportGCode_Click

		private void ExportGCode_Click()
		{
			SaveFileDialogParams saveParams = new SaveFileDialogParams("Export GCode|*.gcode", title: "Export GCode");
			saveParams.Title = "MatterControl: Export File";
			saveParams.ActionButtonLabel = "Export";
			saveParams.FileName = Path.GetFileNameWithoutExtension(printItemWrapper.Name);

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


示例18: ExportX3G_Click

		private void ExportX3G_Click(object state)
		{
			SaveFileDialogParams saveParams = new SaveFileDialogParams("Export X3G|*.x3g", title: "Export X3G");
			saveParams.Title = "MatterControl: Export File";
			saveParams.ActionButtonLabel = "Export";

			FileDialog.SaveFileDialog(saveParams, onExportX3gFileSelected);
		}
开发者ID:fuding,项目名称:MatterControl,代码行数:8,代码来源:ExportPrintItemWindow.cs


示例19: exportAMF_Click

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

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


示例20: onExportX3gFileSelected

		private void onExportX3gFileSelected(SaveFileDialogParams saveParams)
		{
			if (saveParams.FileName != null)
			{
				x3gPathAndFilenameToSave = saveParams.FileName;
				string extension = Path.GetExtension(x3gPathAndFilenameToSave);
				if (extension == "")
				{
					File.Delete(gcodePathAndFilenameToSave);
					x3gPathAndFilenameToSave += ".x3g";
				}

				string saveExtension = Path.GetExtension(printItemWrapper.FileLocation).ToUpper();
				if (MeshFileIo.ValidFileExtensions().Contains(saveExtension))
				{
					Close();
					SlicingQueue.Instance.QueuePartForSlicing(printItemWrapper);
					printItemWrapper.SlicingDone.RegisterEvent(x3gItemSlice_Complete, ref unregisterEvents);
				}
				else if (partIsGCode)
				{
					Close();
					generateX3GfromGcode(printItemWrapper.FileLocation, x3gPathAndFilenameToSave);
				}
			}
		}
开发者ID:fuding,项目名称:MatterControl,代码行数:26,代码来源:ExportPrintItemWindow.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UI.TextWidget类代码示例发布时间:2022-05-26
下一篇:
C# UI.MouseEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap