Пример #1
0
        public void StlFileExport()
        {
            var path = FileDialogService.SaveFileDialog(null, null, "StereoLithography Files (*.stl)|*.stl;", ".stl");

            if (path == null)
            {
                return;
            }

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();

            var e = new SmileStlExporter(path);

            //e.Export(CurrentModel);
            if (window.ShowHideJawVisualBtn.IsChecked.Value)
            {
                if (window.ShowHideWireVisualBtn.IsChecked.Value && window.ShowHideBraceVisualBtn.IsChecked.Value && window.ShowHideTeethVisualBtn.IsChecked.Value)
                {
                    ((SmileStlExporter)e).Export(JawVisual, Patient);
                }
                else
                {
                    if (window.ShowHideTeethVisualBtn.IsChecked.Value)
                    {
                        ((SmileStlExporter)e).Export(JawVisual.tc, Patient);
                    }

                    if (window.ShowHideBraceVisualBtn.IsChecked.Value)
                    {
                        ((SmileStlExporter)e).Export(JawVisual.bc, Patient);
                    }

                    if (window.ShowHideWireVisualBtn.IsChecked.Value)
                    {
                        ((SmileStlExporter)e).Export(JawVisual.wc, Patient);
                    }
                }

                ((SmileStlExporter)e).WriteExport();

                ((SmileStlExporter)e).Close();

                if (((SmileStlExporter)e).Finish)
                {
                    MessageBox.Show("Data Exported to STL file format at " + path + ".", "STL Export - Successfully");
                }
            }
            showStatus(stopWatch, "Exported");
        }
Пример #2
0
        private void SafeSqlExpression()
        {
            try
            {
                if (string.IsNullOrEmpty(SqlExpression))
                {
                    throw new ArgumentNullException("Напишите SQL выражение");
                }

                using (_fileDialogService)
                {
                    _fileDialogService.SafeFileExtension = "SQL запрос (*.sql)|*.sql";

                    string path = _fileDialogService.SaveFileDialog();

                    if (!string.IsNullOrEmpty(path))
                    {
                        Formatter.SaveTextFile(path, SqlExpression);
                    }
                }
            }
            catch (ArgumentNullException ex)
            {
                MessageService.ShowError(ex.Message);
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex.Message);
            }
        }
Пример #3
0
        private void FileExport()
        {
            var path = FileDialogService.SaveFileDialog(null, null, Exporters.Filter, ".png");

            if (path == null)
            {
                return;
            }
            HelixView.Export(path);

            /*
             *          var ext = Path.GetExtension(path).ToLowerInvariant();
             *          switch (ext)
             *          {
             *              case ".png":
             *              case ".jpg":
             *                  HelixView.Export(path);
             *                  break;
             *              case ".xaml":
             *                  {
             *                      var e = new XamlExporter(path);
             *                      e.Export(CurrentModel);
             *                      e.Close();
             *                      break;
             *                  }
             *
             *              case ".xml":
             *                  {
             *                      var e = new KerkytheaExporter(path);
             *                      e.Export(HelixView.Viewport);
             *                      e.Close();
             *                      break;
             *                  }
             *              case ".obj":
             *                  {
             *                      var e = new ObjExporter(path);
             *                      e.Export(CurrentModel);
             *                      e.Close();
             *                      break;
             *                  }
             *              case ".objz":
             *                  {
             *                      var tmpPath = Path.ChangeExtension(path, ".obj");
             *                       var e = new ObjExporter(tmpPath);
             *                       e.Export(CurrentModel);
             *                       e.Close();
             *                      GZipHelper.Compress(tmpPath);
             *                      break;
             *                  }
             *              case ".x3d":
             *                  {
             *                      var e = new X3DExporter(path);
             *                      e.Export(CurrentModel);
             *                      e.Close();
             *                      break;
             *                  }
             *          }*/
        }