Inheritance: IDictionary, ICollection, IEnumerable
 public override void Map(Channel q, object map_arg) {
   IList retval = new ArrayList();
   IDictionary my_entry = new ListDictionary();
   my_entry["node"] = _node.Address.ToString();
   retval.Add(my_entry);
   q.Enqueue(retval);
 }
        public object Create(object parent, object context, XmlNode section)
        {
            IDictionary directories;
            NameValueSectionHandler nameValueSectionHandler;
            XmlNodeList nodes;
            DirectoryConfiguration directory;
            NameValueCollection properties;

            directories = new ListDictionary();

            nameValueSectionHandler = new NameValueSectionHandler();

            nodes = section.SelectNodes("directory");

            foreach(XmlElement element in nodes) {
                if(element.GetAttributeNode("name") == null)
                    throw(new ConfigurationException("Name not specified.", element));

                if(element.GetAttributeNode("type") == null)
                    throw(new ConfigurationException("Type not specified.", element));

                if(element.SelectSingleNode("properties") == null)
                    properties = new NameValueCollection();
                else
                    properties = (NameValueCollection) nameValueSectionHandler.Create(null, context, element.SelectSingleNode("properties"));

                directory = new DirectoryConfiguration(element.GetAttribute("name"), element.GetAttribute("type"), properties);

                directories.Add(directory.Name, directory);
            }

            return(directories);
        }
Exemple #3
0
        public virtual void UpdateCoverByCategoryID(int categoryID)
        {
            ListDictionary parameters = new ListDictionary();
            parameters.Add(new SqlParameter("@CategoryID", SqlDbType.Int), categoryID);

            base.LoadFromSql("[" + this.SchemaStoredProcedure + "usp_Gallery_UpdateCoverByCategoryID]", parameters);
        }
        protected void lbSendToFriend_Click(object sender, EventArgs e)
        {
            string url = Request.Url.AbsoluteUri;
            SmtpClient client = new SmtpClient(); //host and port picked from web.config
            client.EnableSsl = true;
            MailDefinition message = new MailDefinition();

            message.BodyFileName = @"~\EmailTemplate\MiriMargolinShareWithAFriend.htm";
            message.IsBodyHtml = true;
            message.From = "*****@*****.**";
            message.Subject = "MiriMargolin - Share with a friend";

            ListDictionary replacements = new ListDictionary();
            replacements.Add("<% YourName %>", this.txtYourName.Text);
            replacements.Add("<% Message %>", this.txtMessage.Text);
            //MailMessage msgHtml = message.CreateMailMessage(this.txtFriendsEmail.Text, replacements, new LiteralControl());
            //msgHtml.Bcc.Add(new MailAddress(RECIPIENTS));
            try
            {
                //client.Send(msgHtml);
            }
            catch (Exception)
            {
                //this.lblMsg.Text = "There was a problem to send an email.";
            }
        }
        public ReportViewer()
        {
            // Setup layout boxes
            vboxContents = new Xwt.VBox();
            vboxToolMenu = new Xwt.HBox();

            // Setup tool button menu
            Xwt.Button buttonExport = new Xwt.Button("Export");
            buttonExport.Clicked += delegate(object sender, EventArgs e) {
                SaveAs();
            };
            vboxToolMenu.PackStart(buttonExport);

            Xwt.Button buttonPrint = new Xwt.Button("Print");
            vboxToolMenu.PackStart(buttonPrint);

            // Add vboxContent widgets
            vboxPages = new Xwt.VBox();
            vboxContents.PackStart(vboxToolMenu);
            vboxContents.PackStart(vboxPages);

            // Setup Controls Contents
            scrollView = new Xwt.ScrollView();
            scrollView.Content = vboxContents;
            scrollView.VerticalScrollPolicy = ScrollPolicy.Automatic;
            scrollView.BorderVisible = true;
            this.PackStart(scrollView, BoxMode.FillAndExpand);

            Parameters = new ListDictionary();

            ShowErrors = false;
        }
