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


C# List.RemoveAt方法代码示例

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


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

示例1: generar

        private void generar(object sender, RoutedEventArgs e)
        {
            List<OrdenDeCompra> lstOrdenCompra = new List<OrdenDeCompra>();
            lstOrdenCompra = DataObjects.Reportes.ReporteOrdenCompraSQL.BuscarOrdenesCompra();

            for (int i = 0; i < lstOrdenCompra.Count;i++ )
            {
                if (lstOrdenCompra[i].Estado == "0") lstOrdenCompra[i].Estado = "CANCELADA";
                if (lstOrdenCompra[i].Estado == "1") lstOrdenCompra[i].Estado = "BORRADOR";
                if (lstOrdenCompra[i].Estado == "2") lstOrdenCompra[i].Estado = "EMITIDA";
                if (lstOrdenCompra[i].Estado == "3") lstOrdenCompra[i].Estado = "ATENDIDA";
                for (int j = 0; j < lstProveedor.Count; j++)
                {
                    if (lstProveedor[j].IdProveedor.ToString() == lstOrdenCompra[i].Proveedor)
                        lstOrdenCompra[i].Proveedor = lstProveedor[j].RazonSocial;
                }
            }

            for (int i = 0; i < lstOrdenCompra.Count; i++)
            {
                for (int j = 0; j < ListBoxEstado1.Items.Count; j++)
                {
                    if (lstOrdenCompra[i].Estado == ListBoxEstado1.Items[j].ToString()) { lstOrdenCompra.RemoveAt(i); i = -1; break; }

                }

            }
            for (int i = 0; i < lstOrdenCompra.Count; i++)
            {
                for (int j = 0; j < ListBoxProveedor1.Items.Count; j++)
                {
                    if (lstOrdenCompra[i].Proveedor == ListBoxProveedor1.Items[j].ToString()) { lstOrdenCompra.RemoveAt(i); i = -1; break; }

                }
            }
            DateTime inicio = Convert.ToDateTime(FechaDesde.Text);
            DateTime fin = Convert.ToDateTime(FechaHasta.Text);
            for (int i = 0; i < lstOrdenCompra.Count; i++)
            {
                if (Convert.ToDateTime(lstOrdenCompra[i].FechaReg) < inicio || Convert.ToDateTime(lstOrdenCompra[i].FechaReg) > fin)
                {
                    lstOrdenCompra.RemoveAt(i);
                    i = -1;
                }
            }

            Reportes.reportViewerCompras win = new reportViewerCompras(lstOrdenCompra);
            win.Show();
        }
开发者ID:alfonsobp,项目名称:made-in-house,代码行数:49,代码来源:reporteComprasView.xaml.cs

示例2: DeleteButton_Click

        private void DeleteButton_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to drop the course? This action can't be reverted.", "Confirm Drop",
                MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            {
                XmlWriterSettings xmlWriterSettings = new XmlWriterSettings();
                xmlWriterSettings.Indent = true;

                using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    List<Gradecard> temp = new List<Gradecard>();
                    if (myIsolatedStorage.FileExists("Gradecards.xml"))
                    {
                        using (IsolatedStorageFileStream stream1 = new IsolatedStorageFileStream("Gradecards.xml", FileMode.Open, FileAccess.Read, myIsolatedStorage))
                        {
                            XmlSerializer serializer = new XmlSerializer(typeof(List<Gradecard>));
                            temp = (List<Gradecard>)serializer.Deserialize(stream1);
                        }
                        temp.RemoveAt(index);
                        GlobalVars.UserGc = temp;
                    }

                    using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream("Gradecards.xml", FileMode.Create, myIsolatedStorage))
                    {
                        XmlSerializer serializer = new XmlSerializer(typeof(List<Gradecard>));
                        using (XmlWriter xmlWriter = XmlWriter.Create(stream, xmlWriterSettings))
                        {
                            serializer.Serialize(xmlWriter, GlobalVars.UserGc);
                        }
                    }
                    index = -1;
                    NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
                }
            }
        }
开发者ID:sagar-sm,项目名称:StudyBuddy,代码行数:35,代码来源:EditGc.xaml.cs

