Example #1
0
        private void OnGraphControlLoaded(object sender, RoutedEventArgs e)
        {
            // Kick start library loading on a background thread...
            coreComponent = ClassFactory.CreateCoreComponent(this, geometricPreviewEnabled);
            coreComponent.InitializeAsync(this.OnCoreComponentInitialized);

            // Cursor resources.
            this.cursorSet = new CursorSet(this.MasterGrid);

            // Kick start a check for update version info, if the update manager is idle.
            UpdateManager.Instance.UpdateDownloaded += OnUpdatePackageDownloaded;
            UpdateManager.Instance.CheckForProductUpdate();
            UpdateManager.Instance.ShutdownRequested += OnUpdateManagerShutdownRequested;

            //Library
            libraryView = new LibraryView(this);
            libraryView.SetValue(GraphControl.WidthProperty, 250.0);
            libraryView.SetValue(GraphControl.HeightProperty, 400.0);
            libraryView.SetValue(GraphControl.VerticalAlignmentProperty, VerticalAlignment.Bottom);
            libraryView.SetValue(GraphControl.HorizontalAlignmentProperty, HorizontalAlignment.Left);
            libraryView.SetValue(GraphControl.MarginProperty, new Thickness(5, 0, 0, 0));
            libraryView.SetValue(Panel.ZIndexProperty, 60000);
            MasterGrid.Children.Add(libraryView);

            //Zoom and Pan Bar
            zoomAndPanControl = new ZoomAndPanControl(this);
            zoomAndPanControl.SetValue(GraphControl.VerticalAlignmentProperty, VerticalAlignment.Top);
            zoomAndPanControl.SetValue(GraphControl.HorizontalAlignmentProperty, HorizontalAlignment.Right);
            zoomAndPanControl.SetValue(GraphControl.MarginProperty, new Thickness(0, 5, 5, 0));
            zoomAndPanControl.SetValue(Panel.ZIndexProperty, 60000);
            zoomAndPanControl.Focusable = false;
            MasterGrid.Children.Add(zoomAndPanControl);

            //TabControl
            newCanvasCount = 0;
            tabControl = new GraphTabControl(this);
            tabControl.SetValue(Panel.ZIndexProperty, 60000);
            tabControl.SetValue(GraphControl.MarginProperty, new Thickness(0, -1, 0, 0));
            TabBorder.Child = tabControl;

            // for zoom and pan
            this.canvasScrollViewer.KeyDown += OnScrollViewerKeyDown;
            this.canvasScrollViewer.ScrollChanged += OnScrollViewerScrollChanged;
            this.slider.ValueChanged += OnSliderValueChanged;

            filesToRecover = Utilities.GetFilesToRecover(coreComponent.SessionName);
            if (null == filesToRecover || (filesToRecover.Count == 0))
                CreateBlankOrRecoveredCanvas(false); // Nothing to recover, create default.

            // Either UI or Core can be completely loaded before another. In the event
            // that UI completes its loading first, it sets the "initializationState"
            // to be "InitializationState.UiInitialized". If at this point Core has
            // already finished loading, then the library data can readily be obtained
            // and "Library" tree view populated.
            //
            if (initializationState == InitializationState.None)
                initializationState = InitializationState.UiInitialized;
            else if (initializationState == InitializationState.CoreInitialized)
                OnLoadingComplete();

            if (!coreComponent.StudioSettings.DontShowSplash)
            {
                Splash splashMessage = new Splash(this);
                splashMessage.SetValue(GraphControl.HorizontalAlignmentProperty, HorizontalAlignment.Center);
                splashMessage.SetValue(GraphControl.VerticalAlignmentProperty, VerticalAlignment.Bottom);
                splashMessage.MouseLeftButtonDown += OnSplashMouseLeftButtonDown;
                this.FeedbackMsssagePanel.Children.Add(splashMessage);
            }
        }
