• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ListDictionary类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Constructor_DefaultTests

 public static void Constructor_DefaultTests(ListDictionary ld)
 {
     Assert.Equal(0, ld.Count);
     Assert.False(ld.IsReadOnly);
     Assert.Empty(ld);
     Assert.Empty(ld.Keys);
     Assert.Empty(ld.Values);
     Assert.False(ld.Contains(new object()));
     Assert.Null(ld[new object()]);
 }
开发者ID:SGuyGe,项目名称:corefx,代码行数:10,代码来源:ListDictionaryTests.cs


示例17: StringResources

 StringResources()
 {
     r_InstalledLanguages = new ListDictionary<string, LanguageInfo>()
     {
         { "Japanese", new LanguageInfo("Japanese", "ja-JP", "日本語") },
         { "SimplifiedChinese", new LanguageInfo("SimplifiedChinese", "zh-Hans", "简体中文") },
         { "English", new LanguageInfo("English", "en", "English") },
     };
     InstalledLanguages = r_InstalledLanguages.Values.ToArray();
 }
开发者ID:amatukaze,项目名称:IntelligentNavalGun,代码行数:10,代码来源:StringResources.cs


示例18: CustomerAccountService

        public CustomerAccountService()
        {
            customerAccounts = new ListDictionary<int, CustomerAccount>();

            customerAccounts.Add(1, new CustomerAccount(123456781, "Checking", 1842.75M));
            customerAccounts.Add(1, new CustomerAccount(123456782, "Savings", 9367.92M));

            customerAccounts.Add(2, new CustomerAccount(987654321, "Interest Checking", 2496.44M));
            customerAccounts.Add(2, new CustomerAccount(987654322, "Money Market", 21959.38M));
            customerAccounts.Add(2, new CustomerAccount(987654323, "Car Loan", -19483.95M));
        }
开发者ID:BackupTheBerlios,项目名称:sofia-svn,代码行数:11,代码来源:customeraccountservice.cs


示例19: RadGrid1_ItemCommand

 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
 {
     if (e.CommandName == RadGrid.InitInsertCommandName)
     {
         e.Canceled = true;
         //Prepare an IDictionary with the predefined values
         ListDictionary newValues = new ListDictionary();
         newValues["Subject"] = "New Person";
         //Insert the item and rebind
         e.Item.OwnerTableView.InsertItem(newValues);
     }
 }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:12,代码来源:Default2.aspx.cs


示例20: HybridDictionary

		public HybridDictionary (int initialSize, bool caseInsensitive)
		{
			this.caseInsensitive = caseInsensitive;

			IComparer comparer = caseInsensitive ? CaseInsensitiveComparer.DefaultInvariant : null;
			IHashCodeProvider hcp = caseInsensitive ? CaseInsensitiveHashCodeProvider.DefaultInvariant : null;

			if (initialSize <= switchAfter)
				list = new ListDictionary (comparer);
			else
				hashtable = new Hashtable (initialSize, hcp, comparer);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:HybridDictionary.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ListInfo类代码示例发布时间:2022-05-24
下一篇:
C# ListCreationInformation类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap