Exemplo n.º 1
0
        void ShowInfo(Operation pop, Feature feat)
        {
            if (pop == null)
            {
                infoTextBox.Text = "No editing command";
                Enable(false);
            }
            else
            {
                StringBuilder sb      = new StringBuilder();
                string        newLine = System.Environment.NewLine;
                sb.AppendFormat("{0}\t{1}{2}", "Editor command:", pop.Name, newLine);
                sb.AppendFormat("{0}\t{1}{2}", "Edit sequence:", pop.InternalId, newLine);
                sb.AppendFormat("{0}\t{1}", "Created on:", pop.When.ToShortDateString());
                infoTextBox.Text = sb.ToString();
                Enable(true);

                // Disable the Predecessors button if the selected
                // feature doesn't actually have one.
                if (UpdateUI.GetPredecessor(feat) == null)
                {
                    predecessorsButton.Enabled = false;
                }

                // Disable the Update button if the operation is not updateable.
                if (pop is IRevisable)
                {
                    updateButton.Focus();
                }
                else
                {
                    updateButton.Enabled = false;
                    cancelButton.Focus();
                }
            }
        }