Пример #1
0
        private void cmdTreeSelChanged(object sender, TreeViewEventArgs e)
        {
            // Save any edits that have been done
            HarvestChanges();

            // Get the node's item, if any
            LocItem item = Tree.SelectedNode.Tag as LocItem;

            // If no item, then clear the controls
            if (null == item)
            {
                ClearItemControls();

                LocGroup g = Tree.SelectedNode.Tag as LocGroup;
                if (null != g)
                {
                    Group = g;
                }

                return;
            }

            // Get the group from this node's parent
            LocGroup group = Tree.SelectedNode.Parent.Tag as LocGroup;

            if (null == group)
            {
                return;
            }
            Group = group;

            // Otherwise, populate the controls
            Item = item;
        }
Пример #2
0
        // Internal Methods ------------------------------------------------------------------
        #region Method: bool ItemNeedsAttention(LocItem item)
        bool ItemNeedsAttention(LocItem item)
        {
            LocAlternate alt = item.GetAlternate(iLanguage);

            if (null == alt)
            {
                return(true);
            }
            bool bNeedsAttention = !string.IsNullOrEmpty(alt.NeedsAttention(item));

            return(bNeedsAttention);
        }
Пример #3
0
        bool ShouldDisplayInTree(LocItem item)
        // Assume the parent Group has already been filtered
        {
            // Filter Option: All Needing Attention
            if (FilterCombo.Text == c_ThoseNeedingAttention)
            {
                return(ItemNeedsAttention(item));
            }

            // Filter Option: Advisor Items
            if (FilterCombo.Text == c_TranslatorItemsNeedingAttention)
            {
                return(ItemNeedsAttention(item));
            }

            // Filter Option: Advisor Items Needing Attention
            if (FilterCombo.Text == c_AdvisorItemsNeedingAttention)
            {
                return(ItemNeedsAttention(item));
            }

            // Unknown filter
            return(true);
        }