예제 #1
0
        /// <summary>
        /// Loads the SurveyTreeControl from the current document
        /// </summary>
        protected void LoadWindow()
        {
            ToolWindowDiagramView diagramView    = myDiagramView;
            LinkLabel             watermarkLabel = myWatermarkLabel;

            if (diagramView == null)
            {
                ContainerControl container = new ContainerControl();
                myDiagramView = diagramView = new ToolWindowDiagramView(this);
                diagramView.DiagramClientView.DiagramDisassociating += new EventHandler(DiagramDisassociatingEvent);
                myWatermarkLabel                       = watermarkLabel = new SafeLinkLabel();
                watermarkLabel.Dock                    = DockStyle.Fill;
                watermarkLabel.Site                    = diagramView.Site;
                watermarkLabel.TextAlign               = ContentAlignment.MiddleCenter;
                watermarkLabel.BackColor               = SystemColors.ControlLight;
                watermarkLabel.ForeColor               = SystemColors.ControlText;
                watermarkLabel.LinkClicked            += new LinkLabelLinkClickedEventHandler(WatermarkLinkClicked);
                container.Site                         = diagramView.Site;
                diagramView.BackColor                  = SystemColors.Window;
                diagramView.Dock                       = DockStyle.Fill;
                diagramView.ContextMenuRequestedEvent += new EventHandler <DiagramMouseEventArgs>(this.DesignerContextMenuRequested);
                diagramView.Visible                    = false;
                DiagramClientView clientView = diagramView.DiagramClientView;
                clientView.ZoomChanged        += new ZoomChangedEventHandler(this.DesignerZoomChanged);
                clientView.TakeFocusOnDragOver = true;
                container.SuspendLayout();
                container.Controls.Add(diagramView);
                container.Controls.Add(watermarkLabel);
                container.ResumeLayout();
                Guid commandSetId = typeof(ORMDesignerEditorFactory).GUID;
                Frame.SetGuidProperty((int)__VSFPROPID.VSFPROPID_InheritKeyBindings, ref commandSetId);
            }
            ORMDesignerDocData currentDocument = this.CurrentDocument;
            Store newStore = (currentDocument != null) ? currentDocument.Store : null;
            Store oldStore = myStore;

            if (oldStore != newStore)
            {
                myDiagramSetChanged = true;
                myStore             = newStore;
                AdjustVisibility(false, false);
            }
        }
예제 #2
0
		/// <summary>
		/// Loads the SurveyTreeControl from the current document
		/// </summary>
		protected void LoadWindow()
		{
			ToolWindowDiagramView diagramView = myDiagramView;
			LinkLabel watermarkLabel = myWatermarkLabel;
			if (diagramView == null)
			{
				ContainerControl container = new ContainerControl();
				myDiagramView = diagramView = new ToolWindowDiagramView(this);
				diagramView.DiagramClientView.DiagramDisassociating += new EventHandler(DiagramDisassociatingEvent);
				myWatermarkLabel = watermarkLabel = new SafeLinkLabel();
				watermarkLabel.Dock = DockStyle.Fill;
				watermarkLabel.Site = diagramView.Site;
				watermarkLabel.TextAlign = ContentAlignment.MiddleCenter;
				watermarkLabel.BackColor = SystemColors.ControlLight;
				watermarkLabel.ForeColor = SystemColors.ControlText;
				watermarkLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(WatermarkLinkClicked);
				container.Site = diagramView.Site;
				diagramView.BackColor = SystemColors.Window;
				diagramView.Dock = DockStyle.Fill;
				diagramView.ContextMenuRequestedEvent += new EventHandler<DiagramMouseEventArgs>(this.DesignerContextMenuRequested);
				diagramView.Visible = false;
				DiagramClientView clientView = diagramView.DiagramClientView;
				clientView.ZoomChanged += new ZoomChangedEventHandler(this.DesignerZoomChanged);
				clientView.TakeFocusOnDragOver = true;
				container.SuspendLayout();
				container.Controls.Add(diagramView);
				container.Controls.Add(watermarkLabel);
				container.ResumeLayout();
				Guid commandSetId = typeof(ORMDesignerEditorFactory).GUID;
				Frame.SetGuidProperty((int)__VSFPROPID.VSFPROPID_InheritKeyBindings, ref commandSetId);
			}
			ORMDesignerDocData currentDocument = this.CurrentDocument;
			Store newStore = (currentDocument != null) ? currentDocument.Store : null;
			Store oldStore = myStore;
			if (oldStore != newStore)
			{
				myDiagramSetChanged = true;
				myStore = newStore;
				AdjustVisibility(false, false);
			}
		}