Add() public méthode

public Add ( object key, object value ) : void
key object
value object
Résultat void
 public void PassingEqualityComparers()
 {
     var eqComp = new CaseInsensitiveEqualityComparer();
     var d1 = new OrderedDictionary(eqComp);
     d1.Add("foo", "bar");
     Assert.Throws<ArgumentException>(() => d1.Add("FOO", "bar"));
 }
Exemple #2
0
 public IOrderedDictionary GetSelectedRowData()
 {
     IOrderedDictionary result;
     if (null == this.SelectedRow)
     {
         result = null;
     }
     else
     {
         OrderedDictionary fieldValues = new OrderedDictionary();
         foreach (object field in this.CreateColumns(null, false))
         {
             if (field is BoundField && !fieldValues.Contains(((BoundField)field).DataField))
             {
                 fieldValues.Add(((BoundField)field).DataField, null);
             }
         }
         string[] dataKeyNames = this.DataKeyNames;
         for (int i = 0; i < dataKeyNames.Length; i++)
         {
             string key = dataKeyNames[i];
             if (!fieldValues.Contains(key))
             {
                 fieldValues.Add(key, null);
             }
         }
         this.ExtractRowValues(fieldValues, this.SelectedRow, true, true);
         result = fieldValues;
     }
     return result;
 }
        public string EmitCommand(object[] tupleValues, long? tupleId= null, long? taskId = null, string streamid = null)
        {
            var result = new OrderedDictionary
            {
                {WellKnownStrings.Command, WellKnownStrings.Emit},
            };

            if (tupleId.HasValue)
            {
                result.Add(WellKnownStrings.Id, tupleId.Value.ToString(CultureInfo.InvariantCulture));
            }

            if (!string.IsNullOrEmpty(streamid))
            {
                result.Add(WellKnownStrings.Stream, streamid);
            }

            if (taskId.HasValue)
            {
                result.Add(WellKnownStrings.Task, taskId.Value);
            }

            result.Add(WellKnownStrings.Tuple, tupleValues);
            return result.ToJson();
        }
Exemple #4
0
        public void AgregarColonia(string colonia, string municipio)
        {
            MySqlDataAccess mysqlAccess = new MySqlDataAccess();
            OrderedDictionary listParam = new OrderedDictionary();
            listParam.Add("nombreColonia", colonia);
            listParam.Add("nombreMunicipio", municipio);

            var data = mysqlAccess.ExecuteProcedure("AgregarColonia", listParam);
        }
        public void PrintWithIDictionary() {
            // Arrange
            MockObjectVisitor visitor = CreateObjectVisitor();
            IDictionary dict = new OrderedDictionary();
            dict.Add("foo", "bar");
            dict.Add("abc", 500);

            // Act
            visitor.Print(dict);

            // Assert
            Assert.AreEqual("foo = bar", visitor.KeyValuePairs[0]);
            Assert.AreEqual("abc = 500", visitor.KeyValuePairs[1]);
        }
        public void BuildInstance()
        {
            SimpleEntity simpleEntity = new SimpleEntity();
            OrderedDictionary values = new OrderedDictionary(3);
            values.Add("Id", 1);
            values.Add("Name", "name");
            values.Add("Age", 10);

            TypeDescriptionHelper.BuildInstance(values, simpleEntity);

            Assert.AreEqual(1, simpleEntity.Id);
            Assert.AreEqual("name", simpleEntity.Name);
            Assert.AreEqual(10, simpleEntity.Age);
        }
