本文整理汇总了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;
}
示例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;
}
示例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);
}
);
}
示例4: SaveAs
private void SaveAs()
{
SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Slice Preset|*." + configFileExtension);
saveParams.FileName = presetNameInput.Text;
FileDialog.SaveFileDialog(saveParams, onSaveFileSelected);
}
示例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);
}
示例6: SaveFileDialog
public static Stream SaveFileDialog(ref SaveFileDialogParams saveParams)
{
return FileDialogCreatorPlugin.SaveFileDialog(ref saveParams);
}
示例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);
});
}
示例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
{
}
}
示例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);
}
}
示例10: onExportGcodeFileSelected
private void onExportGcodeFileSelected(SaveFileDialogParams saveParams)
{
if (!string.IsNullOrEmpty(saveParams.FileName))
{
ExportGcodeCommandLineUtility(saveParams.FileName);
}
}
示例11: SaveAs
public void SaveAs()
{
SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Slice Configuration".Localize() + "|*." + configFileExtension);
saveParams.FileName = "default_settings.ini";
FileDialog.SaveFileDialog(saveParams, onExportFileSelected);
}
示例12: onExportFileSelected
private void onExportFileSelected(SaveFileDialogParams saveParams)
{
if (!string.IsNullOrEmpty(saveParams.FileName))
{
GenerateConfigFile(saveParams.FileName, false);
}
}
示例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);
}
}
示例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());
});
}
}
示例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("");
}
}
}
}