Esempio n. 1
0
        public void Commit(Point location)
        {
            Verify.State.IsTrue(IsActive);

            IsActive = false;
            bool docking = false;

            location = ViewHost.PointToScreen(location);
            if (HoveredDockGrid != null)
            {
                var dockResult = HoveredDockGrid.DockMarkers.HitTest(location);
                if (HoveredDockGrid.CanDock(ViewHost, dockResult))
                {
                    docking = true;
                    HoveredDockGrid.PerformDock(ViewHost, dockResult);
                }
                HoveredDockGrid.DockMarkers.Hide();
                HoveredDockGrid = null;
            }
            if (HoveredViewHost != null)
            {
                var host = HoveredViewHost;
                if (!docking)
                {
                    var dockResult = host.DockMarkers.HitTest(location);
                    if (host.CanDock(ViewHost, dockResult))
                    {
                        host.PerformDock(ViewHost, dockResult);
                    }
                }
                host.DockMarkers.Hide();
            }
        }
        internal static bool CheckinPaths(
            WorkspaceInfo wkInfo,
            List<string> paths,
            IAssetStatusCache assetStatusCache,
            bool isGluonMode,
            EditorWindow parentWindow,
            IWorkspaceWindow workspaceWindow,
            ViewHost viewHost,
            GuiMessage.IGuiMessage guiMessage,
            IMergeViewLauncher mergeViewLauncher,
            IGluonViewSwitcher gluonViewSwitcher)
        {
            MetaCache metaCache = new MetaCache();
            metaCache.Build(paths);

            CheckinDialog dialog = Create(
                wkInfo,
                paths,
                assetStatusCache,
                metaCache,
                isGluonMode,
                new ProgressControlsForDialogs(),
                workspaceWindow,
                viewHost,
                guiMessage,
                mergeViewLauncher,
                gluonViewSwitcher);

            return dialog.RunModal(parentWindow) == ResponseType.Ok;
        }
Esempio n. 3
0
        public void runAction(string address, ViewHost viewHost = null, IDataProvider dataProvider = null)
        {
            runningActionViewHost     = viewHost;
            queuedTimeline            = null;
            runningActionDataProvider = dataProvider;

            doRunAction(address);

            if (queuedTimeline != null)
            {
                playTimeline(queuedTimeline);
            }

            core.processViewChanges();

            if (queuedActions.Count > 0)
            {
                QueuedAction action = queuedActions.Dequeue();
                runAction(action.Address, action.ViewHost, action.DataProvider);
            }
            else
            {
                checkShutdownConditions();
            }
        }
Esempio n. 4
0
        internal AssetOperations(
            WorkspaceInfo wkInfo,
            IWorkspaceWindow workspaceWindow,
            IViewSwitcher viewSwitcher,
            IHistoryViewLauncher historyViewLauncher,
            ViewHost viewHost,
            NewIncomingChangesUpdater newIncomingChangesUpdater,
            IAssetStatusCache assetStatusCache,
            IMergeViewLauncher mergeViewLauncher,
            IGluonViewSwitcher gluonViewSwitcher,
            EditorWindow parentWindow,
            IAssetSelection assetSelection,
            bool isGluonMode)
        {
            mWkInfo                    = wkInfo;
            mWorkspaceWindow           = workspaceWindow;
            mViewSwitcher              = viewSwitcher;
            mHistoryViewLauncher       = historyViewLauncher;
            mViewHost                  = viewHost;
            mNewIncomingChangesUpdater = newIncomingChangesUpdater;
            mAssetStatusCache          = assetStatusCache;
            mMergeViewLauncher         = mergeViewLauncher;
            mGluonViewSwitcher         = gluonViewSwitcher;
            mAssetSelection            = assetSelection;
            mIsGluonMode               = isGluonMode;
            mParentWindow              = parentWindow;

            mGuiMessage       = new UnityPlasticGuiMessage(parentWindow);
            mProgressControls = new EditorProgressControls(mGuiMessage);
        }
