treenodecollection

What is the correct way to call an extension method (TreeNodeCollection Add method)?

醉酒当歌 提交于 2019-12-11 16:04:17
问题 The pertinent parts of my code are below. In the MyTreeView class (last block of code below), the line of code TncExtensions.TncNodeAdd(this, myTreeViewNode); generates the error CS7036 There is no argument given that corresponds to the required formal parameter 'myTreeViewNode' of 'TncExtensions.TncNodeAdd(TreeNodeCollection, MyTreeView_Abstract, MyTreeViewNode_Abstract)' Why can't the compiler figure out what the 2nd formal parameter is for my TreeNodeCollection extension method? public

How do I override TreeNodeCollection.Add(TreeNode)?

久未见 提交于 2019-12-08 01:28:23
问题 I have this: public abstract class DRT_Tvw_Abstract : TreeView { TableCountMetrics metrics; public TableCountMetrics Metrics { get => metrics; set => metrics = value; } public class TableCountMetrics { int schemaNameCount = 0; int tableNameCount = 0; public int SchemaNameCount { get => schemaNameCount; set => schemaNameCount = value; } public int TableNameCount { get => tableNameCount; set => tableNameCount = value; } } public DRT_Tvw_Abstract() : base() { } } public class DRT_Tvw_TableList

How do I override TreeNodeCollection.Add(TreeNode)?

大城市里の小女人 提交于 2019-12-06 06:03:21
I have this: public abstract class DRT_Tvw_Abstract : TreeView { TableCountMetrics metrics; public TableCountMetrics Metrics { get => metrics; set => metrics = value; } public class TableCountMetrics { int schemaNameCount = 0; int tableNameCount = 0; public int SchemaNameCount { get => schemaNameCount; set => schemaNameCount = value; } public int TableNameCount { get => tableNameCount; set => tableNameCount = value; } } public DRT_Tvw_Abstract() : base() { } } public class DRT_Tvw_TableList_Unfiltered : DRT_Tvw_Abstract { public DRT_Tvw_TableList_Unfiltered() : base() { } public void