Exemple #6
0
        public bool AddNew(string _title, string _description,string _filePath,bool _showLive,
            int? _govID,int? _civilID,int? _hoID,Guid _userID,string _cType,byte[] _file)
        {
            try
            {
                SqlDataReader searchResult = null;
                ListDictionary parm = new ListDictionary();

                parm.Add("@title", _title);
                parm.Add("@description", _description);
                parm.Add("@filePath", _filePath);
                parm.Add("@showLive", _showLive);

                if (_govID != null)
                    parm.Add("@govid", _govID);
                if (_civilID != null)
                    parm.Add("@civilid", _civilID);
                if (_hoID != null)
                    parm.Add("@healthofficeid", _hoID);
                if (_file != null)
                {
                    parm.Add("@contentType", _cType);
                    parm.Add("@fileData", _file);
                }

                parm.Add("@createdbyuserid", _userID);

                searchResult = LoadFromSqlReader("GUI_AddNews", parm) as SqlDataReader;
                return true;
            }
            catch
            {
                return false;
            }
        }
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        var patientName        = ((TextBox)AddPatientFormView.FindControl("NameTextBox")).Text;
        var patientGender      = ((DropDownList)AddPatientFormView.FindControl("GenderDropdownList")).SelectedValue;
        var patientAddress     = ((TextBox)AddPatientFormView.FindControl("AddressTextbox")).Text;
        var patientDateOfBirth =
            ((TemplateControls_DatePicker)AddPatientFormView.FindControl("DateOfBirthDatePicker")).SelectedDate;

        System.Collections.Specialized.ListDictionary dic = new System.Collections.Specialized.ListDictionary();
        dic.Add("Name", patientName);
        dic.Add("Gender", patientGender);
        dic.Add("Address", patientAddress);
        dic.Add("DateOfBirth", patientDateOfBirth);


        if (AddPatientDataSource.Insert(dic) == 0)
        {
            //fail
            ResultAlert.SetResultAlert("An error occured!",
                                       TemplateControls_ResultAlert.AlertTypeError);
        }
        else
        {
            // success
            ResultAlert.SetResultAlert("Patient inserted successfully!",
                                       TemplateControls_ResultAlert.AlertTypeSuccess);
            ClearForm();
        }
    }
        public virtual bool RPT_GetTicketInfo(int ticketid)
        {
            ListDictionary parameters = new ListDictionary();

            parameters.Add(new SqlParameter("@TicketID", SqlDbType.Int, 0), ticketid);
            return LoadFromSql("RPT_GetTicketInfo", parameters);
        }
Exemple #9
0
 public virtual bool GetUserByUserNameAndPassword(string UserName, string Password)
 {
     ListDictionary parameters = new ListDictionary();
     parameters.Add(new SqlParameter("@UserName", SqlDbType.NVarChar, 200), UserName);
     parameters.Add(new SqlParameter("@Password", SqlDbType.NVarChar, 200), Password);
     return LoadFromSql("GetUserByUserNameAndPassword", parameters);
 }
Exemple #10
0
		private void BasicTests (ListDictionary ld)
		{
			Assert.AreEqual (0, ld.Count, "Count");
			Assert.IsFalse (ld.IsFixedSize, "IsFixedSize");
			Assert.IsFalse (ld.IsReadOnly, "IsReadOnly");
			Assert.IsFalse (ld.IsSynchronized, "IsSynchronized");
			Assert.AreEqual (0, ld.Keys.Count, "Keys");
			Assert.AreEqual (0, ld.Values.Count, "Values");
			Assert.IsNotNull (ld.SyncRoot, "SyncRoot");
			Assert.IsNotNull (ld.GetEnumerator (), "GetEnumerator");
			Assert.IsNotNull ((ld as IEnumerable).GetEnumerator (), "IEnumerable.GetEnumerator");

			ld.Add ("a", "1");
			Assert.AreEqual (1, ld.Count, "Count-1");
			Assert.IsTrue (ld.Contains ("a"), "Contains(a)");
			Assert.IsFalse (ld.Contains ("1"), "Contains(1)");

			ld.Add ("b", null);
			Assert.AreEqual (2, ld.Count, "Count-2");
			Assert.IsNull (ld["b"], "this[b]");

			DictionaryEntry[] entries = new DictionaryEntry[2];
			ld.CopyTo (entries, 0);

			ld["b"] = "2";
			Assert.AreEqual ("2", ld["b"], "this[b]2");

			ld.Remove ("b");
			Assert.AreEqual (1, ld.Count, "Count-3");
			ld.Clear ();
			Assert.AreEqual (0, ld.Count, "Count-4");
		}
Exemple #11
0
    protected void grvTransmitters_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.InitInsertCommandName)
        {
            e.Canceled = true;
            //Prepare an IDictionary with the predefined values
            System.Collections.Specialized.ListDictionary newValues = new System.Collections.Specialized.ListDictionary();

            //set initial checked state for the checkbox on init insert
            newValues["Installed"] = false;

            newValues["Approved"] = false;
            //Insert the item and rebind
            e.Item.OwnerTableView.InsertItem(newValues);

            GridEditCommandColumn editColumn = (GridEditCommandColumn)grvTransmitters.MasterTableView.GetColumn("AutoGeneratedEditColumn");
            editColumn.Visible = false;
        }
        else if (e.CommandName == RadGrid.RebindGridCommandName && e.Item.OwnerTableView.IsItemInserted)
        {
            e.Canceled = true;
        }
        else
        {
            GridEditCommandColumn editColumn = (GridEditCommandColumn)grvTransmitters.MasterTableView.GetColumn("AutoGeneratedEditColumn");
            if (!editColumn.Visible)
            {
                editColumn.Visible = true;
            }
        }
    }
 public FileExplorer(NameObjectCollection fileFunctionMap)
 {
     m_fileFunctionMap = fileFunctionMap;
     _quit = false;
     m_DNV = Settings.Instance.DNV;
     m_indexer = new Indexer(Properties.Settings.Instance.TempIndexPath, IndexMode.CREATE);
 }
