当前位置: 首页>>代码示例>>C#>>正文


C# TreeList类代码示例

本文整理汇总了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);
            }
        }
开发者ID:abombss,项目名称:fitsharp,代码行数:31,代码来源:TextTables.cs

示例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;
                        }
                    }
                }
            };
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:33,代码来源:frmTreeUserManExtUpdate.cs

示例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);
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:26,代码来源:RepositoryPLGridSelect.cs

示例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);
        }
开发者ID:Digresiv,项目名称:garminworkouts,代码行数:28,代码来源:WorkoutIconLabelProvider.cs

示例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);
 }
开发者ID:unclebob,项目名称:nslim,代码行数:7,代码来源:ExecuteOperatorsTest.cs

示例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>>");
 }
开发者ID:unclebob,项目名称:nslim,代码行数:7,代码来源:ExecuteOperatorsTest.cs

示例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);
            }
        }
开发者ID:Diullei,项目名称:Storm,代码行数:28,代码来源:TreeListPainter.cs

示例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>>");
 }
开发者ID:unclebob,项目名称:nslim,代码行数:7,代码来源:ExecuteOperatorsTest.cs

示例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;
 }
开发者ID:abombss,项目名称:fitsharp,代码行数:7,代码来源:TextTables.cs

示例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;
 }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:7,代码来源:ucUserOptions.cs

示例11: GetEnableMouseMulSelect

 public bool GetEnableMouseMulSelect(TreeList treeList)
 {
     if (list.ContainsKey(treeList))
     {
         return list[treeList].EnableMouseMulSelect;
     }
     return false;
 }
开发者ID:dishiyicijinqiu,项目名称:FengSharp,代码行数:8,代码来源:TreeList_MouseMulSelect.cs

示例12: GetShowLineNo

 public bool GetShowLineNo(TreeList treelist)
 {
     if (StyleList.ContainsKey(treelist))
     {
         return StyleList[treelist].EnableLineNo;
     }
     return true;
 }
开发者ID:dishiyicijinqiu,项目名称:FengSharp,代码行数:8,代码来源:TreeList_ShowLine.cs

示例13: GetLineNoFormatString

 public string GetLineNoFormatString(TreeList treelist)
 {
     if (StyleList.ContainsKey(treelist))
     {
         return StyleList[treelist].LineNoFormatString;
     }
     return "{0}";
 }
开发者ID:dishiyicijinqiu,项目名称:FengSharp,代码行数:8,代码来源:TreeList_ShowLine.cs

示例14: GetEnableCommonStyle

 public bool GetEnableCommonStyle(TreeList treelist)
 {
     if (this.list.ContainsKey(treelist))
     {
         return list[treelist].EnableCommonStyle;
     }
     return true;
 }
开发者ID:dishiyicijinqiu,项目名称:OneCardAccess,代码行数:8,代码来源:TreeListCommonStyle.cs

示例15: DashboardListPresenter

 public DashboardListPresenter(TreeList tree, DashboardsFilterPaneViewModel viewModel)
 {
     _viewModel = viewModel;
     _tree = tree;
     InitTree();
     PopulateTree();
     Messenger.Default.Register<DashboardMessage>(this, OnDashboardMessage);
 }
开发者ID:sethjuarez,项目名称:DevAV,代码行数:8,代码来源:DashboardListPresenter.cs


注:本文中的TreeList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。