예제 #1
0
        void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    if ((_control != null) && (!_control.IsDisposed))
                    {
                        try
                        {
                            _control.Dispose();
                        }
                        catch
                        {
                        }
                    }
                }

                try
                {
                    ReleaseHandle();
                }
                catch
                {
                }

                _control  = null;
                _document = null;
                _disposed = true;
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        internal EdgeBarPage(IntPtr hWnd, SolidEdgeFramework.SolidEdgeDocument document, EdgeBarControl control)
        {
            _document = document;

            _control = control;
            _control.Initialize(this);

            this.AssignHandle(hWnd);

            // Reparent child control to this hWnd.
            SetParent(_control.Handle, this.Handle);

            // Show the child control and maximize it to fill the entire EdgeBarPage region.
            ShowWindow(_control.Handle, 3 /* SHOWMAXIMIZED */);
        }
예제 #4
0
 internal EdgeBarPage(int hWnd, SolidEdgeFramework.SolidEdgeDocument document, EdgeBarControl control)
     : this(new IntPtr(hWnd), document, control)
 {
 }
예제 #5
0
 internal EdgeBarPage(int hWnd, EdgeBarControl control)
     : this(new IntPtr(hWnd), null, control)
 {
 }