Esempio n. 1
0
        public void ODEvent_Fired(ODEventArgs e)
        {
            //We don't know what thread will cause a progress status change, so invoke this method as a delegate if necessary.
            if (this.InvokeRequired)
            {
                this.Invoke((Action) delegate() { ODEvent_Fired(e); });
                return;
            }
            //Make sure that this ODEvent is for FormProgressStatus and that the Tag is not null and is a string.
            if (e.Name != _odEventName || e.Tag == null)
            {
                return;
            }
            ProgressBarHelper progHelper = new ProgressBarHelper("");
            bool   hasProgHelper         = false;
            string status = "";

            if (e.Tag.GetType() == typeof(string))
            {
                status = ((string)e.Tag);
            }
            else if (e.Tag.GetType() == typeof(ProgressBarHelper))
            {
                progHelper    = (ProgressBarHelper)e.Tag;
                status        = progHelper.LabelValue;
                hasProgHelper = true;
            }
            else              //Unsupported type passed in.
            {
                return;
            }
            UpdateProgress(status, progHelper, hasProgHelper, status.ToUpper() == "DEFCON 1");
        }
Esempio n. 2
0
        /// <summary>
        /// Publishes the ASP.NET Core project to App Engine Flex and reports progress to the UI.
        /// </summary>
        /// <param name="project">The project to deploy.</param>
        /// <param name="options">The <see cref="DeploymentOptions"/> to use.</param>
        public async Task PublishProjectAsync(IParsedProject project, DeploymentOptions options)
        {
            try
            {
                ShellUtils.SaveAllFiles();

                GcpOutputWindow.Activate();
                GcpOutputWindow.Clear();
                GcpOutputWindow.OutputLine(string.Format(Resources.FlexPublishStepStartMessage, project.Name));

                TimeSpan deploymentDuration;
                AppEngineFlexDeploymentResult result;
                using (StatusbarHelper.Freeze())
                    using (StatusbarHelper.ShowDeployAnimation())
                        using (ProgressBarHelper progress =
                                   StatusbarHelper.ShowProgressBar(Resources.FlexPublishProgressMessage))
                            using (ShellUtils.SetShellUIBusy())
                            {
                                DateTime startDeploymentTime = DateTime.Now;
                                result = await PublishProjectAsync(
                                    project,
                                    options,
                                    progress,
                                    VsVersionUtils.ToolsPathProvider,
                                    GcpOutputWindow.OutputLine);

                                deploymentDuration = DateTime.Now - startDeploymentTime;
                            }

                if (result != null)
                {
                    GcpOutputWindow.OutputLine(string.Format(Resources.FlexPublishSuccessMessage, project.Name));
                    StatusbarHelper.SetText(Resources.PublishSuccessStatusMessage);

                    string url = result.GetDeploymentUrl();
                    GcpOutputWindow.OutputLine(string.Format(Resources.PublishUrlMessage, url));
                    if (options.OpenWebsite)
                    {
                        Process.Start(url);
                    }

                    EventsReporterWrapper.ReportEvent(
                        GaeDeployedEvent.Create(CommandStatus.Success, deploymentDuration));
                }
                else
                {
                    GcpOutputWindow.OutputLine(string.Format(Resources.FlexPublishFailedMessage, project.Name));
                    StatusbarHelper.SetText(Resources.PublishFailureStatusMessage);

                    EventsReporterWrapper.ReportEvent(GaeDeployedEvent.Create(CommandStatus.Failure, deploymentDuration));
                }
            }
            catch (Exception)
            {
                EventsReporterWrapper.ReportEvent(GaeDeployedEvent.Create(CommandStatus.Failure));
                GcpOutputWindow.OutputLine(string.Format(Resources.FlexPublishFailedMessage, project.Name));
                StatusbarHelper.SetText(Resources.PublishFailureStatusMessage);
            }
        }
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            _value += 20;
            _value  = _value > 100 ? 100 : _value;

            ProgressBarHelper.SetAnimateTo(Pgb1, _value);
            ProgressBarHelper.SetAnimateTo(Pgb2, _value);
        }
        private void BtnMinus_Click(object sender, RoutedEventArgs e)
        {
            _value -= 20;
            _value  = _value < 0 ? 0 : _value;

            ProgressBarHelper.SetAnimateTo(Pgb1, _value);
            ProgressBarHelper.SetAnimateTo(Pgb2, _value);
        }
        private void MakeSchedule()
        {
            ProgressBarHelper.ProgressBarEvent(20);
            ScheduleFrame.MakeScheduleFrame();
            var schedule = new Schedule();

            schedule.Create();
            WordTable.Lesson(schedule.MostOptimalitySchedule, schedule.SubgroupsInLessons);
        }
