private void UnloadAllAssets(IAssetFolder folder) { /*foreach (IResource asset in folder.Assets) * asset.Unload(); * * foreach (IAssetFolder subFolder in folder.Folders) * UnloadAllAssets(subFolder);*/ }
/// <summary> /// Gets an enumeration of the children of the given parent object</summary> /// <param name="parent">Parent object</param> /// <returns>Enumeration of children of the parent object</returns> public IEnumerable <object> GetChildren(object parent) { IAssetFolder folder = Adapters.As <IAssetFolder>(parent); foreach (IAssetFolder childfolder in folder.Folders) { yield return(childfolder); } }
private void SetCurrentAssetFolder(IAssetFolder assetFolder) { if (m_currentAssetFolder != assetFolder) { m_currentAssetFolder = assetFolder; m_requestedThumbs.Clear(); RefreshRightPane(); } }
private void AddExistingAsset() { string path = null; DialogResult result = m_fileDialogService.OpenFileName(ref path, Localizer.Localize("All Files") + " (*.*)|*.*"); if (result == DialogResult.OK) { IAssetFolder parent = m_currentAssetFolder; IResource asset = parent.CreateAsset(); asset.Uri = new Uri(path); //OnObjectInserted(new ItemInsertedEventArgs<object>(parent.Assets.Count - 1, asset, parent)); } }
/// <summary> /// Fills in or modifies the given display info for the item /// </summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { IAssetFolder assetFolder = item as IAssetFolder; if (assetFolder != null) { string label = assetFolder.Name; info.Label = label; info.AllowLabelEdit = false; //info.ImageIndex = info.ImageList.Images.IndexOfKey(Sce.Atf.Resources.DataImage); } }
/// <summary> /// Called after selection changed /// </summary> /// <param name="sender">Sender</param> /// <param name="e">Event args</param> void selection_Changed(object sender, EventArgs e) { Selection selection = (Selection)sender; List <Path <object> > newSelection = selection.LastSelected as List <Path <object> >; if (newSelection != null && newSelection.Count > 0) { IAssetFolder assetFolder = newSelection[0].Last as IAssetFolder; if (assetFolder != null) { SetCurrentAssetFolder(assetFolder); } } }
public AssetFile(IHttpClientFactory http, IAssetFolder folder) { _http = http; _folder = folder; }