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


C# List.Skip方法代码示例

本文整理汇总了C#中System.Windows.Documents.List.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# List.Skip方法的具体用法?C# List.Skip怎么用?C# List.Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Documents.List的用法示例。


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

示例1: MainWindow

        public MainWindow()
        {
            InitializeComponent();
            // 以下を追加
            this.btnDownload.Click += (sender, e) =>
            {
                var client = new System.Net.WebClient();
                byte[] buffer = client.DownloadData("http://k-db.com/?p=all&download=csv");
                string str = Encoding.Default.GetString(buffer);
                string[] rows = str.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);

                // 1行目をラベルに表示
                this.lblTitle.Content = rows[0];
                // 2行目以下はカンマ区切りから文字列の配列に変換しておく
                List<string[]> list = new List<string[]>();
                rows.ToList().ForEach(row => list.Add(row.Split(new char[] { ',' })));
                // ヘッダの作成(データバインド用の設計)
                GridView view = new GridView();
                list.First().Select((item, cnt) => new { Count = cnt, Item = item }).ToList().ForEach(header =>
                {
                    view.Columns.Add(
                        new GridViewColumn()
                        {
                            Header = header.Item,
                            DisplayMemberBinding = new Binding(string.Format("[{0}]", header.Count))
                        });
                });
                // これらをリストビューに設定
                lvStockList.View = view;
                lvStockList.ItemsSource = list.Skip(1);
            };
        }
开发者ID:kudakas,项目名称:KabutradeTool1,代码行数:32,代码来源:MainWindow.xaml.cs

示例2: UpdateWeather

 private async void UpdateWeather()
 {
     try
     {
         _weatherList = await OpenWeather.HelperClass.Weather.GetWeather(Properties.Settings.Default.WeatherLocation);
         _currentWeather = _weatherList.First();
         _weatherForecast = _weatherList.Skip(1).ToList();
         tbCurrentLocation.Text = Properties.Settings.Default.WeatherLocation;
         //gridWeather.DataContext = _currentWeather;
         itemsControlForecase.DataContext = _weatherForecast;
         borderWeatherRight.DataContext = _currentWeather;
         borderWeatherStrip.DataContext = _currentWeather;
     }
     catch (System.Exception)
     {
     }
 }
开发者ID:keyanmca,项目名称:_Signage,代码行数:17,代码来源:MainWindow.xaml.cs

示例3: LoadMon

 public void LoadMon(int NhomID)
 {
     lsMenuMon = BOMenuMon.GetAll(NhomID, _IsBanHang, _IsSoLuongChoPhepTonKho, _IsSoLuongKhongChoPhepTonKho, mTransit).ToList();
     if (lsMenuMon.Count > gridItems.Children.Count)
     {
         int CountItems = gridItems.Children.Count - 2;
         List<Data.BOMenuMon> lsItemsTem = lsMenuMon.Skip((PageItems - 1) * CountItems).Take(CountItems).ToList();
         bool Chay = true;
         int j = 0;
         for (int i = 0; i < lsItemsTem.Count; i++, j++)
         {
             if (i == 0)
             {
                 if (IsRefershMenu)
                     OnEventMenuMon(lsItemsTem[i]);
             }
             Chay = true;
             while (Chay)
             {
                 Chay = false;
                 if (Grid.GetRow(gridItems.Children[j]) != gridItems.RowDefinitions.Count - 1)
                     SetButtonItem((POSButtonMenu)gridItems.Children[j], lsItemsTem[i]);
                 else if (Grid.GetColumn(gridItems.Children[j]) > 0 && Grid.GetColumn(gridItems.Children[j]) < gridItems.ColumnDefinitions.Count - 1)
                     SetButtonItem((POSButtonMenu)gridItems.Children[j], lsItemsTem[i]);
                 else
                 {
                     Chay = true;
                     j++;
                 }
             }
         }
         if (lsItemsTem.Count > gridItems.Children.Count - gridItems.ColumnDefinitions.Count)
             j++;
         Chay = true;
         for (; j < gridItems.Children.Count; j++)
         {
             Chay = true;
             while (Chay)
             {
                 Chay = false;
                 if (Grid.GetRow(gridItems.Children[j]) != gridItems.RowDefinitions.Count - 1)
                     SetButtonEmpty((POSButtonMenu)gridItems.Children[j]);
                 else if (Grid.GetColumn(gridItems.Children[j]) > 0 && Grid.GetColumn(gridItems.Children[j]) < gridItems.ColumnDefinitions.Count - 1)
                     SetButtonEmpty((POSButtonMenu)gridItems.Children[j]);
                 else
                 {
                     Chay = true;
                     j++;
                     if (j > gridItems.Children.Count - 1)
                         Chay = false;
                 }
             }
         }
         SetItemPage(LoaiMenu.Mon);
     }
     else
     {
         for (int i = 0; i < lsMenuMon.Count; i++)
         {
             if (i == 0)
             {
                 if (IsRefershMenu)
                     OnEventMenuMon(lsMenuMon[i]);
             }
             SetButtonItem((POSButtonMenu)gridItems.Children[i], lsMenuMon[i]);
         }
         for (int i = lsMenuMon.Count; i < gridItems.Children.Count; i++)
         {
             SetButtonEmpty((POSButtonMenu)gridItems.Children[i]);
         }
         SetItemPage(LoaiMenu.None);
     }
 }