Esempio n. 5
0
        private void InitializeMainWindow()
        {
            mainWindow.Loaded += delegate
            {
                if (ViewHost.ToolViews.Contains(mainWindow.PropertyGrid))
                {
                    ViewHost.BringToFront(mainWindow.PropertyGrid);
                }

                if (ViewHost.ToolViews.Contains(mainWindow.MessageWindow))
                {
                    ViewHost.BringToFront(mainWindow.MessageWindow);
                }

                if (ViewHost.ToolViews.Contains(mainWindow.ProjectExplorer))
                {
                    ViewHost.BringToFront(mainWindow.ProjectExplorer);
                }
            };

            mainWindow.Closing += delegate(object sender, CancelEventArgs e)
            {
                if (isExiting)
                {
                    return;
                }

                e.Cancel = true; // Handle exit manually
                ExitApplication();
            };
        }
        internal ViewSwitcher(
            WorkspaceInfo wkInfo,
            ViewHost viewHost,
            bool isGluonMode,
            PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges,
            NewIncomingChangesUpdater developerNewIncomingChangesUpdater,
            GluonNewIncomingChangesUpdater gluonNewIncomingChangesUpdater,
            IIncomingChangesNotifier incomingChangesNotifier,
            IAssetStatusCache assetStatusCache,
            StatusBar statusBar,
            EditorWindow parentWindow)
        {
            mWkInfo         = wkInfo;
            mViewHost       = viewHost;
            mIsGluonMode    = isGluonMode;
            mPendingChanges = pendingChanges;
            mDeveloperNewIncomingChangesUpdater = developerNewIncomingChangesUpdater;
            mGluonNewIncomingChangesUpdater     = gluonNewIncomingChangesUpdater;
            mIncomingChangesNotifier            = incomingChangesNotifier;
            mAssetStatusCache = assetStatusCache;
            mStatusBar        = statusBar;
            mParentWindow     = parentWindow;

            mPendingChangesTabButton  = new TabButton();
            mIncomingChangesTabButton = new TabButton();
            mChangesetsTabButton      = new TabButton();
            mBranchesTabButton        = new TabButton();
            mHistoryTabButton         = new TabButton();
        }
Esempio n. 7
0
        static void ShowUpdateReportDialog(
            WorkspaceInfo wkInfo,
            ViewHost viewHost,
            UpdateProgress progress,
            IProgressControls progressControls,
            GuiMessage.IGuiMessage guiMessage,
            IUpdateProgress updateProgress,
            IGluonUpdateReport updateReport)
        {
            if (progress.ErrorMessages.Count == 0)
            {
                return;
            }

            UpdateReportResult updateReportResult =
                updateReport.ShowUpdateReport(wkInfo, progress.ErrorMessages);

            if (!updateReportResult.IsUpdateForcedRequested())
            {
                return;
            }

            UpdateForcedOperation updateForced = new UpdateForcedOperation(
                wkInfo, viewHost, progress, progressControls,
                guiMessage, updateProgress, updateReport);

            updateForced.UpdateForced(
                updateReportResult.UpdateForcedPaths,
                updateReportResult.UnaffectedErrors);
        }
Esempio n. 8
0
 public void requestClose(ViewHost viewHost)
 {
     if (viewHost != null)
     {
         viewHost._RequestClosed = true;
     }
 }
Esempio n. 9
0
        internal HistoryTab(
            WorkspaceInfo wkInfo,
            IWorkspaceWindow workspaceWindow,
            RepositorySpec repSpec,
            NewIncomingChangesUpdater newIncomingChangesUpdater,
            ViewHost viewHost,
            EditorWindow parentWindow,
            bool isGluonMode)
        {
            mWkInfo                    = wkInfo;
            mWorkspaceWindow           = workspaceWindow;
            mRepSpec                   = repSpec;
            mNewIncomingChangesUpdater = newIncomingChangesUpdater;
            mViewHost                  = viewHost;
            mParentWindow              = parentWindow;
            mIsGluonMode               = isGluonMode;

            mGuiMessage = new UnityPlasticGuiMessage(parentWindow);

            BuildComponents(wkInfo, repSpec);

            mProgressControls = new ProgressControlsForViews();

            mHistoryViewLogic = new HistoryViewLogic(
                wkInfo, this, mProgressControls);
        }
 public DiscriminantFunctionClassificationModelView()
 {
     InitializeComponent();
     view      = new ViewHost();
     view.Dock = DockStyle.Fill;
     Controls.Add(view);
 }
