Beispiel #1
0
        private void SaveToolbarControlItems(string filePath)
        {
            IBlobStream blobStream = new MemoryBlobStreamClass();
            IStream     stream     = blobStream;

            axToolbarControl1.SaveItems(stream);
            blobStream.SaveToFile(filePath);
        }
Beispiel #2
0
 private void SaveToolbarControlItems(string filePath)
 {
     //Create a MemoryBlobStream.
     IBlobStream blobStream = new MemoryBlobStreamClass();
     //Get the IStream interface.
     IStream stream = blobStream;
     //Save the ToolbarControl into the stream.
     axToolbarControl1.SaveItems(stream);
     //Save the stream to a file.
     blobStream.SaveToFile(filePath);
 }
        private void SaveToolbarControlItems(string filePath)
        {
            //Create a MemoryBlobStream
            IBlobStream blobStream = new MemoryBlobStreamClass();
            //Get the IStream interface
            IStream stream = blobStream;

            //Save the ToolbarControl into the stream
            axToolbarControl1.SaveItems(stream);
            //Save the stream to a file
            blobStream.SaveToFile(filePath);
        }
Beispiel #4
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            // TODO: Add CmdSaveSceneDoc.OnClick implementation

            for (int i = 0; i < pSceneControl.Scene.LayerCount; i++)
            {
                ILayer pLayer = pSceneControl.Scene.get_Layer(i);
                if (pLayer == pSceneControl.Scene.ActiveGraphicsLayer)
                {
                    pSceneControl.Scene.DeleteLayer(pLayer);
                    pSceneControl.Scene.SceneGraph.RefreshViewers();
                }
            }
            try
            {
                //文件名称
                string         pSaveFileName = "";
                SaveFileDialog pSaveDoc      = new SaveFileDialog();
                pSaveDoc.Title  = "保存工作空间";
                pSaveDoc.Filter = "ArcScene Document(*.sxd)|*.sxd";
                if (pSaveDoc.ShowDialog() == DialogResult.OK)
                {
                    pSaveFileName = pSaveDoc.FileName;
                }

                IMemoryBlobStream pMemoryBlobStream = new MemoryBlobStreamClass();
                IObjectStream     pObjectStream     = new ObjectStreamClass();
                pObjectStream.Stream = pMemoryBlobStream;

                IPersistStream pPersistStream = pSceneControl.Scene as IPersistStream;

                pPersistStream.Save(pObjectStream, 1);

                pMemoryBlobStream.SaveToFile(pSaveFileName);
            }
            catch
            {
            }
        }