public VssShadowCopy(
     Guid setId, DateTime creationTime,
     Guid id, string forVol,
     string shadowCopyVol, string originatingMachine,
     string serviceMachine, VssProvider provider,
     VssSnapshotContext context, VssShadowcopyAttributes[] attributes)
 {
     SetId              = setId;
     CreationTime       = creationTime;
     ShadowCopyId       = id;
     OriginalVolume     = forVol;
     ShadowCopyVolume   = shadowCopyVol;
     OriginatingMachine = originatingMachine;
     ServiceMachine     = serviceMachine;
     Provider           = provider;
     Context            = context;
     Attributes         = attributes;
 }
示例#2
0
      public void Initialize(VssSnapshotContext context, string xmlDoc = null, bool duringRestore = false)
      {
         m_backupComponents = Implementation.CreateVssBackupComponents();
         m_duringRestore = duringRestore;

         if (m_duringRestore)
         {
            Host.WriteVerbose("- Calling IVssBackupComponents.InitializeForRestore() {0} xml doc.", xmlDoc == null ? "without" : "with");
            m_backupComponents.InitializeForRestore(xmlDoc);
         }
         else
         {
            Host.WriteVerbose("- Calling IVssBackupComponents.InitializeForBackup() {0} xml doc.", xmlDoc == null ? "without" : "with");
            m_backupComponents.InitializeForBackup(xmlDoc);

            if (OperatingSystemInfo.IsAtLeast(OSVersionName.WindowsServer2003) && context != VssSnapshotContext.Backup)
            {
               Host.WriteLine("- Setting the VSS context to: {0}", context);
               m_backupComponents.SetContext(context);
            }
         }

         m_context = (VssVolumeSnapshotAttributes)context;

         m_backupComponents.SetBackupState(true, true, VssBackupType.Full, false);
      }