Ejemplo n.º 1
0
        /// <summary>
        /// Resolves a CommandSet list given its type.
        /// </summary>
        /// <param name="csType">The type of list CommandSet list to get.</param>
        /// <returns></returns>
        private IEnumerable <CommandSet> ResolveCommandSet(CommandSetType csType)
        {
            switch (csType)
            {
            case CommandSetType.CSTYPE_PHONE_CALL:
                return(PhoneCallSet);

            case CommandSetType.CSTYPE_WEBCHAT:
                return(WebchatSet);

            case CommandSetType.CSTYPE_EMAIL:
                return(EmailSet);

            case CommandSetType.CSTYPE_PERSONAL:
                return(PersonalSet);

            default:
                throw new InvalidOperationException("CommandSet Type not supported!");
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Removes a CommandSet from the SetList in the service layer.
 /// </summary>
 /// <param name="csType">The type of command to remove.</param>
 /// <param name="data">The CommandSet to remove.</param>
 public void RemoveCommandSet(CommandSetType csType, CommandSet data)
 {
     CommandService.RemoveCommandSet(csType, data);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds a CommandSet to the SetList in the service layer.
 /// </summary>
 /// <param name="csType">The type of command to add.</param>
 /// <param name="data">The CommandSet data.</param>
 public void AddCommandSet(CommandSetType csType, CommandSet data)
 {
     CommandService.AddCommandSet(csType, data);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Removes a CommandSet from the given SetType.
        /// </summary>
        /// <param name="csType">The SetType to remove the CommandSet from.</param>
        /// <param name="data">The CommandSet to remove from the SetType.</param>
        public void RemoveCommandSet(CommandSetType csType, CommandSet data)
        {
            List <CommandSet> SetList = ResolveCommandSet(csType) as List <CommandSet>;

            SetList.Remove(data);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Adds a CommandSet to the given SetType.
        /// </summary>
        /// <param name="csType">The SetType to add the command to.</param>
        /// <param name="data">The data to add to the SetType.</param>
        public void AddCommandSet(CommandSetType csType, CommandSet data)
        {
            List <CommandSet> SetList = ResolveCommandSet(csType) as List <CommandSet>;

            SetList.Add(data);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Gets a CommandSet list given its type.
 /// </summary>
 /// <param name="csType">The type of list CommandSet list to get.</param>
 /// <returns></returns>
 public IEnumerable <CommandSet> GetCommandSet(CommandSetType csType)
 {
     return(ResolveCommandSet(csType));
 }
Ejemplo n.º 7
0
 public static bool LoadFromFile(string fileName, out CommandSetType obj) {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Deserializes xml markup from file into an CommandSetType object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output CommandSetType object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out CommandSetType obj, out System.Exception exception) {
     exception = null;
     obj = default(CommandSetType);
     try {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
Ejemplo n.º 9
0
 public static bool Deserialize(string xml, out CommandSetType obj) {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Deserializes workflow markup into an CommandSetType object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output CommandSetType object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out CommandSetType obj, out System.Exception exception) {
     exception = null;
     obj = default(CommandSetType);
     try {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }