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


C# Int32Collection.GetEnumerator方法代碼示例

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


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

示例1: Submission

        // Copy a job...
        public Submission(string db, string backupdb, Int32Collection jobs, bool move = false)
        {
            InitializeComponent();
            Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
            Title = move ? "Moving..." : "Copying...";

            ColumnDefinition c1 = new ColumnDefinition();
            ColumnDefinition c2 = new ColumnDefinition();
            c1.Width = new GridLength(170);
            c2.Width = new GridLength(75);
            outerGrid.ColumnDefinitions.Add(c1);
            outerGrid.ColumnDefinitions.Add(c2);

            workers.Clear();

            Int32Collection.Enumerator e = jobs.GetEnumerator();
            while (e.MoveNext())
            {
                int jobID = e.Current;

                WindowInteropHelper helper = new WindowInteropHelper(this);
                SubmissionWorker w = new SubmissionWorker(helper.Handle, workers.Count());
                w.DoWork += new DoWorkEventHandler(worker_DoWork);
                w.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged);
                w.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
                w.WorkerReportsProgress = true;
                w.WorkerSupportsCancellation = false;

                RowDefinition r = new RowDefinition();
                outerGrid.RowDefinitions.Add(r);
                r.Height = new GridLength(26);
                Label l = new Label();
                l.Content = (move ? "Moving" : "Copying") + " Job #" + jobID.ToString() + "...";
                l.Height = 26;
                Grid.SetRow(l, outerGrid.RowDefinitions.Count() - 1);
                Grid.SetColumn(l, 0);
                outerGrid.Children.Add(l);

                ProgressBar p = new ProgressBar();
                p.Height = 26;
                p.Width = 75;
                Grid.SetRow(p, outerGrid.RowDefinitions.Count() - 1);
                Grid.SetColumn(p, 1);
                outerGrid.Children.Add(p);

                pbars.Add(w.id, p);
                String[] args = { "Copy", db, backupdb, jobID.ToString(), move.ToString() };
                workers.Add(workers.Count(), w);
                w.RunWorkerAsync(args);
            }

            Mouse.OverrideCursor = null;
        }
開發者ID:ExiaHan,項目名稱:z3test,代碼行數:54,代碼來源:Submission.xaml.cs


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