当前位置: 首页>>代码示例>>C#>>正文


C# ListDictionary类代码示例

本文整理汇总了C#中ListDictionary的典型用法代码示例。如果您正苦于以下问题:C# ListDictionary类的具体用法?C# ListDictionary怎么用?C# ListDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ListDictionary类属于命名空间,在下文中一共展示了ListDictionary类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getNguoiDung

 public DataTable getNguoiDung(clsNguoiDung_DTO nguoidungDTO)
 {
     ListDictionary _list = new ListDictionary();
     _list.Add("TenDangNhap", nguoidungDTO.TenDangNhap);
     _list.Add("MaDiemThi", nguoidungDTO.MaDiemThi);
     _list.Add("MatKhau", nguoidungDTO.MatKhau);
     _list.Add("Ho", nguoidungDTO.Ho);
     _list.Add("Ten", nguoidungDTO.Ten);
     _list.Add("CMND", nguoidungDTO.CMND);
     _list.Add("NgaySinh", nguoidungDTO.NgaySinh);
     _list.Add("DiaChi", nguoidungDTO.DiaChi);
     _list.Add("DienThoai", nguoidungDTO.DienThoai);
     _list.Add("Email", nguoidungDTO.Email);
     _list.Add("NgayDK", nguoidungDTO.NgayDK);
     _list.Add("TrangThai", nguoidungDTO.TrangThai);
     _list.Add("MaNhom", nguoidungDTO.MaNhom);
     DataTable dt = new DataTable();
     try
     {
         dt = obj.GetDataTable("Select_Nguoi_Dung",_list, CommandType.StoredProcedure);
     }
     catch
     {
         dt = null;
     }
     return dt;
 }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:27,代码来源:clsNguoiDung_DAL.cs

示例2: FindSpriteNamesInAllScene

    public static void FindSpriteNamesInAllScene()
    {
        ListDictionary<string, string> spriteNames = new ListDictionary<string, string>();

        string[] scenes = (from scene in EditorBuildSettings.scenes where scene.enabled select scene.path).ToArray();
        foreach (string scene in scenes)
        {
            EditorApplication.OpenScene(scene);

            Transform[] allTrnasforms = GameObject.FindObjectsOfType<Transform>();
            foreach (Transform transform in allTrnasforms)
            {
                UISprite sprite = transform.GetComponent<UISprite>();
                if (sprite != null && !spriteNames.ContainsValue(scene, sprite.spriteName))
                    spriteNames.Add(scene, sprite.spriteName);
            }
        }

        string log = string.Empty;
        foreach (string scene in scenes)
        {
            if (!spriteNames.ContainsKey(scene))
                continue;

            log += string.Format("Scene : {0}\n", scene);

            string spriteNameInScene = string.Empty;
            foreach (string spriteName in spriteNames[scene])
                spriteNameInScene += string.Format("{0}\n", spriteName);

            log += string.Format("{0}\n\n", spriteNameInScene);
        }

        Debug.LogWarning(log);
    }
开发者ID:honi90,项目名称:FindAllSpritesInScene,代码行数:35,代码来源:FindSprite.cs

示例3: gridHistoricData_RowCommand

    protected void gridHistoricData_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try {
            if (e.CommandName == "Insert") {
                string[] fields = { "Date", "CASH", "COMM", "GLEQ", "HEDG", "LOSH", "PREQ" };
                ListDictionary listDictionary = new ListDictionary();

                foreach (var f in fields) {
                    string boxName = "text" + f + "Add";
                    TextBox textBox = (TextBox)gridHistoricData.FooterRow.FindControl(boxName);
                    if (f == "Date") {
                        DateTime dt = DateTime.Parse(textBox.Text);
                        listDictionary.Add(f, dt);
                    } else {
                        double db = Double.Parse(textBox.Text);
                        listDictionary.Add(f, db);
                    }
                    textBox.Text = String.Empty;
                }

                sourceHistoricData.Insert(listDictionary);
                gridHistoricData.DataBind();
            }
        } catch (Exception ex) {
            showException(ex, labelException, "adding the asset class prices");
        }
    }
开发者ID:garsiden,项目名称:Report-Generator,代码行数:27,代码来源:editA-M.aspx.cs

