當前位置: 首頁>>代碼示例>>C#>>正文


C# System.Collections.Generic.List.AddRange方法代碼示例

本文整理匯總了C#中System.Collections.Generic.System.Collections.Generic.List.AddRange方法的典型用法代碼示例。如果您正苦於以下問題:C# System.Collections.Generic.List.AddRange方法的具體用法?C# System.Collections.Generic.List.AddRange怎麽用?C# System.Collections.Generic.List.AddRange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Collections.Generic.System.Collections.Generic.List的用法示例。


在下文中一共展示了System.Collections.Generic.List.AddRange方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BasicTest

 public void BasicTest()
 {
     System.Collections.Generic.List<string> TestObject = new System.Collections.Generic.List<string>();
     TestObject.AddRange(new string[] { "this", "is", "a", "test" });
     ListMapping<int, string> Results = TestObject.Permute();
     Assert.Equal(24, Results.Keys.Count);
     foreach (int Key in Results.Keys)
         foreach (string Item in Results[Key])
             Assert.True(Item == "this" || Item == "is" || Item == "a" || Item == "test");
 }
開發者ID:jpsullivan,項目名稱:Craig-s-Utility-Library,代碼行數:10,代碼來源:PermutationExtensions.cs

示例2: Fill

 public void Fill(long house_id)
 {
     this.m_houseId = house_id;
     System.Collections.Generic.List<FasetItem> list = new System.Collections.Generic.List<FasetItem> {
         FasetItem.Null
     };
     list.AddRange(Mappers.FasetItemMapper.FindBySetNameFaset(this.GetSetNameFaset()));
     this.bsFasetItems.set_DataSource(list);
     this.selectedType.set_DataSource(list);
     this.selectedType.set_DisplayMember("Name");
     this.selectedType.set_ValueMember("Id");
     this.dt = Mappers.HouseMapper.GetPropertyByHouse(house_id);
     this.bsHousePropertys.set_DataSource(this.dt);
 }
開發者ID:u4097,項目名稱:SQLScript,代碼行數:14,代碼來源:HouseIngenerTableView.cs

示例3: Fill

 public void Fill()
 {
     System.Collections.Generic.List<string> list = new System.Collections.Generic.List<string> { "" };
     list.AddRange(Session.GetIpAddresses());
     System.Collections.Generic.List<string> list2 = new System.Collections.Generic.List<string> { "" };
     list2.AddRange(Session.GetUsernames());
     System.Collections.Generic.List<string> list3 = new System.Collections.Generic.List<string> { "" };
     list3.AddRange(Session.GetHostnames());
     System.Collections.Generic.List<string> list4 = new System.Collections.Generic.List<string> { "" };
     list4.AddRange(Session.GetArmNames());
     this.cbIpAddress.set_DataSource(list);
     this.cbUsername.set_DataSource(list2);
     this.cbHostname.set_DataSource(list3);
     this.cbArmName.set_DataSource(list4);
 }
開發者ID:u4097,項目名稱:SQLScript,代碼行數:15,代碼來源:AdminSessionsView.cs

示例4: CrawlNow

    public void CrawlNow(string p)
    {
        try
        {

        WebClient easyclient = new WebClient();
        easyclient.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36");
        easyclient.Headers.Add("accept-Encoding", "deflate");
        string theHtml = easyclient.DownloadString(p);

        WebHeaderCollection GetHeaders = easyclient.ResponseHeaders;
        for (int i = 0; i < GetHeaders.Count; i++)
        {
            if (GetHeaders.GetKey(i).Contains("Last-Modified"))
            {
                internalDict.Add(p, GetHeaders.Get(i));
            }

        }

        ///creates an instance of the scraper;creates a generic list  class;
        ///then adds to the list the links it finds on the url requested
        /// then it adds url to queue
        FindsLinksViaRegex linkfinder = new FindsLinksViaRegex();
        List<LinkItem> linkitm = new System.Collections.Generic.List<LinkItem>();

        linkitm.AddRange(linkfinder.Find(theHtml));

            foreach (LinkItem info in linkitm)
            {
                if (info.Href != null)
                {
                   qOfURls.Enqueue(info.Href);
                }
            }
        }
        catch( System.Net.WebException)
            {
            // do something
            }
        catch (Exception)
        {
             //catch other errors
        }
    }
