public static RegisterNeutralImages ( |
||
imageManager | ||
Résultat | void |
public static void RegisterImages(string baseResourceName, System.Reflection.Assembly assembly) { ResourceService.RegisterNeutralImages(new System.Resources.ResourceManager(baseResourceName, assembly)); ResourceService.ResourceAssembly resourceAssembly = new ResourceService.ResourceAssembly(assembly, baseResourceName, true); ResourceService.resourceAssemblies.Add(resourceAssembly); resourceAssembly.Load(); }
/// <summary> /// Invokes the command. /// </summary> public override void Run() { EventWatcher.Initialize(); ServiceManager svcMgr = ServiceManager.Instance; Res.RegisterNeutralStrings(FdoToolbox.Base.Strings.ResourceManager); Res.RegisterNeutralImages(FdoToolbox.Base.Images.ResourceManager); Res.RegisterNeutralStrings(ResourceUtil.StringResourceManager); Workbench.WorkbenchInitialized += delegate { Workbench wb = Workbench.Instance; List <IObjectExplorerExtender> extenders = AddInTree.BuildItems <IObjectExplorerExtender>("/ObjectExplorer/Extenders", this); if (extenders != null) { foreach (IObjectExplorerExtender dec in extenders) { dec.Decorate(wb.ObjectExplorer); } } svcMgr.RestoreSession(); Msg.MainForm = wb; //Find and register drag and drop handlers List <IDragDropHandler> handlers = AddInTree.BuildItems <IDragDropHandler>("/FdoToolbox/DragDropHandlers", this); if (handlers != null) { IDragDropHandlerService handlerSvc = ServiceManager.Instance.GetService <IDragDropHandlerService>(); foreach (IDragDropHandler h in handlers) { handlerSvc.RegisterHandler(h); } } //Init the scripting engine ScriptingEngine engine = ScriptingEngine.Instance; ScriptManager mgr = new ScriptManager(); wb.ShowContent(mgr, ViewRegion.Right); string startup = Path.Combine(Application.StartupPath, "Scripts\\" + ScriptingEngine.STARTUP_SCRIPT); engine.ScriptLoaded += new ScriptEventHandler(EventWatcher.OnScriptLoaded); //Run startup script engine.RunScript(startup); wb.FormClosing += delegate { svcMgr.UnloadAllServices(); }; }; }
public static void InsertAddIn(AddIn addIn) { if (addIn.Enabled) { foreach (ExtensionPath path in addIn.Paths.Values) { AddExtensionPath(path); } foreach (Runtime runtime in addIn.Runtimes) { if (runtime.IsActive) { foreach (LazyLoadDoozer doozer in runtime.DefinedDoozers) { if (AddInTree.Doozers.ContainsKey(doozer.Name)) { throw new AddInLoadException("Duplicate doozer: " + doozer.Name); } AddInTree.Doozers.Add(doozer.Name, doozer); } foreach (LazyConditionEvaluator condition in runtime.DefinedConditionEvaluators) { if (AddInTree.ConditionEvaluators.ContainsKey(condition.Name)) { // throw new AddInLoadException("Duplicate condition evaluator: " + condition.Name); } else { AddInTree.ConditionEvaluators.Add(condition.Name, condition); } } } } string addInRoot = Path.GetDirectoryName(addIn.FileName); foreach (string bitmapResource in addIn.BitmapResources) { string path = Path.Combine(addInRoot, bitmapResource); ResourceManager resourceManager = ResourceManager.CreateFileBasedResourceManager(Path.GetFileNameWithoutExtension(path), Path.GetDirectoryName(path), null); ResourceService.RegisterNeutralImages(resourceManager); } foreach (string stringResource in addIn.StringResources) { string path = Path.Combine(addInRoot, stringResource); ResourceManager resourceManager = ResourceManager.CreateFileBasedResourceManager(Path.GetFileNameWithoutExtension(path), Path.GetDirectoryName(path), null); ResourceService.RegisterNeutralStrings(resourceManager); } } addIns.Add(addIn); }