public static class ApplicationOptions
Public MustInherit NotInheritable Class ApplicationOptions
public static class ApplicationOptions
Public MustInherit NotInheritable Class ApplicationOptions
var lastToolActive = ApplicationOptions.LayoutOptions.KeepLastToolActive; var warnOnSurrounds = ApplicationOptions.LayoutOptions.WarnAboutAssociatedSurrounds; //eg <Install_Path>\Resources\LayoutTemplates\en-US var gallery_path = ApplicationOptions.LayoutOptions.LayoutTemplatePath;
//keep graphic element insert tool active ApplicationOptions.LayoutOptions.KeepLastToolActive = true; //no warning when deleting a map frame results in other elements being deleted ApplicationOptions.LayoutOptions.WarnAboutAssociatedSurrounds = false; //path to .pagx files used as templates ApplicationOptions.LayoutOptions.LayoutTemplatePath = @"D:\data\layout_templates";
//Note: see also SymbolFactory.Instance.GetAvailableFonts() which returns the //same list. Use for TextAndGraphicsElementsOptions.GetAvailableFonts() convenience QueuedTask.Run(() => { //A list of tuples of Font name + associated Font Styles, one tuple per //font, is returned var fonts = ApplicationOptions.TextAndGraphicsElementsOptions.GetAvailableFonts(); StringBuilder sb = new StringBuilder(); sb.AppendLine("Pro Fonts\r\n============================"); foreach (var font in fonts) { var styles = string.Join(",", font.fontStyles); sb.AppendLine($"{font.fontName}, [{styles}]"); } System.Diagnostics.Debug.WriteLine(sb.ToString()); });
QueuedTask.Run(() => { //Get the default font (see also 'SymbolFactory.Instance.DefaultFont') var def_font = ApplicationOptions.TextAndGraphicsElementsOptions.GetDefaultFont(); System.Diagnostics.Debug.WriteLine( $"\r\ndefault font: {def_font.fontName}, {def_font.styleName}"); //Get the default graphics element symbols - point, line, poly, text var ptSymbol = ApplicationOptions.TextAndGraphicsElementsOptions.GetDefaultPointSymbol(); var lineSymbol = ApplicationOptions.TextAndGraphicsElementsOptions.GetDefaultLineSymbol(); var polySymbol = ApplicationOptions.TextAndGraphicsElementsOptions.GetDefaultPolygonSymbol(); var textSymbol = ApplicationOptions.TextAndGraphicsElementsOptions.GetDefaultTextSymbol(); });
QueuedTask.Run(() => { //Set a default font. Use its default style ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultFont("tahoma"); //or specify an explicit style ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultFont("tahoma", "bold"); //Create symbols var ptSymbol2 = SymbolFactory.Instance.ConstructPointSymbol( ColorFactory.Instance.RedRGB, 14, SimpleMarkerStyle.Diamond); var lineSymbol2 = SymbolFactory.Instance.ConstructLineSymbol( ColorFactory.Instance.RedRGB, 2, SimpleLineStyle.Dash); var polySymbol2 = SymbolFactory.Instance.ConstructPolygonSymbol( ColorFactory.Instance.RedRGB, SimpleFillStyle.DiagonalCross); var textSymbol2 = SymbolFactory.Instance.ConstructTextSymbol( ColorFactory.Instance.RedRGB, 12); //Set default point, line, poly, text graphics element symbols ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultPointSymbol(ptSymbol2); ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultLineSymbol(lineSymbol2); ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultPolygonSymbol(polySymbol2); ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultTextSymbol(textSymbol2); });
System.Object
ArcGIS.Desktop.Core.ApplicationOptions
Target Platforms: Windows 11, Windows 10