Пример #1
0
 protected virtual void SetAppIcon(IntPtr window, string filename)
 {
     try
     {
         filename = IconHandler.IconFullPath(filename);
         if (!string.IsNullOrWhiteSpace(filename))
         {
             IntPtr error = IntPtr.Zero;
             gtk_window_set_icon_from_file(window, filename, out error);
             if (error != IntPtr.Zero)
             {
                 Logger.Instance.Log.Error("Icon handle not successfully freed.");
             }
         }
     }
     catch (Exception exception)
     {
         Logger.Instance.Log.Error(exception);
     }
 }
Пример #2
0
 public void SetAppIcon(IntPtr window, string filename)
 {
     try
     {
         filename = IconHandler.IconFullPath(filename);
         if (string.IsNullOrWhiteSpace(filename))
         {
             IntPtr error = IntPtr.Zero;
             NativeMethods.gtk_window_set_icon_from_file(window, filename, out error);
             if (error != IntPtr.Zero)
             {
                 Log.Error("Icon handle not successfully freed.");
             }
         }
     }
     catch (Exception exception)
     {
         Log.Error(exception);
     }
 }
Пример #3
0
 public void SetAppIcon(IntPtr window, string filename)
 {
     try
     {
         IntPtr ptrToAnsi = IconHandler.IconFileToPtr(filename);
         if (ptrToAnsi != IntPtr.Zero)
         {
             IntPtr error = IntPtr.Zero;
             NativeMethods.gtk_window_set_icon_from_file(window, ptrToAnsi, out error);
             Marshal.FreeCoTaskMem(ptrToAnsi);
             if (error != IntPtr.Zero)
             {
                 Log.Error("Icon handle not successfully freed.");
             }
         }
     }
     catch (Exception exception)
     {
         Log.Error(exception);
     }
 }