Example #2
0
        private void OnGraphControlLoaded(object sender, RoutedEventArgs e)
        {
            // Kick start library loading on a background thread...
            coreComponent = ClassFactory.CreateCoreComponent(this, geometricPreviewEnabled);
            coreComponent.InitializeAsync(this.OnCoreComponentInitialized);

            // Cursor resources.
            this.cursorSet = new CursorSet(this.MasterGrid);

            // Kick start a check for update version info, if the update manager is idle.
            UpdateManager.Instance.UpdateDownloaded += OnUpdatePackageDownloaded;
            UpdateManager.Instance.CheckForProductUpdate();
            UpdateManager.Instance.ShutdownRequested += OnUpdateManagerShutdownRequested;

            //Library
            libraryView = new LibraryView(this);
            libraryView.SetValue(GraphControl.WidthProperty, 250.0);
            libraryView.SetValue(GraphControl.HeightProperty, 400.0);
            libraryView.SetValue(GraphControl.VerticalAlignmentProperty, VerticalAlignment.Bottom);
            libraryView.SetValue(GraphControl.HorizontalAlignmentProperty, HorizontalAlignment.Left);
            libraryView.SetValue(GraphControl.MarginProperty, new Thickness(5, 0, 0, 0));
            libraryView.SetValue(Panel.ZIndexProperty, 60000);
            MasterGrid.Children.Add(libraryView);

            //Zoom and Pan Bar
            zoomAndPanControl = new ZoomAndPanControl(this);
            zoomAndPanControl.SetValue(GraphControl.VerticalAlignmentProperty, VerticalAlignment.Top);
            zoomAndPanControl.SetValue(GraphControl.HorizontalAlignmentProperty, HorizontalAlignment.Right);
            zoomAndPanControl.SetValue(GraphControl.MarginProperty, new Thickness(0, 5, 5, 0));
            zoomAndPanControl.SetValue(Panel.ZIndexProperty, 60000);
            zoomAndPanControl.Focusable = false;
            MasterGrid.Children.Add(zoomAndPanControl);

            //TabControl
            newCanvasCount = 0;
            tabControl     = new GraphTabControl(this);
            tabControl.SetValue(Panel.ZIndexProperty, 60000);
            tabControl.SetValue(GraphControl.MarginProperty, new Thickness(0, -1, 0, 0));
            TabBorder.Child = tabControl;

            // for zoom and pan
            this.canvasScrollViewer.KeyDown       += OnScrollViewerKeyDown;
            this.canvasScrollViewer.ScrollChanged += OnScrollViewerScrollChanged;
            this.slider.ValueChanged += OnSliderValueChanged;

            filesToRecover = Utilities.GetFilesToRecover(coreComponent.SessionName);
            if (null == filesToRecover || (filesToRecover.Count == 0))
            {
                CreateBlankOrRecoveredCanvas(false); // Nothing to recover, create default.
            }
            // Either UI or Core can be completely loaded before another. In the event
            // that UI completes its loading first, it sets the "initializationState"
            // to be "InitializationState.UiInitialized". If at this point Core has
            // already finished loading, then the library data can readily be obtained
            // and "Library" tree view populated.
            //
            if (initializationState == InitializationState.None)
            {
                initializationState = InitializationState.UiInitialized;
            }
            else if (initializationState == InitializationState.CoreInitialized)
            {
                OnLoadingComplete();
            }

            if (!coreComponent.StudioSettings.DontShowSplash)
            {
                Splash splashMessage = new Splash(this);
                splashMessage.SetValue(GraphControl.HorizontalAlignmentProperty, HorizontalAlignment.Center);
                splashMessage.SetValue(GraphControl.VerticalAlignmentProperty, VerticalAlignment.Bottom);
                splashMessage.MouseLeftButtonDown += OnSplashMouseLeftButtonDown;
                this.FeedbackMsssagePanel.Children.Add(splashMessage);
            }
        }