Esempio n. 11
0
        /// <summary>Initializes a new instance of the <see cref="ViewDockGrid"/> class.</summary>
        public ViewDockGrid()
        {
            _dockMarkers = new GridDockMarkers(this);
            var bounds = ClientRectangle;

            bounds.X      += ViewConstants.Spacing;
            bounds.Y      += ViewConstants.Spacing;
            bounds.Width  -= ViewConstants.Spacing * 2;
            bounds.Height -= ViewConstants.Spacing * 2;
            RootHost       = new ViewHost(this, true, true, null)
            {
                Bounds = bounds,
                Anchor = ViewConstants.AnchorAll,
            };
            RootControl        = RootHost;
            _floatingViewForms = new LinkedList <FloatingViewForm>();
            PopupsStack        = new PopupNotificationsStack();

            SetStyle(ControlStyles.ContainerControl, true);

            SuspendLayout();
            RootHost.Parent = this;
            ResumeLayout(true);

            lock (_grids)
            {
                _grids.AddLast(this);
            }

            BackColor = ViewManager.Renderer.BackgroundColor;
        }
 static CheckinDialog Create(
     WorkspaceInfo wkInfo,
     List<string> paths,
     IAssetStatusCache assetStatusCache,
     MetaCache metaCache,
     bool isGluonMode,
     ProgressControlsForDialogs progressControls,
     IWorkspaceWindow workspaceWindow,
     ViewHost viewHost,
     GuiMessage.IGuiMessage guiMessage,
     IMergeViewLauncher mergeViewLauncher,
     IGluonViewSwitcher gluonViewSwitcher)
 {
     var instance = CreateInstance<CheckinDialog>();
     instance.IsResizable = true;
     instance.minSize = new Vector2(520, 370);
     instance.mWkInfo = wkInfo;
     instance.mPaths = paths;
     instance.mAssetStatusCache = assetStatusCache;
     instance.mMetaCache = metaCache;
     instance.mIsGluonMode = isGluonMode;
     instance.mProgressControls = progressControls;
     instance.mWorkspaceWindow = workspaceWindow;
     instance.mViewHost = viewHost;
     instance.mGuiMessage = guiMessage;
     instance.mMergeViewLauncher = mergeViewLauncher;
     instance.mGluonViewSwitcher = gluonViewSwitcher;
     instance.mEnterKeyAction = instance.OkButtonAction;
     instance.mEscapeKeyAction = instance.CancelButtonAction;
     return instance;
 }
            void view_ViewResized(ViewHost view)
            {
                if (!view.Animating || lastWorkingParentHeight == int.MinValue)
                {
                    bool  changeScale = false;
                    float ratio       = 1.0f;
                    if (displayManager.VectorMode)
                    {
                        IntSize2 rigidParentSize = view.Container.RigidParentWorkingSize;
                        if (rigidParentSize.Height != lastWorkingParentHeight)
                        {
                            ratio = rigidParentSize.Height / (float)Slideshow.BaseSlideScale * displayManager.AdditionalZoomMultiple;
                            lastWorkingParentHeight = rigidParentSize.Height;
                            changeScale             = true;
                        }
                    }
                    else if (lastWorkingParentHeight != int.MaxValue)
                    {
                        ratio                   = displayManager.AdditionalZoomMultiple;
                        changeScale             = true;
                        lastWorkingParentHeight = int.MaxValue;
                    }

                    if (changeScale)
                    {
                        foreach (var host in viewHosts.Values)
                        {
                            SlidePanel panel = masterStrategy.panels[host.View.ElementName];
                            host.changeScale(ratio);
                        }
                    }
                }
            }