Exemple #13
0
        // GetParameters creates a list dictionary
        // consisting of a report parameter name and a value.
        private System.Collections.Specialized.ListDictionary GetParmeters(string parms)
        {
            System.Collections.Specialized.ListDictionary ld = new System.Collections.Specialized.ListDictionary();
            if (parms == null)
            {
                return(ld); // dictionary will be empty in this case
            }

            // parms are separated by &

            char[]   breakChars = new char[] { '&' };
            string[] ps         = parms.Split(breakChars);

            foreach (string p in ps)
            {
                int iEq = p.IndexOf("=");
                if (iEq > 0)
                {
                    string name = p.Substring(0, iEq);
                    string val  = p.Substring(iEq + 1);
                    ld.Add(name, val);
                }
            }
            return(ld);
        }
 public virtual IDataReader GetDeliveryOrdersDetailsTotals(string DeliveryOrderNoFrom, string DeliveryOrderNoTo)
 {
     ListDictionary parameters = new ListDictionary();
     parameters.Add(new SqlParameter("@DeliveryOrderNoFrom", SqlDbType.NVarChar, 10), DeliveryOrderNoFrom);
     parameters.Add(new SqlParameter("@DeliveryOrderNoTo", SqlDbType.NVarChar, 10), DeliveryOrderNoTo);
     return LoadFromSqlReader("GetDeliveryOrdersDetailsTotals", parameters);
 }
Exemple #15
0
        public virtual bool LoadDetailInfo(int countryID)
        {
            ListDictionary parameters = new ListDictionary();
            parameters.Add(new SqlParameter("@CountryID", SqlDbType.Int), countryID);

            return base.LoadFromSql("[" + this.SchemaStoredProcedure + "usp_Country_LoadDetailInfo]", parameters);
        }
Exemple #16
0
        public static void deSerialize()
        {
            string sPath = HttpContext.Current.Server.MapPath("~/config/config.txt");
            if (!File.Exists(sPath))
            {
                m_lListDictionary = new ListDictionary();
                return;
            }

            m_lListDictionary = new ListDictionary();
            TextReader oTr = File.OpenText(sPath);

            char cN1 = '\n';

            string sTemp = oTr.ReadToEnd();
            string[] asTemp = sTemp.Split(cN1);

            foreach (string sLine in asTemp)
            {
                if (sLine.Length == 0)
                    continue;

                string[] asTemp2 = sLine.Split(',');

                if (asTemp[0].ToString() == "DatabasePassword")
                {
                    CCrypt oCrypt = new CCrypt();
                    m_lListDictionary.Add(asTemp2[0], oCrypt.DESDecrypt(asTemp2[1]));
                    continue;
                }
                m_lListDictionary.Add(asTemp2[0], asTemp2[1]);
            }

            oTr.Close();
        }
		/// <summary>
		///  Create a TcpChannel with a given name, on a given port.
		/// </summary>
		/// <param name="port"></param>
		/// <param name="name"></param>
		/// <returns></returns>
		private static TcpChannel CreateTcpChannel( string name, int port, int limit )
		{
			ListDictionary props = new ListDictionary();
			props.Add( "port", port );
			props.Add( "name", name );
			props.Add( "bindTo", "127.0.0.1" );

			BinaryServerFormatterSinkProvider serverProvider =
				new BinaryServerFormatterSinkProvider();

            // NOTE: TypeFilterLevel and "clientConnectionLimit" property don't exist in .NET 1.0.
			Type typeFilterLevelType = typeof(object).Assembly.GetType("System.Runtime.Serialization.Formatters.TypeFilterLevel");
			if (typeFilterLevelType != null)
			{
				PropertyInfo typeFilterLevelProperty = serverProvider.GetType().GetProperty("TypeFilterLevel");
				object typeFilterLevel = Enum.Parse(typeFilterLevelType, "Full");
				typeFilterLevelProperty.SetValue(serverProvider, typeFilterLevel, null);

//                props.Add("clientConnectionLimit", limit);
            }

			BinaryClientFormatterSinkProvider clientProvider =
				new BinaryClientFormatterSinkProvider();

			return new TcpChannel( props, clientProvider, serverProvider );
		}
Exemple #18
0
 public virtual bool SearchTickets(string txt, int statusID)
 {
     ListDictionary parameters = new ListDictionary();
     parameters.Add(new SqlParameter("@StatusID", SqlDbType.Int, 0), statusID);
     parameters.Add(new SqlParameter("@SearchTxt", SqlDbType.NVarChar, 300), txt);
     return LoadFromSql("SearchAllTickets", parameters);
 }
Exemple #19
0
 public virtual void SearchByCityIDAndCountryID(int cityID, int countryID)
 {
     ListDictionary parameters = new ListDictionary();
     parameters.Add(new SqlParameter("@CityID", SqlDbType.Int), cityID);
     parameters.Add(new SqlParameter("@CountryID", SqlDbType.Int), countryID);
     base.LoadFromSql("[" + this.SchemaStoredProcedure + "usp_BlogPage_SearchByCityIDAndCountryID]", parameters);
 }
