Exemple #1
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (ParticipantType != null)
            {
                p.Add(new KeyValuePair <string, string>("ParticipantType", ParticipantType.ToString()));
            }

            if (Identifier != null)
            {
                p.Add(new KeyValuePair <string, string>("Identifier", Identifier));
            }

            if (FriendlyName != null)
            {
                p.Add(new KeyValuePair <string, string>("FriendlyName", FriendlyName));
            }

            if (ProxyIdentifier != null)
            {
                p.Add(new KeyValuePair <string, string>("ProxyIdentifier", ProxyIdentifier));
            }

            if (ProxyIdentifierSid != null)
            {
                p.Add(new KeyValuePair <string, string>("ProxyIdentifierSid", ProxyIdentifierSid.ToString()));
            }

            return(p);
        }
        /// <summary>
        /// Base for rendering a participant.
        /// </summary>
        /// <param name="participantType">The type of participant.</param>
        /// <param name="name">The name of the participant.</param>
        /// <param name="color">Optional color of the participant.</param>
        /// <param name="order">Optional order of the participant.</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="stringBuilder"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">Thrown when <paramref name="name"/> is <c>null</c>, empty of only white space.</exception>
        internal static void ParticipantBase(this StringBuilder stringBuilder, ParticipantType participantType, ParticipantName name, Color color, int?order)
        {
            if (stringBuilder is null)
            {
                throw new ArgumentNullException(nameof(stringBuilder));
            }

            if (participantType >= ParticipantType.Participant)
            {
                stringBuilder.Append(participantType.ToString().ToLowerInvariant());
                stringBuilder.Append(Constant.Space);
            }

            stringBuilder.Append(name);

            if (order.HasValue)
            {
                stringBuilder.Append(Constant.Space);
                stringBuilder.Append(Constant.Order);
                stringBuilder.Append(Constant.Space);
                stringBuilder.Append(order.Value);
            }

            if (color is not null)
            {
                stringBuilder.Append(Constant.Space);
                stringBuilder.Append(color);
            }

            stringBuilder.AppendNewLine();
        }
Exemple #3
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public override List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (ParticipantType != null)
            {
                p.Add(new KeyValuePair <string, string>("ParticipantType", ParticipantType.ToString()));
            }

            if (Identifier != null)
            {
                p.Add(new KeyValuePair <string, string>("Identifier", Identifier));
            }

            if (PageSize != null)
            {
                p.Add(new KeyValuePair <string, string>("PageSize", PageSize.ToString()));
            }

            return(p);
        }
 public static string ToString(ParticipantType value)
 {
     if( value==ParticipantType.Admitter )
         return "admitter";
     else if( value==ParticipantType.Discharger )
         return "discharger";
     else if( value==ParticipantType.Responsible )
         return "responsible";
     else if( value==ParticipantType.Attending )
         return "attending";
     else if( value==ParticipantType.Consulting )
         return "consulting";
     else if( value==ParticipantType.Referrer )
         return "referrer";
     else
         throw new ArgumentException("Unrecognized ParticipantType value: " + value.ToString());
 }
Exemple #5
0
 public static string ToString(ParticipantType value)
 {
     if (value == ParticipantType.Admitter)
     {
         return("admitter");
     }
     else if (value == ParticipantType.Discharger)
     {
         return("discharger");
     }
     else if (value == ParticipantType.Responsible)
     {
         return("responsible");
     }
     else if (value == ParticipantType.Attending)
     {
         return("attending");
     }
     else if (value == ParticipantType.Consulting)
     {
         return("consulting");
     }
     else if (value == ParticipantType.Referrer)
     {
         return("referrer");
     }
     else
     {
         throw new ArgumentException("Unrecognized ParticipantType value: " + value.ToString());
     }
 }