private void ChangeChildrenWidth(AutomationTreeNode parent)
 {
     foreach (AutomationTreeNode child in parent.ChildNodes)
     {
         child.Width = TreeRootNode.Width - child.Margin.Left;
         ChangeChildrenWidth(child);
     }
 }
Esempio n. 2
0
 private void GetReviews(AnnObject annObject, AutomationTreeNode parent, IList <AnnReview> reviews)
 {
     foreach (AnnReview reply in reviews)
     {
         ReviewTreeNode reviewNode = new ReviewTreeNode(annObject, reviews, reply, parent, _automation, Tree);
         parent.ChildNodes.Add(reviewNode);
         GetReviews(annObject, reviewNode, reply.Replies);
     }
 }
 public AutomationObjectsListControl()
 {
     SetDoubleBuffered(this);
     AutoScroll   = true;
     Padding      = new Padding(0, 0, 0, SystemInformation.HorizontalScrollBarHeight);
     AutoSize     = true;
     AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     TreeRootNode = new AutomationTreeNode(this);
     TreeRootNode.TreeParentNode = null;
     TreeRootNode.Width          = Width;
     BackColor = Control.DefaultBackColor;
 }
Esempio n. 4
0
        public AnnObjectTreeNode(AnnObject annObject, AutomationTreeNode treeParentNode, AnnAutomation automation, AutomationObjectsListControl tree) : base(tree)
        {
            InitializeComponent();

            if (annObject == null)
            {
                throw new ArgumentNullException("annObject");
            }
            if (annObject.Id == AnnObject.SelectObjectId || annObject.Id == AnnObject.None)
            {
                throw new ArgumentException("Cannot create this item with a selection or none annotation object", "annObject");
            }

            if (treeParentNode == null)
            {
                throw new ArgumentNullException("treeParentNode");
            }
            if (automation == null)
            {
                throw new ArgumentNullException("automation");
            }

            _annObject  = annObject;
            _automation = automation;

            _tbComment.Visible = _annObject.SupportsContent;

            AnnAutomationObject automationObject = _automation.Manager.FindObjectById(_annObject.Id);

            if (automationObject != null)
            {
                _lblObjectName.Text = automationObject.Name;
                _pbObjetIcon.Image  = automationObject.ToolBarImage as Image;
            }
            else
            {
                _lblObjectName.Text = _annObject.FriendlyName;
                _pbObjetIcon.Image  = null;
            }

            UpdateMetadata();

            Width          = Tree.TreeRootNode.Width - Margin.Left;
            TreeParentNode = treeParentNode;
            IsExpanded     = false;
            GetReviews(AnnObject, this, AnnObject.Reviews);
        }
Esempio n. 5
0
        public ReviewTreeNode(AnnObject annObject, IList <AnnReview> reviews, AnnReview reply, AutomationTreeNode treeParentNode, AnnAutomation automation, AutomationObjectsListControl tree) : base(tree)
        {
            InitializeComponent();
            if (annObject == null)
            {
                throw new ArgumentNullException("annObject");
            }
            if (annObject.Id == AnnObject.SelectObjectId || annObject.Id == AnnObject.None)
            {
                throw new ArgumentException("Cannot create this item with a selection or none annotation object", "annObject");
            }
            if (reviews == null)
            {
                throw new ArgumentNullException("reviews");
            }
            if (reply == null)
            {
                throw new ArgumentNullException("reply");
            }
            if (automation == null)
            {
                throw new ArgumentNullException("automation");
            }
            _annObject  = annObject;
            _automation = automation;
            _reviews    = reviews;
            _reply      = reply;
            AnnAutomationObject automationObject = _automation.Manager.FindObjectById(_annObject.Id);

            if (automationObject != null)
            {
                _lblObjectName.Text = automationObject.Name;
            }
            else
            {
                _lblObjectName.Text = _annObject.FriendlyName;
            }
            _pbObjetIcon.Image = _replyImage;

            if (!String.IsNullOrEmpty(_reply.Author))
            {
                _lblAuthor.Text = _reply.Author;
            }

            string date = _reply.Date.ToString();

            if (!String.IsNullOrEmpty(date))
            {
                _lblDate.Text = date;
            }

            string status = _reply.Status;

            if (!String.IsNullOrEmpty(status))
            {
                _lblDate.Text = status + ": " + _lblDate.Text;
            }

            foreach (ToolStripMenuItem item in _miSetStatus.DropDownItems)
            {
                item.Checked = (item.Text == status);
            }

            if (!String.IsNullOrEmpty(_reply.Comment))
            {
                _tbComment.Text = _reply.Comment;
            }

            _cbChecked.Checked = _reply.IsChecked;

            TreeParentNode = treeParentNode;
            IsExpanded     = false;
            Width          = Tree.TreeRootNode.Width - Margin.Left;
        }