/// <summary> /// Get items. /// </summary> /// <returns>All items.</returns> #else /// <summary> /// アイテムを取得します。 /// </summary> /// <returns>アイテム。</returns> #endif public WPFContextMenuItem[] GetItems() { var count = (int)Target.App[typeof(WPFContextMenu), "GetItemCount"](Target, OpenByKey).Core; var items = new WPFContextMenuItem[count]; for (int i = 0; i < count; i++) { items[i] = new WPFContextMenuItem(Target, OpenByKey, new object[] { i }); } return(items); }
/// <summary> /// Get items. /// </summary> /// <returns>All items.</returns> #else /// <summary> /// アイテムを取得します。 /// </summary> /// <returns>アイテム。</returns> #endif public WPFContextMenuItem[] GetItems() { var count = (int)Target.App[GetType(), "GetItemCount"](Target).Core; var items = new WPFContextMenuItem[count]; for (int i = 0; i < count; i++) { items[i] = new WPFContextMenuItem(Target, new int[] { i }); } return(items); }
/// <summary> /// Get items. /// </summary> /// <returns>All items.</returns> #else /// <summary> /// アイテムを取得します。 /// </summary> /// <returns>アイテム。</returns> #endif public WPFContextMenuItem[] GetItems() { using (var item = GetItem()) { var count = (int)item.Item.App[GetType(), "GetItemCount"](item.Item).Core; var items = new WPFContextMenuItem[count]; for (int i = 0; i < count; i++) { var next = new List <int>(_indices); next.Add(i); items[i] = new WPFContextMenuItem(_target, next.ToArray()); } return(items); } }
/// <summary> /// Get items. /// </summary> /// <returns>All items.</returns> #else /// <summary> /// アイテムを取得します。 /// </summary> /// <returns>アイテム。</returns> #endif public WPFContextMenuItem[] GetItems() { var count = (int)Target.App[GetType(), "GetItemCount"](Target).Core; var items = new WPFContextMenuItem[count]; for (int i = 0; i < count; i++) { items[i] = new WPFContextMenuItem(Target, new int[] { i }); } return items; }
/// <summary> /// Get items. /// </summary> /// <returns>All items.</returns> #else /// <summary> /// アイテムを取得します。 /// </summary> /// <returns>アイテム。</returns> #endif public WPFContextMenuItem[] GetItems() { using (var item = GetItem()) { var count = (int)item.Item.App[GetType(), "GetItemCount"](item.Item).Core; var items = new WPFContextMenuItem[count]; for (int i = 0; i < count; i++) { var next = new List<int>(_indices); next.Add(i); items[i] = new WPFContextMenuItem(_target, next.ToArray()); } return items; } }