Exemple #7
0
 public bool ValidateUser(string userName, string pass)
 {
     bool respu = false;
     MySqlDataAccess mysqlAccess = new MySqlDataAccess();
     OrderedDictionary listParam = new OrderedDictionary();
     listParam.Add("userName", userName);
     listParam.Add("pass", pass);
       var data =  mysqlAccess.ExecuteProcedure("ValidarUsuario", listParam);
       if (data.Rows.Count > 0)
       {
           respu = true;
       }
       return respu;
 }
		/// <summary>
		/// Parses the parameters passed to the constructor.
		/// </summary>
		/// <param name="fields">The object[] passed to the constructor.</param>
		/// <exception cref="ArgumentException">Either the length of the params argument is odd, each pair of objects within the params argument do not each comprise a valid <see cref="KeyValuePair{SortBy,SortOrder}"/>, or there is a duplicate <see cref="SortBy"/> key within the params argument.</exception>
		private void ParseParams(ref object[] fields)
		{
			var orderedDictionary = new OrderedDictionary();
			
			// Must have an even number of items in the array.
			if (fields.Length % 2 != 0)
			{
				throw new ArgumentException("There must be an even number of items in the array.");
			}
			else
			{
				for (int i = 0; i < fields.Length/2; i++)
				{
					if (fields[i*2] is SortBy && fields[i*2 + 1] is SortOrder)
					{
						orderedDictionary.Add((SortBy)fields[i * 2], (SortOrder)fields[i * 2 + 1]);
					}
					else
					{
						throw new ArgumentException(
							"Each pair of items added to the object array must be a pairing of SortBy then SortOrder.");
					}
				}
			}

			OrderedDictionary = orderedDictionary;
		}
        public PollsMainForm(User _user)
        {
            InitializeComponent();
            //_anketsUser=new User();
            //_anketsUser.Login = "******";
            //_anketsUser.CodMfo = 964;
            //_anketsUser.CodObl = 8;
            //_anketsUser.CodRKC = 0;
            //_anketsUser.PrivilegesCodMfo = 0;
            //_anketsUser.PrivilegesCodObl = 6;
            //_anketsUser.PrivilegesCodRKC = 0;
            //_anketsUser.
            _anketsUser = _user;
            _deposPollsTable = new DeposPollsTableForm(_anketsUser);
            splitContainer1.Panel2.Controls.Add(_deposPollsTable);
            _deposPollsTable.Dock = DockStyle.Fill;
            settings = global::Poll.Properties.Settings.Default;
            //Console.WriteLine(settings.Test);
            //settings.Test = "проверка";
            //Console.WriteLine(settings.Test);
            //MessageBox.Show(settings.Test);
            OrderedDictionary ttt = new OrderedDictionary();
            foreach (DataColumn t in _deposPollsTable.pollsDataSet.POLL_DEPOS.Columns)
            {
                ttt.Add(t.ColumnName, "");
                //settings.DeposTableColumnsText.Add(t.ColumnName,"");
            }
            settings.DeposTableColumnsText = ttt;
            settings.Save();

            //_deposPollsTable.buttonAddPoll.
            //Refresh();
            Update();
        }
Exemple #10
0
        public OrderedDictionary GetEmoticonHashTable()
        {
            const string key = "GetEmoticonHashTable";
            var emoticons = _cacheService.Get<OrderedDictionary>(key);
            if (emoticons == null)
            {
                emoticons = new OrderedDictionary();
                var root = SiteConfig.Instance.GetSiteConfig();
                    var emoticonNodes = root?.SelectNodes("/forum/emoticons/emoticon");
                    if (emoticonNodes != null)
                    {
                        foreach (XmlNode emoticonNode in emoticonNodes)
                        {
                            //<emoticon symbol="O:)" image="angel-emoticon.png" />  
                            if (emoticonNode.Attributes != null)
                            {
                                var emoticonSymbolAttr = emoticonNode.Attributes["symbol"];
                                var emoticonImageAttr = emoticonNode.Attributes["image"];
                                if (emoticonSymbolAttr != null && emoticonImageAttr != null)
                                {
                                    emoticons.Add(emoticonSymbolAttr.InnerText, emoticonImageAttr.InnerText);
                                }
                            }
                        }

                        _cacheService.Set(key, emoticons, CacheTimes.OneDay);
                    }
              
            }

            return emoticons;
        }
        public static OrderedDictionary CustomTrim(this OrderedDictionary source)
        {
            if (source == null) return null;


            var result = new OrderedDictionary();


            var keys = source.Keys;

            foreach (var key in keys)
            {
                var value = source[key];


                var stringValue = value as string;

                if (stringValue != null)
                {
                    value = stringValue.CustomTrim();
                }


                result.Add(key, value);
            }


            return result;
        }
        public void CountTests()
        {
            var d = new OrderedDictionary();
            Assert.Equal(0, d.Count);

            for (int i = 0; i < 1000; i++)
            {
                d.Add(i, i);
                Assert.Equal(i + 1, d.Count);
            }

            for (int i = 0; i < 1000; i++)
            {
                d.Remove(i);
                Assert.Equal(1000 - i - 1, d.Count);
            }

            for (int i = 0; i < 1000; i++)
            {
                d[(object)i] = i;
                Assert.Equal(i + 1, d.Count);
            }

            for (int i = 0; i < 1000; i++)
            {
                d.RemoveAt(0);
                Assert.Equal(1000 - i - 1, d.Count);
            }
        }
        public void BuildInstanceThrowsIfPropertyIsReadOnly()
        {
            OrderedDictionary values = new OrderedDictionary(1);
            values.Add("Name", "name");

            TypeDescriptionHelper.BuildInstance(values, new SimpleEntityWithReadOnlyProperty());
        }
