Beispiel #1
0
 public static void InitTextures(List <clsTextureGroup> list_0, bool bool_0)
 {
     try
     {
         foreach (clsTextureGroup current in list_0)
         {
             clsTextureGroup clsTextureGroup = current;
             short           num             = 0;
             while ((int)num < clsTextureGroup.TexturePaths.Count)
             {
                 bool flag = clsTextureGroup.Symbols.Count < (int)(num + 1) || clsTextureGroup.AspectRatios.Count < (int)(num + 1) || clsTextureGroup.SymbolIsDirty.Count < (int)(num + 1) || (bool_0 && clsTextureGroup.SymbolIsDirty[(int)num]) || !bool_0 || clsTextureGroup.SymbolIsDirty[(int)num];
                 if (flag)
                 {
                     IPictureFillSymbol pictureFillSymbol = new PictureFillSymbol();
                     if (clsTextureGroup.TexturePaths[(int)num].IndexOf('[') == 0)
                     {
                         string text = clsTextureGroup.TexturePaths[(int)num].Substring(1, clsTextureGroup.TexturePaths[(int)num].Length - 2);
                         text = System.Windows.Forms.Application.StartupPath + "\\" + text + ".bmp";
                         pictureFillSymbol.CreateFillSymbolFromFile(esriIPictureType.esriIPictureBitmap, text);
                     }
                     else
                     {
                         pictureFillSymbol.CreateFillSymbolFromFile(esriIPictureType.esriIPictureBitmap, clsTextureGroup.TexturePaths[(int)num]);
                     }
                     clsTextureGroup.Symbols.Add(pictureFillSymbol as ISymbol);
                     int    height = pictureFillSymbol.Picture.Height;
                     int    width  = pictureFillSymbol.Picture.Width;
                     double item   = (double)height / (double)width;
                     clsTextureGroup.AspectRatios.Add(item);
                 }
                 num += 1;
             }
             clsTextureGroup.RoofSymbol = (new SimpleFillSymbol
             {
                 Color = new RgbColor
                 {
                     RGB = clsTextureGroup.RoofColorRGB
                 }
             } as ISymbol);
             short num2 = 0;
             while ((int)num2 < clsTextureGroup.Symbols.Count)
             {
                 clsTextureGroup.SymbolIsDirty.Add(false);
                 num2 += 1;
             }
         }
     }
     catch
     {
     }
 }
Beispiel #2
0
 public void Init()
 {
     for (int i = 0; i < this.TexturePaths.Count; i++)
     {
         bool flag = this.Symbols.Count <= i || this.AspectRatios.Count <= i || this.SymbolIsDirty.Count <= i || this.SymbolIsDirty[i] || this.SymbolIsDirty[i];
         if (flag)
         {
             IPictureFillSymbol pictureFillSymbol = new PictureFillSymbol();
             if (this.TexturePaths[i].IndexOf('[') == 0)
             {
                 string text = this.TexturePaths[i].Substring(1, this.TexturePaths[i].Length - 2);
                 text = System.Windows.Forms.Application.StartupPath + "\\" + text + ".bmp";
                 pictureFillSymbol.CreateFillSymbolFromFile(esriIPictureType.esriIPictureBitmap, text);
             }
             else
             {
                 pictureFillSymbol.CreateFillSymbolFromFile(esriIPictureType.esriIPictureBitmap, this.TexturePaths[i]);
             }
             this.Symbols.Add(pictureFillSymbol as ISymbol);
             double num  = (double)pictureFillSymbol.Picture.Height;
             double num2 = (double)pictureFillSymbol.Picture.Width;
             double item = num / num2;
             this.AspectRatios.Add(item);
         }
     }
     this.RoofSymbol = (new SimpleFillSymbol
     {
         Color = new RgbColor
         {
             RGB = this.RoofColorRGB
         }
     } as ISymbol);
     for (int j = 0; j < this.Symbols.Count; j++)
     {
         this.SymbolIsDirty.Add(false);
     }
 }