/// <summary> /// update library item /// </summary> /// <param name="item"></param> public virtual bool Update(T item) { if (item != null && !string.IsNullOrEmpty(item.Name)) { int length = Count; for (int i = 0; i < length; i++) { if (string.Equals(this[i].Name, item.Name)) { //this[i].Dispose(); //this[i] = null; ILockLibraryItem locker = this[i] as ILockLibraryItem; if (locker != null) { item.Id = this[i].Id; locker.FromTo(item as ILockLibraryItem, locker.LockCount); } else { this[i] = item; } MessageBus.Send(this, new EntityChangedMessage <T>(new T[] { item }, EntityAction.Update)); return(true); } } } return(false); }
public void FromTo(ILockLibraryItem locker, int lockCounter) { FileLibraryItem item = locker as FileLibraryItem; this._path = item._path; this.Name = item.Name; }
public virtual void FromTo(ILockLibraryItem locker, int lockCounter) { InternalFromTo(locker as MemoryLibraryItem); }
public override void FromTo(ILockLibraryItem locker, int lockCounter) { base.FromTo(locker, lockCounter); InternalFromTo(locker as TimeSliceGroupInfo); }
public override void FromTo(ILockLibraryItem locker, int lockCounter) { base.FromTo(locker, lockCounter); InternalFromTo(locker as PlaylistInfo); }