Example #1
0
 /// <summary>
 /// Handle a Vix event.
 /// Currently handles the job completion event, call WaitForCompletion to block with a timeout.
 /// </summary>
 /// <param name="job">an instance that implements IJob</param>
 /// <param name="eventType">event type</param>
 /// <param name="moreEventInfo">additional event info</param>
 public void OnVixEvent(IJob job, int eventType, IVixHandle moreEventInfo)
 {
     switch (eventType)
     {
     case VixCOM.Constants.VIX_EVENTTYPE_JOB_COMPLETED:
         _jobCompleted.Set();
         break;
     }
 }
 /// <summary>
 /// Handle a Vix event.
 /// Currently handles the job completion event, call WaitForCompletion to block with a timeout.
 /// </summary>
 /// <param name="job">An instance that implements IJob.</param>
 /// <param name="eventType">Event type.</param>
 /// <param name="moreEventInfo">Additional event info.</param>
 private void OnVixEvent(VMWareVixHandle <IJob> job, int eventType, IVixHandle moreEventInfo)
 {
     switch (eventType)
     {
     case Constants.VIX_EVENTTYPE_JOB_COMPLETED:
         _jobCompleted.Set();
         break;
     }
 }
Example #3
0
 /// <summary>
 /// Handle a Vix event.
 /// Currently handles the job completion event, call WaitForCompletion to block with a timeout.
 /// </summary>
 /// <param name="job">an instance that implements IJob</param>
 /// <param name="eventType">event type</param>
 /// <param name="moreEventInfo">additional event info</param>
 public void OnVixEvent(IJob job, int eventType, IVixHandle moreEventInfo)
 {
     switch (eventType)
     {
         case VixCOM.Constants.VIX_EVENTTYPE_JOB_COMPLETED:
             _jobCompleted.Set();
             break;
     }
 }
 /// <summary>
 /// Handle a Vix event.
 /// Currently handles the job completion event, call WaitForCompletion to block with a timeout.
 /// </summary>
 /// <param name="job">An instance that implements IJob.</param>
 /// <param name="eventType">Event type.</param>
 /// <param name="moreEventInfo">Additional event info.</param>
 private void OnVixEvent(VMWareVixHandle<IJob> job, int eventType, IVixHandle moreEventInfo)
 {
     switch (eventType)
     {
         case Constants.VIX_EVENTTYPE_JOB_COMPLETED:
             _jobCompleted.Set();
             break;
     }
 }
 /// <summary>
 /// Handle a Vix event.
 /// </summary>
 /// <param name="job">An instance that implements IJob.</param>
 /// <param name="eventType">Event type.</param>
 /// <param name="moreEventInfo">Additional event info.</param>
 public void OnVixEvent(IJob job, int eventType, IVixHandle moreEventInfo)
 {
     using (VMWareVixHandle <IJob> jobHandle = new VMWareVixHandle <IJob>(job))
     {
         using (VMWareVixHandle <IVixHandle> moreEventInfoHandle = new VMWareVixHandle <IVixHandle>(moreEventInfo))
         {
             OnVixEvent(jobHandle, eventType, moreEventInfo);
         }
     }
 }
 /// <summary>
 /// Handle a Vix event.
 /// </summary>
 /// <param name="job">An instance that implements IJob.</param>
 /// <param name="eventType">Event type.</param>
 /// <param name="moreEventInfo">Additional event info.</param>
 public void OnVixEvent(IJob job, int eventType, IVixHandle moreEventInfo)
 {
     using(VMWareVixHandle<IJob> jobHandle = new VMWareVixHandle<IJob>(job))
     {
         using (VMWareVixHandle<IVixHandle> moreEventInfoHandle = new VMWareVixHandle<IVixHandle>(moreEventInfo))
         {
             OnVixEvent(jobHandle, eventType, moreEventInfo);
         }
     }
 }
Example #7
0
        /// <summary>
        /// Handle a Vix event.
        /// Currently handles the job completion event, call WaitForCompletion to block with a timeout.
        /// </summary>
        /// <param name="job">an instance that implements IJob</param>
        /// <param name="eventType">event type</param>
        /// <param name="moreEventInfo">additional event info</param>
        public void OnVixEvent(IJob job, int eventType, IVixHandle moreEventInfo)
        {
            switch (eventType)
            {
            case Constants.VIX_EVENTTYPE_JOB_COMPLETED:
                _jobCompleted.Set();
                break;
            }

            /*
             * fix: close job object since we are done with this object
             *
             * note: this does not invalidate the original job object that specified this as its callback function
             * i.e. IJob createSnapshotJob = vm.CreateSnapshot(...); createSnapshotJob is still valid and can be used
             *
             */
            ((IVixHandle2)job).Close();
        }
Example #8
0
        /// <summary>
        /// Handle a Vix event.
        /// Currently handles the job completion event, call WaitForCompletion to block with a timeout.
        /// </summary>
        /// <param name="job">an instance that implements IJob</param>
        /// <param name="eventType">event type</param>
        /// <param name="moreEventInfo">additional event info</param>
        public void OnVixEvent(IJob job, int eventType, IVixHandle moreEventInfo)
        {
            switch (eventType)
            {
                case Constants.VIX_EVENTTYPE_JOB_COMPLETED:
                    _jobCompleted.Set();
                    break;
            }

            /*
             * fix: close job object since we are done with this object
             * 
             * note: this does not invalidate the original job object that specified this as its callback function
             * i.e. IJob createSnapshotJob = vm.CreateSnapshot(...); createSnapshotJob is still valid and can be used
             * 
             */
            ((IVixHandle2)job).Close();
        }
Example #9
0
            public void OnVixEvent(IJob job, int type, IVixHandle more)
            {
                ulong err;

                if (type == Constants.VIX_EVENTTYPE_FIND_ITEM)
                {
                    object ret = null;
                    err = more.GetProperties(new int[] { Constants.VIX_PROPERTY_FOUND_ITEM_LOCATION }, ref ret);
                    Debug.Assert(err == 0);
                    string pathname = (string)((object[])ret)[0];
                    //  Console.WriteLine(pathname);
                    VM vv = new VM();
                    vv.path = pathname;
                    if (!vm.Exists(x => x.path == pathname))
                    {
                        vm.Add(vv);
                    }
                    VM t = vm.Find(x => x.path == pathname);
                    t.state &= ~VMSTATE.down;
                }
                CloseVixObject(job);
            }