Beispiel #1
0
        private void OnReportPlanProgress(object sender, GuiCommandEventArgs e)
        {
            if (this.Model == null || !CurrentOperation.GotInitialInfo)
            {
                return;
            }

            string planType = e.Command.GetArgumentValue <string>("planType");

            if (!planType.Equals("backup"))
            {
                return;
            }

            Models.BackupPlan plan = this.Model as Models.BackupPlan;

            Int32 planId = e.Command.GetArgumentValue <Int32>("planId");

            if (planId != plan.Id)
            {
                return;
            }

            Commands.GuiReportPlanProgress progress = e.Command.GetArgumentValue <Commands.GuiReportPlanProgress>("progress");
            UpdatePlanProgress(progress);
        }
Beispiel #2
0
        private void OnError(object sender, GuiCommandEventArgs e)
        {
            int    errorCode = e.Command.GetArgumentValue <int>("errorCode");
            string message   = e.Command.GetArgumentValue <string>("message");

            switch (errorCode)
            {
            default:
                MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                break;
                //case (int)Commands.ErrorCode.NOT_AUTHORIZED:
                //	Provider.Handler.SendRegister();
                //	break;
            }
        }
Beispiel #3
0
        private void OnReportPlanStatus(object sender, GuiCommandEventArgs e)
        {
            string planType = e.Command.GetArgumentValue <string>("planType");

            if (this.Model == null || !planType.Equals("backup"))
            {
                return;
            }

            Models.BackupPlan plan = this.Model as Models.BackupPlan;

            Int32 planId = e.Command.GetArgumentValue <Int32>("planId");

            if (planId != plan.Id)
            {
                return;
            }

            Commands.GuiReportPlanStatus report = e.Command.GetArgumentValue <Commands.GuiReportPlanStatus>("report");
            UpdatePlanInfo(report);
        }
Beispiel #4
0
        protected override void RegisterCommandHandlers()
        {
            Commands.GUI_ERROR.Handler += delegate(object sender, EventArgs e)
            {
                GuiCommandEventArgs args = (GuiCommandEventArgs)e;
                int errorCode            = args.Command.GetArgumentValue <int>("errorCode");

                switch (errorCode)
                {
                default:
                    break;

                case (int)Commands.ErrorCode.NAME_ALREADY_IN_USE:
                    DidSendRegister = false;
                    break;
                }

                if (OnError != null)
                {
                    OnError(this, args);
                }
            };
            Commands.GUI_REPORT_PLAN_STATUS.Handler += delegate(object sender, EventArgs e)
            {
                if (OnReportPlanStatus != null)
                {
                    OnReportPlanStatus(this, (GuiCommandEventArgs)e);
                }
            };
            Commands.GUI_REPORT_PLAN_PROGRESS.Handler += delegate(object sender, EventArgs e)
            {
                if (OnReportPlanProgress != null)
                {
                    OnReportPlanProgress(this, (GuiCommandEventArgs)e);
                }
            };
        }