Exemple #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        WebUtility.ShowClientConfirm("Message", "Detailfdsafdsafsdafdsaf\nfdsafdsafsdafsdaf\nfdsafdsafdsafsdafsad", "titleOK",
                                     "OK", "cancel", null, "onCancel");
        wf.Width  = 500;
        wf.Height = 700;
        wf.Center = true;
        WebUtility.AdjustWindow(wf);

        String cbReference =
            Page.ClientScript.GetCallbackEventReference(this,
                                                        "arg", "ReceiveServerData", "context");
        String callbackScript;

        callbackScript = "function CallServer(arg, context)" +
                         "{ " + cbReference + ";}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
                                                    "CallServer", callbackScript, true);

        catalog = new System.Collections.Specialized.ListDictionary();
        catalog.Add("monitor", 12);
        catalog.Add("laptop", 10);
        catalog.Add("keyboard", 23);
        catalog.Add("mouse", 17);

        ListBox1.DataSource    = catalog;
        ListBox1.DataTextField = "key";
        ListBox1.DataBind();
    }
Exemple #21
0
 public TCPParser()
 {
     for (int i = 0; i < 2; i++)
     {
         List[i] = new System.Collections.Specialized.ListDictionary();
     }
 }
Exemple #22
0
        public DataTable GetAllNews(int? _newsID,bool? _showLive,int? _govID, int? _civilID, int? _hoID)
        {
            try
            {
                SqlDataReader searchResult = null;
                ListDictionary parm = new ListDictionary();
                if (_newsID != null)
                    parm.Add("@newsID", _newsID.Value);
                if (_showLive != null)
                    parm.Add("@showLive", _showLive.Value);
                if (_govID != null)
                    parm.Add("@govid", _govID.Value);
                if (_civilID != null)
                    parm.Add("@civilid", _civilID.Value);
                if (_hoID != null)
                    parm.Add("@healthofficeid", _hoID.Value);

                searchResult = LoadFromSqlReader("GUI_GetAllNews", parm) as SqlDataReader;
                DataTable ResultTable = new DataTable();
                newAdapter da = new newAdapter();
                if (searchResult != null && searchResult.HasRows)
                {
                    da.FillFromReader(ResultTable, searchResult);
                }
                return ResultTable;
            }
            catch
            {
                return new DataTable();
            }
        }
Exemple #23
0
        private void sendEmailToAdmin()
        {
            //Sending out emails to Admin

            MailDefinition md_2 = new MailDefinition();
            md_2.From = ConfigurationManager.AppSettings["MailFrom"];
            md_2.IsBodyHtml = true;
            md_2.Subject = ConfigurationManager.AppSettings["emailSubject"];

            ListDictionary replacements = new ListDictionary();

            replacements.Add("<%client_name%>", (string)(Session["client_name"]));
            replacements.Add("<%client_church_name%>", (string)(Session["client_church_name"]));
            replacements.Add("<%client_address%>", (string)(Session["client_address"]));
            replacements.Add("<%client_city%>", (string)(Session["client_city"]));
            replacements.Add("<%client_state%>", (string)(Session["client_state"]));
            replacements.Add("<%client_Zip%>", (string)(Session["client_Zip"]));
            replacements.Add("<%client_phone%>", (string)(Session["client_phone"]));
            replacements.Add("<%client_email%>", (string)(Session["client_email"]));
            replacements.Add("<%Payment_Amount%>", (string)(Session["Payment_Amount"]));
            replacements.Add("<%client_roommate1%>", (string)(Session["client_roommate1"]));
            replacements.Add(" <%client_registrationType%>", (string)(Session["client_registrationType"]));

            string body = String.Empty;

            using (StreamReader sr_2 = new StreamReader(Server.MapPath(ConfigurationManager.AppSettings["emailPath"] + "registration.txt")))
            {
                body = sr_2.ReadToEnd();
            }

            MailMessage msg_2 = md_2.CreateMailMessage(ConfigurationManager.AppSettings["management_Email"], replacements, body, new System.Web.UI.Control());

            SmtpClient client = new SmtpClient();
            client.Send(msg_2);
        }
Exemple #24
0
        public virtual bool LoadByBlogPageID(int blogPageID)
        {
            ListDictionary parameters = new ListDictionary();
            parameters.Add(new SqlParameter("@BlogPageID", SqlDbType.Int), blogPageID);

            return base.LoadFromSql("[" + this.SchemaStoredProcedure + "usp_BlogPageCity_LoadByBlogPageID]", parameters);
        }
		/// <summary>
		/// Default constructor.
		/// </summary>
		/// <param name="owner">The owning control of the visualizer.</param>
		public ProcessVisualizer(Control owner) 
		{
			if (owner == null) throw new ArgumentNullException("owner");

			_owner = owner;
			_processesDictionary = new ListDictionary();			
		}
Exemple #26
0
        public bool ChangeUsername(string oldUsername, string newUsername, string applicationName, out string errorMsg)
        {
            errorMsg = string.Empty;
            ListDictionary parameters = new ListDictionary();
            parameters.Add(new SqlParameter("@ApplicationName", SqlDbType.NVarChar), applicationName);
            parameters.Add(new SqlParameter("@OldUserName", SqlDbType.NVarChar), oldUsername);
            parameters.Add(new SqlParameter("@NewUserName", SqlDbType.NVarChar), newUsername);
            SqlParameter retValParam = new SqlParameter("@ReturnValue", SqlDbType.Int);
            retValParam.Direction = ParameterDirection.ReturnValue;
            parameters.Add(retValParam, null);

            base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_MembershipChangeUserName]", parameters);

            int returnValue = -1;
            if (retValParam.Value != null)
            {
                returnValue = Convert.ToInt32(retValParam.Value);
                if (returnValue == 1)
                {
                    errorMsg = "إسم المستخدم المطلوب تغييره غير موجود";
                }
                else if (returnValue == 2)
                {
                    errorMsg = "الإسم الجديد مستخدم من قبل";
                }
            }
            else
            {
                errorMsg = "Unknow error";
            }

            return (returnValue == 0 ? true : false);
        }
        public virtual bool SearchSectorClients(string filterText)
        {
            ListDictionary parameters = new ListDictionary();

            parameters.Add(new SqlParameter("@filterText", SqlDbType.NVarChar, 200), filterText);
            return LoadFromSql("SearchSectorClients", parameters);
        }