示例4: getThiSinh

    public DataTable getThiSinh(clsThiSinh_DTO thisinhDTO)
    {
        ListDictionary _list = new ListDictionary();
        _list.Add("MaTS", thisinhDTO.MaTS);
        _list.Add("MatKhau", thisinhDTO.MatKhau);
        _list.Add("HoTenLot", thisinhDTO.HoTenLot);
        _list.Add("Ten", thisinhDTO.Ten);
        _list.Add("QuocTich", thisinhDTO.QuocTich);
        _list.Add("NgaySinh", thisinhDTO.NgaySinh);
        _list.Add("NguyenQuan", thisinhDTO.NguyenQuan);
        _list.Add("NoiDKHoKhau", thisinhDTO.NoiDKHoKhau);
        _list.Add("NoiThuongTru", thisinhDTO.NoiThuongTru);
        _list.Add("DienThoai", thisinhDTO.DienThoai);
        _list.Add("DVCongTac", thisinhDTO.DVCongTac);
        _list.Add("CMND", thisinhDTO.CMND);
        _list.Add("NgayCapCMND", thisinhDTO.NgayCapCMND);
        _list.Add("NoiCapCMND", thisinhDTO.NoiCapCMND);
        _list.Add("TrinhDoVanHoa", thisinhDTO.TrinhDoVanHoa);
        _list.Add("NgayDKThi", thisinhDTO.NgayDKThi);
        _list.Add("MaCaThi", thisinhDTO.MaCaThi);
        _list.Add("MaPhong", thisinhDTO.MaPhong);

        DataTable dt = new DataTable();
        try
        {
            dt = obj.GetDataTable("Select_Thi_Sinh", _list, CommandType.StoredProcedure);
        }
        catch
        {
            dt = null;
        }
        return dt;
    }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:33,代码来源:clsThiSinh_DAL.cs

示例5: submitButton_Click

    // Submit Button adds a new guestbook entry to the database,
    // clears the form and displays the updated list of guestbook entries
    protected void submitButton_Click( object sender, EventArgs e )
    {
        // create dictionary of parameters for inserting
          ListDictionary insertParameters = new ListDictionary();

          // add current date and the user's name, e-mail address
          // and message to dictionary of insert parameters
          insertParameters.Add( "Date", DateTime.Now.ToShortDateString() );
          insertParameters.Add( "Name", nameTextBox.Text );
          insertParameters.Add( "Email", emailTextBox.Text );
          insertParameters.Add( "Message1", messageTextBox.Text );

          // execute an INSERT LINQ statement to add a new entry to the
          // Messages table in the Guestbook data context that contains the
          // current date and the user's name, e-mail address and message
          messagesLinqDataSource.Insert( insertParameters );

          // clear the TextBoxes
          nameTextBox.Text = String.Empty;
          emailTextBox.Text = String.Empty;
          messageTextBox.Text = String.Empty;

          // update the GridView with the new database table contents
          messagesGridView.DataBind();
    }
开发者ID:Kazempour,项目名称:src,代码行数:27,代码来源:Guestbook.aspx.cs

示例6: getcauluachon_cauhoi

 //lay cau lua chon theo cau hoi
 public DataTable getcauluachon_cauhoi(string MaCauHoi)
 {
     //DataTable dt_dethi1 = new DataTable();
     DataTable dt_cauhoi_cauluachon = new DataTable();
     try
     {
        // dt_dethi1 = obj.GetDataTable("select top 0 * from View_cauhoi_cauluachon", CommandType.Text);
        // dt_cauhoi_cauluachon = obj.GetDataTable("Select_cauluachontheocauhoi", //getcauluachon_cauhoi(MaCauHoi);
         //foreach (DataRow dr in dt_cauhoi_cauluachon.Rows)
         //{
             ListDictionary _list = new ListDictionary();
             _list.Add("MaCauHoi", MaCauHoi);
         //    _list.Add("NoiDung", dr["NoiDung"].ToString());
         //    _list.Add("HinhAnh", dr["HinhAnh"].ToString());
         //    _list.Add("NoiDungCLC", dr["NoiDungCLC"].ToString());
         //    //_list.Add("NoiDung", dr["NoiDung"].ToString());
             dt_cauhoi_cauluachon = obj.GetDataTable("Select_cauluachontheocauhoi", _list, CommandType.StoredProcedure);
            //for (int i = 0; i < dt_cauhoi_cauluachon.Rows.Count; i++)
            // {
            //     DataRow drDeThi = dt_dethi1.NewRow();
            //     drDeThi["MaCauHoi"] = dt_cauhoi_cauluachon.Rows[i]["MaCauHoi"];
            //     drDeThi["NoiDung"] = dt_cauhoi_cauluachon.Rows[i]["NoiDung"];
            //     drDeThi["HinhAnh"] = dt_cauhoi_cauluachon.Rows[i]["HinhAnh"];
            //     drDeThi["NoiDungCLC"] = dt_cauhoi_cauluachon.Rows[i]["NoiDungCLC"];
            //     dt_dethi1.Rows.Add(drDeThi);
            // }
         }
     //}
     catch
     {
         dt_cauhoi_cauluachon = null;
     }
     return dt_cauhoi_cauluachon;
 }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:35,代码来源:clsDeThi_DAL.cs

