예제 #1
0
 private void cbImageFormat_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         if (this.ExportOptions.SupportedFormats == null)
         {
             MSCRasterService mSCRasterService = this.ThisService as MSCRasterService;
             if (mSCRasterService != null)
             {
                 try
                 {
                     this.ExportOptions.SupportedFormats = mSCRasterService.ParentService.SupportedImageTypes.ToArray();
                 }
                 catch
                 {
                 }
             }
             if (this.ExportOptions.SupportedFormats == null)
             {
                 this.ExportOptions.SupportedFormats = DocUtil.CADSupportedImageFormats;
             }
         }
         if (string.IsNullOrEmpty(this.ExportOptions.Format))
         {
             this.ExportOptions.Format = "PNG24";
         }
         ComboBox comboBox = (ComboBox)sender;
         comboBox.ItemsSource   = this.ExportOptions.SupportedFormats;
         comboBox.SelectedValue = this.ExportOptions.Format;
     }
     catch
     {
     }
 }
        public string SuggestExportName()
        {
            string text = this.CurrentFileName;
            string result;

            try
            {
                string formatFileExtension = MSCRasterService.GetFormatFileExtension(this.ExportOptions.Format);
                text   = this.Name;
                text   = Path.ChangeExtension(text, formatFileExtension);
                result = text;
            }
            catch
            {
                result = text;
            }
            return(result);
        }
        public ServicePropertyEditor(MSCRasterService rs)
        {
            this.mscRasterService = rs;
            AGSRasterService parentService = rs.ParentService;

            if (parentService == null)
            {
                throw new Exception("Service not connected");
            }
            this.InitializeComponent();
            this.localRasterService = (AGSRasterService)Utility.CloneObject(parentService);
            this.localRasterService.ExportOptions = (AGSExportOptions)Utility.CloneObject(rs.ExportOptions);
            this.localRasterService.ExportOptions.Transparency = rs.GetTransparency();
            this.localRasterService.ExportOptions.Dynamic      = rs.Dynamic;
            this.spProps.SetService(this.localRasterService, rs.ExportOptions);
            this.spProps.ExtentOptions.Add(AfaStrings.Current, rs.BoundaryExtent);
            this.spProps.cbBoundingBoxTypes.SelectedIndex = this.spProps.ExtentOptions.Count - 1;
        }