示例3: tirer

 static int tirer(List<int> w)
 {
     int index = r.Next(w.Count);
     int p = w[index];
     w.RemoveAt(index);
     return p;
 }
开发者ID:bnogent,项目名称:lecompteestbon,代码行数:7,代码来源:MainWindow.xaml.cs

示例4: Decorate

        /// <summary>
        /// Transform collection of inlines
        /// </summary>
        public List<Inline> Decorate(IConferenceMessage msg, List<Inline> inlines)
        {
            const string pattern = @"((https?|ftp|dchub|magnet|mailto|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)";

            for (int i = 0; i < inlines.Count; i++)
            {
                // splite one Inline element (text (Run)) into several inlines (Runs and Hyperlinks)
                var inline = inlines[i] as Run;
                if (inline == null)
                    continue;

                var matches = Regex.Matches(inline.Text, pattern).OfType<Match>().Select(item => item.Value).ToArray();
                if (matches.Length < 1)
                    continue;

                inlines.RemoveAt(i);

                var parts = inline.Text.SplitAndIncludeDelimiters(matches).ToArray();
                for (int j = i; j < parts.Length + i; j++)
                {
                    var part = parts[j];
                    if (matches.Contains(part))
                        inlines.Insert(j, DecorateAsHyperlink(part));
                    else
                        inlines.Insert(j, CommonMessageDecorator.Decorate(msg, part));
                }
            }
            return inlines;
        }
开发者ID:eNoise,项目名称:cyclops-chat,代码行数:32,代码来源:HyperlinkDecorator.cs

示例5: DirectionsResultView

        public DirectionsResultView(MapWidget mapWidget, FindCloseFacilityResultView fcfResultView, RouteResult routeResult, FindClosestResourceToolbar fcrToolbar)
        {
            InitializeComponent();
            base.DataContext = this;

            // Store a reference to the MapWidget that the toolbar has been installed to.
            _mapWidget = mapWidget;

            _closestFaculityResult = fcfResultView;
            _findClosestFacilityToolbar = fcrToolbar;

            RouteName = routeResult.Directions.RouteName;
            Summary = string.Format("{0:F1} {1}, {2}", routeResult.Directions.TotalLength, "miles", FormatTime(routeResult.Directions.TotalTime));

            List<Graphic> features = new List<Graphic>(routeResult.Directions.Features);
            features.RemoveAt(0);

            List<ManeuverViewModel> directionElements = new List<ManeuverViewModel>();
            Graphic previous = null;
            int i = 1;

            foreach (var next in features)
            {
                ManeuverViewModel maneuver = new ManeuverViewModel(previous, next, i++);
                maneuver.Graphic.MouseLeftButtonDown += Graphic_MouseLeftButtonDown;

                directionElements.Add(maneuver);
                previous = next;
            }

            Maneuvers = directionElements;
        }
开发者ID:ruisebastiao,项目名称:solutions-widgets-wpf,代码行数:32,代码来源:DirectionsResultView.xaml.cs

示例6: salvaScore_Click

        private void salvaScore_Click(object sender, RoutedEventArgs e)
        {
            List<itemRanking> ranking = new List<itemRanking>();
            ranking.Capacity = 3;
            itemRanking itemRanking = new itemRanking();

            itemRanking.nomeJogador = campoJogador.Text;
            itemRanking.pontuacao = this.pontuacao;

            IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;

            if (settings.Contains("ranking"))
            {
                ranking = (List<itemRanking>)settings["ranking"];
                ranking.Add(itemRanking);
                Comparison<itemRanking> comparador = new Comparison<itemRanking>(itemRanking.comparaPontuacao);
                ranking.Sort(comparador);
                if (ranking.Count > 3)
                {
                    ranking.RemoveAt(3);
                }
            }
            else
            {
                ranking.Add(itemRanking);
            }
            settings["ranking"] = ranking;
            settings.Save();
            NavigationService.Navigate(new Uri("/Ranking.xaml", UriKind.Relative));
        }
开发者ID:enilapb,项目名称:wp7,代码行数:30,代码来源:SalvaJogo.xaml.cs

