Пример #1
0
        internal bool SetEnumChannel()
        {
            var @enum = EnumHelpers.XmlToEnum <XmlEnumAlternateName>(channelName, typeof(StandardTriggerChannel), false);

            if (@enum != null)
            {
                channel = (StandardTriggerChannel)@enum;
                return(true);
            }

            return(false);
        }
Пример #2
0
        internal bool SetEnumChannel()
        {
            var @enum = EnumExtensions.XmlToEnum <XmlEnumAlternateName>(translatedChannelName ?? channelName, typeof(StandardTriggerChannel), false);

            if (@enum != null)
            {
                channel = (StandardTriggerChannel)@enum;
                return(true);
            }

            return(false);
        }
Пример #3
0
        /// <summary>
        /// Indicates whether the notification trigger can use a <see cref="StandardTriggerChannel"/> as its <see cref="Channel"/> (where applicable).
        /// If so, the object's channel is set to the resolved enum value.
        /// </summary>
        /// <returns></returns>
        internal bool SetEnumChannel()
        {
            switch (Type)
            {
            case TriggerType.Speed:
            case TriggerType.Threshold:
            case TriggerType.Volume:
                var @enum = EnumHelpers.XmlToEnum <XmlEnumAlternateName>(channelName, typeof(StandardTriggerChannel), false);

                if (@enum == null)
                {
                    return(true);
                }

                channel = (StandardTriggerChannel)@enum;

                break;
            }

            return(false);
        }