private void OnMruGroupChanged() { ToolManager toolManager = this.designerContext.ToolManager; if (toolManager == null) { return; } AssetTool assetTool = toolManager.ActiveTool as AssetTool; for (int index = toolManager.Tools.Count - 1; index >= 0; --index) { Tool tool = toolManager.Tools[index]; if (tool.Category == ToolCategory.Asset) { toolManager.Remove(tool); } } foreach (Asset asset in this.mruAssetList) { Tool tool = (Tool) new AssetTool(this.toolContext, asset); toolManager.Add(tool); if (assetTool != null && this.activeAsset == asset && (asset.IsValid && tool.IsEnabled)) { toolManager.ActiveTool = tool; } } }