Skip to content

Commit 10d256a

Browse files
committed
some refactoring
1 parent c118f78 commit 10d256a

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

TreeViewPanelExtension/TreePanel.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,15 @@ public void OnLoad()
325325
lvSessions.Invalidated += LvSessions_Invalidated;
326326

327327
// Create our TreeView
328-
tv = new CustomTreeView();
329-
tv.Name = Constants.TreeViewName;
330-
tv.ImageList = this.imageList;
331-
tv.Location = lvSessions.Location;
332-
tv.Size = lvSessions.Size;
333-
tv.HideSelection = false; // If "false" the highlight is too "light", so we'll keep the selection "manually"
334-
tv.ContextMenu = FiddlerApplication.UI.mnuSessionContext; // Assign same context menu
328+
tv = new CustomTreeView
329+
{
330+
Name = Constants.TreeViewName,
331+
ImageList = this.imageList,
332+
Location = lvSessions.Location,
333+
Size = lvSessions.Size,
334+
HideSelection = false, // If "false" the highlight is too "light", so we'll keep the selection "manually"
335+
ContextMenu = FiddlerApplication.UI.mnuSessionContext // Assign same context menu
336+
};
335337
//tv.BeforeSelect += new TreeViewCancelEventHandler(tv_BeforeSelect);
336338
//tv.LostFocus += new EventHandler(tv_LostFocus);
337339
tv.AfterSelect += new TreeViewEventHandler(tv_AfterSelect);

TreeViewPanelExtension/TreeViewGenerator.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,7 @@ public void AddSession(CustomTreeView tv, Session oSession)
8080
}
8181

8282
string[] contents = oSession.PathAndQuery.Split(new char[] { '?' });
83-
string justPath = "";
84-
if (contents.Length > 1)
85-
{
86-
justPath = contents[0];
87-
}
88-
else
89-
{
90-
justPath = oSession.PathAndQuery;
91-
}
83+
string justPath = (contents.Length > 1) ? contents[0] : oSession.PathAndQuery;
9284

9385
// Default node text to be displayed
9486
string nodeText = $"[{oSession.id}] /";

0 commit comments

Comments
 (0)