开发者ID:MisterTobi,项目名称:restaurant-cafe,代码行数:73,代码来源:UCMenu.xaml.cs

示例4: CreateAnimatedString

        public string CreateAnimatedString(string wrong, string right, List<Change> changes)
        {
            var word = wrong;
            foreach (var change in changes)
            {
                switch (change.ChangeType)
                {
                    case ChangeType.Insert:
                    {
                        word = word.Insert(change.Index, change.Character + "");
                        //when you insert a charahter the indexes will be effected so you need to push them
                        changes.Skip(changes.IndexOf(change) + 1).ToList().ForEach(f =>
                        {
                            f.Index++;
                            if (f.Index2.HasValue)
                                f.Index2++;
                        });
                    }
                    break;
                    case ChangeType.Remove:
                    //leav the char in there cuz the animation will take it out
                    break;
                    case ChangeType.Swap:
                    //leav them unswaped cuz the animation will do it 
                    break;
                    case ChangeType.Replace:
                    {
                        //put the new char next to the old one 
                        word = word.Insert(change.Index, change.Character2 + "");
                        //when you insert a charahter the indexes will be effected so you need to push them
                        changes.Skip(changes.IndexOf(change) + 1).ToList().ForEach(f =>
                        {
                            f.Index++;
                            if (f.Index2.HasValue)
                                f.Index2++;
                        });

                    }
                    break;
                }
            }
            return word;
        }
开发者ID:JackWangCUMT,项目名称:Playground,代码行数:43,代码来源:Window1.xaml.cs

示例5: Timer_Tick

    private void Timer_Tick(object sender, EventArgs e) {

      InitializeVault();
      if (volumeInfo.Count == 0)
        return;

      List<Point> points = new List<Point>();
      for (int i = 0; i < volumeInfo.Count; i++) {
        var item = volumeInfo[volumeInfo.Count - i - 1];
        if ((DateTime.Now - item.TimeStamp).TotalMilliseconds > timeOnScreen)
          break;

        points.Add(new Point((DateTime.Now - item.TimeStamp).TotalMilliseconds * Width / timeOnScreen, Height - item.VolumeLevel * Height * 150));
      }

      if (points.Count > 0) {
        var pathGeom = new PathGeometry();
        pathGeom.Figures.Add(new PathFigure(points[0], points.Skip(1).Select(f => new LineSegment(f, true)), false));
        XPath.Data = pathGeom;  
      }
    }
开发者ID:podkolzzzin,项目名称:RhythmDefiner,代码行数:21,代码来源:MainWindow.xaml.cs