Exemple #14
0
        public void AgregarLugar(string lugar)
        {
            MySqlDataAccess mysqlAccess = new MySqlDataAccess();
            OrderedDictionary listParam = new OrderedDictionary();
            listParam.Add("nombreLugar", lugar);

            var data = mysqlAccess.ExecuteProcedure("AgregarLugar", listParam);
        }
Exemple #15
0
		public void DataKeyArray_Item ()
		{
			OrderedDictionary dictionary = new OrderedDictionary();
			dictionary.Add("key","value");
			ArrayList list = new ArrayList ();
			DataKey key = new DataKey (dictionary);
			list.Add (key);
			DataKeyArray keyarray = new DataKeyArray (list);
			Assert.AreEqual(1,keyarray.Count,"CreateItems");
			Assert.AreEqual (key, keyarray[0], "CreateKeyData");
			Assert.AreEqual ("value",((DataKey)keyarray[0]).Value,"KeyArrayValue");
			dictionary.Add ("key1", "value1");
			key = new DataKey (dictionary);
			list.Add (key);
			keyarray = new DataKeyArray (list);
			Assert.AreEqual (2, keyarray.Count, "CreateItemsMulty");
		}
        public void PassingEqualityComparers()
        {
            var eqComp = new CaseInsensitiveEqualityComparer();
            var d1 = new OrderedDictionary(eqComp);
            d1.Add("foo", "bar");
            Assert.Throws<ArgumentException>(() => d1.Add("FOO", "bar"));

            // The equality comparer should also test for a non-existent key 
            d1.Remove("foofoo");
            Assert.True(d1.Contains("foo"));

            // Make sure we can change an existent key that passes the equality comparer
            d1["FOO"] = "barbar";
            Assert.Equal("barbar", d1["foo"]);

            d1.Remove("FOO");
            Assert.False(d1.Contains("foo"));
        }
		public void DataKey_Functionality()
		{
			OrderedDictionary  dictionary = new OrderedDictionary ();
			IOrderedDictionary iDictionary;
			dictionary.Add ("key", "value");
			DataKey key = new DataKey (dictionary);
			Assert.AreEqual ("value", key[0].ToString(), "DataKeyItemIndex");
			Assert.AreEqual ("value", key["key"].ToString (), "DataKeyItemKeyName");
			Assert.AreEqual ("value", key.Value, "FirstIndexValue");
			iDictionary = key.Values;
			Assert.AreEqual (1, iDictionary.Count, "AllValuesReferringToKey");
			Assert.AreEqual ("value", iDictionary[0], "ValueReferringToKey");
			dictionary.Add("key1", "value1");
			key = new DataKey (dictionary);
			iDictionary = key.Values;
			Assert.AreEqual (2, iDictionary.Count, "AllValuesReferringToKey#1");
			Assert.AreEqual ("value1", iDictionary[1], "ValueReferringToKey#1");
		}
		private void Common (OrderedDictionary od)
		{
			Assert.IsNotNull (od.GetEnumerator (), "GetEnumerator");
			Assert.AreEqual (0, od.Count, "Count-0");
			Assert.IsFalse (od.IsReadOnly, "IsReadOnly");
			od.Add ("a", "1");
			Assert.AreEqual (1, od.Count, "Count-1");
			od["a"] = "11";
			Assert.AreEqual ("11", od["a"], "this[string]");
			od[0] = "111";
			Assert.AreEqual ("111", od[0], "this[int]");

			DictionaryEntry[] array = new DictionaryEntry[2];
			od.CopyTo (array, 1);

			Assert.AreEqual ("111", ((DictionaryEntry)array[1]).Value, "CopyTo");
			Assert.AreEqual (1, od.Keys.Count, "Keys");
			Assert.AreEqual (1, od.Values.Count, "Values");
			Assert.IsTrue (od.Contains ("a"), "Contains(a)");
			Assert.IsFalse (od.Contains ("111"), "Contains(111)");

			od.Insert (0, "b", "2");
			Assert.AreEqual (2, od.Count, "Count-2");
			od.Add ("c", "3");
			Assert.AreEqual (3, od.Count, "Count-3");

			OrderedDictionary ro = od.AsReadOnly ();

			od.RemoveAt (2);
			Assert.AreEqual (2, od.Count, "Count-4");
			Assert.IsFalse (od.Contains ("c"), "Contains(c)");

			od.Remove ("b");
			Assert.AreEqual (1, od.Count, "Count-5");
			Assert.IsFalse (od.Contains ("b"), "Contains(b)");

			od.Clear ();
			Assert.AreEqual (0, od.Count, "Count-6");

			Assert.IsTrue (ro.IsReadOnly, "IsReadOnly-2");
			// it's a read-only reference
			Assert.AreEqual (0, od.Count, "Count-7");
		}
        public void GetReadOnlyDictionaryReturnsReadOnlyDictionary()
        {
            OrderedDictionary dictionary = new OrderedDictionary(1);
            dictionary.Add("key", "value");

            IDictionary result = DictionaryHelper.GetReadOnlyDictionary(dictionary);

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("value", result["key"]);
            Assert.IsTrue(result.IsReadOnly);
        }
