Ejemplo n.º 1
0
        /// <summary>
        ///     Build the model of this tree view
        /// </summary>
        /// <returns>the root nodes of the tree</returns>
        protected override List <BaseTreeNode> BuildModel()
        {
            List <BaseTreeNode> retVal = new List <BaseTreeNode>();

            ModelElement modelElement = Root as ModelElement;

            if (modelElement != null)
            {
                History history = modelElement.EFSSystem.History;
                foreach (Change change in history.GetChanges(modelElement))
                {
                    ChangeTreeNode node = new ChangeTreeNode(change, true);
                    retVal.Add(node);
                }
            }

            return(retVal);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Updates the window according to the new selected change
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void historyTreeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            Properties.SelectedObject = null;

            ChangeTreeNode changeTreeNode = e.Node as ChangeTreeNode;

            if (changeTreeNode != null)
            {
                Change item = changeTreeNode.Item;
                if (item != null)
                {
                    beforeRichTextBox.Text    = item.getBefore();
                    afterRichTextBox.Text     = item.getAfter();
                    Properties.SelectedObject = item;
                }
                else
                {
                    beforeRichTextBox.Text = "";
                    afterRichTextBox.Text  = "";
                }
            }
        }