Exemple #28
0
 public override object Map(object map_arg) {
   IList retval = new ArrayList();
   IDictionary my_entry = new ListDictionary();
   my_entry["node"] = _node.Address.ToString();
   retval.Add(my_entry);
   return retval;
 }
Exemple #29
0
        /// <summary>
        /// Returns true if all items in <paramref name="names0"/> and <paramref name="names1"/> are 
        /// unique strings.  Case sensitivity consideration depends on <paramref name="ignoreCase"/>.
        /// </summary>
        /// <param name="names0">An array of strings.</param>
        /// <param name="names1">An array of strings.</param>
        /// <param name="ignoreCase">If true then case is not considered when comparing strings.</param>
        /// <returns>bool</returns>
        public static bool AreNamesUnique(string[] names0, string[] names1, bool ignoreCase)
        {
            bool result = true;
            if (names0 == null && names1 == null)
                return result;

            ListDictionary dic = new ListDictionary(StringComparer.Create(new CultureInfo("en"), ignoreCase));

            for (int i = 0; i < names0.Length; i++)
            {
                if (dic.Contains(names0[i]))
                {
                    result = false;
                    break;
                }
                dic.Add(names0[i], null);
            }
            for (int i = 0; i < names1.Length; i++)
            {
                if (dic.Contains(names1[i]))
                {
                    result = false;
                    break;
                }
                dic.Add(names1[i], null);
            }
            if (dic.Count == 0)
                result = false; // when both arrays are empty
            return result;
        }
Exemple #30
0
        public virtual bool LoadPriceByRoomCategoryID(int roomCategoryID)
        {
            ListDictionary parameters = new ListDictionary();
            parameters.Add(new SqlParameter("@RoomCategoryID", SqlDbType.Int), roomCategoryID);

            return base.LoadFromSql("[" + this.SchemaStoredProcedure + "usp_Room_LoadPriceByRoomCategoryID]", parameters);
        }
        public static void SendWelcomeEmail(string mailTo ,Guid orgId, string tournamentId, string orgLogo, string tournamentName, DateTime startDate)
        {
            ListDictionary replacements = new ListDictionary();
            replacements.Add("<% OrgId %>", orgId);
            replacements.Add("<% TournamentName %>", tournamentName);
            replacements.Add("<% StartDate %>", startDate);
            replacements.Add("<% TournamentId %>", tournamentId);

            string templatePath = Path.Combine(ConfigurationManager.AppSettings["EmailTemplatePath"].ToString(), "WelcomeEmail.htm");
            string matchUpReadyTemplate = File.ReadAllText(templatePath);
            SmtpClient client = new SmtpClient(); //host and port picked from web.config
            client.EnableSsl = true;

            foreach (DictionaryEntry item in replacements)
            {
                matchUpReadyTemplate = matchUpReadyTemplate.Replace(item.Key.ToString(), item.Value.ToString());
            }
            MailMessage message = new MailMessage();
            message.Subject = "Welcome Email";
            message.From = new MailAddress("*****@*****.**");
            message.To.Add(mailTo);
            message.IsBodyHtml = true;
            message.Body = matchUpReadyTemplate;

            try
            {
                client.Send(message);
            }
            catch (Exception)
            {

            }
        }
Exemple #32
0
 /*
  * Map method to add CachEntry to CacheList
  * @param map_arg [content,alpha,start,end]
  */
 public override void Map(Channel q, object map_arg) {
   IList arg = map_arg as IList;	    
   object input = arg[0];
   double alpha = (double)arg[1]; //replication factor
   string st = arg[2] as string;  // start brunet address of range
   string ed = arg[3] as string;  // end brunet address of range 
   AHAddress a = (AHAddress)AddressParser.Parse(st);
   AHAddress b = (AHAddress)AddressParser.Parse(ed);
   Entry ce = new Entry(input, alpha, a, b);
   int result = 0;   // if caching is successful, result will set to 1.
   int previous_count = _cl.Count;
   try {
     if( _cl.Insert(ce) ) {
       result = 1;
     }
     else {
       result = 0;
     }
   }
   catch {
     result = 0;
   }
   if (_cl.Count > previous_count) { result = 1; }
   IDictionary my_entry = new ListDictionary();
   my_entry["count"]=1;
   my_entry["height"]=1;
   my_entry["success"]=result;
   q.Enqueue(my_entry);
 }
        public DataTable FilterICDcodes(string initText)
        {
            try
            {
                //string connection = ConfigurationSettings.AppSettings["dbConnection"];
                //SqlConnection con = new SqlConnection(connection);

                //string selectString = "select * from ICDCODE9000" + initText[0].ToString() + " where DescrENG like '" + initText + "%'";
                //SqlCommand cmd = new SqlCommand(selectString, con);
                //cmd.CommandType = CommandType.Text;
                //SqlDataAdapter adb = new SqlDataAdapter();
                //adb.SelectCommand = cmd;
                //DataTable tbl = new DataTable();
                //adb.Fill(tbl);
                //return tbl;
                SqlDataReader searchResult = null;
                ListDictionary parm = new ListDictionary();
                parm.Add("@initText", initText);
                searchResult = LoadFromSqlReader("Mho_Gui_GetICDcode", parm) as SqlDataReader;
                DataTable ResultTable = new DataTable();
                newAdapter da = new newAdapter();
                if (searchResult != null && searchResult.HasRows)
                {
                    da.FillFromReader(ResultTable, searchResult);
                }
                return ResultTable;
            }
            catch
            {
                return new DataTable();
            }
        }
