Exemplo n.º 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;
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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 */);
        }
Exemplo n.º 4
0
 internal EdgeBarPage(int hWnd, SolidEdgeFramework.SolidEdgeDocument document, EdgeBarControl control)
     : this(new IntPtr(hWnd), document, control)
 {
 }
Exemplo n.º 5
0
 internal EdgeBarPage(int hWnd, EdgeBarControl control)
     : this(new IntPtr(hWnd), null, control)
 {
 }