Exemplo n.º 1
0
 public void Startup(ViewStartupParams p)
 {
     publishModel = new PublishModel(p.AuthProvider, p.CustomNodeManager);
     publishViewModel = new PublishViewModel(publishModel);
    
     inviteModel = new InviteModel(p.AuthProvider);
     inviteModel.MessageLogged += this.OnMessageLogged;
     inviteViewModel = new InviteViewModel(inviteModel);            
 }
Exemplo n.º 2
0
        public DynamoView(DynamoViewModel dynamoViewModel)
        {
            // The user's choice to enable hardware acceleration is now saved in
            // the Dynamo preferences. It is set to true by default. 
            // When the view is constructed, we enable or disable hardware acceleration based on that preference. 
            //This preference is not exposed in the UI and can be used to debug hardware issues only
            // by modifying the preferences xml.
            RenderOptions.ProcessRenderMode = dynamoViewModel.Model.PreferenceSettings.UseHardwareAcceleration ? 
                RenderMode.Default : RenderMode.SoftwareOnly;
            
            this.dynamoViewModel = dynamoViewModel;
            this.dynamoViewModel.UIDispatcher = Dispatcher;            
            nodeViewCustomizationLibrary = new NodeViewCustomizationLibrary(this.dynamoViewModel.Model.Logger);

            DataContext = dynamoViewModel;
            Title = dynamoViewModel.BrandingResourceProvider.GetString(ResourceNames.MainWindow.Title);

            tabSlidingWindowStart = tabSlidingWindowEnd = 0;

            _timer = new Stopwatch();
            _timer.Start();

            InitializeComponent();

            ToggleIsUsageReportingApprovedCommand.ToolTip = string.Format(
                Wpf.Properties.Resources.DynamoViewSettingMenuEnableDataReportingTooltip,
                dynamoViewModel.BrandingResourceProvider.ProductName);

            Loaded += DynamoView_Loaded;
            Unloaded += DynamoView_Unloaded;

            SizeChanged += DynamoView_SizeChanged;
            LocationChanged += DynamoView_LocationChanged;

            // Check that preference bounds are actually within one
            // of the available monitors.
            if (CheckVirtualScreenSize())
            {
                Left = dynamoViewModel.Model.PreferenceSettings.WindowX;
                Top = dynamoViewModel.Model.PreferenceSettings.WindowY;
                Width = dynamoViewModel.Model.PreferenceSettings.WindowW;
                Height = dynamoViewModel.Model.PreferenceSettings.WindowH;
            }
            else
            {
                Left = 0;
                Top = 0;
                Width = 1024;
                Height = 768;
            }

            _workspaceResizeTimer.Tick += _resizeTimer_Tick;

            if (dynamoViewModel.Model.AuthenticationManager.HasAuthProvider)
            {
                loginService = new LoginService(this, new System.Windows.Forms.WindowsFormsSynchronizationContext());
                dynamoViewModel.Model.AuthenticationManager.AuthProvider.RequestLogin += loginService.ShowLogin;
            }

            var viewExtensions = viewExtensionManager.ExtensionLoader.LoadDirectory(dynamoViewModel.Model.PathManager.ViewExtensionsDirectory);
            viewExtensionManager.MessageLogged += Log;

            var startupParams = new ViewStartupParams(dynamoViewModel);

            foreach (var ext in viewExtensions)
            {
                try
                {
                    var logSource = ext as ILogSource;
                    if (logSource != null)
                        logSource.MessageLogged += Log;

                    ext.Startup(startupParams);
                    viewExtensionManager.Add(ext);
                }
                catch (Exception exc)
                {
                    Log(ext.Name + ": " + exc.Message);
                }
            }

            this.dynamoViewModel.RequestPaste += OnRequestPaste;
            this.dynamoViewModel.RequestReturnFocusToView += OnRequestReturnFocusToView;
            FocusableGrid.InputBindings.Clear();
        }
 public void Startup(ViewStartupParams p)
 {
     this.startupParams = p;
 }
 public void Startup(ViewStartupParams p)
 {
     manipulatorDaemon = ManipulatorDaemon.Create(new NodeManipulatorFactoryLoader());
 }
Exemplo n.º 5
0
 public void Startup(ViewStartupParams p)
 {
     viewStartupParams = p;
 }
Exemplo n.º 6
0
 public void Startup(ViewStartupParams p)
 {
     publishModel = new PublishModel(p.AuthProvider, p.CustomNodeManager);
     publishViewModel = new PublishViewModel(publishModel);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Action to be invoked when DynamoView begins to start up.  This is guaranteed to happen
 /// after the DynamoModel has been created.
 ///
 /// This method is *not* guaranteed to be invoked unless the extension is present
 /// at startup.
 ///
 /// Exceptions thrown from this method will be caught by Dynamo and
 /// displayed.
 /// </summary>
 public virtual void Startup(ViewStartupParams viewStartupParams)
 {
 }
Exemplo n.º 8
0
        public void Startup(ViewStartupParams p)
        {

        }
Exemplo n.º 9
0
 public void Startup(ViewStartupParams p)
 {
     // Some start up stuff.
 }