開發者ID:jaynav,項目名稱:MyWebCrawler,代碼行數:45,代碼來源:Crawls.cs

示例5: AngleSort

 // sortowanie katowe punktow z tablicy p w kierunku przeciwnym do ruchu wskazowek zegara wzgledem punktu centralnego c
 // czyli sortowanie wzgledem roznacych katow odcinka (c,p[i]) z osia x
 // przy pomocy parametru ifAngleEqual można doprwcyzować kryterium sortowania gdy katy sa rowne
 // (domyslnie nic nie doprecyzowujemy, pozostawiamy rowne)
 public static Point[] AngleSort(Point c, Point[] p, System.Comparison<Point> ifAngleEqual = null)
 {
     if (ifAngleEqual == null) ifAngleEqual = (p1, p2) => 0;
     if (p == null) throw new System.ArgumentNullException();
     if (p.Length < 2) return p;
     System.Comparison<Point> cmp = delegate(Point p1, Point p2)
         {
             int r = -(new Geometry.Segment(c, p1)).Direction(p2);
             return r != 0 ? r : ifAngleEqual(p1, p2);
         };
     var s1 = new System.Collections.Generic.List<Point>();
     var s2 = new System.Collections.Generic.List<Point>();
     for (int i = 0; i < p.Length; ++i)
         if (p[i].y > c.y || (p[i].y == c.y && p[i].x >= c.x))
             s1.Add(p[i]);
         else
             s2.Add(p[i]);
     s1.Sort(cmp);
     s2.Sort(cmp);
     s1.AddRange(s2);
     return s1.ToArray();
 }
開發者ID:padzikm,項目名稱:ComputerGraphics,代碼行數:26,代碼來源:Geometry.cs

