示例#1
0
        /// <summary>
        /// Creates a new <see cref="List`AllowedValuesCollection"/> from a <see cref="AllowedValuesCollection"/>.
        /// </summary>
        public static IList <string> ToList(this AllowedValuesCollection collection)
        {
            List <string> list = new List <string>();

            foreach (string item in collection)
            {
                list.Add(item);
            }

            return(list);
        }
示例#2
0
        private List <string> GetAllowedValues(AllowedValuesCollection allowedValues)
        {
            var values = new List <string>();

            foreach (var value in allowedValues)
            {
                values.Add(value.ToString());
            }

            return(values);
        }
        internal static AllowedValuesCollectionWrapper GetInstance()
        {
            AllowedValuesCollection real = default(AllowedValuesCollection);

            RealInstanceFactory(ref real);
            var instance = (AllowedValuesCollectionWrapper)AllowedValuesCollectionWrapper.GetWrapper(real);

            InstanceFactory(ref instance);
            if (instance == null)
            {
                Assert.Inconclusive("Could not Create Test Instance");
            }
            return(instance);
        }
        private string FindBestState(string currentValue, AllowedValuesCollection allowedValues)
        {
            switch (currentValue)
            {
            case "Fermé":
                if (allowedValues.Contains("Closed"))
                {
                    return("Closed");
                }
                return(currentValue);

            case "Actif":
                if (allowedValues.Contains("Active"))
                {
                    return("Active");
                }
                return(currentValue);

            default:
                return(currentValue);
            }
        }
 static partial void RealInstanceFactory(ref AllowedValuesCollection real, [CallerMemberName] string callerName = "");