Exemple #34
0
		public void Add (string key, string value)
		{
			if (data == null)
				data = new ListDictionary ();

			data.Add (key, value);
		}
Exemple #35
0
		// Constructor		
		public MailMessage ()
		{
			attachments = new ArrayList (8);
			headers = new ListDictionary ();
			bodyEncoding = Encoding.Default;
			fields = new Hashtable ();
		}		
 private static void FillDictionaryWithContent(int limit, System.Collections.Specialized.ListDictionary listDictionary)
 {
     _stopwatch.Start();
     for (int i = 0; i < limit; i++)
     {
         listDictionary.Add(i, $"Nummer_{i}");
     }
     _stopwatch.Stop();
 }
 private static void WriteAllContentToConsole(System.Collections.Specialized.ListDictionary listDictionary)
 {
     _stopwatch.Start();         //ab hier fängt das aufzeichnen der Zeit an
     foreach (DictionaryEntry item in listDictionary)
     {
         Console.WriteLine($"{item.Key} | {item.Value}");
     }
     _stopwatch.Stop();          //ab hier stoppen wir die Aufzeichnung
 }
Exemple #38
0
 static void LearnListDictionary()
 {
     Console.WriteLine("from LearnListDictionary  Method");
     System.Collections.Specialized.ListDictionary lstData = new System.Collections.Specialized.ListDictionary();
     lstData.Add("Name", "Atul");            //Inserting string
     lstData.Add("Age", 100);                // inserting integer
     lstData.Add("IsSeniorCitizen", true);   // Inserting boolean
     lstData["Country"] = "USA";             //Another way to inserting the data
     foreach (DictionaryEntry item in lstData)
     {
         Console.WriteLine($"Value for Key {item.Key} is {item.Value}");
     }
 }
Exemple #39
0
    // <Snippet1>
    protected void Add_Click(object sender, EventArgs e)
    {
        System.Collections.Specialized.ListDictionary listDictionary
            = new System.Collections.Specialized.ListDictionary();
        listDictionary.Add("ProductName", TextBox1.Text);
        listDictionary.Add("ProductCategory", "General");
        listDictionary.Add("Color", "Not assigned");
        listDictionary.Add("ListPrice", null);
        LinqDataSource1.Insert(listDictionary);

        TextBox1.Text = String.Empty;
        DetailsView1.DataBind();
    }
