public static JumpItem Wrap(ApplicationJumpItemInfo applicationJumpItem)
        {
            ApplicationJumpTaskInfo applicationJumpTask = applicationJumpItem as ApplicationJumpTaskInfo;

            if (applicationJumpTask != null)
            {
                return(new ApplicationJumpTaskWrap(applicationJumpTask));
            }
            ApplicationJumpPathInfo applicationJumpPath = applicationJumpItem as ApplicationJumpPathInfo;

            if (applicationJumpPath != null)
            {
                return(new ApplicationJumpPathWrap(applicationJumpPath));
            }
            throw new ArgumentException(string.Empty, "applicationJumpItem");
        }
        public void AddPath_CastListToObjectArray()
        {
            ApplicationJumpPathInfo jumpPathInfo = applicationJumpListService.Items.Add("1");

            object[] a = applicationJumpListService.Items.Cast <object>().ToArray();
            Assert.AreEqual(1, a.Length);
            Assert.AreEqual(jumpPathInfo, a[0]);
            IEnumerable items = applicationJumpListService.Items;

            object[] b = items.Cast <object>().ToArray();
            Assert.AreEqual(1, b.Length);
            Assert.AreEqual(jumpPathInfo, b[0]);
            object[] c = ((ApplicationJumpListService)applicationJumpListService).Items.Cast <object>().ToArray();
            Assert.AreEqual(1, c.Length);
            ApplicationJumpPath jumpPath = (ApplicationJumpPath)c[0];

            Assert.AreEqual(jumpPathInfo, ApplicationJumpItem.GetItemInfo(jumpPath));
            Assert.AreEqual(jumpPath, ApplicationJumpItem.GetItem(jumpPathInfo));
        }
Exemplo n.º 3
0
        public static ApplicationJumpItem GetItem(ApplicationJumpItemInfo itemInfo)
        {
            IApplicationJumpItemInfoInternal itemInfoInternal = itemInfo;
            ApplicationJumpItem item = (ApplicationJumpItem)itemInfoInternal.Source;

            if (item != null)
            {
                return(item);
            }
            ApplicationJumpPathInfo jumpPathInfo = itemInfo as ApplicationJumpPathInfo;

            if (jumpPathInfo != null)
            {
                return(new ApplicationJumpPath(jumpPathInfo));
            }
            ApplicationJumpTaskInfo jumpTaskInfo = itemInfo as ApplicationJumpTaskInfo;

            if (jumpTaskInfo != null)
            {
                return(new ApplicationJumpTask(jumpTaskInfo));
            }
            throw new ArgumentException("itemInfo");
        }
 public ApplicationJumpPathWrap(ApplicationJumpPathInfo applicationJumpPath)
 {
     GuardHelper.ArgumentNotNull(applicationJumpPath, "applicationJumpPath");
     ApplicationJumpPath = applicationJumpPath;
 }
 public ApplicationJumpPathWrap(ApplicationJumpPathInfo applicationJumpPath) {
     Guard.ArgumentNotNull(applicationJumpPath, "applicationJumpPath");
     ApplicationJumpPath = applicationJumpPath;
 }
Exemplo n.º 6
0
 public ApplicationJumpPath(ApplicationJumpPathInfo itemInfo) : base(itemInfo)
 {
 }
 public ApplicationJumpPath(ApplicationJumpPathInfo itemInfo) : base(itemInfo) { }