/// <summary> /// Do the bare minimum for use in tests /// </summary> /// <param name="configuration"></param> /// <param name="configurationPath"></param> protected override void LoadUIFromXmlDocument(XmlDocument configuration, string configurationPath) { m_windowConfigurationNode = configuration.SelectSingleNode("window"); ReplaceControlAssemblies(); PropertyTable.SetProperty("WindowConfiguration", m_windowConfigurationNode); PropertyTable.SetPropertyPersistence("WindowConfiguration", false); LoadDefaultProperties(m_windowConfigurationNode.SelectSingleNode("defaultProperties")); m_mediator.PropertyTable.SetProperty("window", this); m_mediator.PropertyTable.SetPropertyPersistence("window", false); CommandSet commandset = new CommandSet(m_mediator); commandset.Init(m_windowConfigurationNode); m_mediator.Initialize(commandset); LoadStringTableIfPresent(configurationPath); RestoreWindowSettings(false); m_mediator.AddColleague(this); m_menusChoiceGroupCollection = new ChoiceGroupCollection(m_mediator, null, m_windowConfigurationNode); m_sidebarChoiceGroupCollection = new ChoiceGroupCollection(m_mediator, null, m_windowConfigurationNode); m_toolbarsChoiceGroupCollection = new ChoiceGroupCollection(m_mediator, null, m_windowConfigurationNode); var handle = this.Handle; // create's a window handle for this form to allow processing broadcasted items. }
private void SetupTestMediator() { m_mediator = new Mediator(); m_mediator.PropertyTable.SetProperty("cache", Cache); m_testWindowConfig = SetupMinimalWindowConfig(); var cmdSet = new CommandSet(m_mediator); cmdSet.Init(m_testWindowConfig); m_mediator.Initialize(cmdSet); }