Exemple #40
0
    public static Language Get(string basePath, string code)
    {
        Language language1 = new Language();

        System.Collections.Specialized.ListDictionary listDictionary = new System.Collections.Specialized.ListDictionary();
        System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
        xmlDocument.Load(basePath + code + ".xml");
        language1.Code = code;
        language1.Name = xmlDocument.DocumentElement.Attributes["name"].Value;
        foreach (System.Xml.XmlNode xmlNode in xmlDocument.DocumentElement.ChildNodes)
        {
            language1.Words.Add(xmlNode.InnerText);
        }
        return(language1);
    }
 protected void grid_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
 {
     if (e.CommandName == RadGrid.InitInsertCommandName)
     {
         e.Canceled = true;
         System.Collections.Specialized.ListDictionary newValues = new System.Collections.Specialized.ListDictionary();
         newValues["Ena"]     = false;
         newValues["Ena2"]    = false;
         newValues["Ena3"]    = false;
         newValues["Ena4"]    = false;
         newValues["PhoneNr"] = "";
         newValues["SiteId"]  = "";
         newValues["Note"]    = "";
         e.Item.OwnerTableView.InsertItem(newValues);
     }
 }
        public static void PerformListDictionary()                                                                              //Diese Methode zeigt wie schnell eine kleine ListDictionary sein kann und wie sehr eine große ListDictionary die Performance beeinträchtigt
        {
            System.Collections.Specialized.ListDictionary listDictionary = new System.Collections.Specialized.ListDictionary(); //Da unsere Klasse ebenfalls "ListDictionary" heißt, müssen wir die ListDictionary-Collection bei vollem Namen nennen. Natürlich war das beabsichtigt um den Hintergrund zu erklären ;) Man kann gleichnamige Klassen haben solange sich der Vollständige name bzw der Namespace unterscheidet.
            Hashtable hashtable = new Hashtable();                                                                              //Ein HashTable ist im Prinzip genau wie ein Dictionary nur dass es seinen Inhalt nach dem HashCode sortiert. HashCodes sind Codes die jedes Objekt generiert. Hashtables gelten jedoch als veraltet weshalb ich nicht weiter darauf eingehen werde.

            string bigHashTableResult    = null;
            string smallDictionaryResult = null;
            string bigDictionaryResult   = null;

            _isLoading = true;
            Task.Run(VisibleLoadingCycle);                 //Hier bedeuted "Task" eine Asynchrone Operation welches parallel zum derzeitigem Hauptprogramm abläuft. Während wir also die Methode "VisibleLoadingCycle" angestoßen haben gehen wir gleichzeitig weiter mit der nächsten Zeile.
            FillDictionaryWithContent(10, listDictionary); // ^in diesem Kontext bedeuted "Hauptprogramm"/"Mainthread" das programm welches das Konsolenfenster/Kommandofenster verfolgt.
            WriteAllContentToConsole(listDictionary);
            _isLoading            = false;
            smallDictionaryResult = _stopwatch.Elapsed.ToString();
            _stopwatch.Reset();     //Hier stellen wir die Stopwatch wieder auf 0

            listDictionary.Clear();

            Console.WriteLine("Drücke 'Enter' um das große ListDictionary zu füllen");
            if (Console.ReadKey().Key == ConsoleKey.Enter)
            {
                _isLoading = true;
                Task.Run(VisibleLoadingCycle);
                FillDictionaryWithContent(100_000, listDictionary);
                WriteAllContentToConsole(listDictionary);
                _isLoading          = false;
                bigDictionaryResult = _stopwatch.Elapsed.ToString();
                _stopwatch.Reset();
            }

            Console.WriteLine("Drücke 'Enter' um das Hashtable zu füllen");
            if (Console.ReadKey().Key == ConsoleKey.Enter)
            {
                _isLoading = true;
                Task.Run(VisibleLoadingCycle);
                FillDictionaryWithContent(100_000, hashtable);
                WriteAllContentToConsole(hashtable);
                _isLoading         = false;
                bigHashTableResult = _stopwatch.Elapsed.ToString(); //Die "stopwatch.Elapsed" Property gibt die Zeitspanne zurück die wir während der Laufzeit der Stopwatch aufgenommen haben
            }

            Console.WriteLine(smallDictionaryResult);
            Console.WriteLine(bigDictionaryResult);
            Console.WriteLine(bigHashTableResult);
        }
Exemple #43
0
    public bool ExecuteNonQueryOnly(string proName, System.Collections.Specialized.ListDictionary Parameters)
    {
        SqlConnection con = new SqlConnection();
        SqlCommand    cmd;

        con.ConnectionString = ConnectionString;
        try
        {
            con.Open();
            cmd             = new SqlCommand(proName);
            cmd.CommandType = CommandType.StoredProcedure;
            IDataParameter p;
            if (Parameters != null)
            {
                foreach (System.Collections.DictionaryEntry param in Parameters)
                {
                    p = param.Key as IDataParameter;
                    if (null == p)
                    {
                        p.ParameterName = (string)param.Key;
                        p.Value         = param.Value;
                    }
                    else
                    {
                        p.Value = param.Value;
                    }
                    cmd.Parameters.Add(p);
                }
            }
            cmd.Connection = con;
            cmd.ExecuteNonQuery();
            con.Close();
            return(true);
        }
        catch (Exception ex)
        {
            //ex.Message.ToString();
            throw ex;
        }
        finally
        {
            con.Close();
            //return false;
        }
    }
    //</Snippet3>
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
                                                    validationLookUpStock, "function LookUpStock() {  " +
                                                    "var lb = document.forms[0].ListBox1; " +
                                                    "if (lb.selectedIndex == -1) { alert ('Please make a selection.'); return; } " +
                                                    "var product = lb.options[lb.selectedIndex].text;  " +
                                                    @"CallServer(product, ""LookUpStock"");}  ", true);
        if (User.Identity.IsAuthenticated)
        {
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
                                                        validationLookUpSale, "function LookUpSale() {  " +
                                                        "var lb = document.forms[0].ListBox1; " +
                                                        "if (lb.selectedIndex == -1) { alert ('Please make a selection.'); return; } " +
                                                        "var product = lb.options[lb.selectedIndex].text;  " +
                                                        @"CallServer(product, ""LookUpSale"");} ", true);
        }

        String cbReference = "var param = arg + '|' + context;" +
                             Page.ClientScript.GetCallbackEventReference(this,
                                                                         "param", "ReceiveServerData", "context");
        String callbackScript;

        callbackScript = "function CallServer(arg, context)" +
                         "{ " + cbReference + "} ;";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
                                                    "CallServer", callbackScript, true);

        catalog  = new System.Collections.Specialized.ListDictionary();
        saleitem = new System.Collections.Specialized.ListDictionary();
        catalog.Add("monitor", 12);
        catalog.Add("laptop", 10);
        catalog.Add("keyboard", 23);
        catalog.Add("mouse", 17);
        saleitem.Add("monitor", 1);
        saleitem.Add("laptop", 0);
        saleitem.Add("keyboard", 0);
        saleitem.Add("mouse", 1);

        ListBox1.DataSource    = catalog;
        ListBox1.DataTextField = "key";
        ListBox1.DataBind();
    }
