C# Class Network_Manager.Config.SavedRouteList

Show file Open project: SortByte/Network-Manager

Public Properties

Property Type Description
Nodes List

Public Methods

Method Description
AddNode ( TreeView treeView, SavedRouteNode node, bool rename = false ) : int

For rename = true, if node already exists and source is a group it renames it without changing its subnodes, and if it's an item it replaces it. Returns: 0: success 1: invlid destination 2: name already exists

DeleteNode ( TreeView treeView ) : int
Find ( SavedRouteItem route ) : TreeView

Find the first SavedRouteItem based on destination+prefix+gateway+interface and return a Tree View with the equivalent node selected, that can be passed to the other functions

GetRoutes ( SavedRouteNode node ) : List

Recursively receives the routes from a node into a list

GetSelectedNode ( TreeView treeView, bool getParent = false, TreeNode selectedNode = null ) : SavedRouteNode

Get the SavedRouteNode based on Tree View selection

MoveNode ( TreeView treeView, TreeNode source, TreeNode destination ) : int
Populate ( TreeView treeView, List selectionPath = null ) : void

Populates TreeView nodes with saved routes nodes

Private Methods

Method Description
FindPath ( SavedRouteItem route, SavedRouteGroup rootNode = null ) : List
PopulateNode ( TreeNodeCollection tvNodes, List nodes ) : void

Method Details

AddNode() public method

For rename = true, if node already exists and source is a group it renames it without changing its subnodes, and if it's an item it replaces it. Returns: 0: success 1: invlid destination 2: name already exists
public AddNode ( TreeView treeView, SavedRouteNode node, bool rename = false ) : int
treeView System.Windows.Forms.TreeView
node SavedRouteNode
rename bool Rename group/edit item
return int

DeleteNode() public method

public DeleteNode ( TreeView treeView ) : int
treeView System.Windows.Forms.TreeView
return int

Find() public method

Find the first SavedRouteItem based on destination+prefix+gateway+interface and return a Tree View with the equivalent node selected, that can be passed to the other functions
public Find ( SavedRouteItem route ) : TreeView
route SavedRouteItem
return System.Windows.Forms.TreeView

GetRoutes() public method

Recursively receives the routes from a node into a list
public GetRoutes ( SavedRouteNode node ) : List
node SavedRouteNode
return List

GetSelectedNode() public method

Get the SavedRouteNode based on Tree View selection
public GetSelectedNode ( TreeView treeView, bool getParent = false, TreeNode selectedNode = null ) : SavedRouteNode
treeView System.Windows.Forms.TreeView
getParent bool
selectedNode System.Windows.Forms.TreeNode
return SavedRouteNode

MoveNode() public method

public MoveNode ( TreeView treeView, TreeNode source, TreeNode destination ) : int
treeView System.Windows.Forms.TreeView
source System.Windows.Forms.TreeNode
destination System.Windows.Forms.TreeNode
return int

Populate() public method

Populates TreeView nodes with saved routes nodes
public Populate ( TreeView treeView, List selectionPath = null ) : void
treeView System.Windows.Forms.TreeView
selectionPath List
return void

Property Details

Nodes public property

public List Nodes
return List