Exemple #1
0
 /// <summary>
 /// Allows the drag&drop page <see cref="DND"/> to open the next page
 /// </summary>
 void OpenPage2(Renderer.BasicRenderer rend) => pageViewer.Content = new CompilationSettings(OpenPage3, rend)
 {
     GoBack = () => {
         pageViewer.GoBack();
         pageViewer.Content = new DND(OpenPage2);
         //else pageViewer.GoBack();
     }
 };
Exemple #2
0
 public CompilationSettings(Action <IRenderPage> switchToRenderPage, Renderer.BasicRenderer renderer)
 {
     System.Diagnostics.Contracts.Contract.Requires(renderer != null);
     this.renderer = renderer;
     InitializeComponent();
     foreach (var s in renderer.OutputFiles)
     {
         cbFiles.Items.Add(s);
     }
     if (cbFiles.Items.Count == 1)
     {
         cbFiles.SelectedIndex = 0;
     }
     gbScene.Visibility      = renderer is Renderer.SceneBasedRenderer ? Visibility.Visible : Visibility.Collapsed;
     this.switchToRenderPage = switchToRenderPage;
 }
 public RenderPage(Renderer.BasicRenderer rend, int outputIndex, int width)
 {
     sw = Stopwatch.StartNew();
     Contract.Requires(rend != null);
     renderer = rend;
     InitializeComponent();
     pbStatus.Maximum = width;
     pbStatus.Value   = 0;
     updateBlur();
     if (outputIndex != -1)
     {
         Ofile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + renderer.OutputFiles[outputIndex];
     }
     if (renderer is Renderer.MaterialRenderer r && r.CanAbort)
     {
         btAbort.Visibility = Visibility.Visible;
     }
     Wait();
     SizeChanged += (_, __) => updateBlur();
     ShowEstimation();
 }
Exemple #4
0
        /// <summary>
        /// Detects if this should immediatly open the <see cref="CompilationSettings"/> page based on the command line parameters
        /// <para>
        /// <see cref="LibraryHandler"/> will relaunch  the Application if required. When is does so, it will pass the name of the target DLL as a parameter.
        /// But depending on the execution environment the path to our executable might be the first parameter. To ignore this we check for such options.
        /// After checking all this this function will cause <see cref="LibraryHandler"/> to load the passed DLL.
        /// Since <see cref="LibraryHandler"/> remembers this, the <see cref="MainWindow()"/> constructor will detect that a library has been loaded and trigger the <see cref="CompilationSettings"/>
        /// Page instead of the <see cref="DND"/> page
        /// </para>
        /// </summary>
        void Preexecution()
        {
            var para = Environment.GetCommandLineArgs();

            if (para[0] != Assembly.GetExecutingAssembly().Location)
            {
                ////For debugging purposes: List all command line parameters
                //var s = "";
                //foreach(var p in para) s += p + "\n";
                //MessageBox.Show(s);
            }
            if (para.Length == 1)
            {
                if (para[0] == Assembly.GetExecutingAssembly().Location)
                {
                    return;
                }
                prefetchRenderer = LibraryHandler.TryLoadLib(para[0]);
            }
            else if (para.Length > 1 && para[0] == Assembly.GetExecutingAssembly().Location)
            {
                prefetchRenderer = LibraryHandler.TryLoadLib(para[1]);
            }
        }
Exemple #5
0
 public Abgabe(Renderer.BasicRenderer rend, int width, int height)
 {
     lib = rend;
     InitializeComponent();
     Render(width, height);
 }