public void Add(SolidEdgeFramework.SolidEdgeDocument document, EdgeBarControl control, int imageId) { if (document == null) { throw new ArgumentNullException("document"); } if (control == null) { throw new ArgumentNullException("control"); } var options = (int)SolidEdgeConstants.EdgeBarConstant.DONOT_MAKE_ACTIVE; int hWnd = 0; if (_addIn.EdgeBarEx2 != null) { hWnd = _addIn.EdgeBarEx2.AddPageEx(document, _addIn.NativeResourcesDllPath, imageId, control.ToolTip, options); } else if (_addIn.EdgeBarEx != null) { hWnd = _addIn.EdgeBarEx.AddPageEx(document, _addIn.NativeResourcesDllPath, imageId, control.ToolTip, options); } if (hWnd != 0) { var edgeBarPage = new EdgeBarPage(hWnd, document, control); _edgeBarPages.Add(edgeBarPage); } }
public void Initialize(EdgeBarPage edgeBarPage) { if (edgeBarPage == null) { throw new ArgumentNullException("edgeBarPage"); } if (_edgeBarPage != null) { throw new InvalidOperationException("Control has already been initialized."); } _edgeBarPage = edgeBarPage; AfterInitialize?.Invoke(this, null); }