Exemple #20
0
 internal static bool AddToCollection(OrderedDictionary col, ref object Item)
 {
     bool result = false;
     if (!Exists(col, Item))
     {
         //UPGRADE_WARNING: (1068) Item of type Variant is being forced to string. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
         col.Add(Convert.ToString(Item), Item);
         result = true;
     }
     return result;
 }
Exemple #21
0
        public void SetFormalParameterNames(List<string> formalParameters)
        {
            FormalParameters = new OrderedDictionary<string, string>();

            formalParameters.ForEach(parameterName =>
            {
                string varNameUsed = NameGenerator.GetAvailableName(JavaScriptCodeParameters.VARIABLEPREFIX + parameterName, variablesCreated);
                variablesCreated.Add(varNameUsed);
                FormalParameters.Add(parameterName, varNameUsed);
            });
        }
        public static IDictionary GetReadOnlyDictionary(IDictionary dictionary)
        {
            Guard.ArgumentNotNull(dictionary, "dictionary");

            OrderedDictionary result = new OrderedDictionary();
            foreach (DictionaryEntry entry in dictionary)
            {
                result.Add(entry.Key, entry.Value);
            }
            return result.AsReadOnly();
        }
        public void MergeNameValueDictionaries()
        {
            OrderedDictionary dictionary1 = new OrderedDictionary(1);
            dictionary1.Add("key1", "value1");
            OrderedDictionary dictionary2 = new OrderedDictionary(1);
            dictionary2.Add("key2", "value2");

            IDictionary result = DictionaryHelper.MergeNameValueDictionaries(dictionary1, dictionary2);

            Assert.AreEqual(2, result.Count);
            Assert.AreEqual("value1", result["key1"]);
            Assert.AreEqual("value2", result["key2"]);
        }
 public void PassingCapacityAndIEqualityComparer()
 {
     var eqComp = new CaseInsensitiveEqualityComparer();
     var d1 = new OrderedDictionary(-1000, eqComp);
     var d2 = new OrderedDictionary(-1, eqComp);
     var d3 = new OrderedDictionary(0, eqComp);
     var d4 = new OrderedDictionary(1, eqComp);
     var d5 = new OrderedDictionary(1000, eqComp);
     Assert.Throws<ArgumentOutOfRangeException>(() => d1.Add("foo", "bar"));
     Assert.Throws<ArgumentOutOfRangeException>(() => d2.Add("foo", "bar"));
     d3.Add("foo", "bar");
     d4.Add("foo", "bar");
     d5.Add("foo", "bar");
 }
Exemple #25
0
        public List<Reporte> GetReporte( string edad, string brigada, string lugar, string municipio, string colonia,
            DateTime fechaInicial, DateTime fechaHasta)
        {
            try
            {
                List<Reporte> list = new List<Reporte>();
                MySqlDataAccess mysqlAccess = new MySqlDataAccess();
                OrderedDictionary listParam = new OrderedDictionary();
                

                listParam.Add("pEdad", int.Parse(edad));
                listParam.Add("pBrigada", brigada);
                listParam.Add("pLugar", lugar);
                listParam.Add("pMunicipio", municipio);
                listParam.Add("pColonia", colonia);             

                listParam.Add("pFechaInicial", fechaInicial.Date);


                listParam.Add("pFechaFinal", fechaHasta.Date);
                var data = mysqlAccess.ExecuteProcedure("ObtenerReporte", listParam);


                foreach (DataRow row in data.Rows)
                {
                    Reporte itemReporte = new Reporte();
                    itemReporte.Brigada = row["brigada"].ToString();
                    itemReporte.Colonia = row["colonia"].ToString();

                    DateTime edadD = Convert.ToDateTime(row["edad"].ToString());


                    itemReporte.Edad = (DateTime.Now.Year - edadD.Year).ToString();
                    itemReporte.Lugar = row["lugar"].ToString();
                    itemReporte.Municipio = row["municipio"].ToString();
                    itemReporte.Nombre = row["nombre"].ToString();
                    itemReporte.FechaInicial = Convert.ToDateTime(row["creado"].ToString());

                    list.Add(itemReporte);
                }

                return list;
            }

            catch (Exception ex)
            {
                throw ex;
            }
         //   return ParseDataTableComboBox(data);
        }
 public void CreatingWithDifferentCapacityValues()
 {
     // exceptions are not thrown until you add an element
     var d1 = new OrderedDictionary(-1000);
     var d2 = new OrderedDictionary(-1);
     var d3 = new OrderedDictionary(0);
     var d4 = new OrderedDictionary(1);
     var d5 = new OrderedDictionary(1000);
     Assert.Throws<ArgumentOutOfRangeException>(() => d1.Add("foo", "bar"));
     Assert.Throws<ArgumentOutOfRangeException>(() => d2.Add("foo", "bar"));
     d3.Add("foo", "bar");
     d4.Add("foo", "bar");
     d5.Add("foo", "bar");
 }
