/// <summary> /// Gets display info (label, icon, ...) for the ProjectLister and other controls</summary> /// <param name="info">Item info: passed in and modified by this method</param> public virtual void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); info.Label = Name; if (IsLocked) info.StateImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.LockImage); }
/// <summary> /// Gets display info (label, icon, ...) for the ProjectLister and other controls</summary> /// <param name="info">Item info: passed in and modified by this method</param> public override void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); info.Label = Name; info.IsLeaf = ControlPoints.Count == 0; if (IsLocked) info.StateImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.LockImage); }
/// <summary> /// Provides info for the ProjectLister tree view and other controls</summary> /// <param name="info">Item info passed in and modified by the method</param> public override void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); if (Reference != null && Reference.Target != null && Reference.Target.Uri != null) info.Label = string.Format("{0}: {1}", Name, Path.GetFileName(Reference.Target.Uri.LocalPath)); else info.Label = Name; if (IsLocked) info.StateImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.LockImage); info.IsLeaf = false; }
public void GetInfo(ItemInfo info) { info.ImageIndex = info.GetImageList().Images.IndexOfKey(LevelEditorCore.Resources.CubesImage); info.Label = DomNode.Type.GetTag("OpaqueListable") as string; info.Label = info.Label ?? "<<opaque>>"; info.IsLeaf = false; }
/// <summary> /// Provides info for the ProjectLister tree view and other controls</summary> /// <param name="info">Item info passed in and modified by the method</param> public override void GetInfo(ItemInfo info) { base.GetInfo(info); info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); if (Reference != null && Reference.Target != null && Reference.Target.Uri != null) info.Label = string.Format("{0}: {1}", Name, Path.GetFileName(Reference.Target.Uri.LocalPath)); else info.Label = Name; info.IsLeaf = false; }
/// <summary> /// Gets item's display information</summary> /// <param name="item">Item being displayed</param> /// <param name="info">Item info, to fill out</param> public void GetInfo(object item, ItemInfo info) { object value = ((Tree <object>)item).Value; if (value is string) { info.Label = (string)value; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.FolderImage); info.AllowSelect = false; } else { UserSettingsInfo settingsInfo = value as UserSettingsInfo; info.Label = settingsInfo.Name; info.AllowLabelEdit = false; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.PreferencesImage); info.IsLeaf = true; } }
/// <summary> /// Gets display information for the item</summary> /// <param name="item">Item</param> /// <param name="info">Information object, which client can fill out</param> void IPaletteClient.GetInfo(object item, ItemInfo info) { DomNodeType nodeType = (DomNodeType)item; NodeTypePaletteItem paletteItem = nodeType.GetTag<NodeTypePaletteItem>(); if (paletteItem != null) { info.Label = paletteItem.Name; info.Description = paletteItem.Description; info.ImageIndex = info.GetImageList().Images.IndexOfKey(paletteItem.ImageName); } }
/// <summary> /// Gets item's display information</summary> /// <param name="item">Item being displayed</param> /// <param name="info">Item info, to fill out</param> public virtual void GetInfo(object item, ItemInfo info) { IResourceFolder resourceFolder = item.As <IResourceFolder>(); if (resourceFolder != null) { info.Label = resourceFolder.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.FolderImage); info.AllowLabelEdit = !resourceFolder.ReadOnlyName; info.IsLeaf = resourceFolder.Folders.Count == 0; } }
/// <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) { Resource resource = Adapters.As<Resource>(item); info.Label = resource.Name; string type = null; if (resource.DomNode.Type == Schema.animationResourceType.Type) type = Resources.AnimationImage; else if (resource.DomNode.Type == Schema.geometryResourceType.Type) type = Resources.GeometryImage; info.ImageIndex = info.GetImageList().Images.IndexOfKey(type); info.Properties = new object[] { resource.Size }; }
public void GetInfo(object item, Sce.Atf.Applications.ItemInfo info) { DirectoryInfo directoryInfo = item as DirectoryInfo; if (directoryInfo != null) { info.Label = directoryInfo.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.ComputerImage); DirectoryInfo[] directories = GetSubDirectories(directoryInfo); info.IsLeaf = directories != null && directories.Length == 0; } }
/// <summary> /// Gets item's display information</summary> /// <param name="item">Item being displayed</param> /// <param name="info">Item info, to fill out</param> public virtual void GetInfo(object item, ItemInfo info) { Uri resourceUri = ResourceLister.GetUriFromTag(item); if (resourceUri != null) { FileInfo fileInfo = new FileInfo(resourceUri.LocalPath); info.Label = fileInfo.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.ResourceImage); Shell32.SHFILEINFO shfi = new Shell32.SHFILEINFO(); uint flags = Shell32.SHGFI_TYPENAME | Shell32.SHGFI_USEFILEATTRIBUTES; Shell32.SHGetFileInfo(fileInfo.FullName, Shell32.FILE_ATTRIBUTE_NORMAL, ref shfi, (uint)System.Runtime.InteropServices.Marshal.SizeOf(shfi), flags); string typeName = shfi.szTypeName; long length; DateTime lastWriteTime; try { length = fileInfo.Length; lastWriteTime = fileInfo.LastWriteTime; } catch (IOException) { length = 0; lastWriteTime = new DateTime(); } info.Properties = new object[] { length, typeName, lastWriteTime }; } }
public void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); info.Label = "EnvUtility"; }
/// <summary> /// Gets display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Info object, which client can fill out</param> void IPaletteClient.GetInfo(object item, ItemInfo info) { var paletteItem = (NodeTypePaletteItem)item; if (paletteItem != null) { info.Label = paletteItem.Name; info.Description = paletteItem.Description; info.ImageIndex = info.GetImageList().Images.IndexOfKey(paletteItem.ImageName); info.HoverText = paletteItem.Description; } }
public void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); info.Label = "Settings: " + Name; }
/// <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) { PrototypeFolder category = Adapters.As<PrototypeFolder>(item); if (category != null) { info.Label = category.Name; } else { Prototype prototype = Adapters.As<Prototype>(item); if (prototype != null) { info.Label = prototype.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.StatechartDocImage); info.IsLeaf = true; } } }
/// <summary> /// Gets item's display information</summary> /// <param name="item">Item being displayed</param> /// <param name="info">Item info, to fill out</param> public void GetInfo(object item, ItemInfo info) { DomNode node = item as DomNode; if (node != null) { if (node.Type == UISchema.UIRefType.Type) { info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.RefImage); string label = string.Empty; UIRef uiRef = node.As<UIRef>(); UIObject uiTarget = uiRef.UIObject; if (uiTarget != null) label = uiTarget.Name; info.Label = "[" + label + "]"; } else if (node.Is<Curve>()) { Curve cv = node.Cast<Curve>(); info.Label = string.IsNullOrWhiteSpace(cv.DisplayName) ? cv.Name : cv.DisplayName; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.CurveImage); } else { NodeTypePaletteItem paletteItem = node.Type.GetTag<NodeTypePaletteItem>(); if (paletteItem != null) { info.ImageIndex = info.GetImageList().Images.IndexOfKey(paletteItem.ImageName); } info.Label = node.GetId(); } info.IsLeaf = !GetChildren(item).Any(); } else { EmptyRef emptyRef = item as EmptyRef; if (emptyRef != null) { info.Label = "Ref"; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.RefEmptyImage); info.IsLeaf = true; } } if (string.IsNullOrEmpty(info.Label)) throw new ArgumentException("info.lable"); }
public void GetInfo(object item, ItemInfo info) { IListable listable = item.As<IListable>(); if (listable != null) { listable.GetInfo(info); return; } IResource resource = item.As<IResource>(); if (resource != null && !item.Is<Game>()) { info.Label = Path.GetFileName(resource.Uri.LocalPath); info.ImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.ResourceImage); return; } // If the object has a name use it as the label (overriding whatever may have been set previously) INameable nameable = Adapters.As<INameable>(item); if (nameable != null) info.Label = nameable.Name; }
public virtual void GetInfo(object item, ItemInfo info) { var folder = item.As<TemplateFolder>(); if (folder != null) { info.Label = folder.Name; //if (folder.) info.ImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.FolderIcon); } else { var template = item.As<Template>(); if (template != null) { info.Label = template.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.ComponentImage); info.IsLeaf = true; } } }
public void GetInfo(ItemInfo info) { info.Label = string.Format("[{0}]", ChildInfo != null ? ChildInfo.Name : "<missing>"); info.ImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.ReferenceNullImage); info.IsLeaf = true; }
public void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); info.Label = "VegetationSpawnConfig"; }
void IPaletteClient.GetInfo(object item, ItemInfo info) { DomNodeType nodeType = item as DomNodeType; if (nodeType != null) { NodeTypePaletteItem paletteItem = nodeType.GetTag<NodeTypePaletteItem>(); if (paletteItem != null) { info.Label = paletteItem.Name; info.Description = paletteItem.Description; info.ImageIndex = info.GetImageList().Images.IndexOfKey(paletteItem.ImageName); } if (info.ImageIndex == -1) info.ImageIndex = Util.GetTypeImageIndex(nodeType, info.GetImageList()); } }
/// <summary> /// Gets item's display information</summary> /// <param name="item">Item being displayed</param> /// <param name="info">Item info, to fill out</param> public void GetInfo(object item, ItemInfo info) { DomNode node = item as DomNode; if (node != null) { if (node.Type == UISchema.UIRefType.Type) { info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.RefImage); string label = string.Empty; UIRef uiRef = node.As<UIRef>(); UIObject uiTarget = uiRef.UIObject; if (uiTarget != null) label = uiTarget.Name; info.Label = "[" + label + "]"; } else { NodeTypePaletteItem paletteItem = node.Type.GetTag<NodeTypePaletteItem>(); if (paletteItem != null) { info.ImageIndex = info.GetImageList().Images.IndexOfKey(paletteItem.ImageName); info.Label = node.GetId(); } } info.IsLeaf = !Enumerable.Any(GetChildren(item)); return; } else { EmptyRef emptyRef = item as EmptyRef; if (emptyRef != null) { info.Label = "Ref"; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.RefEmptyImage); info.IsLeaf = true; } } }
/// <summary> /// Gets display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Display info for item</param> public void GetInfo(object item, ItemInfo info) { // set the first column info (name) FileSystemInfo fileSystemInfo = item as FileSystemInfo; if (fileSystemInfo is DirectoryInfo) { info.Label = fileSystemInfo.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.FolderImage); } else if (fileSystemInfo is FileInfo) { info.Label = fileSystemInfo.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.DocumentImage); info.IsLeaf = true; } // set the 2nd and 3nd columns info (size and creation time) info.Properties = new string[m_fileDataExtensions.Length-1]; for (int i = 0; i < info.Properties.Length; i++) info.Properties[i] = m_fileDataExtensions[i+1].GetValue(fileSystemInfo); }
/// <summary> /// Gets display info (label, icon, ...) for the ProjectLister and other controls</summary> /// <param name="info">Item info: passed in and modified by this method</param> public void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); info.Label = Name; info.IsLeaf = (GameObjects.Count == 0) && (GameObjectFolders.Count == 0); if (IsLocked) info.StateImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.LockImage); }
public void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); info.Label = "EnvSettingsFolder"; }
/// <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) { Event _event = item.As<Event>(); info.Label = _event.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.EventImage); info.Properties = new object[] { _event.Duration }; }
public void GetInfo(object item, ItemInfo info) { Bookmark bookmark = Adapters.As<Bookmark>(item); if (bookmark != null) { info.Label = bookmark.Name; info.HasCheck = false; info.IsLeaf = bookmark.Bookmarks.Count == 0; info.ImageIndex = info.GetImageList().Images.IndexOfKey(LevelEditorCore.Resources.BookmarkImage); } }
/// <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 virtual void GetInfo(object item, ItemInfo info) { var folder = item.As<TemplateFolder>(); if (folder != null) { info.Label = folder.Name; if (folder.Url != null) { info.ImageIndex = info.GetImageList().Images.IndexOfKey(info.IsExpandedInView ? Sce.Atf.Resources.ReferenceFolderOpen : Sce.Atf.Resources.ReferenceFolderClosed); info.HoverText = info.Description = folder.Url.LocalPath; } else info.ImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.FolderIcon); } else { var template = item.As<Template>(); if (template != null) { info.Label = template.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.ComponentImage); info.IsLeaf = true; } } }