コード例 #1
0
        public static Cronofy.Channel CreateChannel(string path, bool onlyManaged, IEnumerable <string> calendarIds)
        {
            Cronofy.Channel channel = null;

            var builtChannel = new CreateChannelBuilder()
                               .CallbackUrl(path)
                               .OnlyManaged(onlyManaged)
                               .CalendarIds(calendarIds)
                               .Build();

            try
            {
                channel = CronofyAccountRequest <Cronofy.Channel>(() => { return(AccountClient.CreateChannel(builtChannel)); });
                LogHelper.Log(String.Format("CreateChannel success - path=`{0}` - onlyManaged=`{1}` - calendarIds=`{2}`", path, onlyManaged, String.Join(",", calendarIds)));
            }
            catch (CronofyException)
            {
                LogHelper.Log(String.Format("CreateChannel failure - path=`{0}` - onlyManaged=`{1}` - calendarIds=`{2}`", path, onlyManaged, String.Join(",", calendarIds)));
                throw;
            }

            return(channel);
        }