Exemple #27
0
        /// <summary>
        ///     Reset states of all nodes to State.NoChange. It should be called
        ///     before each running.
        /// </summary>
        public void ResetStates()
        {
            // Remove all thoses deleted nodes and mark the states of remaining
            // nodes as clean.
            var newStates = new OrderedDictionary();
            foreach (Guid guid in states.Keys)
            {
                State state = (State)states[guid];
                if (state != State.Deleted)
                {
                    newStates.Add(guid, State.Clean);
                }
            }

            states = newStates;
        }
 protected override void ProcessRecord()
 {
     var sites = Sitecore.Sites.SiteManager.GetSites().EcommerceOnly().Select(x => x.Name);
     if (SwitchParameter.Present)
     {
         var dict = new OrderedDictionary();
         foreach (var site in sites)
         {
             dict.Add(site, site);
         }
         WriteObject(dict);
     }
     else
     {
         WriteObject(sites);
     }
 }
Exemple #29
0
        public static MultiSelectList BuildSortedMultiList(dynamic p_viewBag, object p_model)
        {
            IEnumerable l_items = null;
            if (p_viewBag.RelatedEntityId != null)
            {
                OrderedDictionary l_params = new OrderedDictionary();
                l_params.Add("relatedEntityId", p_viewBag.RelatedEntityId.ToString());
                l_items = BuildEnumerable(p_viewBag.EntityTypeName, p_viewBag.ChoiceMethodName, false, l_params);
            }
            else
            {
                l_items = BuildEnumerable(p_viewBag.EntityTypeName, p_viewBag.ChoiceMethodName, false);
            }

            MultiSelectList l_list = new MultiSelectList(l_items.Cast<object>().OrderBy(o => DataBinder.Eval(o, ViewPropertyDescriptor.EntityDisplayName)), ViewPropertyDescriptor.EntityKey, ViewPropertyDescriptor.EntityDisplayName, BuildSelectedEnumerable(p_model as IEnumerable));

            return l_list;
        }
        public void loadResXFileToModify(string resXFileToModify)
        {
            _resourceEntries = new OrderedDictionary();

            // Get existing resources.
            using (var reader = new ResXResourceReader(resXFileToModify))
            {
                if (reader != null)
                {
                    reader.UseResXDataNodes = true;
                    foreach (DictionaryEntry entry in reader)
                    {
                        var dnode = (ResXDataNode)entry.Value;
                        _resourceEntries.Add(dnode.Name, dnode);
                    }
                }
            }
        }
