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; }
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; }
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; }
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; }