本文整理汇总了C#中TreeList类的典型用法代码示例。如果您正苦于以下问题:C# TreeList类的具体用法?C# TreeList怎么用?C# TreeList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreeList类属于命名空间,在下文中一共展示了TreeList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeTables
void MakeTables(TreeList<CellBase> result)
{
string leader = string.Empty;
TreeList<CellBase> table = null;
scanner.MoveNext();
do {
if (scanner.Current.Type == TokenType.Leader) {
leader = scanner.Current.Content;
scanner.MoveNext();
}
else if (scanner.Current.Type == TokenType.Word) {
table = new TreeList<CellBase>(new CellBase(string.Empty));
table.Value.SetAttribute(CellAttribute.StartTag, "<p>");
table.Value.SetAttribute(CellAttribute.EndTag, "</p>");
if (leader.Length > 0) {
table.Value.SetAttribute(CellAttribute.Leader, leader);
leader = string.Empty;
}
result.AddBranch(table);
MakeRows(table);
if (scanner.Current.Type == TokenType.Newline) scanner.MoveNext();
}
else {
scanner.MoveNext();
}
} while (scanner.Current.Type != TokenType.End);
if (table != null && scanner.Current.Content.Length > 0) {
table.Value.SetAttribute(CellAttribute.Trailer, scanner.Current.Content);
}
}
示例2: SetCellDisableTree
public static void SetCellDisableTree(TreeList tree,string FieldName,string KeyField,long[]KeyValues)
{
tree.CustomDrawNodeCell += delegate(object sender, CustomDrawNodeCellEventArgs e) {
if (e.Node == tree.FocusedNode) {
return;
}
if (e.Column.FieldName == FieldName)
{
for (int vt = 0; vt <= KeyValues.Length - 1; vt++)
{
if (Convert.ToInt64(e.Node.GetValue(KeyField)) == KeyValues[vt])
{
e.Appearance.BackColor = Color.LightGray;
}
}
}
};
tree.ShowingEditor += delegate(object sender, CancelEventArgs e) {
TreeListNode note = tree.FocusedNode;
if (note != null)
{
for (int vt = 0; vt <= KeyValues.Length - 1; vt++)
{
if (Convert.ToInt64(note.GetValue(KeyField)) == KeyValues[vt]
&& tree.FocusedColumn.FieldName == FieldName)
{
e.Cancel = true;
}
}
}
};
}
示例3: RepositoryPLGridSelect
public RepositoryPLGridSelect(XtraForm frmDanhMuc, string columnField, string tableName, string ValueField, string[] visibleField, string[] caption, string getField, TreeList treeList)
{
init();
plDanhMuc.TreeList = treeList;
plDanhMuc._init(frmDanhMuc ,columnField, tableName , ValueField , visibleField , caption , getField);
treeList.GotFocus += delegate(object sender , EventArgs e)
{
if (treeList.DataSource != null &&
!((DataTable)treeList.DataSource).Columns.Contains(columnField + getField))
{
((DataTable)treeList.DataSource).Columns.Add(new DataColumn(columnField + getField));
}
};
treeList.CellValueChanged += delegate(object sender , CellValueChangedEventArgs e)
{
if (e.Column.FieldName.Equals(columnField+getField))
{
DataRowView rowView = (DataRowView)treeList.GetDataRecordByNode(e.Node);
DataRow row = rowView.Row;
row[columnField] = _getId(e.Value);
}
};
this.Popup += new EventHandler(RepositoryHuyDanhMuc_Popup);
this.Leave += new EventHandler(RepositoryDanhMucAdv_Leave);
}
示例4: GetImage
public override System.Drawing.Image GetImage(object element, TreeList.Column column)
{
if (element.GetType() == typeof(WorkoutWrapper))
{
WorkoutWrapper wrapper = (WorkoutWrapper)element;
if (((Workout)wrapper.Element).IsDirty)
{
return global::GarminFitnessPlugin.Resources.Resources.WorkoutDirtyIcon;
}
else if (((Workout)wrapper.Element).ContainsFITOnlyFeatures)
{
return global::GarminFitnessPlugin.Resources.Resources.FITWorkoutIcon;
}
return global::GarminFitnessPlugin.Resources.Resources.WorkoutIcon;
}
if (element.GetType() == typeof(WorkoutPartWrapper))
{
return global::GarminFitnessPlugin.Resources.Resources.WorkoutPartIcon;
}
else if (element.GetType() == typeof(ActivityCategoryWrapper))
{
return global::GarminFitnessPlugin.Resources.Resources.CategoryIcon;
}
return base.GetImage(element, column);
}
示例5: ExecuteImportAddsNamespace
public void ExecuteImportAddsNamespace()
{
var executeImport = new ExecuteImport();
var input = new TreeList<string>().AddBranchValue("step").AddBranchValue("import").AddBranchValue("fitnesse.unitTest.slim");
ExecuteOperation(executeImport, input, 2);
Assert.IsTrue(processor.Create("SampleClass").Value is SampleClass);
}
示例6: ExecuteDefaultReturnsException
public void ExecuteDefaultReturnsException()
{
var executeDefault = new ExecuteDefault();
var input = new TreeList<string>().AddBranchValue("step").AddBranchValue("garbage");
ExecuteOperation(executeDefault, input, 2);
CheckForException("message<<MALFORMED_INSTRUCTION step,garbage>>");
}
示例7: PaintCell
public virtual void PaintCell(Graphics dc,
Rectangle cellRect,
Node node,
TreeListColumn column,
TreeList.TextFormatting format,
object data)
{
if (format.BackColor != Color.Transparent)
{
Rectangle r = cellRect;
r.X = column.CalculatedRect.X;
r.Width = column.CalculatedRect.Width;
SolidBrush brush = new SolidBrush(format.BackColor);
dc.FillRectangle(brush, r);
brush.Dispose();
}
if (data != null)
{
cellRect = CommonTools.Util.AdjustRectangle(cellRect, format.Padding);
//dc.DrawRectangle(Pens.Black, cellRect);
Color color = format.ForeColor;
if (m_owner.FocusedNode == node && Application.RenderWithVisualStyles == false)
color = SystemColors.HighlightText;
TextFormatFlags flags= TextFormatFlags.EndEllipsis | format.GetFormattingFlags();
TextRenderer.DrawText(dc, data.ToString(), m_owner.Font, cellRect, color, flags);
}
}
示例8: ExecuteMakeBadClassReturnsException
public void ExecuteMakeBadClassReturnsException()
{
var executeMake = new ExecuteMake();
var input = new TreeList<string>().AddBranchValue("step").AddBranchValue("make").AddBranchValue("variable").AddBranchValue("garbage");
ExecuteOperation(executeMake, input, 2);
CheckForException("message<<NO_CLASS garbage>>");
}
示例9: Parse
public Tree<CellBase> Parse(string input)
{
scanner = new TextTableScanner(input);
var result = new TreeList<CellBase>(new CellBase(string.Empty));
MakeTables(result);
return result;
}
示例10: AddTreeListNode
public TreeListNode AddTreeListNode(TreeList treelist, TreeListNode node, Type type, string propertyName, string defaultFunction, string validationFunction)
{
TreeListNode newNode = treelist.AppendNode(new object[] { propertyName, defaultFunction, validationFunction }, node);
//newNode.ImageIndex = newNode.SelectImageIndex = (int)image;
newNode.Tag = type;
return newNode;
}
示例11: GetEnableMouseMulSelect
public bool GetEnableMouseMulSelect(TreeList treeList)
{
if (list.ContainsKey(treeList))
{
return list[treeList].EnableMouseMulSelect;
}
return false;
}
示例12: GetShowLineNo
public bool GetShowLineNo(TreeList treelist)
{
if (StyleList.ContainsKey(treelist))
{
return StyleList[treelist].EnableLineNo;
}
return true;
}
示例13: GetLineNoFormatString
public string GetLineNoFormatString(TreeList treelist)
{
if (StyleList.ContainsKey(treelist))
{
return StyleList[treelist].LineNoFormatString;
}
return "{0}";
}
示例14: GetEnableCommonStyle
public bool GetEnableCommonStyle(TreeList treelist)
{
if (this.list.ContainsKey(treelist))
{
return list[treelist].EnableCommonStyle;
}
return true;
}
示例15: DashboardListPresenter
public DashboardListPresenter(TreeList tree, DashboardsFilterPaneViewModel viewModel)
{
_viewModel = viewModel;
_tree = tree;
InitTree();
PopulateTree();
Messenger.Default.Register<DashboardMessage>(this, OnDashboardMessage);
}