public virtual IEnumerable <RejectedApplicationJumpItem> Apply() { if (InteractionHelper.IsInDesignMode(this)) { return new RejectedApplicationJumpItem[] { } } ; jumpActionsManager.BeginUpdate(); try { foreach (JumpItem jumpItem in nativeJumpList) { ApplicationJumpItemWrapper.FillWrapProperties(jumpItem); ApplicationJumpTaskWrap jumpTask = jumpItem as ApplicationJumpTaskWrap; if (jumpTask != null) { jumpActionsManager.RegisterAction(jumpTask, CommandLineArgumentPrefix, GetLauncherPath); } } IEnumerable <Tuple <JumpItem, JumpItemRejectionReason> > nativeRejectedItems = nativeJumpList.Apply() ?? new Tuple <JumpItem, JumpItemRejectionReason>[] { }; return(nativeRejectedItems.Select(i => new RejectedApplicationJumpItem(ApplicationJumpItemWrapper.Unwrap(i.Item1), i.Item2)).ToArray()); } finally { jumpActionsManager.EndUpdate(); } }
protected virtual ApplicationJumpItemInfo GetItem(int index) { if (InteractionHelper.IsInDesignMode(this)) { return(designModeItems[index]); } return(ApplicationJumpItemWrapper.Unwrap(nativeJumpList[index])); }
protected virtual bool ContainsItem(ApplicationJumpItemInfo item) { if (InteractionHelper.IsInDesignMode(this)) { return(designModeItems.Contains(item)); } return(nativeJumpList.Contains(ApplicationJumpItemWrapper.Wrap(item))); }
protected virtual IEnumerable <ApplicationJumpItemInfo> GetItems() { if (InteractionHelper.IsInDesignMode(this)) { return(designModeItems); } return(nativeJumpList.Select(i => ApplicationJumpItemWrapper.Unwrap(i))); }
protected virtual int ItemsCount() { if (InteractionHelper.IsInDesignMode(this)) { return(designModeItems.Count); } return(nativeJumpList.Count); }
public virtual void AddToRecentCategory(string jumpPath) { if (InteractionHelper.IsInDesignMode(this)) { return; } nativeJumpList.AddToRecentCategory(jumpPath); }
protected virtual int IndexOfItem(ApplicationJumpItemInfo item) { if (InteractionHelper.IsInDesignMode(this)) { return(designModeItems.IndexOf(item)); } return(nativeJumpList.IndexOf(ApplicationJumpItemWrapper.Wrap(item))); }
bool ShouldAttachItem(T item) { if (!InteractionHelper.IsInDesignMode(AssociatedObject)) { return(true); } return(!InteractionHelper.IsInDesignMode(item)); }
protected virtual void ClearItems() { if (InteractionHelper.IsInDesignMode(this)) { designModeItems.Clear(); return; } nativeJumpList.Clear(); }
protected virtual void RemoveItemAt(int index) { if (InteractionHelper.IsInDesignMode(this)) { designModeItems.RemoveAt(index); return; } nativeJumpList.RemoveAt(index); }
protected virtual void InsertItem(int index, ApplicationJumpItemInfo item) { if (InteractionHelper.IsInDesignMode(this)) { designModeItems.Insert(index, item); return; } nativeJumpList.Insert(index, PrepareItem(item, null)); }
protected virtual void AddItem(ApplicationJumpItemInfo item) { if (InteractionHelper.IsInDesignMode(this)) { designModeItems.Add(item); return; } nativeJumpList.Add(PrepareItem(item, null)); }
protected virtual void SetItem(int index, ApplicationJumpItemInfo item) { if (InteractionHelper.IsInDesignMode(this)) { designModeItems[index] = item; return; } nativeJumpList[index] = PrepareItem(item, nativeJumpList[index]); }
protected virtual ApplicationJumpTaskInfo Find(string commandId) { if (InteractionHelper.IsInDesignMode(this)) { return(null); } ApplicationJumpTaskWrap task = (ApplicationJumpTaskWrap)nativeJumpList.Find(commandId); return(task == null ? null : task.ApplicationJumpTask); }
protected ApplicationJumpListService(INativeJumpList nativeJumpList, IJumpActionsManager jumpActionsManager) { IconStorage = CreateDefaultIconStorage(); jumpList = new ApplicationJumpList(this); Items = new ApplicationJumpItemCollectionInternal(this); if (InteractionHelper.IsInDesignMode(this)) { return; } this.nativeJumpList = nativeJumpList ?? currentNativeJumpList; this.jumpActionsManager = jumpActionsManager ?? JumpActionsManager.Current; }
bool ShouldAttachItem(T item) { if (InteractionHelper.GetEnableBehaviorsInDesignTime(AssociatedObject)) { return(true); } if (!InteractionHelper.IsInDesignMode(AssociatedObject)) { return(true); } return(!InteractionHelper.IsInDesignMode(item)); }
public virtual bool AddOrReplace(ApplicationJumpTaskInfo jumpTask) { if (InteractionHelper.IsInDesignMode(this)) { designModeItems.Add(jumpTask); return(true); } ApplicationJumpTaskWrap jumpTaskWrap = new ApplicationJumpTaskWrap(jumpTask); PrepareTask(jumpTaskWrap); ISupportInitialize itemInit = jumpTask; itemInit.EndInit(); JumpItem existingItem = nativeJumpList.Find(jumpTask.CommandId); if (existingItem != null) { nativeJumpList[nativeJumpList.IndexOf(existingItem)] = jumpTaskWrap; return(false); } nativeJumpList.Add(jumpTaskWrap); return(true); }