Esempio n. 6
0
        public void UpdateProgressDetailed(string labelValue, string percentVal = "", string tagString = "", int barVal = 0, int barMax               = 100, int marqSpeed = 0,
                                           string labelTop        = "", bool isLeftHidden = false, bool isTopHidden     = false, bool isPercentHidden = false,
                                           ProgBarStyle progStyle = ProgBarStyle.Blocks, ProgBarEventType progEvent = ProgBarEventType.ProgressBar)
        {
            ProgressBarHelper progHelper = new ProgressBarHelper(labelValue, percentVal, barVal, barMax, progStyle, tagString, marqSpeed, labelTop, isLeftHidden,
                                                                 isTopHidden, isPercentHidden, progEvent);

            UpdateProgress(labelValue, progHelper, true, false);
        }
Esempio n. 7
0
        public void ODEvent_Fired(ODEventArgs e)
        {
            //We don't know what thread will cause a progress status change, so invoke this method as a delegate if necessary.
            if (this.InvokeRequired)
            {
                this.Invoke((Action) delegate() { ODEvent_Fired(e); });
                return;
            }
            //Make sure that this ODEvent is for FormProgressExtended and that the Tag is not null and is a string.
            if (e.Name != _odEventName || e.Tag == null)
            {
                return;
            }
            ProgressBarHelper progHelper = new ProgressBarHelper("");
            bool   hasProgHelper         = false;
            string status = "";

            if (e.Tag.GetType() == typeof(string))
            {
                status = ((string)e.Tag);
            }
            else if (e.Tag.GetType() == typeof(ProgressBarHelper))
            {
                progHelper    = (ProgressBarHelper)e.Tag;
                status        = progHelper.LabelValue;
                hasProgHelper = true;
            }
            else              //Unsupported type passed in.
            {
                return;
            }
            //When the developer wants to close the window, they will send an ODEvent with "DEFCON 1" to signal this form to shut everything down.
            if (status.ToUpper() == "DEFCON 1")
            {
                DialogResult = DialogResult.OK;
                Close();
                return;
            }
            labelProgress.Text = status + "... (" + progHelper.PercentValue + ")";
            if (hasProgHelper)
            {
                if (progHelper.BlockMax != 0)
                {
                    progressBar.Maximum = progHelper.BlockMax;
                }
                if (progHelper.BlockValue != 0)
                {
                    //When the progress bar draws itself it gradually fills in the bar. This causes the progress bar to be much further behind the percent
                    //label when the program loads quickly. A trick to get around this is to set the value and then set the value to a lower value.
                    progressBar.Value = progHelper.BlockValue;
                    progressBar.Value = Math.Max(progHelper.BlockValue - 1, 0);
                    progressBar.Value = progHelper.BlockValue;
                }
            }
            Application.DoEvents();            //So that the label updates with the new status.
        }
Esempio n. 8
0
        private void Clear(object sebder, RoutedEventArgs s)
        {
            this.J16.Text  = "";
            this.RGBA.Text = "";

            this.Errorsay.Visibility = Visibility.Collapsed;
            this.RunCard.Visibility  = Visibility.Collapsed;
            this.Percent.Foreground  = ColorFst;
            ProgressBarHelper.SetAnimateTo(Percent, 0);
        }
Esempio n. 9
0
    void FooterSetup()
    {
        footerGroup  = transform.Find("FooterGroup");
        progressBar  = new ProgressBarHelper(footerGroup.transform.Find("ProgressBar").gameObject);
        progressText = new SimpleTextHelper(footerGroup.transform.Find("ProgressText").gameObject);

        clientFooterGroup        = transform.Find("ClientFooterGroup");
        clientFooterHelperButton = clientFooterGroup.Find("Help").GetComponent <UnityEngine.UI.Button>();
        backButtonGroup          = transform.Find("BackToMainMenu");
    }