示例6: longTouFengWei

        //判斷龍頭鳳尾
        private string[] longTouFengWei()
        {
            System.Collections.Generic.List<string> result = new System.Collections.Generic.List<string>();

            int nums = 0;

            List<string> mm = new List<string>();
            foreach (Control ctls in this.ltfwMustGpb.Controls)
            {
                if ((ctls as CheckBox).Checked == true)
                {
                    mm.Add(ctls.Text);
                }
            }

            if (mm.Contains("包含"))
            {
                foreach (Control ctls in this.touDxGpb.Controls)
                {
                    if ((ctls as CheckBox).Checked == true)
                    {
                        nums++;
                        result.AddRange(touDx());
                    }
                }
                foreach (Control ctls in this.touDsGpb.Controls)
                {
                    if ((ctls as CheckBox).Checked == true)
                    {
                        nums++;
                        result.AddRange(touDs());
                    }
                }
                foreach (Control ctls in this.touZhGpb.Controls)
                {
                    if ((ctls as CheckBox).Checked == true)
                    {
                        nums++;
                        result.AddRange(touZh());
                    }
                }
                foreach (Control ctls in this.weiDxGpb.Controls)
                {
                    if ((ctls as CheckBox).Checked == true)
                    {
                        nums++;
                        result.AddRange(weiDx());
                    }
                }
                foreach (Control ctls in this.weiDsGpb.Controls)
                {
                    if ((ctls as CheckBox).Checked == true)
                    {
                        nums++;
                        result.AddRange(weiDs());
                    }
                }
                foreach (Control ctls in this.weiZhGpb.Controls)
                {
                    if ((ctls as CheckBox).Checked == true)
                    {
                        nums++;
                        result.AddRange(weiZh());
                    }
                }
            }

            if (mm.Contains("殺去"))
            {
                foreach (Control ctls in this.touDxGpb.Controls)
                {
                    if ((ctls as CheckBox).Checked == true)
                    {
                        nums++;
                        result.AddRange(touDx());
                    }
                }
                foreach (Control ctls in this.touDsGpb.Controls)
                {
                    if ((ctls as CheckBox).Checked == true)
                    {
                        nums++;
                        result.AddRange(touDs());
                    }
                }
                foreach (Control ctls in this.touZhGpb.Controls)
                {
                    if ((ctls as CheckBox).Checked == true)
                    {
                        nums++;
                        result.AddRange(touZh());
                    }
                }
                foreach (Control ctls in this.weiDxGpb.Controls)
                {
                    if ((ctls as CheckBox).Checked == true)
                    {
                        nums++;
                        result.AddRange(weiDx());
//.........這裏部分代碼省略.........
開發者ID:svn2github,項目名稱:eztx,代碼行數:101,代碼來源:page3.cs

示例7: quanTaiCal


//.........這裏部分代碼省略.........
                            for (int i = 0; i < allNum.Count(); i++)
                            {
                                string a = allNum[i].Substring(0, 1);
                                string b = allNum[i].Substring(1, 1);
                                string c = allNum[i].Substring(2, 1);
                                if (
                                    (xiaoNums.Contains(a) && xiaoNums.Contains(b) && xiaoNums.Contains(c))
                                    )
                                {
                                    result.Add(allNum[i]);
                                }
                            }
                        }
                        else if (ctls.Name.Equals("he"))
                        {
                            for (int i = 0; i < allNum.Count(); i++)
                            {
                                string a = allNum[i].Substring(0, 1);
                                string b = allNum[i].Substring(1, 1);
                                string c = allNum[i].Substring(2, 1);
                                if (
                                    (heNums.Contains(a) && heNums.Contains(b) && heNums.Contains(c))
                                    )
                                {
                                    result.Add(allNum[i]);
                                }
                            }
                        }
                        else if (ctls.Name.Equals("shuang"))
                        {
                            for (int i = 0; i < allNum.Count(); i++)
                            {
                                string a = allNum[i].Substring(0, 1);
                                string b = allNum[i].Substring(1, 1);
                                string c = allNum[i].Substring(2, 1);
                                if (
                                    (shuangNums.Contains(a) && shuangNums.Contains(b) && shuangNums.Contains(c))
                                    )
                                {
                                    result.Add(allNum[i]);
                                }
                            }
                        }
                        else if (ctls.Name.Equals("da"))
                        {
                            for (int i = 0; i < allNum.Count(); i++)
                            {
                                string a = allNum[i].Substring(0, 1);
                                string b = allNum[i].Substring(1, 1);
                                string c = allNum[i].Substring(2, 1);
                                if (
                                    (daNums.Contains(a) && daNums.Contains(b) && daNums.Contains(c))
                                    )
                                {
                                    result.Add(allNum[i]);
                                }
                            }
                        }
                        else if (ctls.Name.Equals("zuSan"))
                        {
                            for (int i = 0; i < allNum.Count(); i++)
                            {
                                int a = Convert.ToInt16(allNum[i].Substring(0, 1));
                                int b = Convert.ToInt16(allNum[i].Substring(1, 1));
                                int c = Convert.ToInt16(allNum[i].Substring(2, 1));
                                if (
                                    a == b || a == c || b == c
                                    )
                                {
                                    result.Add(allNum[i]);
                                }
                            }
                        }
                        else if (ctls.Name.Equals("zuLiu"))
                        {
                            for (int i = 0; i < allNum.Count(); i++)
                            {
                                int a = Convert.ToInt16(allNum[i].Substring(0, 1));
                                int b = Convert.ToInt16(allNum[i].Substring(1, 1));
                                int c = Convert.ToInt16(allNum[i].Substring(2, 1));
                                if (
                                    a != b && a != c && b != c
                                    )
                                {
                                    result.Add(allNum[i]);
                                }
                            }
                        }
                    }
            }

            if (cbkCount == 0)
            {
                result.AddRange(allNum);
            }

            List<string> result1 = result.Distinct().ToList();//去除重複項
            result1.Sort();
            return result1.ToArray();
        }
開發者ID:svn2github,項目名稱:eztx,代碼行數:101,代碼來源:page3.cs