Exemple #31
0
    public void Populate()
    {
        #region Types of Keywords

        FieldPublicDynamic = new { PropPublic1 = "A", PropPublic2 = 1, PropPublic3 = "B", PropPublic4 = "B", PropPublic5 = "B", PropPublic6 = "B", PropPublic7 = "B", PropPublic8 = "B", PropPublic9 = "B", PropPublic10 = "B", PropPublic11 = "B", PropPublic12 = new { PropSubPublic1 = 0, PropSubPublic2 = 1, PropSubPublic3 = 2 } };
        FieldPublicObject  = new StringBuilder("Object - StringBuilder");
        FieldPublicInt32   = int.MaxValue;
        FieldPublicInt64   = long.MaxValue;
        FieldPublicULong   = ulong.MaxValue;
        FieldPublicUInt    = uint.MaxValue;
        FieldPublicDecimal = 100000.999999m;
        FieldPublicDouble  = 100000.999999d;
        FieldPublicChar    = 'A';
        FieldPublicByte    = byte.MaxValue;
        FieldPublicBoolean = true;
        FieldPublicSByte   = sbyte.MaxValue;
        FieldPublicShort   = short.MaxValue;
        FieldPublicUShort  = ushort.MaxValue;
        FieldPublicFloat   = 100000.675555f;

        FieldPublicInt32Nullable   = int.MaxValue;
        FieldPublicInt64Nullable   = 2;
        FieldPublicULongNullable   = ulong.MaxValue;
        FieldPublicUIntNullable    = uint.MaxValue;
        FieldPublicDecimalNullable = 100000.999999m;
        FieldPublicDoubleNullable  = 100000.999999d;
        FieldPublicCharNullable    = 'A';
        FieldPublicByteNullable    = byte.MaxValue;
        FieldPublicBooleanNullable = true;
        FieldPublicSByteNullable   = sbyte.MaxValue;
        FieldPublicShortNullable   = short.MaxValue;
        FieldPublicUShortNullable  = ushort.MaxValue;
        FieldPublicFloatNullable   = 100000.675555f;

        #endregion

        #region System

        FieldPublicDateTime         = new DateTime(2000, 1, 1, 1, 1, 1);
        FieldPublicTimeSpan         = new TimeSpan(1, 10, 40);
        FieldPublicEnumDateTimeKind = DateTimeKind.Local;

        // Instantiate date and time using Persian calendar with years,
        // months, days, hours, minutes, seconds, and milliseconds
        FieldPublicDateTimeOffset = new DateTimeOffset(1387, 2, 12, 8, 6, 32, 545,
                                                       new System.Globalization.PersianCalendar(),
                                                       new TimeSpan(1, 0, 0));

        FieldPublicIntPtr         = new IntPtr(100);
        FieldPublicTimeZone       = TimeZone.CurrentTimeZone;
        FieldPublicTimeZoneInfo   = TimeZoneInfo.Utc;
        FieldPublicTuple          = Tuple.Create <string, int, decimal>("T-string\"", 1, 1.1m);
        FieldPublicType           = typeof(object);
        FieldPublicUIntPtr        = new UIntPtr(100);
        FieldPublicUri            = new Uri("http://www.site.com");
        FieldPublicVersion        = new Version(1, 0, 100, 1);
        FieldPublicGuid           = new Guid("d5010f5b-0cd1-44ca-aacb-5678b9947e6c");
        FieldPublicSingle         = Single.MaxValue;
        FieldPublicException      = new Exception("Test error", new Exception("inner exception"));
        FieldPublicEnumNonGeneric = EnumTest.ValueA;
        FieldPublicAction         = () => true.Equals(true);
        FieldPublicAction2        = (a, b) => true.Equals(true);
        FieldPublicFunc           = () => true;
        FieldPublicFunc2          = (a, b) => true;

        #endregion

        #region Arrays and Collections

        FieldPublicArrayUni    = new string[2];
        FieldPublicArrayUni[0] = "[0]";
        FieldPublicArrayUni[1] = "[1]";

        FieldPublicArrayTwo       = new string[2, 2];
        FieldPublicArrayTwo[0, 0] = "[0, 0]";
        FieldPublicArrayTwo[0, 1] = "[0, 1]";
        FieldPublicArrayTwo[1, 0] = "[1, 0]";
        FieldPublicArrayTwo[1, 1] = "[1, 1]";

        FieldPublicArrayThree          = new string[1, 1, 2];
        FieldPublicArrayThree[0, 0, 0] = "[0, 0, 0]";
        FieldPublicArrayThree[0, 0, 1] = "[0, 0, 1]";

        FieldPublicJaggedArrayTwo    = new string[2][];
        FieldPublicJaggedArrayTwo[0] = new string[5] {
            "a", "b", "c", "d", "e"
        };
        FieldPublicJaggedArrayTwo[1] = new string[4] {
            "a1", "b1", "c1", "d1"
        };

        FieldPublicJaggedArrayThree          = new string[1][][];
        FieldPublicJaggedArrayThree[0]       = new string[1][];
        FieldPublicJaggedArrayThree[0][0]    = new string[2];
        FieldPublicJaggedArrayThree[0][0][0] = "[0][0][0]";
        FieldPublicJaggedArrayThree[0][0][1] = "[0][0][1]";

        FieldPublicMixedArrayAndJagged = new int[3][, ]
        {
            new int[, ] {
                { 1, 3 }, { 5, 7 }
            },
            new int[, ] {
                { 0, 2 }, { 4, 6 }, { 8, 10 }
            },
            new int[, ] {
                { 11, 22 }, { 99, 88 }, { 0, 9 }
            }
        };

        FieldPublicDictionary = new System.Collections.Generic.Dictionary <string, string>();
        FieldPublicDictionary.Add("Key1", "Value1");
        FieldPublicDictionary.Add("Key2", "Value2");
        FieldPublicDictionary.Add("Key3", "Value3");
        FieldPublicDictionary.Add("Key4", "Value4");

        FieldPublicList = new System.Collections.Generic.List <int>();
        FieldPublicList.Add(0);
        FieldPublicList.Add(1);
        FieldPublicList.Add(2);

        FieldPublicQueue = new System.Collections.Generic.Queue <int>();
        FieldPublicQueue.Enqueue(10);
        FieldPublicQueue.Enqueue(11);
        FieldPublicQueue.Enqueue(12);

        FieldPublicHashSet = new System.Collections.Generic.HashSet <string>();
        FieldPublicHashSet.Add("HashSet1");
        FieldPublicHashSet.Add("HashSet2");

        FieldPublicSortedSet = new System.Collections.Generic.SortedSet <string>();
        FieldPublicSortedSet.Add("SortedSet1");
        FieldPublicSortedSet.Add("SortedSet2");
        FieldPublicSortedSet.Add("SortedSet3");

        FieldPublicStack = new System.Collections.Generic.Stack <string>();
        FieldPublicStack.Push("Stack1");
        FieldPublicStack.Push("Stack2");
        FieldPublicStack.Push("Stack3");

        FieldPublicLinkedList = new System.Collections.Generic.LinkedList <string>();
        FieldPublicLinkedList.AddFirst("LinkedList1");
        FieldPublicLinkedList.AddLast("LinkedList2");
        FieldPublicLinkedList.AddAfter(FieldPublicLinkedList.Find("LinkedList1"), "LinkedList1.1");

        FieldPublicObservableCollection = new System.Collections.ObjectModel.ObservableCollection <string>();
        FieldPublicObservableCollection.Add("ObservableCollection1");
        FieldPublicObservableCollection.Add("ObservableCollection2");

        FieldPublicKeyedCollection = new MyDataKeyedCollection();
        FieldPublicKeyedCollection.Add(new MyData()
        {
            Data = "data1", Id = 0
        });
        FieldPublicKeyedCollection.Add(new MyData()
        {
            Data = "data2", Id = 1
        });

        var list = new List <string>();
        list.Add("list1");
        list.Add("list2");
        list.Add("list3");

        FieldPublicReadOnlyCollection = new ReadOnlyCollection <string>(list);

        FieldPublicReadOnlyDictionary           = new ReadOnlyDictionary <string, string>(FieldPublicDictionary);
        FieldPublicReadOnlyObservableCollection = new ReadOnlyObservableCollection <string>(FieldPublicObservableCollection);
        FieldPublicCollection = new Collection <string>();
        FieldPublicCollection.Add("collection1");
        FieldPublicCollection.Add("collection2");
        FieldPublicCollection.Add("collection3");

        FieldPublicArrayListNonGeneric = new System.Collections.ArrayList();
        FieldPublicArrayListNonGeneric.Add(1);
        FieldPublicArrayListNonGeneric.Add("a");
        FieldPublicArrayListNonGeneric.Add(10.0m);
        FieldPublicArrayListNonGeneric.Add(new DateTime(2000, 01, 01));

        FieldPublicBitArray    = new System.Collections.BitArray(3);
        FieldPublicBitArray[2] = true;

        FieldPublicSortedList = new System.Collections.SortedList();
        FieldPublicSortedList.Add("key1", 1);
        FieldPublicSortedList.Add("key2", 2);
        FieldPublicSortedList.Add("key3", 3);
        FieldPublicSortedList.Add("key4", 4);

        FieldPublicHashtableNonGeneric = new System.Collections.Hashtable();
        FieldPublicHashtableNonGeneric.Add("key1", 1);
        FieldPublicHashtableNonGeneric.Add("key2", 2);
        FieldPublicHashtableNonGeneric.Add("key3", 3);
        FieldPublicHashtableNonGeneric.Add("key4", 4);

        FieldPublicQueueNonGeneric = new System.Collections.Queue();
        FieldPublicQueueNonGeneric.Enqueue("QueueNonGeneric1");
        FieldPublicQueueNonGeneric.Enqueue("QueueNonGeneric2");
        FieldPublicQueueNonGeneric.Enqueue("QueueNonGeneric3");

        FieldPublicStackNonGeneric = new System.Collections.Stack();
        FieldPublicStackNonGeneric.Push("StackNonGeneric1");
        FieldPublicStackNonGeneric.Push("StackNonGeneric2");

        FieldPublicIEnumerable = FieldPublicSortedList;

        FieldPublicBlockingCollection = new System.Collections.Concurrent.BlockingCollection <string>();
        FieldPublicBlockingCollection.Add("BlockingCollection1");
        FieldPublicBlockingCollection.Add("BlockingCollection2");

        FieldPublicConcurrentBag = new System.Collections.Concurrent.ConcurrentBag <string>();
        FieldPublicConcurrentBag.Add("ConcurrentBag1");
        FieldPublicConcurrentBag.Add("ConcurrentBag2");
        FieldPublicConcurrentBag.Add("ConcurrentBag3");

        FieldPublicConcurrentDictionary = new System.Collections.Concurrent.ConcurrentDictionary <string, int>();
        FieldPublicConcurrentDictionary.GetOrAdd("ConcurrentDictionary1", 0);
        FieldPublicConcurrentDictionary.GetOrAdd("ConcurrentDictionary2", 0);

        FieldPublicConcurrentQueue = new System.Collections.Concurrent.ConcurrentQueue <string>();
        FieldPublicConcurrentQueue.Enqueue("ConcurrentQueue1");
        FieldPublicConcurrentQueue.Enqueue("ConcurrentQueue2");

        FieldPublicConcurrentStack = new System.Collections.Concurrent.ConcurrentStack <string>();
        FieldPublicConcurrentStack.Push("ConcurrentStack1");
        FieldPublicConcurrentStack.Push("ConcurrentStack2");

        // FieldPublicOrderablePartitioner = new OrderablePartitioner();
        // FieldPublicPartitioner;
        // FieldPublicPartitionerNonGeneric;

        FieldPublicHybridDictionary = new System.Collections.Specialized.HybridDictionary();
        FieldPublicHybridDictionary.Add("HybridDictionaryKey1", "HybridDictionary1");
        FieldPublicHybridDictionary.Add("HybridDictionaryKey2", "HybridDictionary2");

        FieldPublicListDictionary = new System.Collections.Specialized.ListDictionary();
        FieldPublicListDictionary.Add("ListDictionaryKey1", "ListDictionary1");
        FieldPublicListDictionary.Add("ListDictionaryKey2", "ListDictionary2");
        FieldPublicNameValueCollection = new System.Collections.Specialized.NameValueCollection();
        FieldPublicNameValueCollection.Add("Key1", "Value1");
        FieldPublicNameValueCollection.Add("Key2", "Value2");

        FieldPublicOrderedDictionary = new System.Collections.Specialized.OrderedDictionary();
        FieldPublicOrderedDictionary.Add(1, "OrderedDictionary1");
        FieldPublicOrderedDictionary.Add(2, "OrderedDictionary1");
        FieldPublicOrderedDictionary.Add("OrderedDictionaryKey2", "OrderedDictionary2");

        FieldPublicStringCollection = new System.Collections.Specialized.StringCollection();
        FieldPublicStringCollection.Add("StringCollection1");
        FieldPublicStringCollection.Add("StringCollection2");

        #endregion

        #region Several

        PropXmlDocument = new XmlDocument();
        PropXmlDocument.LoadXml("<xml>something</xml>");

        var tr = new StringReader("<Root>Content</Root>");
        PropXDocument         = XDocument.Load(tr);
        PropStream            = GenerateStreamFromString("Stream");
        PropBigInteger        = new System.Numerics.BigInteger(100);
        PropStringBuilder     = new StringBuilder("StringBuilder");
        FieldPublicIQueryable = new List <string>()
        {
            "IQueryable"
        }.AsQueryable();

        #endregion

        #region Custom

        FieldPublicMyCollectionPublicGetEnumerator           = new MyCollectionPublicGetEnumerator("a b c", new char[] { ' ' });
        FieldPublicMyCollectionInheritsPublicGetEnumerator   = new MyCollectionInheritsPublicGetEnumerator("a b c", new char[] { ' ' });
        FieldPublicMyCollectionExplicitGetEnumerator         = new MyCollectionExplicitGetEnumerator("a b c", new char[] { ' ' });
        FieldPublicMyCollectionInheritsExplicitGetEnumerator = new MyCollectionInheritsExplicitGetEnumerator("a b c", new char[] { ' ' });
        FieldPublicMyCollectionInheritsTooIEnumerable        = new MyCollectionInheritsTooIEnumerable("a b c", new char[] { ' ' });

        FieldPublicEnumSpecific = EnumTest.ValueB;
        MyDelegate            = MethodDelegate;
        EmptyClass            = new EmptyClass();
        StructGeneric         = new ThreeTuple <int>(0, 1, 2);
        StructGenericNullable = new ThreeTuple <int>(0, 1, 2);
        FieldPublicNullable   = new Nullable <ThreeTuple <int> >(StructGeneric);

        #endregion
    }