Esempio n. 10
0
 private void updatePBar()            //刷新进度条
 {
     ProgressBarHelper.SetAnimateTo(Health, health);
     ProgressBarHelper.SetAnimateTo(yHealth, yhealth);
     ProgressBarHelper.SetAnimateTo(Hug, hug);
     ProgressBarHelper.SetAnimateTo(yHug, yhug);
     ProgressBarHelper.SetAnimateTo(Duang, duang);
     ProgressBarHelper.SetAnimateTo(yDuang, yduang);
     ProgressBarHelper.SetAnimateTo(Love, love);
     ProgressBarHelper.SetAnimateTo(yLove, ylove);
 }
Esempio n. 11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_sign_up);

            FindViews();
            HandleEvents();

            _progressBarHelper = new ProgressBarHelper(this, Window, layout);
        }
        private void ChbShowPercent_CheckChanged(object sender, RoutedEventArgs e)
        {
            if (!IsLoaded)
            {
                return;
            }

            ProgressBarHelper.SetIsPercentVisible(PgbCustom, ChbShowPercent.IsChecked == true);

            UpdateCode();
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.fragment_confirmation_code_input_dialog, container);

            FindViews(view);

            HandleEvents();

            _progressBarHelper = new ProgressBarHelper(Activity, Activity.Window, layout);

            return(view);
        }
Esempio n. 14
0
 private void TaskBarRun_Click(object sender, RoutedEventArgs e)
 {
     if (!isRun)
     {
         isOpen.Text = "正在启动";
         ProgressBarHelper.SetAnimateTo(openPer, 50);
         RunFun();
     }
     else
     {
         SSUserClass.Proc.KillProc(SSUserClass.Proc.GetProc("edge"));
     }
 }
Esempio n. 15
0
        private async void youtubeResultsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count == 1)
            {
                var elem = e.AddedItems[0] as YouTubeMedia;
                await ProgressBarHelper.ShowProgress("Luncing " + elem.Name);

                App.ViewModel.PlayItem(new MediaElemntViewModel()
                {
                    FileUri = elem.GetFullurl()
                });
                await ProgressBarHelper.HideProgress();
            }
        }
Esempio n. 16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            _email = Intent.GetStringExtra("Email");

            SetContentView(Resource.Layout.activity_reset_password);

            FindViews();

            HandleEvents();

            _progressBarHelper = new ProgressBarHelper(this, Window, layout);
        }
Esempio n. 17
0
 public void SetProgressBar(double value)
 {
     ProgressBarHelper.SetAnimateTo(pbDown, value);
     T2.Text = Convert.ToInt32(value / Max * 100) + " %";
     if (value < Max)
     {
         T1.Text = "正在下载……";
     }
     if (Convert.ToInt32(value / Max * 100) >= 100)
     {
         T1.Text = "正在生成更新脚本……";
         Thread thread = new Thread(RunUpdate);
         thread.Start();
     }
 }
Esempio n. 18
0
        private async void TryToConnect()
        {
            await ProgressBarHelper.ShowProgress("Connecting to VLC…");

            var res = await App.ViewModel.ConnectAndLoad(App.VlcSettings.GetUrl(), App.VlcSettings.Password, @"");

            await ProgressBarHelper.HideProgress();

            if (!res)
            {
                var dialog = new Windows.UI.Popups.MessageDialog("Connection failed. Pleease check settings");
                await dialog.ShowAsync();

                return;
            }
        }
Esempio n. 19
0
        private void RunFun()
        {
            ButtonHelper.SetIsWaiting(Run, true);
            //基本数据
            string IPADRESS      = nowUsed.isDHCP ? "dhcp:" + nowUsed.iP : nowUsed.iP; //自定义本机IP,DHCP请在DHCP服务器IP前加:"dhcp:"
            string DHCP          = nowUsed.isDHCP ? "-r" : "";                         //如果为DHCP请将此项改为:"-r",不是DHCP请留空:""。
            string GROUPNAME     = "\"" + nowUsed.teamName + "\"";                     //填写组名
            string PASSWORD      = nowUsed.teamPassword;                               //填写密码
            string SUPERNODEIP   = nowUsed.severIP;                                    //此项为SuperNode服务器IP(公网)
            string SUPERNODEPORT = nowUsed.severPost.ToString();                       //此项为SuperNode服务器端口
            string OTHERARG      = " " + nowUsed.iPAdditional;                         //其他参数
            string APPADDRESS    = Directory.GetCurrentDirectory();                    //程序所在目录
            //准备配置文件
            string           edgearg = DHCP + " -a " + IPADRESS + " -c " + GROUPNAME + " -k " + PASSWORD + " -l " + SUPERNODEIP + ":" + SUPERNODEPORT + OTHERARG;
            ProcessStartInfo psi     = new ProcessStartInfo();

            psi.FileName               = "System\\edge.exe";
            psi.Verb                   = "runas";
            psi.Arguments              = edgearg;
            psi.UseShellExecute        = false;
            psi.CreateNoWindow         = true;
            psi.WindowStyle            = ProcessWindowStyle.Minimized;
            psi.RedirectStandardOutput = true;
            process.StartInfo          = psi;
            process.Start();
            //process.
            try
            {
                //监控进程
                this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate()
                {
                    RunInfo.Visibility = Visibility.Visible;
                    isOpen.Text        = "正在启动线程维护";
                    ProgressBarHelper.SetAnimateTo(openPer, 99);
                });
                Thread thread = new Thread(Seeing);
                thread.Start();
            }
            catch
            {
                this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate()
                {
                    ProgressBarHelper.SetAnimateTo(openPer, 0);
                    isOpen.Text = "未启用";
                });
            }
        }