示例8: kuaJu

        //跨距
        private string[] kuaJu()
        {
            System.Collections.Generic.List<string> result = new System.Collections.Generic.List<string>();
            string[] allNum = heZhi();

            if (killKuaDu.Checked == false)
            {
                List<int> nums = new List<int>();
                foreach (Control ctls in this.kuaJuGpb.Controls)
                {
                    bool isNum = isNumber(ctls.Text);
                    if ((ctls as CheckBox).Checked == true && isNum == true)
                    {
                        nums.Add(Convert.ToInt16(ctls.Text));
                    }
                }

                if (nums.Count > 0)
                {
                    for (int i = 0; i < allNum.Count(); i++)
                    {
                        for (int j = 0; j < nums.Count(); j++)
                        {
                            int a = Convert.ToInt32(allNum[i].Substring(0, 1));
                            int b = Convert.ToInt32(allNum[i].Substring(1, 1));
                            int c = Convert.ToInt32(allNum[i].Substring(2, 1));
                            int max = 0;
                            int min = 0;

                            if (a > b)
                            {
                                if (a > c)
                                {
                                    max = a;
                                }
                                else
                                {
                                    max = c;
                                }
                            }
                            else
                            {
                                if (b > c)
                                {
                                    max = b;
                                }
                                else
                                {
                                    max = c;
                                }
                            }

                            if (a < b)
                            {
                                if (a < c)
                                {
                                    min = a;
                                }
                                else
                                {
                                    min = c;
                                }
                            }
                            else
                            {
                                if (b < c)
                                {
                                    min = b;
                                }
                                else
                                {
                                    min = c;
                                }
                            }

                            if (
                                max - min == nums[j]
                            )
                            {
                                result.Add(allNum[i]);
                            }
                        }
                    }
                }
                else
                {
                    result.AddRange(allNum);
                }

                List<string> result1 = result.Distinct().ToList();//去除重複項
                return result1.ToArray();
            }
            else
            {
                List<int> nums = new List<int>();
                result.AddRange(allNum);

                foreach (Control ctls in this.kuaJuGpb.Controls)
                {
//.........這裏部分代碼省略.........
開發者ID:svn2github,項目名稱:eztx,代碼行數:101,代碼來源:page3.cs

示例9: zhiLinSha

        //臨碼之質臨
        private string[] zhiLinSha()
        {
            System.Collections.Generic.List<string> result = new System.Collections.Generic.List<string>();
            string[] allNum = daXiaoSha();
            string[] bigNum = { "1", "2", "3", "5", "7" };
            if (zhiLinCbx.Checked == false)
            {
                result.AddRange(allNum);
            }

            if (zhiLinCbx.Checked && linMaShaQuCbx.Checked)//質臨殺去
            {
                for (int i = 0; i < allNum.Count(); i++)
                {
                    for (int j = 0; j < bigNum.Count(); j++)
                    {
                        if (
                            !(
                            ((bigNum.Contains(allNum[i].Substring(0, 1)) && bigNum.Contains(allNum[i].Substring(1, 1))) && (Convert.ToInt32(allNum[i].Substring(0, 1)) - Convert.ToInt32(allNum[i].Substring(1, 1)) == 1))
                            ||
                            ((bigNum.Contains(allNum[i].Substring(0, 1)) && bigNum.Contains(allNum[i].Substring(1, 1))) && (Convert.ToInt32(allNum[i].Substring(1, 1)) - Convert.ToInt32(allNum[i].Substring(0, 1)) == 1))
                            ||
                            ((bigNum.Contains(allNum[i].Substring(1, 1)) && bigNum.Contains(allNum[i].Substring(2, 1))) && (Convert.ToInt32(allNum[i].Substring(1, 1)) - Convert.ToInt32(allNum[i].Substring(2, 1)) == 1))
                            ||
                            ((bigNum.Contains(allNum[i].Substring(1, 1)) && bigNum.Contains(allNum[i].Substring(2, 1))) && (Convert.ToInt32(allNum[i].Substring(2, 1)) - Convert.ToInt32(allNum[i].Substring(1, 1)) == 1))
                            ||
                            ((bigNum.Contains(allNum[i].Substring(0, 1)) && bigNum.Contains(allNum[i].Substring(2, 1))) && (Convert.ToInt32(allNum[i].Substring(0, 1)) - Convert.ToInt32(allNum[i].Substring(2, 1)) == 1))
                            ||
                            ((bigNum.Contains(allNum[i].Substring(0, 1)) && bigNum.Contains(allNum[i].Substring(2, 1))) && (Convert.ToInt32(allNum[i].Substring(2, 1)) - Convert.ToInt32(allNum[i].Substring(0, 1)) == 1))
                            )
                            )
                        {
                            result.Add(allNum[i]);
                        }
                    }
                }
            }
            List<string> result1 = result.Distinct().ToList();//去除重複項
            return result1.ToArray();
        }
開發者ID:MEZboy,項目名稱:csharpsrc,代碼行數:41,代碼來源:page1.cs

示例10: bianLinHeCal

        //邊臨和
        private string[] bianLinHeCal()
        {
            System.Collections.Generic.List<string> result = new System.Collections.Generic.List<string>();
            string[] allNum = zuiDaLinMaJuLiCal();
            int countChecked = 0;//計算勾選過數字沒
            foreach (Control ctls in this.bianLinHe.Controls)
            {
                if (ctls is CheckBox == false || (ctls as CheckBox).Checked == false)
                {
                    continue;
                }
                countChecked++;

                int _blh = Convert.ToInt32(ctls.Name.Split('_')[1]);//拿到勾選的邊臨和

                for (int i = 0; i < allNum.Length; i++)
                {
                    int a = Convert.ToInt16(allNum[i].Substring(0, 1));
                    int b = Convert.ToInt16(allNum[i].Substring(1, 1));
                    int c = Convert.ToInt16(allNum[i].Substring(2, 1));

                    //反邊球運算 開始
                    int left = a;//得到百位之前空格數
                    int right = 9 - c;//得到個位之後空格數
                    int _fbq=left + right;
                    //反邊球運算 結束

                    int leftCenter = 9 - a + b;//得到百位與十位在立體走勢圖中的空格數
                    int centerRight = 9 - b + c;//得到十位與個位在立體走勢圖中的空格數
                    if (leftCenter > centerRight && leftCenter + _fbq == _blh)//如果左邊大於右邊
                    {
                        result.Add(allNum[i]);
                    }

                    if (centerRight > leftCenter && centerRight + _fbq == _blh)//如果右邊大於左邊
                    {
                        result.Add(allNum[i]);
                    }

                    if (leftCenter == centerRight && centerRight + _fbq == _blh)//如果兩個跨距相等
                    {
                        result.Add(allNum[i]);
                    }

                }
            }
            if (countChecked == 0)
            {
                result.AddRange(allNum);
            }

            return result.ToArray();
        }
開發者ID:svn2github,項目名稱:eztx,代碼行數:54,代碼來源:page3.cs

示例11: fanBianQiuCal

        //反邊球
        private string[] fanBianQiuCal()
        {
            System.Collections.Generic.List<string> result = new System.Collections.Generic.List<string>();
            string[] allNum = bianLinHeCal();
            int countChecked = 0;//計算勾選過數字沒
            foreach (Control ctls in this.fanBianQiu.Controls)
            {
                if (ctls is CheckBox == false || (ctls as CheckBox).Checked == false)
                {
                    continue;
                }
                countChecked++;

                int _fbq = Convert.ToInt16(ctls.Name.Split('_')[1]);//拿到勾選的反邊球

                for (int i = 0; i < allNum.Length; i++)
                {
                    int a = Convert.ToInt16(allNum[i].Substring(0, 1));
                    int b = Convert.ToInt16(allNum[i].Substring(1, 1));
                    int c = Convert.ToInt16(allNum[i].Substring(2, 1));

                    int left = a;//得到百位之前空格數
                    int right = 9 - c;//得到個位之後空格數
                    if (left + right == _fbq)
                    {
                        result.Add(allNum[i]);
                    }

                }

            }
            if (countChecked == 0)
            {
                result.AddRange(allNum);
            }

            return result.ToArray();
        }
開發者ID:svn2github,項目名稱:eztx,代碼行數:39,代碼來源:page3.cs

示例12: RequestProductInfoToPurchaseServer

	public void RequestProductInfoToPurchaseServer( body2_SC_CHARGE_ITEMLIST[] _chargeItems)
	{
		dicChargeItemInfo.Clear();
		
		List<string> listItemName = new System.Collections.Generic.List<string>();
		
		dicChargeItemInfo = ConvertChargeItemListToDictionary( _chargeItems);
		
		listItemName.AddRange( dicChargeItemInfo.Keys);

		if( purchaseManager != null)
		{
			purchaseManager.RequestProductInfos( listItemName.ToArray());
		}
		else
		{
			#region -test-
#if UNITY_EDITOR
			List<Store_Item_Info_Table> testList = new List<Store_Item_Info_Table>();
			int count = 0;

			foreach (body2_SC_CHARGE_ITEMLIST item in _chargeItems)
				Debug.LogWarning(item.ToString());

			foreach( string id in listItemName)
				testList.Add( new Store_Item_Info_Table( Store_Item_Type.ChargeItem, count++, id, 1));

			ProcessAfterReceiveProductInfo();

			nowState = StoreState.NOTOUCH;
#endif
			#endregion
		}
	}
開發者ID:ftcaicai,項目名稱:ArkClient,代碼行數:34,代碼來源:AsCashStore.cs

示例13: zuiDaLinMaJuLiCal

        //最大鄰碼跨距
        private string[] zuiDaLinMaJuLiCal()
        {
            System.Collections.Generic.List<string> result = new System.Collections.Generic.List<string>();
            string[] allNum = quanTaiCal();
            int countChecked = 0;//計算勾選過數字沒
            foreach (Control ctls in this.zuiDaLinMaKuaJu.Controls)
            {
                if (ctls is CheckBox == false || (ctls as CheckBox).Checked == false)
                {
                    continue;
                }
                countChecked++;

                int _kuaJu = Convert.ToInt16(ctls.Name.Split('_')[1]);//拿到勾選的最大鄰碼跨距
                for (int i = 0; i < allNum.Length; i++)
                {
                    int a = Convert.ToInt16(allNum[i].Substring(0, 1));
                    int b = Convert.ToInt16(allNum[i].Substring(1, 1));
                    int c = Convert.ToInt16(allNum[i].Substring(2, 1));

                    int leftCenter = 9 - a + b;//得到百位與十位在立體走勢圖中的空格數
                    int centerRight = 9 - b + c;//得到十位與個位在立體走勢圖中的空格數
                    if (leftCenter > centerRight && leftCenter == _kuaJu)//如果左邊大於右邊
                    {
                        result.Add(allNum[i]);
                    }

                    if (centerRight > leftCenter && centerRight == _kuaJu)//如果右邊大於左邊
                    {
                        result.Add(allNum[i]);
                    }

                    if (leftCenter == centerRight && centerRight == _kuaJu)//如果兩個跨距相等
                    {
                        result.Add(allNum[i]);
                    }

                }
            }
            if (countChecked == 0)
            {
                result.AddRange(allNum);
            }
            return result.ToArray();
        }
開發者ID:svn2github,項目名稱:eztx,代碼行數:46,代碼來源:page3.cs

示例14: Main

        static void Main(string[] args)
        {
            int hSeg = 16;
            int vSeg = 8;
            mikity.index myIndex = new mikity.index();                  //節點番號と座標変數の対応表
            mikity.index mask = new mikity.index();                  //節點番號と座標変數の対応表
            mikity.shape myShape = new mikity.shape();                  //座標変數
            mikity.elements Triangles = new mikity.elements();          //三角形要素
            mikity.elements myElements = new mikity.elements();         //張力要素リスト
            mikity.elements Border = new mikity.elements();         //境界要素リスト

            //形狀定義
            System.Random rand = new System.Random(0);
            for (int i = 0; i < hSeg; i++)
            {
                for (int j = 0; j < vSeg + 1; j++)
                {
                    int num = i + j * (hSeg);
                    myIndex.Add(new int[3] { num * 3, num * 3 + 1, num * 3 + 2 });
                    myShape.AddRange(new double[3] { (rand.NextDouble() - 0.5) * 15d, (rand.NextDouble() - 0.5) * 15d, (rand.NextDouble() - 0.5) * 15d });
                }
            }
            double Radius = 10.0;
            for (int i = 0; i < hSeg; i++)
            {
                int num = i + 0 * (hSeg);
                mask.Add(myIndex[num]);
                double theta = System.Math.PI * 2 / hSeg * i;
                myShape[mask.Last()] = new double[3] { Radius*System.Math.Cos(theta), Radius*System.Math.Sin(theta), -2.0 };
            }
            for (int i = 0; i < hSeg; i++)
            {
                int num = i + vSeg * (hSeg);
                double theta = System.Math.PI * 2 / hSeg * i;
                mask.Add(myIndex[num]);
                myShape[mask.Last()] = new double[3] { Radius * System.Math.Cos(theta), Radius * System.Math.Sin(theta), 0.0 };
            }
            //基準正方形を構成する2つの三角形
            int[,] _t = (matrix_INT)(new int[2, 2] { { 0, 1 }, { hSeg, hSeg+1 } });
            Triangles.Add(new int[3] { _t[0, 0], _t[0, 1], _t[1, 0] });
            Triangles.Add(new int[3] { _t[0, 1], _t[1, 1], _t[1, 0] });
            int[] tmp = vector.lin(0, 1);
            //作成した基準正方形を並べて行を作成
            for (int i = 1; i < hSeg; i++)
            {
                Triangles.AddRange((elements)Triangles[tmp] + i);
            }
            Triangles[Triangles.Count-2][1] = 0;
            Triangles[Triangles.Count-1][0] = 0;
            Triangles[Triangles.Count-1][1] = hSeg;
            //作成した基準行を並べて膜を作成
            tmp = vector.lin(0, 2*hSeg-1);
            for (int i = 1; i < vSeg; i++)
            {
                Triangles.AddRange((elements)Triangles[tmp] + i * (hSeg));

            }
            myElements.AddRange(Triangles);

            //3項法の準備
            mikity.term p = new mikity.term(myShape.Count);          //加速度
            mikity.term q = new mikity.term(myShape.Count);          //速度
            mikity.term x = new mikity.term(myShape);                //位置

            //GUIと可変パラメータの準備
            mikity.visualize.FigureUI figUI = new mikity.visualize.FigureUI();
            //時間の刻み幅
            mikity.visualize.slider s1 = figUI.addSlider(min: 1, step: 2, max: 44, val: 38, text: "dt");
            s1.Converter = val => Math.Pow(10, ((double)val / 10) - 4.8) * 2.0;
            System.Collections.Generic.List<double> dt = new System.Collections.Generic.List<double>();
            //リング間の距離
            mikity.visualize.slider s2 = figUI.addSlider(min: 0, step: 2, max: 4000, val: 800, text: "Ring");
            s2.Converter = val => (val)/200;
            //描畫ウインドウの準備
            mikity.visualize.figure3D myFigure = new mikity.visualize.figure3D();
            myFigure.xtitle = "Tanzbrunnen";
            System.Collections.Generic.List<double> fps = new System.Collections.Generic.List<double>();
            System.Collections.Generic.List<int> ticks = new System.Collections.Generic.List<int>();
            ticks.AddRange(new int[101]);
            //3項法のメインループ
            int t = 0;
            mikity.visualize.drawelements.scale(0.5);
            while (figUI.Exit == false)
            {
                if (figUI.Pause == false)
                {
                    t++;
                    ticks.Add(System.Environment.TickCount);
                    ticks.Remove(ticks[0]);
                    fps.Add((double)1000 / (ticks[100] - ticks[0]) * 100);
                    dt.Add(s1.value);
                    double w1 = s2.value;//リング
                    for (int i = 0; i < hSeg; i++)
                    {
                        double theta = System.Math.PI * 2 / hSeg * i;
                        myShape[mask[i]] = new double[3] { Radius * System.Math.Cos(theta), Radius * System.Math.Sin(theta), -w1 };
                    }
                    for (int i = 0; i < hSeg; i++)
                    {
                        double theta = System.Math.PI * 2 / hSeg * i;
//.........這裏部分代碼省略.........
開發者ID:mikity-mikity,項目名稱:ForceDiagram,代碼行數:101,代碼來源:Program.cs

示例15: AddItemToListForEditor

	public void AddItemToListForEditor()
	{
		List<string> listItemName = new System.Collections.Generic.List<string>();
	
		listItemName.AddRange( dicChargeItemInfo.Keys);
	
		List<Store_Item_Info_Table> testList = new List<Store_Item_Info_Table>();
		int count = 0;
		foreach( string id in listItemName)
			testList.Add( new Store_Item_Info_Table( Store_Item_Type.ChargeItem, count++, id, 1));

		AddStoreItems( testList);

		nowState = StoreState.NOTOUCH;
	}
開發者ID:ftcaicai,項目名稱:ArkClient,代碼行數:15,代碼來源:AsCashStore.cs


注:本文中的System.Collections.Generic.System.Collections.Generic.List.AddRange方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。