CmisSync.UIHelpers.GetIcon C# (CSharp) Method

GetIcon() private method

private GetIcon ( string name, int size ) : Gdk.Pixbuf
name string
size int
return Gdk.Pixbuf
        public static Gdk.Pixbuf GetIcon(string name, int size) {
            IconTheme icon_theme = new IconTheme();
            icon_theme.AppendSearchPath(Path.Combine(UI.AssetsPath, "icons"));

            try {
                return icon_theme.LoadIcon(name, size, IconLookupFlags.GenericFallback);
            } catch {
                try {
                    return icon_theme.LoadIcon("gtk-image-missing", size, IconLookupFlags.GenericFallback);
                } catch {
                    return null;
                }
            }
        }

Same methods

UIHelpers::GetIcon ( string name ) : Icon

Usage Example

示例#1
0
 private void CreateAnimationFrames()
 {
     this.animation_frames = new Icon[] {
         UIHelpers.GetIcon("process-syncing-i"),
         UIHelpers.GetIcon("process-syncing-ii"),
         UIHelpers.GetIcon("process-syncing-iii"),
         UIHelpers.GetIcon("process-syncing-iiii"),
         UIHelpers.GetIcon("process-syncing-iiiii")
     };
 }
All Usage Examples Of CmisSync.UIHelpers::GetIcon