Exemplo n.º 1
0
 internal static void CheckResult(CarbonMenuStatus result)
 {
     if (result != CarbonMenuStatus.Ok)
     {
         throw new CarbonMenuException(result);
     }
 }
Exemplo n.º 2
0
        public static ushort InsertMenuSeparator(IntPtr parentRef, ushort afterItemIndex)
        {
            CarbonMenuStatus result = InsertMenuItemTextWithCFString(parentRef, IntPtr.Zero, afterItemIndex, MenuItemAttributes.Separator, 0);

            CheckResult(result);
            return((ushort)(afterItemIndex + 1));
        }
Exemplo n.º 3
0
        public static ushort AppendMenuSeparator(IntPtr parentRef)
        {
            ushort           index;
            CarbonMenuStatus result = AppendMenuItemTextWithCFString(parentRef, IntPtr.Zero, MenuItemAttributes.Separator, 0, out index);

            CheckResult(result);
            return(index);
        }
Exemplo n.º 4
0
        public static void SetMenuItemText(IntPtr menuRef, ushort index, string title)
        {
            IntPtr           str    = CoreFoundation.CreateString(title);
            CarbonMenuStatus result = SetMenuItemTextWithCFString(menuRef, index, str);

            CoreFoundation.Release(str);
            CheckResult(result);
        }
Exemplo n.º 5
0
        public static void SetMenuTitle(IntPtr menuRef, string title)
        {
            IntPtr           str    = CoreFoundation.CreateString(title);
            CarbonMenuStatus result = SetMenuTitleWithCFString(menuRef, str);

            CoreFoundation.Release(str);
            CheckResult(result);
        }
Exemplo n.º 6
0
        public static ushort InsertMenuItem(IntPtr parentRef, string title, ushort afterItemIndex, MenuItemAttributes attributes, uint commandId)
        {
            IntPtr           str    = CoreFoundation.CreateString(title);
            CarbonMenuStatus result = InsertMenuItemTextWithCFString(parentRef, str, afterItemIndex, attributes, commandId);

            CoreFoundation.Release(str);
            CheckResult(result);
            return((ushort)(afterItemIndex + 1));
        }
Exemplo n.º 7
0
        public static ushort AppendMenuItem(IntPtr parentRef, string title, MenuItemAttributes attributes, uint commandId)
        {
            ushort           index;
            IntPtr           str    = CoreFoundation.CreateString(title);
            CarbonMenuStatus result = AppendMenuItemTextWithCFString(parentRef, str, attributes, commandId, out index);

            CoreFoundation.Release(str);
            CheckResult(result);
            return(index);
        }
		public CarbonMenuException (CarbonMenuStatus result)
		{
			this.Result = result;
		}
		internal static void CheckResult (CarbonMenuStatus result)
		{
			if (result != CarbonMenuStatus.Ok)
				throw new CarbonMenuException (result);
		}
Exemplo n.º 10
0
 public CarbonMenuException(CarbonMenuStatus result)
 {
     this.Result = result;
 }