private void LoadToolbarControlItems(string filePath)
        {
            //Create a MemoryBlobStream
            IBlobStream blobStream = new MemoryBlobStream();
            //Get the IStream interface
            IStream stream = blobStream;

            //Load the stream from the file
            blobStream.LoadFromFile(filePath);
            //Load the stream into the ToolbarControl
            axToolbarControl1.LoadItems(stream);
        }
Beispiel #2
0
        public override void OnClick()
        {
            if (m_DialogOpenGlobe.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    IGlobe pGlobe = m_globeHookHelper.Globe;
                    IObjectStream pObjectStream = new ObjectStream();
                    IMemoryBlobStream pMemorysBlobStream = new MemoryBlobStream();
                    pMemorysBlobStream.LoadFromFile(m_DialogOpenGlobe.FileName);
                    IPersistStream pPersistStream = pGlobe as IPersistStream;
                    pObjectStream.Stream = pMemorysBlobStream;
                    pPersistStream.Load(pObjectStream);

                    m_globeHookHelper.GlobeDisplay.RefreshViewers();
                    m_globeHookHelper.ActiveViewer.Redraw(true);
                    (pGlobe as IActiveView).Refresh();
                }
                catch (Exception exp)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show(string.Format("抱歉,加载操作出现意外错误,信息:{0}", exp.Message));
                }
            }
        }
Beispiel #3
0
        public override void OnClick()
        {
            if (m_DialogOpenGlobe.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    IGlobe            pGlobe             = m_globeHookHelper.Globe;
                    IObjectStream     pObjectStream      = new ObjectStream();
                    IMemoryBlobStream pMemorysBlobStream = new MemoryBlobStream();
                    pMemorysBlobStream.LoadFromFile(m_DialogOpenGlobe.FileName);
                    IPersistStream pPersistStream = pGlobe as IPersistStream;
                    pObjectStream.Stream = pMemorysBlobStream;
                    pPersistStream.Load(pObjectStream);

                    m_globeHookHelper.GlobeDisplay.RefreshViewers();
                    m_globeHookHelper.ActiveViewer.Redraw(true);
                    (pGlobe as IActiveView).Refresh();
                }
                catch (Exception exp)
                {
                    DevExpress.XtraEditors.XtraMessageBox.Show(string.Format("抱歉,加载操作出现意外错误,信息:{0}", exp.Message));
                }
            }
        }