示例6: LoadGroup

        public void LoadGroup()
        {
            bool isHasMon = false;
            lsMenuNhom = BOMenuNhom.GetAll(LoaiNhomID, _IsBanHang, _IsSoLuongChoPhepTonKho, _IsSoLuongKhongChoPhepTonKho, mTransit).ToList();
            if (lsMenuNhom.Count > gridGroup.Children.Count)
            {
                int CountGroup = gridGroup.Children.Count - 2;
                List<Data.BOMenuNhom> lsGroupTem = lsMenuNhom.Skip((PageGroup - 1) * CountGroup).Take(CountGroup).ToList();
                for (int i = 0; i < lsGroupTem.Count; i++)
                {
                    if (i == 0)
                    {
                        MenuNhomIndex = lsGroupTem[i];
                        PageItems = 1;
                        LoadMon(lsMenuNhom[i].MenuNhom.NhomID);
                        OnEventMenuNhom(MenuNhomIndex);
                        isHasMon = true;
                    }
                    SetButtonNhom((POSButtonMenu)gridGroup.Children[i + 1], lsGroupTem[i]);
                }
                for (int i = lsGroupTem.Count; i < CountGroup; i++)
                {
                    SetButtonEmpty((POSButtonMenu)gridGroup.Children[i + 1]);
                }
                SetGroupPage();
            }
            else
            {
                for (int i = 0; i < lsMenuNhom.Count; i++)
                {
                    if (i == 0)
                    {
                        MenuNhomIndex = lsMenuNhom[i];
                        PageItems = 1;
                        LoadMon(lsMenuNhom[i].MenuNhom.NhomID);
                        OnEventMenuNhom(MenuNhomIndex);
                        isHasMon = true;
                    }
                    SetButtonNhom((POSButtonMenu)gridGroup.Children[i], lsMenuNhom[i]);
                }

                for (int i = lsMenuNhom.Count; i < gridGroup.Children.Count; i++)
                    SetButtonEmpty((POSButtonMenu)gridGroup.Children[i]);
            }
            if (isHasMon==false)
            {
                for (int i = 0; i < gridItems.Children.Count; i++)
                {
                    SetButtonEmpty((POSButtonMenu)gridItems.Children[i]);
                }
            }
        }
开发者ID:MisterTobi,项目名称:restaurant-cafe,代码行数:52,代码来源:UCMenu.xaml.cs

