SetVisualAttribute ( RunSetVisualAttributeCommandEventArgs e ) { Debug.Assert(e != null); AssertValid(); Microsoft.Office.Interop.Excel.Range oSelectedRange; if (e.VisualAttributeSet || !m_oSheets1And2Helper.TryGetSelectedRange(out oSelectedRange)) { return; } // See if the specified attribute is set by the helper class. m_oSheets1And2Helper.SetVisualAttribute(e, oSelectedRange, VertexTableColumnNames.Color, CommonTableColumnNames.Alpha); if (e.VisualAttributeSet) { return; } if (e.VisualAttribute == VisualAttributes.VertexShape) { Debug.Assert(e.AttributeValue is VertexShape); ExcelTableUtil.SetVisibleSelectedTableColumnData( this.Vertices.InnerObject, oSelectedRange, VertexTableColumnNames.Shape, (new VertexShapeConverter()).GraphToWorkbook( (VertexShape)e.AttributeValue) ); e.VisualAttributeSet = true; } else if (e.VisualAttribute == VisualAttributes.VertexRadius) { VertexRadiusDialog oVertexRadiusDialog = new VertexRadiusDialog(); if (oVertexRadiusDialog.ShowDialog() == DialogResult.OK) { ExcelTableUtil.SetVisibleSelectedTableColumnData( this.Vertices.InnerObject, oSelectedRange, VertexTableColumnNames.Radius, oVertexRadiusDialog.VertexRadius); e.VisualAttributeSet = true; } } else if (e.VisualAttribute == VisualAttributes.VertexVisibility) { Debug.Assert(e.AttributeValue is VertexWorksheetReader.Visibility); ExcelTableUtil.SetVisibleSelectedTableColumnData( this.Vertices.InnerObject, oSelectedRange, CommonTableColumnNames.Visibility, (new VertexVisibilityConverter()).GraphToWorkbook( (VertexWorksheetReader.Visibility)e.AttributeValue) ); e.VisualAttributeSet = true; } }
SetVisualAttribute ( RunSetVisualAttributeCommandEventArgs e ) { Debug.Assert(e != null); AssertValid(); Microsoft.Office.Interop.Excel.Range oSelectedRange; if ( e.VisualAttributeSet || !m_oSheets1And2Helper.TryGetSelectedRange(out oSelectedRange) ) { return; } // See if the specified attribute is set by the helper class. m_oSheets1And2Helper.SetVisualAttribute(e, oSelectedRange, VertexTableColumnNames.Color, CommonTableColumnNames.Alpha); if (e.VisualAttributeSet) { return; } if (e.VisualAttribute == VisualAttributes.VertexShape) { Debug.Assert(e.AttributeValue is VertexShape); ExcelTableUtil.SetVisibleSelectedTableColumnData( this.Vertices.InnerObject, oSelectedRange, VertexTableColumnNames.Shape, ( new VertexShapeConverter() ).GraphToWorkbook( (VertexShape)e.AttributeValue) ); e.VisualAttributeSet = true; } else if (e.VisualAttribute == VisualAttributes.VertexRadius) { VertexRadiusDialog oVertexRadiusDialog = new VertexRadiusDialog(); if (oVertexRadiusDialog.ShowDialog() == DialogResult.OK) { ExcelTableUtil.SetVisibleSelectedTableColumnData( this.Vertices.InnerObject, oSelectedRange, VertexTableColumnNames.Radius, oVertexRadiusDialog.VertexRadius); e.VisualAttributeSet = true; } } else if (e.VisualAttribute == VisualAttributes.VertexVisibility) { Debug.Assert(e.AttributeValue is VertexWorksheetReader.Visibility); ExcelTableUtil.SetVisibleSelectedTableColumnData( this.Vertices.InnerObject, oSelectedRange, CommonTableColumnNames.Visibility, ( new VertexVisibilityConverter() ).GraphToWorkbook( (VertexWorksheetReader.Visibility)e.AttributeValue) ); e.VisualAttributeSet = true; } }