Tree Node Name logic

This commit is contained in:
Jsj
2008-03-26 18:28:34 +00:00
parent 5ae7cb88be
commit 50719291d1
2 changed files with 89 additions and 3 deletions

View File

@@ -130,9 +130,36 @@ namespace VEPROMS.CSLA.Library
{
get { return Get().FolderConfig; }
}
/// <summary>
/// These settings are set on the user interface side.
/// This is used to control whether the Name and/or Title is displayed
/// next to the tree nodes in the user interface
/// </summary>
private bool _DisplayTreeNodeNames = true;
public bool DisplayTreeNodeNames
{
get { return _DisplayTreeNodeNames; }
set { _DisplayTreeNodeNames = value; }
}
private bool _DisplayTreeNodeTitles = false;
public bool DisplayTreeNodeTitles
{
get { return _DisplayTreeNodeTitles; }
set { _DisplayTreeNodeTitles = value; }
}
public override string ToString()
{
return string.Format("{0} - {1}", Name, Title);
// assume that at least one of the two options was selected
string rtnstr = "";
if ( _DisplayTreeNodeNames) rtnstr = Name;
if (_DisplayTreeNodeTitles)
{
if (rtnstr.Length > 0) rtnstr += " - ";
rtnstr += Title;
}
return rtnstr;
//return string.Format("{0} - {1}", Name, Title);
}
//public string ToString(string str, System.IFormatProvider ifp)
//{