示例7: Run2

        /// <summary>
        /// 過去のもの。頑張りすぎた。
        /// </summary>
        /// <returns></returns>
        ClusteringResult Run2()
        {
            List<ClusteringResult> tmpResult = new List<ClusteringResult>();
            OnReport("開始");
            for (int i = 0; i < wideCount; i++)
            {
                ClusteringResult cr = new ClusteringResult() { Parent = this };
                cr.CreateRandom(ClusterTable, random.Next());
                tmpResult.Add(cr);
            }

            int loopCount = 0;
            int sameCount = 0;
            double sameRate = 0;
            while (true)
            {

                loopCount++;
                if (tmpResult.First().GetLockRate() == sameRate)
                {
                    sameCount++;
                }
                else
                {
                    sameRate = tmpResult.First().GetLockRate();
                    sameCount = 0;
                }

                OnReport(loopCount + "回目開始");
                foreach (var item in tmpResult)
                {
                    item.Run();
                }
                OnReport("計算終了");

                var baseResult = tmpResult.OrderByDescending(n => n.GetPerformanceIndex()).First();
                foreach (var item in tmpResult)
                {
                    item.CategorySort(baseResult);
                }
                tmpResult = tmpResult.OrderByDescending(n => n.GetPerformanceIndex()).ToList();
                List<ClusteringResult> list = new List<ClusteringResult>();
                foreach (var item in tmpResult.Take(tmpResult.Count / 2))
                {
                    var clone = item.Clone();
                    list.Add(clone);
                }
                if (tmpResult.Count > 3)
                {
                    foreach (var item in tmpResult.Skip(tmpResult.Count / 2).ToArray())
                    {
                        tmpResult.Remove(item);
                    }
                    foreach (var item in list)
                    {
                        tmpResult.Add(item.Clone());
                    }
                }

                if (tmpResult.First().GetLockRate() < 0.9 && loopCount < 100 && sameCount < 10)
                {
                    int c = 0;
                    OnReport("マージ・ランダム振り開始");
                    foreach (var item in tmpResult)
                    {
                        var count = item.CreateMargeData(list, true);
                        //  lock (this)
                        {
                            c += count;
                        }
                    }
                    OnReport("レポート開始");
                    OnReport(tmpResult.First().View());

                    if (c == 0) break;
                }
                else
                {
                    foreach (var item in tmpResult)
                    {
                        var count = item.CreateMargeData(list, false);
                    }
                    tmpResult.First().Run();
                    break;
                }

                if (tmpResult.First().DivideCategory())
                {
                    OnReport("クラスタ分割発生");
                    var r = tmpResult.First();
                    tmpResult.Clear();
                    for (int i = 0; i < TryCount; i++)
                    {
                        tmpResult.Add(r.Clone());
                    }
                }
//.........这里部分代码省略.........
开发者ID:kiichi54321,项目名称:ClusterViewForSliverlinght,代码行数:101,代码来源:Clustering2.cs

示例8: learningService_BookGetByBookTypeCompleted

 void learningService_BookGetByBookTypeCompleted(object sender, BookGetByBookTypeCompletedEventArgs e)
 {
     try
     {
         take = loop;
         skip = 0;
         _BookList = new List<Book>();
         if (e.Error == null)
         {
             foreach (Book book in e.Result)
             {
                 _BookList.Add(book);
                 
             }
             List<Book> list = _BookList.Skip(skip).Take(take).ToList();
             foreach (Book _book in list)
             {
                 AddControl(0, new Thickness(0, 0, 0, 0), new Thickness(10, 0, 0, 0), 50.0, 80.0, 75.0, "../Images/Library/Data/" + _book.BookImg, _book.BookName, 11, _book.BookID, "Book", BookListStackPanel);
             }
             WaittingServices(false);
             TakeAndSkip();
         }
         else
             return;
     }
     catch
     {
         return;
     }
 }
开发者ID:lengocluyen,项目名称:pescode,代码行数:30,代码来源:Library.xaml.cs

示例9: completeGame

        private void completeGame(List<List<GameState>> listOfGameStates)
        {
            var tempFinished = new List<GameState>();
            listOfGameStates.Reverse();
            tempFinished.Add(listOfGameStates.First().First(x => x.game.totalScore.score == listOfGameStates.First().Max(o => o.game.totalScore.score)));
            int index = 1;

            foreach (var round in listOfGameStates.Skip(1))//skip the first element cuz we just dealt with it above
            {
                tempFinished.Add(listOfGameStates[index].OrderByDescending(o => o.game.totalScore.score).ToList().First(
                    x => x.droppedPiece == tempFinished[index - 1].lastPiece));
                index++;
            }
            tempFinished.Reverse();
            finishedGame.AddRange(tempFinished);
        }
开发者ID:vanbujm,项目名称:CITS4211,代码行数:16,代码来源:Program.cs

示例10: SurfaceMode

        private void SurfaceMode(HandCollection data)
        {
            this.Dispatcher.Invoke(new Action(() =>
            {
                if (isNew)
                {
                    if (this.selectedVideo != null)
                    {
                        this.selectedVideo.IsSelected = false;
                    }
                    this.selectedVideo = new VideoSurface(this.videoPaths[this.videoPointer++]);
                    this.videos.Add(this.selectedVideo);
                    this.selectedVideo.RequestRemove += new EventHandler(videoSurface_RequestRemove);
                    if (videoPointer >= this.videoPaths.Length)
                    {
                        videoPointer = 0;
                    }

                    this.viewPort.Children.Add(selectedVideo.ModelVisual3D);
                    this.selectedVideo.Play();
                    this.selectedVideo.Opacity = 0.8;
                    isNew = false;
                }
                if (selectedVideo.IsPaused)
                {
                    selectedVideo.Play();
                }

                var points = new List<CCT.NUI.Core.Point>();

                var hand1 = data.Hands[0];
                var hand2 = data.Hands[1];

                points.Add(hand1.FingerPoints[0].Fingertip);
                points.Add(hand1.FingerPoints[1].Fingertip);
                points.Add(hand2.FingerPoints[0].Fingertip);
                points.Add(hand2.FingerPoints[1].Fingertip);

                points = points.OrderBy((p) => p.X).ToList();
                var leftPoints = points.Take(2).ToList();
                var rightPoints = points.Skip(2).Take(2).ToList();
                leftPoints = leftPoints.OrderByDescending(p => p.Y).ToList();
                rightPoints = rightPoints.OrderByDescending(p => p.Y).ToList();

                this.selectedVideo.SetPoints(Map(leftPoints[0]), Map(rightPoints[0]), Map(rightPoints[1]), Map(leftPoints[1]));
            }));
            moveMode = false;
        }
开发者ID:an83,项目名称:KinectTouch2,代码行数:48,代码来源:VideoManipulationWindow.xaml.cs

示例11: updateAnimListBox

        private void updateAnimListBox()
        {
            List<CurvePoint> points = new List<CurvePoint>();

            foreach (var p in selectedLine.points)
            {
                points.Add(new CurvePoint(p.time, p.weight, p.inTangent, p.leaveTangent));
            }
            List<Animation> anims = new List<Animation>();
            int pos = 0;
            int animLength;
            for (int i = 0; i < selectedLine.animations.Length; i++)
            {
                animLength = selectedLine.numKeys[i];
                anims.Add(new Animation
                {
                    Name = FaceFX.Header.Names[selectedLine.animations[i].index],
                    points = new LinkedList<CurvePoint>(points.Skip(pos).Take(animLength))
                });
                pos += animLength;
            }
            animationListBox.ItemsSource = anims;
            graph.Clear();
        }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:24,代码来源:FaceFXEditor.xaml.cs


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