AddinAssemblyLocation() public static method

public static AddinAssemblyLocation ( ) : string
return string
Exemplo n.º 1
0
        public static string GetLayerFileFromCurrentStandard()
        {
            string layerFileStandard = "2525BChange2"; // this name format is slightly different

            if (ProSymbolUtilities.Standard != SupportedStandardsType.mil2525b)
            {
                layerFileStandard = ProSymbolUtilities.StandardString;
            }

            string layerFileName = "MilitaryOverlay-" + layerFileStandard + ".lpkx";

            string layerFilePath = System.IO.Path.Combine(ProSymbolUtilities.AddinAssemblyLocation(),
                                                          "LayerFiles", layerFileName);

            return(layerFilePath);
        }
Exemplo n.º 2
0
        private void GeneratePreviewSymbol()
        {
            // Step 1: Create a dictionary/map of well known attribute names to values
            Dictionary <string, string> attributeSet = GenerateAttributeSetDictionary();

            // Step 2: Set the SVG Home Folder
            // This should be within the git clone of joint-military-symbology-xml
            // ex: C:\Github\joint-military-symbology-xml\svg\MIL_STD_2525D_Symbols

            // This is called in CheckSettings below, but you should call yourself if
            // reusing this method
            //Utilities.SetImageFilesHome(@"C:\Projects\Github\joint-military-symbology-xml\svg\MIL_STD_2525D_Symbols");

            string militarySymbolsPath = System.IO.Path.Combine(ProSymbolUtilities.AddinAssemblyLocation(), "Images", "MIL_STD_2525D_Symbols");
            bool   pathExists          = Utilities.SetImageFilesHome(militarySymbolsPath);

            if (!Utilities.CheckImageFilesHomeExists())
            //if (!CheckSettings())
            {
                Console.WriteLine("No SVG Folder, can't continue.");
                return;
            }

            // Step 3: Get the Layered Bitmap from the Library
            const int width = 256, height = 256;
            Size      exportSize = new Size(width, height);

            System.Drawing.Bitmap exportBitmap;

            bool success = Utilities.ExportSymbolFromAttributes(attributeSet, out exportBitmap, exportSize);

            if (success && exportBitmap != null)
            {
                _symbolImage = ProSymbolUtilities.BitMapToBitmapImage(exportBitmap);
                NotifyPropertyChanged(() => SymbolImage);
            }

            if (!success || (exportBitmap == null))
            {
                Console.WriteLine("Export failed!");
                _symbolImage = null;
                NotifyPropertyChanged(() => SymbolImage);
                return;
            }
        }