private RepositoryExplorerControl GetRepositoryExplorerControl()
        {
            // TODO: Implement a better way to get to the repository explorer control
            // For now we just find the parent control

            Control control = null;

            if (TreeNode != null)
            {
                control = this.TreeNode.TreeView;
            }
            else if (ListViewItem != null)
            {
                control = ListViewItem.ListView;
            }

            RepositoryExplorerControl rc = null;

            while (control != null && (null == (rc = control as RepositoryExplorerControl)))
            {
                control = control.Parent;
            }

            return(rc);
        }
 public void RefreshItem(bool refreshParent)
 {
     if (TreeNode != null)
     {
         Uri uri = null;
         if (refreshParent && null != TreeNode.Parent && null != TreeNode.Origin)
         {
             uri = ((RepositoryTreeNode)this.TreeNode.Parent).NormalizedUri;
         }
         else
         {
             uri = TreeNode.NormalizedUri;
         }
         if (uri != null &&
             this.TreeNode.TreeView is RepositoryTreeView)
         {
             RepositoryTreeView rtv = (RepositoryTreeView)this.TreeNode.TreeView;
             rtv.Reload(uri);
         }
     }
     else if (ListViewItem != null)
     {
         RepositoryExplorerControl rec = GetRepositoryExplorerControl();
         if (rec != null)
         {
             // This always reloads the parent and its children (not only when requested)
             Uri uri = new Uri(SvnTools.GetNormalizedUri(this.Uri), "./"); // parent uri
             rec.Reload(uri);
         }
     }
 }