Esempio n. 20
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_tasks);

            PrepareToolbar();

            FindViews();
            HandleEvents();

            await PrepareRecyclerViewAsync();

            _progressBarHelper = new ProgressBarHelper(this, Window, layout);

            _isRefreshed = true;
        }
Esempio n. 21
0
        private void RunTool(object sebder, RoutedEventArgs s)
        {
            this.RunCard.Visibility = Visibility.Visible;
            ProgressBarHelper.SetAnimateTo(Percent, 0);
            this.Errorsay.Visibility = Visibility.Collapsed;
            bool Error;

            ButtonHelper.SetIsWaiting(RunButton, true);
            Error = SeachFile(Address.Text);
            ButtonHelper.SetIsWaiting(RunButton, false);
            if (Error)
            {
                this.Percent.Foreground = ColorFst;
                ProgressBarHelper.SetAnimateTo(Percent, 100);
            }
            Error = false;
        }
        private void RdbProgressBarStyle_CheckChanged(object sender, RoutedEventArgs e)
        {
            if (!IsLoaded)
            {
                return;
            }
            var rdb      = sender as RadioButton;
            var pgbStyle = (ProgressBarStyle)Enum.Parse(typeof(ProgressBarStyle), rdb.Content.ToString());

            ProgressBarHelper.SetProgressBarStyle(PgbCustom, pgbStyle);

            PgbCustom.Height = pgbStyle == ProgressBarStyle.Standard ? 30 : 80;
            PgbCustom.Width  = pgbStyle == ProgressBarStyle.Standard ? 200 : 80;

            UpdateTemplate();
            UpdateCode();
        }
Esempio n. 23
0
        public void Fire(ODEventArgs e)
        {
            DateTime start = DateTime.Now;

            while (!_hasProgressOpened || start.AddSeconds(3) < DateTime.Now)
            {
                Thread.Sleep(10);
            }
            if (e.Tag is ProgressBarHelper)
            {
                ProgressBarHelper progBarHelper = (ProgressBarHelper)e.Tag;
                if (progBarHelper.ProgressStyle == ProgBarStyle.NoneSpecified)
                {
                    progBarHelper.ProgressStyle = _progBarStyle;
                }
            }
            _event.FireEvent(e);
        }
        private static void DoCheckAllEnabledScenes(IList <MessageInfo> errorReports)
        {
            using (var progression = new ProgressBarHelper(IsProgressBarEnabled, "Check Scenes", "Please wait, this may take a few minutes."))
            {
                var scenes = GetAllEnabledScenes();
                var count  = 0;
                var total  = scenes.Count();
                foreach (var scene in scenes)
                {
                    var progress = count / (float)total;
                    var message  = $"Checking scene: {++count}/{total} (Errors: {errorReports.Count()})";
                    progression.DisplayProgression(message, scene.path, progress);

                    var gameObjects = GetAllGameObjectsFromScene(scene.path);
                    CheckGameObjects(gameObjects, scene.path, errorReports);
                }
            }
        }
