Esempio n. 1
0
        void UpdateNeedsAttentionStatus()
        // Assumes changes have been Harvested to the LocAlternative
        {
            if (null == Item)
                return;
            LocAlternate alt = new LocAlternate(
                m_textYourLanguage.Text,
                m_comboShortcutKey.Text,
                m_textToolTip.Text);

            // Do the test
            string sNeedsMessage = alt.NeedsAttention(Item);
            bool bNeedsAttention = !string.IsNullOrEmpty(sNeedsMessage);

            // Update the tree node
            if (null != Tree.SelectedNode && null != Tree.SelectedNode.Tag as LocItem)
                Tree.SelectedNode.ForeColor = (bNeedsAttention ? Color.Red : Color.Navy);

            // Update the message
            m_labelNeedsAttention.Text = sNeedsMessage;
        }
Esempio n. 2
0
        public void AddAlternate(int iIndex, LocAlternate alt)
        {
            // Extend the vector if we need to
            if (iIndex >= Alternates.Length )
            {
                LocAlternate[] v = new LocAlternate[iIndex + 1];
                for (int i = 0; i < Alternates.Length; i++)
                    v[i] = Alternates[i];
                m_vAlternates = v;
            }

            // Place the value in the appropriate position
            Alternates[iIndex] = alt;
        }
Esempio n. 3
0
        void HarvestChanges()
        {
            if (null == Item || -1 == iLanguage)
                return;

            LocAlternate alt = new LocAlternate(ItemYourLanguage, null, null);

            Item.AddAlternate(iLanguage, alt);
            alt.ShortcutKey = m_comboShortcutKey.Text;
            alt.ToolTip = m_textToolTip.Text;
        }
Esempio n. 4
0
        static public LocAlternate ReadXML(XmlRead xml)
        {
            // Collect the parts
            string sValue = xml.GetValue(c_sValue);
            string sShortcutKey = xml.GetValue(c_sKey);
            string sToolTip = xml.GetValue(c_sTip);

            // Create and return the class
            LocAlternate alt = new LocAlternate(sValue, sShortcutKey, sToolTip);
            return alt;
        }