예제 #1
0
        public static T GetChannel(ChannelType type, string emailProductId)
        {
            var simpleFactoryType = typeof(T);

            switch (simpleFactoryType.Name)
            {
            case "IMailChannel":
            {
                return((T)SimpleEmailFactory.CreateChannel(type, emailProductId));
            }

            case "IPushChannel":
            {
                return((T)SimplePushFactory.CreateChannel(type, emailProductId));
            }

            default:
            {
                return(default(T));
            }
            }
        }
예제 #2
0
        public static T CreateChannel(ChannelType type, IList <AudiencePropertieSetting> settings, string emailProductId)
        {
            var simpleFactoryType = typeof(T);

            switch (simpleFactoryType.Name)
            {
            case "IMailChannel":
            {
                return((T)SimpleEmailFactory.CreateChannel(type, settings, emailProductId));
            }

            case "IPushChannel":
            {
                return((T)SimplePushFactory.CreateChannel(type, settings, emailProductId));
            }

            default:
            {
                return(default(T));
            }
            }
        }