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


C# Selector.AddNode方法代码示例

本文整理汇总了C#中Selector.AddNode方法的典型用法代码示例。如果您正苦于以下问题:C# Selector.AddNode方法的具体用法?C# Selector.AddNode怎么用?C# Selector.AddNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Selector的用法示例。


在下文中一共展示了Selector.AddNode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FillTreeWithData

        protected override void FillTreeWithData(Selector selector, ITypeDescriptorContext context, IServiceProvider provider)
        {
            base.FillTreeWithData(selector, context, provider);

            var model = xElementProperty.GetValue(wrappedItemProperty.GetValue(context.Instance)) as XElement;

            selector.AddNode("(None)", null, null);
            foreach (XElement entityType in new PropertyManager(model.GetDefaultNamespace()).GetEntityTypes(model))
            {
                selector.AddNode(entityType.Attribute("Name").Value, entityType, null);
            }
        }
开发者ID:mlzharov,项目名称:Asp.Net-Identity-Tools-for-Entity-Framework-model,代码行数:12,代码来源:IdentityEntityPropertyEditor.cs

示例2: FillTreeWithData

        protected override void FillTreeWithData(Selector selector, ITypeDescriptorContext context, IServiceProvider provider)
        {
            base.FillTreeWithData(selector, context, provider);

            var model = xElementProperty.GetValue(wrappedItemProperty.GetValue(context.Instance)) as XElement;

            selector.AddNode("(None)", null, null);
            var items = new PropertyManager(model.GetDefaultNamespace()).GetEntityTypes(model).Select(et => et.Attribute("Name").Value).OrderBy(n => n).ToList();
            foreach (string entityTypeName in items)
            {
                selector.AddNode(entityTypeName, entityTypeName, null);
            }

            //int nOfItems = selector.Height / selector.ItemHeight;
            selector.Height = selector.ItemHeight * Math.Min(items.Count + 1, 8);
        }
开发者ID:mlzharov,项目名称:Asp.Net-Identity-Tools-for-Entity-Framework-model,代码行数:16,代码来源:IdentityEntityPropertyEditor.cs

示例3: FillTreeWithData

        protected override void FillTreeWithData(Selector selector, ITypeDescriptorContext context, IServiceProvider provider)
        {
            base.FillTreeWithData(selector, context, provider);
              IHaveConnection source = context.Instance as IHaveConnection;

              if (source == null) return;

              using (DataTable table = source.GetConnection().GetSchema("Catalogs"))
              {
            foreach (DataRow row in table.Rows)
            {
              selector.AddNode(row[0].ToString(), row[0], null);
            }
              }
        }
开发者ID:cody82,项目名称:spacewar-arena,代码行数:15,代码来源:Table.cs

示例4: FillTreeWithData

        protected override void FillTreeWithData(Selector selector, ITypeDescriptorContext context, IServiceProvider provider)
        {
            base.FillTreeWithData(selector, context, provider);
              IHaveConnectionScope source = context.Instance as IHaveConnectionScope;
              Table design;

              if (source == null) return;

              design = source.DesignTable as Table;

              using (DataTable table = source.GetConnection().GetSchema("Tables", new string[] { source.CatalogScope }))
              {
            foreach (DataRow row in table.Rows)
            {
              bool add = true;
              if (design != null && (row[2].ToString() == design.OldName || row[2].ToString() == design.Name))
            add = false;

              if (add)
            selector.AddNode(row[2].ToString(), row[2], null);
            }
              }
              if (design != null)
            selector.AddNode(design.Name, design.Name, null);
        }
开发者ID:lucianocampos,项目名称:Npgsql2,代码行数:25,代码来源:Index.cs

示例5: FillTreeWithData

    protected override void FillTreeWithData(Selector selector, ITypeDescriptorContext context, IServiceProvider provider)
    {
      object manager = Activator.CreateInstance(_managerType, new object[] { provider });
      DbConnection connection = (DbConnection)context.Instance;
      ObjectSelectorEditor.SelectorNode node;

      _selector = selector;

      _selector.Clear();

      if (manager != null)
      {
        int items = (int)_managerType.InvokeMember("GetConnectionCount", BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.Public, null, manager, null);
        string dataProvider;
        string connectionString;
        string connectionName;

        for (int n = 0; n < items; n++)
        {
          connectionString = (string)_managerType.InvokeMember("GetConnectionString", BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.Public, null, manager, new object[] { n });
          connectionName = (string)_managerType.InvokeMember("GetConnectionName", BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.Public, null, manager, new object[] { n });
          dataProvider = (string)_managerType.InvokeMember("GetProvider", BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.Public, null, manager, new object[] { n });
          if (String.Compare(dataProvider, "System.Data.SQLite", StringComparison.OrdinalIgnoreCase) == 0)
          {
            node = selector.AddNode(connectionName, connectionString, null);
            
            if (String.Compare(connectionString, connection.ConnectionString, StringComparison.OrdinalIgnoreCase) == 0)
              selector.SelectedNode = node;
          }
        }
        selector.AddNode("<New Connection...>", this, null);
      }
    }
开发者ID:CuneytKukrer,项目名称:TestProject,代码行数:33,代码来源:SQLiteConnectionStringEditor.cs


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