Esempio n. 14
0
        private static Rectangle GetBounds(ViewHost dockHost, ViewHost dockClient)
        {
            var loc  = dockHost.PointToScreen(Point.Empty);
            var size = dockHost.Size;

            if (dockHost.IsDocumentWell)
            {
                if (dockClient.IsDocumentWell || (dockClient.ViewsCount == 1 && dockClient.GetView(0).IsDocument))
                {
                    return(new Rectangle(
                               loc.X + (size.Width - 112) / 2,
                               loc.Y + (size.Height - 112) / 2,
                               112, 112));
                }
                else
                {
                    return(new Rectangle(
                               loc.X + (size.Width - 184) / 2,
                               loc.Y + (size.Height - 184) / 2,
                               184, 184));
                }
            }
            else
            {
                return(new Rectangle(
                           loc.X + (size.Width - 112) / 2,
                           loc.Y + (size.Height - 112) / 2,
                           112, 112));
            }
        }
Esempio n. 15
0
        internal PlasticGUIClient(
            WorkspaceInfo wkInfo,
            IViewSwitcher switcher,
            IMergeViewLauncher mergeViewLauncher,
            ViewHost viewHost,
            PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges,
            NewIncomingChangesUpdater developerNewIncomingChangesUpdater,
            GluonNewIncomingChangesUpdater gluonNewIncomingChangesUpdater,
            EditorWindow parentWindow,
            GuiMessage.IGuiMessage guiMessage)
        {
            mWkInfo            = wkInfo;
            mSwitcher          = switcher;
            mMergeViewLauncher = mergeViewLauncher;
            mViewHost          = viewHost;
            mPendingChanges    = pendingChanges;
            mDeveloperNewIncomingChangesUpdater = developerNewIncomingChangesUpdater;
            mGluonNewIncomingChangesUpdater     = gluonNewIncomingChangesUpdater;
            mPlasticWindow = parentWindow;
            mGuiMessage    = guiMessage;

            ((IWorkspaceWindow)this).UpdateTitle();

            mCheckedStateManager = new CheckedStateManager();

            mDeveloperProgressOperationHandler = new Developer.ProgressOperationHandler(mWkInfo, this);
            mGluonProgressOperationHandler     = new Gluon.ProgressOperationHandler(this);
        }
 void ViewHost_ViewResized(ViewHost obj)
 {
     if (ViewResized != null)
     {
         ViewResized.Invoke(obj);
     }
 }
Esempio n. 17
0
 public LAPAssignmentView()
 {
     InitializeComponent();
     assignmentViewHost      = new ViewHost();
     assignmentViewHost.Dock = DockStyle.Fill;
     assignmentViewHost.ViewsLabelVisible = true;
     splitContainer.Panel2.Controls.Add(assignmentViewHost);
 }
Esempio n. 18
0
        internal PendingChangesTab(
            WorkspaceInfo wkInfo,
            ViewHost viewHost,
            bool isGluonMode,
            WorkspaceWindow workspaceWindow,
            IViewSwitcher switcher,
            IMergeViewLauncher mergeViewLauncher,
            IHistoryViewLauncher historyViewLauncher,
            PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges,
            NewIncomingChangesUpdater developerNewIncomingChangesUpdater,
            GluonNewIncomingChangesUpdater gluonNewIncomingChangesUpdater,
            IAssetStatusCache assetStatusCache,
            NotificationDrawer notificationDrawer,
            EditorWindow parentWindow)
        {
            mWkInfo              = wkInfo;
            mViewHost            = viewHost;
            mIsGluonMode         = isGluonMode;
            mWorkspaceWindow     = workspaceWindow;
            mHistoryViewLauncher = historyViewLauncher;
            mPendingChanges      = pendingChanges;
            mDeveloperNewIncomingChangesUpdater = developerNewIncomingChangesUpdater;
            mGluonNewIncomingChangesUpdater     = gluonNewIncomingChangesUpdater;
            mAssetStatusCache    = assetStatusCache;
            mNotificationDrawer  = notificationDrawer;
            mParentWindow        = parentWindow;
            mGuiMessage          = new UnityPlasticGuiMessage(parentWindow);
            mMergeViewLauncher   = mergeViewLauncher;
            mCheckedStateManager = new CheckedStateManager();

            mNewChangesInWk = NewChangesInWk.Build(
                mWkInfo,
                new BuildWorkspacekIsRelevantNewChange());

            BuildComponents(isGluonMode, parentWindow);

            mBorderColor = EditorGUIUtility.isProSkin
                ? (Color) new Color32(35, 35, 35, 255)
                : (Color) new Color32(153, 153, 153, 255);

            mProgressControls = new ProgressControlsForViews();

            workspaceWindow.RegisterPendingChangesProgressControls(mProgressControls);

            mPendingChangesOperations = new PendingChangesOperations(
                mWkInfo,
                workspaceWindow,
                switcher,
                mergeViewLauncher,
                this,
                mProgressControls,
                workspaceWindow,
                null,
                null,
                null);

            InitIgnoreRulesAndRefreshView(mWkInfo.ClientPath, this);
        }