示例7: Button_Click

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            // URL: http://en.wikipedia.org/wiki/Main_Page
            WebClient w = new WebClient();
            string s = w.DownloadString("http://www.rotowire.com/daily/nba/defense-vspos.htm");
            //string s = w.DownloadString("http://rotoguru1.com/cgi-bin/hstats.cgi?pos=0&sort=4&game=d&colA=0&daypt=0&xavg=4&show=2&fltr=00");

            // 2.
               List <string> xList = new List <string>();
               //string[] result;

            foreach (LinkItem i in LinkFinder.Find(s))
            {
                //var result = i.ToString().Split(new[] { '\r', '\n' });
                //xList = result.ToList<string>();
                Debug.WriteLine(i);
            }

            for (int i = xList.Count - 1; i >= 0; i--)
            {
                if (xList[i].Length > 3)
                {
                    string input = xList[i].Substring(0, 4);
                    if (Regex.IsMatch(input, @"^\d+$") == true)
                    {
                        //InsertData(xList[i]);
                    }
                }
                else
                {
                    xList.RemoveAt(i);
                }
            }
        }
开发者ID:jswindell,项目名称:WebScraper,代码行数:34,代码来源:MainWindow.xaml.cs

示例8: GotoSummaryItem

        internal void GotoSummaryItem(int changeNum)
        {
            SummaryNode rootNode = DataContext as SummaryNode;
            if (rootNode != null)
            {
                Stack<SummaryNode> changeLocation = rootNode.FindPathToChangeNumber(changeNum);

                if (changeLocation != null)
                {
                    SummaryNode snChange = changeLocation.Peek();
                    Debug.Assert(snChange.SummaryItem.FirstChangeNumber == changeNum || snChange.SummaryItem.LastChangeNumber == changeNum);
                    List<object> locationList = new List<object>();
                    foreach (SummaryNode sn in changeLocation)
                    {
                        locationList.Insert(0,sn);
                    }
                    locationList.RemoveAt(0);

                    TreeViewItem tvi = theTreeView.ContainerFromItem(locationList);
                    snChange.Selected = true;
                    Debug.Assert(tvi != null);
                    if (tvi != null)
                    {
						SelectAndShow(tvi);
                    }
                }
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:28,代码来源:ChangeTree.xaml.cs

示例9: Button_Click_1

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            Tienda tienda = cmbTienda.SelectedItem as Tienda;
            Cliente cliente = cmbCliente.SelectedItem as Cliente;
            Servicio servicio = cmbServicio.SelectedItem as Servicio;
            DateTime ini = Convert.ToDateTime(FechaDesde.Text);
            DateTime fin = Convert.ToDateTime(FechaHasta.Text);

            if (servicio.Nombre == "TODOS")
            {
                lista = DataObjects.Reportes.reporteServiciosSQL.BuscarServiTodos(tienda.IdTienda, cliente.Id);
                for (int i = 0; i < lista.Count; i++)
                {
                    if (Convert.ToDateTime(lista[i].Fecha) < ini || Convert.ToDateTime(lista[i].Fecha) > fin)
                    {
                        lista.RemoveAt(i);
                        i = 0;
                    }
                }
            }
            else
            {
                lista = DataObjects.Reportes.reporteServiciosSQL.BuscarServi(tienda.IdTienda, cliente.Id, servicio.IdServicio);
                for (int i = 0; i < lista.Count; i++)
                {
                    if (Convert.ToDateTime(lista[i].Fecha) < ini || Convert.ToDateTime(lista[i].Fecha) > fin)
                    {
                        lista.RemoveAt(i);
                        i = 0;
                    }
                }
            }
            Window_Loaded(sender, e);
        }
开发者ID:alfonsobp,项目名称:made-in-house,代码行数:34,代码来源:reportViewerServicios.xaml.cs

示例10: AddBlocksToSpan

 // Methods
 internal static void AddBlocksToSpan(FlowDocument tempFlowDocument, Span newspan)
 {
     List<Inline> ic = new List<Inline>();
     CollectInlineFromBlocks(tempFlowDocument.Blocks, ic);
     if ((ic.Count > 0) && (ic[ic.Count - 1] is LineBreak))
     {
         ic.RemoveAt(ic.Count - 1);
     }
     newspan.Inlines.AddRange(ic);
 }
开发者ID:QuocHuy7a10,项目名称:Arianrhod,代码行数:11,代码来源:ReplaceControls.cs

示例11: AddToSearchHistory

        private void AddToSearchHistory(ref List<string> history, string newSearch)
        {
            if (history.Contains(newSearch))
                history.Remove(newSearch);

            if (history.Count == 100)
                history.RemoveAt(99);

            history.Insert(0, newSearch);
        }
开发者ID:AlanCS,项目名称:Database-Utilities,代码行数:10,代码来源:MainWindow.xaml.cs

示例12: removeItem

        private void removeItem(ListBox lb, int index)
        {
            List<string> lst = new List<string>();

            for (int i = 0; i < lb.Items.Count; i++)
            {
                lst.Add(lb.Items[i].ToString());
            }
            lst.RemoveAt(index);
            lb.ItemsSource = lst;
        }
开发者ID:sankalpau3,项目名称:AdoraDestopAppFinalized,代码行数:11,代码来源:FOBActualCost.xaml.cs

示例13: DeleteData

 private void DeleteData()
 {
     List<Data> newData = new List<Data>((List<Data>)dataGrid1.ItemsSource);
     int j = 0;
     for (int i = 0; i < dataGrid1.Items.Count; ++i) {
         DataGridRow row = (DataGridRow)dataGrid1.ItemContainerGenerator.ContainerFromIndex(i);
         if (row.IsSelected) {
             newData.RemoveAt(i - j);
             ++j;
         }
     }
     dataGrid1.ItemsSource = newData;
 }
开发者ID:kittttttan,项目名称:test,代码行数:13,代码来源:MainWindow.xaml.cs

示例14: Button_Click

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            // Scrape links from wikipedia.org

            // 1.
            // URL: http://en.wikipedia.org/wiki/Main_Page
            WebClient w = new WebClient();
            //string s = w.DownloadString("http://www.basketball-reference.com/leagues/NBA_2015_ratings.html");
            string s = w.DownloadString("http://rotoguru1.com/cgi-bin/hstats.cgi?pos=0&sort=4&game=d&colA=0&daypt=0&xavg=4&show=2&fltr=00");

            // 2.
               List <string> xList = new List <string>();
               //string[] result;

            foreach (LinkItem i in LinkFinder.Find(s, "pre"))
            {
                var result = i.ToString().Split(new[] { '\r', '\n' });
                xList = result.ToList<string>();
                Debug.WriteLine(i);
            }

            for (int i = xList.Count - 1; i >= 0; i--)
            {
                if (xList[i].Length > 3)
                {
                    string input = xList[i].Substring(0, 4);
                    if (Regex.IsMatch(input, @"^\d+$") == false)
                    {
                        xList.RemoveAt(i);
                    }
                }
                else
                {
                    xList.RemoveAt(i);
                }
            }
        }
