/// <summary>
 /// 返回ICO
 /// </summary>
 /// <param name="resxname"></param>
 /// <returns></returns>
 public System.Drawing.Icon GetIco(string resxname)
 {
     if (resxname.IsNullOrEmptyOrSpace()) return null;
     var stream = GetType().Assembly.GetManifestResourceStream("App.Resx.ICO." + resxname);
     if (stream == null)
     {
         return null;
     }
     var icon = new System.Drawing.Icon(stream);
     return icon.IsEmptyIcon() ? null : icon;
 }
 /// <summary>
 /// 返回ICO
 /// </summary>
 /// <param name="icoResxName"></param>
 /// <returns></returns>
 public System.Drawing.Icon GetIco(string icoResxName)
 {
     #region 返回ICO
     if (icoResxName.IsNullOrEmptyOrSpace()) return null;
     using (var stream = GetType().Assembly.GetManifestResourceStream("App.Resx.ICO." + icoResxName))
     {
         if (stream == null)
         {
             return null;
         }
         var icon = new System.Drawing.Icon(stream);
         return icon.IsEmptyIcon() ? null : icon;
     }
     #endregion
 }
Exemple #3
0
        /// <summary>
        /// 返回ICO
        /// </summary>
        /// <param name="resxname"></param>
        /// <returns></returns>
        public System.Drawing.Icon GetIco(string resxname)
        {
            if (resxname.IsNullOrEmptyOrSpace())
            {
                return(null);
            }
            var stream = GetType().Assembly.GetManifestResourceStream("App.Resx.ICO." + resxname);

            if (stream == null)
            {
                return(null);
            }
            var icon = new System.Drawing.Icon(stream);

            return(icon.IsEmptyIcon() ? null : icon);
        }