Esempio n. 19
0
        /// <summary>Create <see cref="ViewHostTabs"/>.</summary>
        internal ViewHostTabs(ViewHost viewHost, AnchorStyles side)
        {
            Verify.Argument.IsNotNull(viewHost, "viewHost");

            _viewHost = viewHost;
            _viewHost.ActiveViewChanged += OnActiveViewChanged;

            SetStyle(
                ControlStyles.ContainerControl |
                ControlStyles.Selectable |
                ControlStyles.SupportsTransparentBackColor,
                false);
            SetStyle(
                ControlStyles.UserPaint |
                ControlStyles.ResizeRedraw |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer,
                true);

            _side = side;

            _tabs = new List <ViewHostTab>();
            foreach (var view in viewHost.Views)
            {
                _tabs.Add(new ViewHostTab(this, view));
            }
            if (_tabs.Count != 0)
            {
                int length = 0;
                foreach (var tab in _tabs)
                {
                    tab.ResetLength(GraphicsUtility.MeasurementGraphics);
                    length += tab.Length;
                }
                _length = length;
            }

            _tabHover      = new TrackingService <ViewHostTab>(OnTabHoverChanged);
            _areaHover     = new TrackingService <object>(OnAreaHoverChanged);
            _areaMouseDown = -1;
            if (viewHost.IsDocumentWell)
            {
                var tabHeight       = Renderer.TabHeight;
                var tabFooterHeight = Renderer.TabFooterHeight;
                _leftButtons = new ViewButtons(this)
                {
                    Height = tabHeight + tabFooterHeight,
                };
                _leftButtons.ButtonClick += OnViewButtonClick;
                _rightButtons             = new ViewButtons(this)
                {
                    Height = tabHeight + tabFooterHeight,
                };
                _rightButtons.SetAvailableButtons(ViewButtonType.TabsMenu);
                _rightButtons.ButtonClick += OnViewButtonClick;
            }
            _floatId = -1;
        }
Esempio n. 20
0
        public ViewHostDockMarker(ViewHost dockHost, ViewHost dockClient)
            : base(dockHost, dockClient, GetButtons(dockHost, dockClient), GetBorder(dockHost, dockClient), GetBounds(dockHost, dockClient))
        {
            _dockHost = dockHost;

            Region                    = GetRegion(dockHost, dockClient);
            dockHost.Resize          += OnHostBoundsChanged;
            dockHost.LocationChanged += OnHostBoundsChanged;
        }
 void ViewHost_ViewResized(ViewHost viewHost)
 {
     if (allowResizeEvents)
     {
         allowResizeEvents = false;
         positionResizeWidget();
         allowResizeEvents = true;
     }
 }
Esempio n. 22
0
        public ViewDockSideTab(ViewDockSide side, ViewHost viewHost, ViewBase view)
            : base(view, Utility.InvertAnchor(side.Side))
        {
            Verify.Argument.IsNotNull(side, "side");
            Verify.Argument.IsNotNull(viewHost, "viewHost");

            _side     = side;
            _viewHost = viewHost;
        }
