Esempio n. 1
0
        /// <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();

            PropTable.SetProperty("WindowConfiguration", m_windowConfigurationNode, true);
            PropTable.SetPropertyPersistence("WindowConfiguration", false);

            LoadDefaultProperties(m_windowConfigurationNode.SelectSingleNode("defaultProperties"));

            PropTable.SetProperty("window", this, true);
            PropTable.SetPropertyPersistence("window", false);

            CommandSet commandset = new CommandSet(m_mediator);

            commandset.Init(m_windowConfigurationNode);
            m_mediator.Initialize(commandset);

            var st = StringTable.Table;             // Force loading it.

            RestoreWindowSettings(false);
            m_mediator.AddColleague(this);

            m_menusChoiceGroupCollection    = new ChoiceGroupCollection(m_mediator, m_propertyTable, null, m_windowConfigurationNode);
            m_sidebarChoiceGroupCollection  = new ChoiceGroupCollection(m_mediator, m_propertyTable, null, m_windowConfigurationNode);
            m_toolbarsChoiceGroupCollection = new ChoiceGroupCollection(m_mediator, m_propertyTable, null, m_windowConfigurationNode);

            var handle = Handle;             // create's a window handle for this form to allow processing broadcasted items.
        }
Esempio n. 2
0
 protected override void XWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (!m_mediator.IsDisposed)
     {
         m_mediator.ProcessMessages = false;
         PropTable.SetProperty("windowState", WindowState, false);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Activates the controls for the given toolName.
        /// Assumes tool exists only in one area.
        /// </summary>
        /// <param name="toolName"></param>
        /// <returns></returns>
        public XmlNode ActivateTool(string toolName)
        {
            XmlNode configurationNode = GetToolNode(toolName);

            PropTable.SetProperty("currentContentControlParameters", configurationNode.SelectSingleNode("control"), true);
            PropTable.SetPropertyPersistence("currentContentControlParameters", false);
            PropTable.SetProperty("currentContentControl", toolName, true);
            PropTable.SetPropertyPersistence("currentContentControl", false);
            ProcessPendingItems();
            return(configurationNode);
        }
Esempio n. 4
0
 protected override void OnClosed(EventArgs ea)
 {
     base.OnClosed(ea);
     // remember last word used, if possible
     PropTable.SetProperty("TryAWordDlg-lastWordToTry", m_wordformTextBox.Text.Trim(), PropertyTable.SettingsGroup.LocalSettings, false);
     PropTable.SetPropertyPersistence("TryAWordDlg-lastWordToTry", true, PropertyTable.SettingsGroup.LocalSettings);
     m_persistProvider.PersistWindowSettings(PersistProviderID, this);
     if (m_parserListener.Connection != null)
     {
         m_parserListener.Connection.TryAWordDialogIsRunning = false;
         m_parserListener.DisconnectFromParser();
     }
 }