public void DefaultInitialisesActionsHandlers() { ActionHandlerFactory.Reset(); ActionHandlerFactory.PluginFolder = null; Assert.That( ActionHandlerFactory.Default.ActionHandlers, Is.Not.Empty); }
private static Lazy <ActionHandler, IActionHandlerMetadata> InitialiseMockHandler(string actionName) { ActionHandlerFactory.Reset(); ActionHandlerFactory.Default = new ActionHandlerFactory(); var metadataMock = new Mock <IActionHandlerMetadata>(MockBehavior.Strict); metadataMock.Setup(metadata => metadata.Name).Returns(actionName); var expected = new Lazy <ActionHandler, IActionHandlerMetadata>(metadataMock.Object); return(expected); }
public void DefaultIgnoresNonExistantDirectory() { ActionHandlerFactory.Reset(); ActionHandlerFactory.PluginFolder = Path.Combine( Path.GetTempPath(), "CCNetTesting"); if (Directory.Exists(ActionHandlerFactory.PluginFolder)) { Directory.Delete(ActionHandlerFactory.PluginFolder, true); } Assert.That( ActionHandlerFactory.Default.ActionHandlers, Is.Not.Empty); }
public void RetrieveHandlerReturnsNullIfNotFound() { try { var expected = InitialiseMockHandler("testAction"); ActionHandlerFactory.Default.ActionHandlers.Add(expected); var controller = new DynamicController(); var actual = controller.RetrieveHandler("garbage"); Assert.That(actual, Is.Null); } finally { ActionHandlerFactory.Reset(); } }
public void RibbonLoad(Office.IRibbonUI ribbonUi) { ActionHandlerFactory = new ActionHandlerFactory(); EnabledHandlerFactory = new EnabledHandlerFactory(); LabelHandlerFactory = new LabelHandlerFactory(); SupertipHandlerFactory = new SupertipHandlerFactory(); ImageHandlerFactory = new ImageHandlerFactory(); ContentHandlerFactory = new ContentHandlerFactory(); PressedHandlerFactory = new PressedHandlerFactory(); CheckBoxActionHandlerFactory = new CheckBoxActionHandlerFactory(); DisableFormatTab = new Boolean(); ShouldCompressImages = new Boolean(); _ribbon = ribbonUi; }
//Create callback methods here. For more information about adding callback methods, select the Ribbon XML item in Solution Explorer and then press F1 public void RibbonLoad(Office.IRibbonUI ribbonUi) { ActionHandlerFactory = new ActionHandlerFactory(); EnabledHandlerFactory = new EnabledHandlerFactory(); LabelHandlerFactory = new LabelHandlerFactory(); SupertipHandlerFactory = new SupertipHandlerFactory(); ImageHandlerFactory = new ImageHandlerFactory(); ContentHandlerFactory = new ContentHandlerFactory(); PressedHandlerFactory = new PressedHandlerFactory(); CheckBoxActionHandlerFactory = new CheckBoxActionHandlerFactory(); _ribbon = ribbonUi; SetVoicesFromInstalledOptions(); SetCoreVoicesToSelections(); }
public void RetrieveHandlerIgnoresCase() { var actionName = "testAction"; try { var expected = InitialiseMockHandler(actionName); ActionHandlerFactory.Default.ActionHandlers.Add(expected); var controller = new DynamicController(); var actual = controller.RetrieveHandler(actionName.ToUpperInvariant()); Assert.That(actual, Is.SameAs(expected)); } finally { ActionHandlerFactory.Reset(); } }
public void Init(HttpApiServer server) { this.Server = server; this.HandleFactory = Server.ActionFactory; }
public void OnAction(Office.IRibbonControl control) { ActionFramework.Common.Interface.ActionHandler actionHandler = ActionHandlerFactory.CreateInstance(control.Id, control.Tag); actionHandler.Execute(control.Id); }
//Create callback methods here. For more information about adding callback methods, select the Ribbon XML item in Solution Explorer and then press F1 public void RibbonLoad(Office.IRibbonUI ribbonUi) { ActionHandlerFactory = new ActionHandlerFactory(); LabelHandlerFactory = new LabelHandlerFactory(); SupertipHandlerFactory = new SupertipHandlerFactory(); ImageHandlerFactory = new ImageHandlerFactory(); _ribbon = ribbonUi; SetVoicesFromInstalledOptions(); SetCoreVoicesToSelections(); }
public void OnAction(Office.IRibbonControl control) { var actionHandler = ActionHandlerFactory.CreateInstance(control.Id, control.Tag); actionHandler.Execute(control.Id); }