示例7: Main

        static void Main(string[] args)
        {
            ListDictionary<string, string> listDictionary = new ListDictionary<string, string>();
            ListDictionary<int,int> listDictionaryInt = new ListDictionary<int,int>();
            //ListDictionary<byte> listDictionaryByte = new ListDictionary<byte>();

            listDictionary.addItemToDictionary("hello");
            
            Console.WriteLine(listDictionary.getItemFromDictionaryByHash(532));

            listDictionaryInt.addItemToDictionary(500);
            Console.WriteLine(listDictionaryInt.getItemFromDictionaryByHash(149));


            
            Console.ReadLine();





            //Console.WriteLine("would you like to search or add?");
            //string answer = Console.ReadLine().ToString();
            //switch (answer)
            //{
            //    case "search":
            //        //call function to search
            //        listDictionary.calculateHash(answer);
            //        break;

            //    case "add":
            //        //call function to add
            //        break;
            //}
        }
开发者ID:rcisneros138,项目名称:MyDictionary,代码行数:35,代码来源:Program.cs

示例8: AddRemoveAddItemsDoesntChangeItemsOrder

            public void AddRemoveAddItemsDoesntChangeItemsOrder(int itemsToAddCount, int itemsToRemoveCount)
            {
                var dict = new ListDictionary<string, int>();

                for (var i = 0; i < itemsToAddCount; i++)
                {
                    var key = i.ToString();
                    dict[key] = 0;
                }

                for (var i = 0; i < itemsToRemoveCount; i++)
                {
                    var key = (itemsToAddCount - itemsToRemoveCount + i).ToString();
                    dict.Remove(key);
                }

                for (var i = itemsToAddCount - itemsToRemoveCount; i < itemsToAddCount; i++)
                {
                    var key = i.ToString();
                    dict[key] = 0;
                }

                var keyValuePairs = dict.ToList();
                for (var i = 0; i < itemsToAddCount; i++)
                {
                    Assert.AreEqual(i.ToString(), keyValuePairs[i].Key);
                }
            }
开发者ID:jensweller,项目名称:Catel,代码行数:28,代码来源:ListDictionaryFacts.cs

示例9: SQLNETItem

 /// <summary>Default constructor.</summary>
 public SQLNETItem()
 {
     CacheKey = Guid.NewGuid().ToString();
     ParameterTables = new ListDictionary();
     ParameterTypes = new SharedCache<string, Type>();
     ParameterValues = new ListDictionary();
     ParallelItems = new SharedBucketList();
 }
开发者ID:zzzprojects,项目名称:Eval-SQL.NET,代码行数:9,代码来源:SQLNETItem.cs

示例10: Fill

 private static ListDictionary Fill(ListDictionary ld, KeyValuePair<string, string>[] data)
 {
     foreach (KeyValuePair<string, string> d in data)
     {
         ld.Add(d.Key, d.Value);
     }
     return ld;
 }
开发者ID:SGuyGe,项目名称:corefx,代码行数:8,代码来源:ListDictionaryTests.cs

示例11: NonGenericICollectionFactory

 protected override ICollection NonGenericICollectionFactory(int count)
 {
     ListDictionary list = new ListDictionary();
     int seed = 13453;
     for (int i = 0; i < count; i++)
         list.Add(CreateT(seed++), CreateT(seed++));
     return list.Keys;
 }
