Esempio n. 1
0
		public override void Execute(CmdletOperationBase cmdlet)
		{
			object[] objArray = new object[4];
			objArray[0] = this.activity;
			objArray[1] = this.activityID;
			objArray[2] = this.secondsRemaining;
			objArray[3] = this.percentageCompleted;
			DebugHelper.WriteLog("...Activity {0}: id={1}, remain seconds ={2}, percentage completed = {3}", 4, objArray);
			ValidationHelper.ValidateNoNullArgument(cmdlet, "cmdlet");
			ProgressRecord progressRecord = new ProgressRecord(this.activityID, this.activity, this.statusDescription);
			progressRecord.Activity = this.activity;
			progressRecord.ParentActivityId = 0;
			progressRecord.SecondsRemaining = this.secondsRemaining;
			progressRecord.PercentComplete = this.percentageCompleted;
			cmdlet.WriteProgress(progressRecord);
		}
Esempio n. 2
0
        public override void Execute(CmdletOperationBase cmdlet)
        {
            object[] objArray = new object[4];
            objArray[0] = this.activity;
            objArray[1] = this.activityID;
            objArray[2] = this.secondsRemaining;
            objArray[3] = this.percentageCompleted;
            DebugHelper.WriteLog("...Activity {0}: id={1}, remain seconds ={2}, percentage completed = {3}", 4, objArray);
            ValidationHelper.ValidateNoNullArgument(cmdlet, "cmdlet");
            ProgressRecord progressRecord = new ProgressRecord(this.activityID, this.activity, this.statusDescription);

            progressRecord.Activity         = this.activity;
            progressRecord.ParentActivityId = 0;
            progressRecord.SecondsRemaining = this.secondsRemaining;
            progressRecord.PercentComplete  = this.percentageCompleted;
            cmdlet.WriteProgress(progressRecord);
        }
Esempio n. 3
0
        /// <summary>
        /// <para>
        /// Write progress record to powershell
        /// </para>
        /// </summary>
        /// <param name="cmdlet"></param>
        public override void Execute(CmdletOperationBase cmdlet)
        {
            DebugHelper.WriteLog(
                "...Activity {0}: id={1}, remain seconds ={2}, percentage completed = {3}",
                4,
                this.activity,
                this.activityID,
                this.secondsRemaining,
                this.percentageCompleted);

            ValidationHelper.ValidateNoNullArgument(cmdlet, "cmdlet");
            ProgressRecord record = new ProgressRecord(
                this.activityID,
                this.activity,
                this.statusDescription);

            record.Activity         = this.activity;
            record.ParentActivityId = 0;
            record.SecondsRemaining = (int)this.secondsRemaining;
            record.PercentComplete  = (int)this.percentageCompleted;
            cmdlet.WriteProgress(record);
        }
Esempio n. 4
0
        /// <summary>
        /// <para>
        /// Write progress record to powershell
        /// </para>
        /// </summary>
        /// <param name="cmdlet"></param>
        public override void Execute(CmdletOperationBase cmdlet)
        {
            DebugHelper.WriteLog(
                "...Activity {0}: id={1}, remain seconds ={2}, percentage completed = {3}",
                4,
                this.activity,
                this.activityID,
                this.secondsRemaining,
                this.percentageCompleted);

            ValidationHelper.ValidateNoNullArgument(cmdlet, "cmdlet");
            ProgressRecord record = new ProgressRecord(
                this.activityID,
                this.activity,
                this.statusDescription);
            record.Activity = this.activity;
            record.ParentActivityId = 0;
            record.SecondsRemaining = (int)this.secondsRemaining;
            record.PercentComplete = (int)this.percentageCompleted;
            cmdlet.WriteProgress(record);
        }