Esempio n. 23
0
        public ViewDockSideTab(ViewDockSide side, ViewHost viewHost, ViewBase view)
            : base(view, Utility.InvertAnchor(side.Side))
        {
            Verify.Argument.IsNotNull(side, nameof(side));
            Verify.Argument.IsNotNull(viewHost, nameof(viewHost));

            Side     = side;
            ViewHost = viewHost;
        }
Esempio n. 24
0
        public override void execute(AnomalousMvcContext context)
        {
            ViewHost viewHost = context.findViewHost(View);

            if (viewHost != null)
            {
                context.queueCloseView(viewHost);
            }
        }
 public SingleObjectiveProgrammableProblemView()
 {
     InitializeComponent();
     ScriptView = new ViewHost()
     {
         ViewsLabelVisible = false, Dock = DockStyle.Fill
     };
     Controls.Add(ScriptView);
 }
Esempio n. 26
0
        public ViewHeaderMenu(ViewHost viewHost, ViewBase view)
        {
            Verify.Argument.IsNotNull(viewHost, nameof(viewHost));
            Verify.Argument.IsNotNull(view, nameof(view));

            _host = viewHost;
            _view = view;

            Items.Add(new ToolStripMenuItem(Resources.StrClose, null, (s, e) => _view.Close()));
        }
        private void BuildCodeByViewSchema(object item)
        {
            SOView          view       = item as SOView;
            List <SOColumn> columnList = DbSchemaHelper.Instance.CurrentSchema.GetViewColumnList(view);

            //生成代码文件
            ViewHost host = new ViewHost();

            host.View         = view;
            host.ColumnList   = columnList;
            host.TemplateFile = templateFile;

            foreach (object obj in listBox3.Items)
            {
                string[] ss = obj.ToString().Split('|');

                host.SetValue(ss[0], ss[1].Replace("[<->]", "|"));
            }

            Engine engine = new Engine();

            string fileName  = string.Empty;
            string separator = txtFileNamePrefix.Text.Trim();

            if (separator != "")
            {
                fileName = string.Format("{0}{1}", view.Name.RemovePrefix(separator, 10), host.FileExtention);
            }
            else
            {
                fileName = string.Format("{0}{1}", view.Name, host.FileExtention);
            }

            string outputContent = engine.ProcessTemplate(File.ReadAllText(templateFile), host);
            string outputFile    = Path.Combine(outputPath, fileName);

            StringBuilder sb = new StringBuilder();

            if (host.ErrorCollection.HasErrors)
            {
                foreach (CompilerError err in host.ErrorCollection)
                {
                    sb.AppendLine(err.ToString());
                }
                outputContent = outputContent + Environment.NewLine + sb.ToString();
                outputFile    = outputFile + ".error";
            }

            if (Directory.Exists(outputPath) == false)
            {
                Directory.CreateDirectory(outputPath);
            }
            File.WriteAllText(outputFile, outputContent, Encoding.UTF8);
        }
Esempio n. 28
0
 /// <summary>Creates the markers.</summary>
 /// <param name="dockClient">The dock client.</param>
 /// <returns>Created markers.</returns>
 protected override ViewHostDockMarker[] CreateMarkers(ViewHost dockClient)
 {
     if (_dockHost.IsDocumentWell || (!dockClient.IsDocumentWell && !(dockClient.ViewsCount == 1 && dockClient.GetView(0).IsDocument)))
     {
         return(new ViewHostDockMarker[] { new ViewHostDockMarker(_dockHost, dockClient) });
     }
     else
     {
         return(null);
     }
 }
 public ViewHost createViewHost(View view, AnomalousMvcContext context)
 {
     foreach (ViewHostFactory factory in subFactories)
     {
         ViewHost host = factory.createViewHost(view, context);
         if (host != null)
         {
             return(host);
         }
     }
     return(null);
 }
Esempio n. 30
0
            public HostEntry(ViewHost viewHost)
                : this()
            {
                Verify.Argument.IsNotNull(viewHost, nameof(viewHost));

                _isRoot         = viewHost.IsRoot;
                _isDocumentWell = viewHost.IsDocumentWell;
                foreach (var view in viewHost.Views)
                {
                    _views.Add(new ViewEntry(view));
                }
            }