private void axPageLayoutControl1_OnPageLayoutReplaced(object sender, ESRI.ArcGIS.Controls.IPageLayoutControlEvents_OnPageLayoutReplacedEvent e)
		{
			//Get the file path
			string sFilePath = txbMxPath.Text;
			//Validate and load the Mx document
			if (m_PageLayoutControl.CheckMxFile(sFilePath))
			{
				m_PageLayoutControl.LoadMxFile(sFilePath,Type.Missing);
			}
		}
Пример #2
0
        private void axPageLayoutControl1_OnPageLayoutReplaced(object sender, ESRI.ArcGIS.Controls.IPageLayoutControlEvents_OnPageLayoutReplacedEvent e)
        {
            //Get the frame containing the focus map
            IFrameProperties frameProperties = (IFrameProperties)axPageLayoutControl1.GraphicsContainer.FindFrame(axPageLayoutControl1.ActiveView.FocusMap);

            //Create a new ServerStyleGalleryItem with its name set
            IStyleGalleryItem styleGalleryItem = new ServerStyleGalleryItemClass();

            styleGalleryItem.Name = "myStyle";

            ISymbologyStyleClass styleClass;


            //Get the background style class and remove any custom style
            styleClass = axSymbologyControl1.GetStyleClass(esriSymbologyStyleClass.esriStyleClassBackgrounds);
            if (styleClass.GetItem(0).Name == "myStyle")
            {
                styleClass.RemoveItem(0);
            }
            if (frameProperties.Background != null)
            {
                //Set the background into the style gallery item
                styleGalleryItem.Item = frameProperties.Background;
                //Add the item to the style class
                styleClass.AddItem(styleGalleryItem, 0);
            }

            //Get the border style class and remove any custom style
            styleClass = axSymbologyControl1.GetStyleClass(esriSymbologyStyleClass.esriStyleClassBorders);
            if (styleClass.GetItem(0).Name == "myStyle")
            {
                styleClass.RemoveItem(0);
            }
            if (frameProperties.Border != null)
            {
                //Set the border into the style gallery item
                styleGalleryItem.Item = frameProperties.Border;
                //Add the item to the style class
                styleClass.AddItem(styleGalleryItem, 0);
            }

            //Get the shadow style class and remove any custom style
            styleClass = axSymbologyControl1.GetStyleClass(esriSymbologyStyleClass.esriStyleClassShadows);
            if (styleClass.GetItem(0).Name == "myStyle")
            {
                styleClass.RemoveItem(0);
            }
            if (frameProperties.Shadow != null)
            {
                //Set the shadow into the style gallery item
                styleGalleryItem.Item = frameProperties.Shadow;
                //Add the item to the style class
                styleClass.AddItem(styleGalleryItem, 0);
            }
        }
 private void axPageLayoutControl1_OnPageLayoutReplaced(object sender, ESRI.ArcGIS.Controls.IPageLayoutControlEvents_OnPageLayoutReplacedEvent e)
 {
     //when a document gets loaded into the PageLayoutControl enable the draw legend button
     cmdDraw.Enabled = true;
 }
 private void axPageLayoutControl1_OnPageLayoutReplaced(object sender, ESRI.ArcGIS.Controls.IPageLayoutControlEvents_OnPageLayoutReplacedEvent e)
 {
     m_bReplacedPageLayout = true;
     ListMaps();
 }