TransferToNodeXLWithAxesControl ( NodeXLWithAxesControl nodeXLWithAxesControl ) { Debug.Assert(nodeXLWithAxesControl != null); AssertValid(); Font oAxisFont = this.AxisFont; nodeXLWithAxesControl.SetFont( WpfGraphicsUtil.FontToTypeface(oAxisFont), WpfGraphicsUtil.SystemDrawingFontSizeToWpfFontSize( oAxisFont.Size)); TransferToNodeXLControl(nodeXLWithAxesControl.NodeXLControl); }
//************************************************************************* // Method: CreateNodeXLControl() // /// <summary> /// Creates a NodeXLControl, hooks up its events, and assigns it as the /// child of an ElementHost. /// </summary> /// /// <param name="oGeneralUserSettings"> /// The user's general settings. /// </param> //************************************************************************* protected void CreateNodeXLControl( GeneralUserSettings oGeneralUserSettings ) { Debug.Assert(oGeneralUserSettings != null); // AssertValid(); // Control hierarchy: // // 1. ehElementHost contains a NodeXLWithAxesControl. // // 2. The NodeXLWithAxesControl contains an ExcelTemplateNodeXLControl. // // 3. The ExcelTemplateNodeXLControl is derived from NodeXLControl. oNodeXLControl = new ExcelTemplateNodeXLControl(); m_oNodeXLWithAxesControl = new NodeXLWithAxesControl(oNodeXLControl); m_oNodeXLWithAxesControl.ShowAxes = oGeneralUserSettings.ShowGraphAxes; oNodeXLControl.SelectionChanged += new System.EventHandler(this.oNodeXLControl_SelectionChanged); oNodeXLControl.VerticesMoved += new VerticesMovedEventHandler( this.oNodeXLControl_VerticesMoved); oNodeXLControl.GraphMouseUp += new GraphMouseButtonEventHandler( this.oNodeXLControl_GraphMouseUp); oNodeXLControl.LayingOutGraph += new System.EventHandler( this.oNodeXLControl_LayingOutGraph); oNodeXLControl.GraphLaidOut += new AsyncCompletedEventHandler( this.oNodeXLControl_GraphLaidOut); ehNodeXLControlHost.Child = m_oNodeXLWithAxesControl; }
//************************************************************************* // Method: TransferToNodeXLWithAxesControl() // /// <summary> /// Transfers the settings to a <see cref="NodeXLWithAxesControl" />. /// </summary> /// /// <param name="nodeXLWithAxesControl"> /// Control to transfer the settings to. /// </param> //************************************************************************* public void TransferToNodeXLWithAxesControl( NodeXLWithAxesControl nodeXLWithAxesControl ) { Debug.Assert(nodeXLWithAxesControl != null); AssertValid(); Font oAxisFont = this.AxisFont; nodeXLWithAxesControl.SetFont( WpfGraphicsUtil.FontToTypeface(oAxisFont), WpfGraphicsUtil.WindowsFormsFontSizeToWpfFontSize( oAxisFont.Size) ); TransferToNodeXLControl(nodeXLWithAxesControl.NodeXLControl); }