Changeset 984 for trunk/CrypPluginBase


Ignore:
Timestamp:
Dec 13, 2009, 3:56:35 PM (12 years ago)
Author:
Thomas Schmid
Message:
  • changed exception handling in ContextMenuHelper, because previous error message was inapprehensible and did not guide plugin developers to the source of the problem
  • fixed defect #86: Context menu attribute referenced some non existing icons. Changed error message for this case - see prev. line.
  • new bins
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPluginBase/PluginExtension.cs

    r947 r984  
    325325          try
    326326          {
    327             string icon = type.GetPluginInfoAttribute().Icons[index];           
    328             int sIndex = icon.IndexOf('/');
    329             Image img = new Image();
    330             img.Source = BitmapFrame.Create(new Uri(string.Format("pack://application:,,,/{0};component/{1}", icon.Substring(0, sIndex), icon.Substring(sIndex + 1))));
    331             return img;
     327            return GetImageWithoutLogMessage(type, index);
    332328          }
    333329          catch (Exception exception)
     
    339335            return null;
    340336          }
     337        }
     338
     339        public static Image GetImageWithoutLogMessage(this Type type, int index)
     340        {
     341          string icon = type.GetPluginInfoAttribute().Icons[index];
     342          int sIndex = icon.IndexOf('/');
     343          Image img = new Image();
     344          img.Source = BitmapFrame.Create(new Uri(string.Format("pack://application:,,,/{0};component/{1}", icon.Substring(0, sIndex), icon.Substring(sIndex + 1))));
     345          return img;
    341346        }
    342347
Note: See TracChangeset for help on using the changeset viewer.