void GetUrl() { if (log == null) { return; } string url = log.Url; TreeNode n = treeViewMain.Find(url); if (n != null) { if (treeViewMain.SelectedNode == n) { return; } treeViewMain.SelectedNode = n; ILogItem d = n.Tag as ILogItem; toolStripLabelSize.Text = "Length = " + d.GetLength(); toolStripLabelSize.Visible = true; } else { toolStripLabelSize.Visible = false; } }
void SetUrl() { TreeNode n = treeViewMain.SelectedNode; if (n == current) { return; } current = n; changeNode(n); if (n == null) { return; } if (log == null) { return; } if (n.Tag is ILogItem) { ILogItem d = n.Tag as ILogItem; string uid = d.GetUrl(); try { log.Url = uid; toolStripLabelSize.Text = "Length = " + d.GetLength(); toolStripLabelSize.Visible = true; } catch (Exception exception) { exception.ShowError(); } return; } toolStripLabelSize.Visible = false; }