public override TreeNode <object> FindNode(string key) { if (!key.StartsWith(Key)) { return(null); } if (key == Key) { return(this); } var item = MediaLibraryHelper.GetMediaItem(MediaLibraryHelper.GetObjectId(key)); var parentId = new Guid(item.Aspects[ProviderResourceAspect.ASPECT_ID].GetAttributeValue( ProviderResourceAspect.ATTR_PARENT_DIRECTORY_ID).ToString()); BasicContainer parent; if (parentId == Guid.Empty) { parent = new BasicContainer(MediaLibraryHelper.GetBaseKey(key)); } else { parent = new BasicContainer(MediaLibraryHelper.GetBaseKey(key) + ":" + parentId.ToString()); } return((TreeNode <object>)MediaLibraryHelper.InstansiateMediaLibraryObject(item, MediaLibraryHelper.GetBaseKey(key), parent)); }
public MediaLibraryShareContainer(string id) : base(id) { var split = id.IndexOf(':'); BaseKey = MediaLibraryHelper.GetBaseKey(id); ObjectId = MediaLibraryHelper.GetObjectId(id); }