Exemple #45
0
        /// <summary>
        /// Gets the scripts.
        /// </summary>
        /// <param name="RemoveFromCollection">if set to <c>true</c> [remove from collection].</param>
        /// <returns></returns>
        internal static ListDictionary GetScripts(bool RemoveFromCollection)
        {
            Guid pageID = (Guid)System.Web.HttpContext.Current.Items[Constant.AjaxID + ".pageID"];

            lock (pages.SyncRoot)
            {
                ListDictionary scripts = (ListDictionary)pages[pageID];

                if (RemoveFromCollection && scripts != null)
                {
                    pages.Remove(pageID);
                }

                if (!RemoveFromCollection && scripts == null)
                {
                    scripts       = new System.Collections.Specialized.ListDictionary();
                    pages[pageID] = scripts;
                }

                return(scripts);
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        String cbReference =
            Page.ClientScript.GetCallbackEventReference(this,
                                                        "arg", "ReceiveServerData", "context");
        String callbackScript;

        callbackScript = "function CallServer(arg, context)" +
                         "{ " + cbReference + ";}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
                                                    "CallServer", callbackScript, true);

        catalog = new System.Collections.Specialized.ListDictionary();
        catalog.Add("monitor", 12);
        catalog.Add("laptop", 10);
        catalog.Add("keyboard", 23);
        catalog.Add("mouse", 17);

        ListBox1.DataSource    = catalog;
        ListBox1.DataTextField = "key";
        ListBox1.DataBind();
    }
Exemple #47
0
 // Constructor.
 public ListMemberCollection(ListDictionary list, bool wantKeys)
 {
     this.list     = list;
     this.wantKeys = wantKeys;
 }
Exemple #48
0
 public NodeKeyValueCollection(ListDictionary list, bool isKeys)
 {
     this.list   = list;
     this.isKeys = isKeys;
 }
Exemple #49
0
 public DictionaryNodeEnumerator(ListDictionary dict)
 {
     this.dict = dict;
     version   = dict.version;
     Reset();
 }
Exemple #50
0
 public DictionaryNodeCollection(ListDictionary dict, bool isKeyList)
 {
     this.dict      = dict;
     this.isKeyList = isKeyList;
 }
Exemple #51
0
 // Constructor.
 public ListMemberEnumerator(ListDictionary list, bool wantKeys)
     : base(list)
 {
     this.wantKeys = wantKeys;
 }
Exemple #52
0
    public MyProjectInstaller(ExpectedState expectedState, string RelatPath)
    {
        // Instantiate installers for process and services.
        serviceInstaller = new ServiceInstaller();
        ServiceProcessInstaller ProcesServiceInstaller = new ServiceProcessInstaller();

        InstallContext Context = new InstallContext();

        String AbsolPath = Path.GetFullPath(RelatPath);

        AbsolPath = Path.Combine(AbsolPath, WyprostujSie.Files.WSB);
        AbsolPath = String.Format("/assemblypath={0}", AbsolPath);
        String[] cmdline = { AbsolPath };

        serviceInstaller.Parent = ProcesServiceInstaller;
        Context = new InstallContext("", cmdline);

        serviceInstaller.Context = Context;

        // The services are started automaticly.
        serviceInstaller.StartType = ServiceStartMode.Automatic;

        serviceInstaller.ServiceName = ServiceName;

        // Info for users
        serviceInstaller.DisplayName = "Wyprostuj się";
        serviceInstaller.Description = WyprostujSie.Properties.Resources.ServiceInstallerDescr.ToString();
        ServiceController serviceController = new ServiceController(serviceInstaller.ServiceName);

        System.Collections.Specialized.ListDictionary stateSaver = new System.Collections.Specialized.ListDictionary();

        switch (expectedState)
        {
        case ExpectedState.Install:
        {
            if (!Installed())
            {
                try
                {
                    serviceInstaller.Install(null);
                }
                catch { }
            }
            break;
        }

        case ExpectedState.Uninstall:
        {
            if (Installed())
            {
                try
                {
                    if (serviceController.Status == ServiceControllerStatus.Running || serviceController.Status == ServiceControllerStatus.StartPending)
                    {
                        serviceController.Stop();
                        serviceController.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(3));
                    }
                    serviceInstaller.Uninstall(null);
                }
                catch { }
            }
            break;
        }

        case ExpectedState.Stop:
        {
            if (Installed())
            {
                if (serviceController.Status == ServiceControllerStatus.Running || serviceController.Status == ServiceControllerStatus.StartPending)
                {
                    try
                    {
                        serviceController.Stop();
                        serviceController.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(5));
                    }
                    catch { }
                }
            }
            break;
        }

        case ExpectedState.Start:
        {
            if (Installed())
            {
                if (serviceController.Status == ServiceControllerStatus.Stopped || serviceController.Status == ServiceControllerStatus.StopPending)
                {
                    try
                    {
                        serviceController.Start();
                        serviceController.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(5));
                    }
                    catch { }
                }
            }
            break;
        }
        }
    }
Exemple #53
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
    }