コード例 #1
0
        private void m_timer_Tick(object sender, EventArgs e)
        {
            if (m_parserListener == null)
            {
                return;
            }

            m_statusLabel.Text = m_parserListener.ParserActivityString;

            if (m_parserListener.Connection == null)
            {
                m_statusLabel.Text = ParserStoppedMessage();
                return;
            }
            Exception ex = m_parserListener.Connection.UnhandledException;

            if (ex != null)
            {
                m_parserListener.DisconnectFromParser();
                m_statusLabel.Text    = ParserStoppedMessage();
                m_tryItButton.Enabled = true;
                var app = PropTable.GetValue <IApp>("App");
                ErrorReporter.ReportException(ex, app.SettingsKey, app.SupportEmailAddress, this, false);
                return;
            }

            if (m_tryAWordResult != null && m_tryAWordResult.IsCompleted)
            {
                var result = (XDocument)m_tryAWordResult.AsyncState;
                CreateResultPage(result);
                m_tryAWordResult = null;
                // got result so enable Try It button
                m_tryItButton.Enabled = true;
            }
        }
コード例 #2
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.
        }
コード例 #3
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);
     }
 }
コード例 #4
0
        private void GetLastWordUsed()
        {
            var word = PropTable.GetValue <string>("TryAWordDlg-lastWordToTry");

            if (word != null)
            {
                SetWordToUse(word.Trim());
            }
        }
コード例 #5
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);
        }
コード例 #6
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();
     }
 }
コード例 #7
0
 private void m_tree_TreeLoad(object sender, EventArgs e)
 {
     if (m_pOSPopupTreeManager == null)
     {
         m_pOSPopupTreeManager = new POSPopupTreeManager(m_tree,
                                                         m_cache,
                                                         List,
                                                         m_cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem.Handle,
                                                         false,
                                                         m_mediator,
                                                         PropTable,
                                                         PropTable.GetValue <Form>("window"));
         m_pOSPopupTreeManager.AfterSelect += m_pOSPopupTreeManager_AfterSelect;
     }
     m_pOSPopupTreeManager.LoadPopupTree(0);
 }
コード例 #8
0
        /// <summary>
        /// Override to handle case of improper menu in the reversal cat list tool.
        /// </summary>
        /// <param name="commandObject"></param>
        /// <param name="display"></param>
        /// <returns></returns>
        public override bool OnDisplayJumpToTool(object commandObject, ref UIItemDisplayProperties display)
        {
            CheckDisposed();

            Command command    = (Command)commandObject;
            string  tool       = Utils.XmlUtils.GetMandatoryAttributeValue(command.Parameters[0], "tool");
            string  toolChoice = PropTable.GetStringProperty("currentContentControl", null);

            if (tool == "posEdit" && toolChoice == "reversalToolReversalIndexPOS")
            {
                display.Visible = display.Enabled = false;                 // we're already there!
                return(true);
            }
            else
            {
                return(base.OnDisplayJumpToTool(commandObject, ref display));
            }
        }
コード例 #9
0
 /// <summary>
 ///
 /// </summary>
 protected TaskBase()
 {
     _nullArithmetic = Constants.NULL_ARITH_USE_DEF;
     _propTab        = new PropTable(this);
 }
コード例 #10
0
 private void m_tree_TreeLoad(object sender, EventArgs e)
 {
     if (m_InflectionFeatureTreeManager == null)
     {
         m_InflectionFeatureTreeManager = new InflectionFeaturePopupTreeManager(m_tree,
                                                                                m_cache, false, m_mediator, PropTable,
                                                                                PropTable.GetValue <Form>("window"),
                                                                                m_displayWs);
         m_InflectionFeatureTreeManager.AfterSelect += new TreeViewEventHandler(m_pOSPopupTreeManager_AfterSelect);
     }
     m_InflectionFeatureTreeManager.LoadPopupTree(0);
 }
コード例 #11
0
 private void m_buttonHelp_Click(object sender, EventArgs e)
 {
     ShowHelp.ShowHelpTopic(PropTable.GetValue <IHelpTopicProvider>("HelpTopicProvider"), HelpTopicID);
 }
コード例 #12
0
        /// <summary>
        ///   Fill inner members and needed links for the current 'fld'
        /// </summary>
        /// <param name = "((DataView)dataView)">reference to all DataView object, which consist relevant fields </param>
        private bool initInnerObjects(XmlParser parser, String foundTagName, DataView dataView)
        {
            switch (foundTagName)
            {
            case XMLConstants.MG_TAG_FLD:
                if (_isOwnerFld)
                // init <fld id = recompute_by=> first time, init reference by id
                {
                    fillFldField(parser, dataView);
                    _isOwnerFld = false; // must to be after FillFldField
                }
                else
                {
                    fillFldField(parser, dataView); // it's not need ((DataView)dataView), it's not first <fld >
                }
                break;

            case ConstInterface.MG_TAG_LINK:
                fillLink(parser, dataView);
                break;

            case XMLConstants.MG_TAG_CONTROL:
                if (_ctrlProps == null)
                {
                    _ctrlProps = new PropTable();
                }

                // fill the prop table using the existing properties
                _ctrlProps.fillDataByExists(Task);

                //if virtual field causes recompute of repeatable control
                if (_ctrlProps.getCtrlRef() != null && _ctrlProps.getCtrlRef().IsRepeatable&& OwnerFld.IsVirtual &&
                    (!(OwnerFld.hasInitExp())))
                {
                    OwnerFld.causeTableInvalidation(true);
                }
                break;

            case XMLConstants.MG_TAG_FORM_PROPERTIES:
                if (_formProps == null)
                {
                    _formProps = new PropTable();
                }

                // fill the prop table using the existing properties
                _formProps.fillDataByExists(Task);
                break;

            case ConstInterface.MG_TAG_FLD_END:
                parser.setCurrIndex2EndOfTag();
                return(false);

            case XMLConstants.MG_TAG_DCVALUES:
                string segment = parser.ReadToEndOfCurrentElement();
                var    handler = new DCValuesRecomputeSaxHandler(Task);
                MgSAXParser.Parse(segment, handler);
                AddRecomputeItem(handler.DcValuesRecomputeAction);
                break;

            default:
                Logger.Instance.WriteExceptionToLog(
                    "There is no such tag in Recompute. Insert else if to Recompute.initInnerObjects for " + foundTagName);
                return(false);
            }
            return(true);
        }
コード例 #13
0
        private void m_tree_TreeLoad(object sender, EventArgs e)
        {
            if (m_PhonologicalFeatureTreeManager == null)
            {
                if (!String.IsNullOrEmpty(m_featDefnAbbr))
                {
                    // Find the feature definition this editor was created to choose options from
                    var featDefns = from s in m_cache.LangProject.PhFeatureSystemOA.FeaturesOC
                                    where s.Abbreviation.BestAnalysisAlternative.Text == m_featDefnAbbr
                                    select s;
                    if (featDefns.Any())
                    {
                        m_closedFeature = featDefns.First() as IFsClosedFeature;
                    }
                }

                m_PhonologicalFeatureTreeManager = new PhonologicalFeaturePopupTreeManager(m_tree,
                                                                                           m_cache, false, m_mediator, PropTable,
                                                                                           PropTable.GetValue <Form>("window"),
                                                                                           m_displayWs, m_closedFeature);
                m_PhonologicalFeatureTreeManager.AfterSelect += new TreeViewEventHandler(m_PhonFeaturePopupTreeManager_AfterSelect);
            }
            m_PhonologicalFeatureTreeManager.LoadPopupTree(0);
        }