static public void SetOverlay(VCItemStatus status, TreeNode node, TreeView tree) { if (!maps.ContainsKey(status)) { return; } OverlayMap map = maps[status]; if (map.ContainsKey(node.ImageIndex)) { node.SelectedImageIndex = node.ImageIndex = map[node.ImageIndex]; return; } if (tree.ImageList.Images.Count <= node.ImageIndex) { return; } Image original = tree.ImageList.Images[node.ImageIndex]; Bitmap composed = original.Clone() as Bitmap; using (Graphics destination = Graphics.FromImage(composed)) { destination.DrawImage(iconSkin, new Rectangle(0, 0, 16, 16), new Rectangle((int)status * 16, 0, 16, 16), GraphicsUnit.Pixel); } int index = tree.ImageList.Images.Count; tree.ImageList.Images.Add(composed); map[node.ImageIndex] = index; node.SelectedImageIndex = node.ImageIndex = index; }
internal void Reset() { OverlayMap.Reset(); if (currentTree != null) { ResetNodes(currentTree.Nodes); } }
public OverlayManager(FSWatchers fsWatchers) { this.fsWatchers = fsWatchers; FileNode.OnFileNodeRefresh += new FileNodeRefresh(FileNode_OnFileNodeRefresh); DirectoryNode.OnDirectoryNodeRefresh += new DirectoryNodeRefresh(DirectoryNode_OnDirectoryNodeRefresh); OverlayMap.Init(); }
void UpdateNodeStatus(GenericNode node) { if (node.Meta == null) { node.Meta = new Dictionary <string, object>(); } if (!node.Meta.ContainsKey(META_VC)) { LocateVC(node); } IVCManager currentVC = node.Meta[META_VC] as IVCManager; string root = (string)node.Meta[META_ROOT]; if (currentVC != null) { VCItemStatus status = currentVC.GetOverlay(node.BackingPath, root); node.Meta[META_STATUS] = status; OverlayMap.SetOverlay(status, node, currentTree); } }
static public void SetOverlay(VCItemStatus status, TreeNode node, TreeView tree) { if (!maps.ContainsKey(status)) { return; } OverlayMap map = maps[status]; if (map.ContainsKey(node.ImageIndex)) { node.SelectedImageIndex = node.ImageIndex = map[node.ImageIndex]; return; } if (tree.ImageList.Images.Count <= node.ImageIndex) { return; } Image original = tree.ImageList.Images[node.ImageIndex]; Bitmap composed = original.Clone() as Bitmap; Int32 curSize = ScaleHelper.GetScale() > 1.5 ? 32 : 16; using (Graphics destination = Graphics.FromImage(composed)) { destination.DrawImage(iconSkin, new Rectangle(0, 0, composed.Width, composed.Height), new Rectangle((int)status * curSize, 0, curSize, curSize), GraphicsUnit.Pixel); } int index = tree.ImageList.Images.Count; composed = (Bitmap)PluginCore.PluginBase.MainForm.ImageSetAdjust((Image)composed); tree.ImageList.Images.Add(composed); map[node.ImageIndex] = index; node.SelectedImageIndex = node.ImageIndex = index; }
internal void Dispose() { OverlayMap.Reset(); fsWatchers = null; }