コード例 #1
0
 public void Init(SettingNode node)
 {
     connName = node.TryGetValue("connectionName");
     if (String.IsNullOrEmpty(connName))
     {
         throw new MissConfigurationException(node, "connectionName");
     }
 }
コード例 #2
0
        IShardSessionFactory CreateShardSessionFactory(SettingNode node, string path)
        {
            var factoryTypeString = node.TryGetValue(path);

            if (String.IsNullOrEmpty(factoryTypeString))
            {
                return(null);
            }

            Type factoryType = Type.GetType(factoryTypeString);

            return(CreateShardSessionFactory(factoryType));
        }
コード例 #3
0
        IShardStrategy CreateShardStrategy(SettingNode node, string path)
        {
            var type = node.TryGetValue(path);

            if (String.IsNullOrEmpty(type))
            {
                return(null);
            }

            IShardStrategy strategy = (IShardStrategy)FastActivator.Create(type);

            if (strategy != null && strategy is AbstractShardStrategy)
            {
                ((AbstractShardStrategy)strategy).Init(node.Attributes);
            }

            return(strategy);
        }