开发者ID:swaroop-sridhar,项目名称:corefx,代码行数:8,代码来源:ListDictionary.Values.Tests.cs

示例12: GetBuddyList

    protected void GetBuddyList()
    {
        ISession session = (ISession)Context.Items[Constant.NHibernateSessionSign];
        int userId = (int)Session[Constant.NormalUserSessionSign];

        DateTime time = DateTime.Now;

        if ((Session["cometchat_buddytime"] == null) || (Request["initialize"] == "1") || (Session["cometchat_buddytime"] != null) && ((DateTime.Now - (DateTime)Session["cometchat_buddytime"]).Seconds > 60))
        {
            IDbCommand cmdGetBuddy = session.Connection.CreateCommand();
            cmdGetBuddy.CommandText = "select users.id as userid, user.username, user.last_update, chat_status.message, chat_status.status from userlist join users on  userlist.relationid = users.id left join chat_status on users.id = chat_status.userid where userlist.friend = 'yes' and userlist.userid = @userId order by username asc";
            IDbDataParameter paramUserId = cmdGetBuddy.CreateParameter();
            paramUserId.DbType = DbType.Int32;
            paramUserId.ParameterName = "@userid";
            paramUserId.Value = userId;
            cmdGetBuddy.Parameters.Add(paramUserId);
            session.Transaction.Enlist(cmdGetBuddy);

            IDataReader readerGetBuddyList = cmdGetBuddy.ExecuteReader();
            ListDictionary chat = new ListDictionary();
            IList<ListDictionary> buddyList = new List<ListDictionary>();
            

            while (readerGetBuddyList.Read())
            {
                string status = readerGetBuddyList["status"].ToString();

                if ((time - (DateTime)readerGetBuddyList["last_update"]).Seconds < 120 && status != "invisible" && status != "offline")
                {
                    if (status != "busy")
                        status = "available";
                }
                else
                    status = "offline";

                string message = readerGetBuddyList["message"].ToString();
                if (string.IsNullOrEmpty(message))
                    message = "I'm " + TextUtility.UppercaseFirst(status);


                ListDictionary buddy = new ListDictionary();
                buddy["id"] = readerGetBuddyList["userid"];
                buddy["name"] = readerGetBuddyList["username"];
                buddy["status"] = status;
                buddy["message"] = message;
                buddy["time"] = readerGetBuddyList["last_update"];
                buddyList.Add(buddy);
            }
            readerGetBuddyList.Close();

            Session["cometchat_buddytime"] = time;

            if (buddyList.Count > 0)
                response["buddylist"] = buddyList;

        }
    }
开发者ID:DF-thangld,项目名称:web_game,代码行数:57,代码来源:cometchat_receive.aspx.cs

示例13: FriendDictionary

 public FriendDictionary(IEnumerable<TwitterUser> users)
 {
     FriendsByCount = new ListDictionary<int, TwitterUser>();
     foreach (TwitterUser user in users)
     {
         friendsByName.Add(user.Name, user);
         FriendsByCount.Add(user.FriendCount, user);
     }
 }
开发者ID:trasa,项目名称:TwitDegrees,代码行数:9,代码来源:FriendDictionary.cs

示例14: Start

	void Start() {
		DontDestroyOnLoad(gameObject);
		breakdownObjects = new Dictionary<Type, int>();
		objectDictionary = new ListDictionary<System.Type, UnityEngine.Object>();
		baseLineSizes = new Dictionary<Type, int>();
		meshes = new List<Mesh>();
		Resources.UnloadUnusedAssets();
		InvokeRepeating("Detect",3f,3f);
	}
开发者ID:unit9,项目名称:swip3,代码行数:9,代码来源:DetectLeaks.cs

示例15: Update

        internal void Update()
        {
            var rResult = new ListDictionary<FleetLoSFormulaInfo, double>();
            foreach (var rCalculation in FleetLoSFormulaInfo.Formulas.Select(r => new { Formula = r, LoS = r.Calculate(r_Fleet) }))
                rResult.Add(rCalculation.Formula, rCalculation.LoS);

            Formulas = rResult;
            OnPropertyChanged(nameof(Formulas));
        }
开发者ID:amatukaze,项目名称:IntelligentNavalGun-Fx4,代码行数:9,代码来源:FleetLoSStatus.cs


注:本文中的ListDictionary类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。