public void Cancel()
 {
     if (!IsFinished && !CurrentProgress.IsCancelled)
     {
         CurrentProgress.Cancel();
     }
 }
Esempio n. 2
0
        public void UpdateStatus(Status status)
        {
            DownloadStatus = (int)status;
            if (status == Status.Downloaded)
            {
                CurrentProgress.Update(0, 0);
            }

            DownloadDetailsCache.Instance.UpdateDownloadDetails(this);
        }
        /// <summary>
        /// Gets a formatted string showing the value of the current progress as a percentage.
        /// </summary>
        /// <param name="numberOfDecimalPlaces">OPTIONAL: The number of decimal places to show
        /// in the string returned. Default: 0.</param>
        /// <value></value>
        /// <returns></returns>
        /// <remarks></remarks>
        public string GetCurrentProgressString(int numberOfDecimalPlaces = 0)
        {
            if (numberOfDecimalPlaces < 0 || numberOfDecimalPlaces > 8)
            {
                numberOfDecimalPlaces = 0;
            }

            string formatter = "p" + numberOfDecimalPlaces.ToString();

            return(CurrentProgress.ToString(formatter));
        }
 private void SongAdded(object sender, SongAddedEventArgs e)
 {
     CurrentProgress++;
     Dispatcher.Invoke((Action)(() =>
     {
         listBox2.Items.Add(e.SongName);
         label2.Content = "Processed " + CurrentProgress.ToString() + " of " + CollectionToProcessSize.ToString();
         progressBar1.Value = CurrentProgress;
         listBox2.ScrollIntoView(listBox2.Items[listBox2.Items.Count - 1]);
     }));
 }
Esempio n. 5
0
        public void Update(DownloadDetails downloadDetails)
        {
            DownloadStatus = downloadDetails.DownloadStatus;
            ContentUri     = ContentUri ?? downloadDetails.ContentUri;

            if (DownloadStatus == (int)Status.Downloaded)
            {
                CurrentProgress.Update(0, 0);
            }

            CurrentProgress.Update(downloadDetails.CurrentProgress);
        }
Esempio n. 6
0
        private async void Go_ClickAsync(object sender, EventArgs e)
        {
            // show progress bar
            CurrentProgress.Show();
            // clear chart series
            foreach (var series in StockChart.Series)
            {
                series.Points.Clear();
            }

            // get total chart length to retrieve
            int size = int.Parse(ChartLength.SelectedItem.ToString());

            // gets the s&p 500 data points
            var spxPoints = Fetch.GetStockPoints(true, 0, size);

            CalculateTechnicalIndicators(spxPoints, true);
            LodingInfoLabel.Text = "Analyzing current market trends.";
            double spxAverage = await GetAveragePercent(spxPoints);

            SpxAverage.Text = $"SPX Percent: {Math.Round(spxAverage, 5)}";

            var symbolPoints = Fetch.GetStockPoints(false, 0, size);

            // calculate the accuaracy of the current predictions
            if (CalculateAccuracy)
            {
                await GetAccuracy(size, symbolPoints);
            }

            // add data points to chart
            CalculateTechnicalIndicators(symbolPoints);
            LodingInfoLabel.Text = $"Analyzing trends for {SymbolToLoad.Text.ToUpper()}.";
            // get the average prediction of the three pattern sizes
            double average = await GetAveragePercent(symbolPoints);

            AveragePredictionLabel.Text = $"Average Percent: {Math.Round(average, 5)}";
            if (symbolPoints.Count > 0)
            {
                ExpectedChangeLabel.Text = $"Expected Close: {Math.Round(average * double.Parse(symbolPoints.Last().Close), 3)}";
                InclusiveAverage.Text    = $"Average (Including SPX): {Math.Round((average + spxAverage) / 2.0, 5)}";
            }
            LodingInfoLabel.Text = "Done";
            CurrentProgress.Hide();

            await Task.Delay(3000);

            LodingInfoLabel.Text = "";
        }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="Rest.ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (UploadStatus != null)
     {
         UploadStatus.Validate();
     }
     if (DownloadStatus != null)
     {
         DownloadStatus.Validate();
     }
     if (CurrentProgress != null)
     {
         CurrentProgress.Validate();
     }
 }
        public bool Equals(DestinyFactionProgression input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     FactionHash == input.FactionHash ||
                     (FactionHash.Equals(input.FactionHash))
                     ) &&
                 (
                     FactionVendorIndex == input.FactionVendorIndex ||
                     (FactionVendorIndex.Equals(input.FactionVendorIndex))
                 ) &&
                 (
                     ProgressionHash == input.ProgressionHash ||
                     (ProgressionHash.Equals(input.ProgressionHash))
                 ) &&
                 (
                     DailyProgress == input.DailyProgress ||
                     (DailyProgress.Equals(input.DailyProgress))
                 ) &&
                 (
                     DailyLimit == input.DailyLimit ||
                     (DailyLimit.Equals(input.DailyLimit))
                 ) &&
                 (
                     WeeklyProgress == input.WeeklyProgress ||
                     (WeeklyProgress.Equals(input.WeeklyProgress))
                 ) &&
                 (
                     WeeklyLimit == input.WeeklyLimit ||
                     (WeeklyLimit.Equals(input.WeeklyLimit))
                 ) &&
                 (
                     CurrentProgress == input.CurrentProgress ||
                     (CurrentProgress.Equals(input.CurrentProgress))
                 ) &&
                 (
                     Level == input.Level ||
                     (Level.Equals(input.Level))
                 ) &&
                 (
                     LevelCap == input.LevelCap ||
                     (LevelCap.Equals(input.LevelCap))
                 ) &&
                 (
                     StepIndex == input.StepIndex ||
                     (StepIndex.Equals(input.StepIndex))
                 ) &&
                 (
                     ProgressToNextLevel == input.ProgressToNextLevel ||
                     (ProgressToNextLevel.Equals(input.ProgressToNextLevel))
                 ) &&
                 (
                     NextLevelAt == input.NextLevelAt ||
                     (NextLevelAt.Equals(input.NextLevelAt))
                 ) &&
                 (
                     CurrentResetCount == input.CurrentResetCount ||
                     (CurrentResetCount.Equals(input.CurrentResetCount))
                 ) &&
                 (
                     SeasonResets == input.SeasonResets ||
                     (SeasonResets != null && SeasonResets.SequenceEqual(input.SeasonResets))
                 ) &&
                 (
                     RewardItemStates == input.RewardItemStates ||
                     (RewardItemStates != null && RewardItemStates.SequenceEqual(input.RewardItemStates))
                 ));
        }
Esempio n. 9
0
        public bool IsProjectApproved()
        {
            string status = CurrentProgress.Split('\n')[0];

            return(status.Contains("立项") || status.Contains("需求"));
        }
Esempio n. 10
0
        public bool IsSuspended()
        {
            string status = CurrentProgress.Split('\n')[0];

            return(status.Contains("暂停"));
        }