Example #1
0
		public static ThemedIcon NewWithDefaultFallbacks(string iconname)
		{
			IntPtr native_iconname = GLib.Marshaller.StringToPtrGStrdup (iconname);
			ThemedIcon result = new ThemedIcon (g_themed_icon_new_with_default_fallbacks(native_iconname));
			GLib.Marshaller.Free (native_iconname);
			return result;
		}
Example #2
0
        public static ThemedIcon NewWithDefaultFallbacks(string iconname)
        {
            IntPtr native_iconname = GLib.Marshaller.StringToPtrGStrdup(iconname);
            var    result          = new ThemedIcon(g_themed_icon_new_with_default_fallbacks(native_iconname));

            GLib.Marshaller.Free(native_iconname);
            return(result);
        }
Example #3
0
        public static ThemedIcon NewFromNames(string iconnames)
        {
            var result = new ThemedIcon(g_themed_icon_new_from_names(GLib.Marshaller.StringToPtrGStrdup(iconnames), System.Text.Encoding.UTF8.GetByteCount(iconnames)));

            return(result);
        }
		/// <summary>
		/// Returns the string name of the supplied icon.
		/// </summary>
		/// <param name="icon">
		/// A <see cref="GLib.Icon"/>
		/// </param>
		/// <returns>
		/// A <see cref="System.String"/>
		/// </returns>
		public string IconFromGIcon (GLib.Icon icon)
		{
			string name = "";
			if (icon is ThemedIcon) {
				ThemedIcon themeIcon = new ThemedIcon (icon.Handle);
				// if the icon exists in the theme, this will return the relevent icon
				if (themeIcon.Names.Any ())
					name = themeIcon.Names.FirstOrDefault (n => IconTheme.Default.HasIcon (n));
				themeIcon.Dispose ();
				
			} else if (icon is FileIcon) {
				// in some cases, devices provide their own icon.  This will use the device icon.
				FileIcon iconFile = new FileIcon (icon.Handle);
				name = iconFile.File.Path;
				iconFile.Dispose ();
			}
			return name;
		}
Example #5
0
		public static ThemedIcon NewFromNames(string iconnames)
		{
			ThemedIcon result = new ThemedIcon (g_themed_icon_new_from_names(GLib.Marshaller.StringToPtrGStrdup(iconnames), System.Text.Encoding.UTF8.GetByteCount (iconnames)));
			return result;
		}