コード例 #1
0
ファイル: GameObject.cs プロジェクト: ldh9451/XLE
 /// <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);
 }
コード例 #2
0
ファイル: Curve.cs プロジェクト: JanDeHud/LevelEditor
        /// <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);
        }
コード例 #3
0
ファイル: Locator.cs プロジェクト: arsaccol/LevelEditor
        /// <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;
        }
コード例 #4
0
ファイル: OpaqueAdapters.cs プロジェクト: ldh9451/XLE
 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;
 }
コード例 #5
0
ファイル: Locator.cs プロジェクト: BeRo1985/LevelEditor
 /// <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;
 }
コード例 #6
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 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;
                }
            }
コード例 #7
0
ファイル: PaletteClient.cs プロジェクト: vincenthamm/ATF
 /// <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);
     }
 }
コード例 #8
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)
            {
                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;
                }
            }
コード例 #9
0
ファイル: EventContext.cs プロジェクト: vincenthamm/ATF
        /// <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 };
        }
コード例 #10
0
            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;
                }
            }
コード例 #11
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
                    };
                }
            }
コード例 #12
0
ファイル: EnvUtility.cs プロジェクト: ldh9451/XLE
 public void GetInfo(ItemInfo info)
 {
     info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList());
     info.Label = "EnvUtility";
 }
コード例 #13
0
ファイル: ModulePlugin.cs プロジェクト: jethac/ATF
 /// <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;
     }
 }
コード例 #14
0
ファイル: XLEEnvAdapter.cs プロジェクト: coreafive/XLE
 public void GetInfo(ItemInfo info)
 {
     info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList());
     info.Label = "Settings: " + Name;
 }
コード例 #15
0
ファイル: PrototypingContext.cs プロジェクト: Joxx0r/ATF
 /// <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;
         }
     }
 }
コード例 #16
0
ファイル: TreeView.cs プロジェクト: sbambach/ATF
        /// <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");
        }
コード例 #17
0
ファイル: GameContext.cs プロジェクト: arsaccol/LevelEditor
        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;
        }
コード例 #18
0
ファイル: TemplatingContext.cs プロジェクト: vincenthamm/ATF
 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;
         }
     }
 }
コード例 #19
0
ファイル: Slot.cs プロジェクト: JanDeHud/LevelEditor
 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;
 }
コード例 #20
0
ファイル: VegetationSpawnGob.cs プロジェクト: coreafive/XLE
 public void GetInfo(ItemInfo info)
 {
     info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList());
     info.Label = "VegetationSpawnConfig";
 }
コード例 #21
0
ファイル: GameEditor.cs プロジェクト: calciferol/LevelEditor
        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());
            }
        }
コード例 #22
0
ファイル: TreeView.cs プロジェクト: Joxx0r/ATF
        /// <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;
                }
            }
        }
コード例 #23
0
ファイル: FileViewer.cs プロジェクト: Joxx0r/ATF
            /// <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);
            }
コード例 #24
0
ファイル: GameObjectFolder.cs プロジェクト: ldh9451/XLE
        /// <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);
        }
コード例 #25
0
ファイル: XLEEnvAdapter.cs プロジェクト: coreafive/XLE
 public void GetInfo(ItemInfo info)
 {
     info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList());
     info.Label = "EnvSettingsFolder";
 }
コード例 #26
0
ファイル: EventSequenceContext.cs プロジェクト: sbambach/ATF
 /// <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 };
 }
コード例 #27
0
ファイル: BookmarkingContext.cs プロジェクト: ldh9451/XLE
 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);
     }
 }
コード例 #28
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 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;
         }
     }
 }