开发者ID:jswindell,项目名称:WebScraper,代码行数:37,代码来源:MainWindow.xaml+-+Copy.cs

示例15: btnDraw_Click

        private void btnDraw_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                int rows = Int32.Parse(drawNumber.Text);

                List<int> randomNumbers = new List<int>();

                int count = 0;
                int max = 1;
                Random rand = new Random();
                switch (theGameBox.SelectedItem.ToString())
                {
                    case "Suomi":
                        count = 7;
                        max = 40;
                    break;
                    case "VikingLotto":
                        count = 6;
                        max = 49;
                        break;
                    case "Eurojackpot":
                        count = 5;
                        max = 51;
                        break;
                }
                for (int j = 0; j < rows; j++)
                {
                    for (int i = 1; i < max; i++)
                    {
                        randomNumbers.Add(i);
                    }
                    for (int i = 0; i < count; i++)
                    {
                        int index;
                        //drawnRandomNumbers.Text += rand.Next(1, max).ToString() + " ";
                        index = rand.Next(0, randomNumbers.Count);
                        drawnRandomNumbers.Text += randomNumbers[index].ToString() + " ";
                        randomNumbers.RemoveAt(index);
                    }
                    drawnRandomNumbers.Text += "\n";
                }
               
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
开发者ID:LauriKorte,项目名称:IIO11300,代码行数:49,代码来源:MainWindow.xaml.cs


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