Esempio n. 25
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            __scheduledTaskId = new Guid(Intent.GetStringExtra("TaskId"));

            _scheduledTask = await _taskDataHelper.GetByIdAsync(__scheduledTaskId);

            SetContentView(Resource.Layout.activity_create_task);

            FindViews();

            SetValues();

            HandleEvents();

            _progressBarHelper = new ProgressBarHelper(this, Window, layout);
        }
        private static void DoCheckSelectedPrefabs(IList <MessageInfo> errorReports)
        {
            using (var progression = new ProgressBarHelper(IsProgressBarEnabled, "Check Prefabs", "Please wait, this may take a few minutes."))
            {
                var prefabs = GetSelectedPrefabs();
                var count   = 0;
                var total   = prefabs.Count();
                var time    = DateTime.Now;
                foreach (var prefab in prefabs)
                {
                    var progress = count / (float)total;
                    var message  = $"Checking prefab: {++count}/{total} (Errors: {errorReports.Count()})";
                    progression.DisplayProgression(message, prefab.Path, progress);

                    var gameObjects = GetAllGameObjectsFromPrefab(prefab.GameObject);
                    CheckGameObjects(gameObjects, prefab.Path, errorReports);
                }
            }
        }
        private async void btnMakeSchedule_Click(object sender, RoutedEventArgs e)
        {
            MainFrame.Content = new SchedulePage();
            MainButtonsActivityOff();
            ProgressBarHelper.ProgressBarEvent(10);

            DeleteOldData();

            try
            {
                Task task = Task.Run(() => MakeSchedule());
                await task.ContinueWith(x => MainButtonsActivityOn());
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message);
                MainButtonsActivityOn();
            }
        }
        private void UpdateCode()
        {
            var pgStyle         = ProgressBarHelper.GetProgressBarStyle(PgbCustom);
            var value           = _usingAnimation ? ProgressBarHelper.GetAnimateTo(PgbCustom) : PgbCustom.Value;
            var isIndeterminate = PgbCustom.IsIndeterminate;
            var cornerRadius    = SldCornerRadius.Value;
            var percentVisible  = ProgressBarHelper.GetIsPercentVisible(PgbCustom);

            TbCode.Text = $"<ProgressBar  Height=\"{PgbCustom.Height}\"" +
                          $"\nWidth=\"{PgbCustom.Width}\"" +
                          (pgStyle == ProgressBarStyle.Standard ? "" : $"\npu:ProgressBarHelper.ProgressBarStyle=\"{pgStyle}\"") +
                          (pgStyle == ProgressBarStyle.Standard ? $"\nBackground=\"{PgbCustom.Background}\"" : $"\nBorderBrush=\"{PgbCustom.BorderBrush}\"") +
                          $"\nForeground=\"{PgbCustom.Foreground}\"" +
                          (value == 0 ? "" : _usingAnimation ? $"\npu:ProgressBarHelper.AnimateTo=\"{value}\"" : $"\nValue=\"{value}\"") +
                          (cornerRadius == 0 ? "" : $"\npu:ProgressBarHelper.CornerRadius=\"{cornerRadius}\"") +
                          (isIndeterminate ? "\nIsIndeterminate=\"True\"" : "") +
                          (percentVisible ? "\npu:ProgressBarHelper.IsPercentVisible=\"True\"" : "") +
                          " />";
        }
Esempio n. 29
0
 public void UpdateStatus(string message, double process)
 {
     Dispatcher.Invoke(() =>
     {
         processInfo.Content = message;
         Thickness thickness = processInfo.Margin;
         processInfo.Margin  = thickness;
         if (process < 0 || process > 1)
         {
             processing.IsIndeterminate = true;
             ProgressBarHelper.SetIsPercentVisible(processing, false);
         }
         else
         {
             processing.IsIndeterminate = false;
             processing.Value           = process;
             ProgressBarHelper.SetIsPercentVisible(processing, true);
         }
     });
 }
Esempio n. 30
0
        public PageHD2()
        {
            InitializeComponent();

            this.Height = 477;

            this.RunCard.Background  = baseColora.Card;
            this.IconCard.Background = baseColora.Card;


            this.Percent.Background = baseColora.DBg;
            this.Percent.Foreground = baseColora.Main;

            CMD.Foreground      = baseColora.Font;
            Errorsay.Foreground = baseColora.Font;
            Errorsay.Text       = "初始化启动成功!";
            ProgressBarHelper.SetAnimateTo(Percent, 100);

            CMD.Text = "Stapx Steve Tool Box [ 版本 1.0.16.33 ] \n(c) Stapx Steve Team.  保留所有权利。\n\n注意事项:\n使用任何删除操作或者使用输入法将会使当前行失效。\n输入Y继续>";
            loading  = false;
        }