コード例 #1
0
        /// <summary>
        /// Starts system restore
        /// </summary>
        /// <param name="strDescription">The description of the restore</param>
        /// <param name="rt">The type of restore point</param>
        /// <param name="lSeqNum">Returns the sequence number</param>
        /// <returns>The status of call</returns>
        /// <seealso cref="Use EndRestore() or CancelRestore() to end the system restore"/>
        public static int StartRestore(string strDescription, RestoreType rt, out long lSeqNum)
        {
            RestorePointInfo rpInfo   = new RestorePointInfo();
            STATEMGRSTATUS   rpStatus = new STATEMGRSTATUS();

            if (!SysRestoreAvailable())
            {
                lSeqNum = 0;
                return(-1);
            }

            try
            {
                // Prepare Restore Point
                rpInfo.dwEventType = BeginSystemChange;
                // By default we create a verification system
                rpInfo.dwRestorePtType  = (int)rt;
                rpInfo.llSequenceNumber = 0;
                rpInfo.szDescription    = strDescription;

                SRSetRestorePointW(ref rpInfo, out rpStatus);
            }
            catch (DllNotFoundException)
            {
                lSeqNum = 0;
                return(-1);
            }

            lSeqNum = rpStatus.llSequenceNumber;

            return(rpStatus.nStatus);
        }
コード例 #2
0
 public PathBlockState(int oldStackSize)
 {
     Block             = null;
     _restoreType      = RestoreType.PopPushOp;
     _restoreValue     = (ulong)oldStackSize;
     _restoreMergeType = default;
 }
コード例 #3
0
 public PathBlockState(Block block)
 {
     Block             = block;
     _restoreType      = RestoreType.None;
     _restoreValue     = 0;
     _restoreMergeType = default;
 }
コード例 #4
0
 public PathBlockState(ulong syncAddress, MergeType mergeType)
 {
     Block             = null;
     _restoreType      = RestoreType.PushBranchOp;
     _restoreValue     = syncAddress;
     _restoreMergeType = mergeType;
 }
コード例 #5
0
        //TODO conditions, exec script on use, etc

        public AidItemModel(string name, float weight, float value, float maxCondition, bool hidden, bool essential, string[] flags, string worldModel,
                            AidType aType, RestoreType rType, float amount)
            : base(name, weight, value, maxCondition, hidden, essential, flags, worldModel)
        {
            AType  = aType;
            RType  = rType;
            Amount = amount;
        }
コード例 #6
0
 public AidItemModel(string name, float weight, float maxCondition, bool unique, bool essential,
                     AidType aType, RestoreType rType, float amount)
     : base(name, weight, maxCondition, unique, essential)
 {
     AType  = aType;
     RType  = rType;
     Amount = amount;
 }
コード例 #7
0
        void restore(string parameter, RestoreType restoreType)
        {
            restoreButton.Enabled          = false;
            skipButton.Enabled             = false;
            restorationProgressBar.Visible = true;

            restorationBackgroundWorker.RunWorkerAsync(new RestoreTaskInfo(_record, restoreType, parameter));
        }
コード例 #8
0
 private protected FullBehavior(SimpleDescriptor standardShortDesc, SimpleDescriptor singleShortDesc, PartDescriptor <DataClass> longDesc,
                                PlayerBodyPartDelegate <ContainerClass> playerDesc, ChangeType <DataClass> transformDesc, RestoreType <DataClass> restoreDesc) : base(standardShortDesc, singleShortDesc)
 {
     longStr          = longDesc ?? throw new ArgumentNullException(nameof(longDesc));
     playerStr        = playerDesc ?? throw new ArgumentNullException(nameof(playerDesc));
     transformFromStr = transformDesc ?? throw new ArgumentNullException(nameof(transformDesc));
     restoredStr      = restoreDesc ?? throw new ArgumentNullException(nameof(restoreDesc));
 }
コード例 #9
0
ファイル: Gills.cs プロジェクト: JustSomeGuy6561/CoCSharp
        protected GillType(ShortPluralDescriptor shortDesc, SimpleDescriptor singleDesc, PartDescriptor <GillData> longDesc, PlayerBodyPartDelegate <Gills> playerDesc,
                           ChangeType <GillData> transform, RestoreType <GillData> restore) : base(PluralHelper(shortDesc), singleDesc, longDesc, playerDesc, transform, restore)
        {
            _index = indexMaker++;
            gills.AddAt(this, _index);

            pluralDesc = shortDesc;
        }
コード例 #10
0
        public void CreateRestorePoint(RestoreType restoreType)
        {
            List <FileInformation> files        = _watchedFilePaths.Select(x => _fileSystem.Read(x)).ToList();
            RestorePoint           restorePoint = _restorePointCreator.Create(_backupPath, files, _restorePoints,
                                                                              _dateTimeProvider, _storageAlgorithm, restoreType);

            _restorePoints.Add(restorePoint);
            WriteRestorePoint(restorePoint);
        }
コード例 #11
0
ファイル: RestoreEffect.cs プロジェクト: dqchess/Descension
 public RestoreEffect()
 {
     EffectType    = AbilityEffectType.Restore;
     RestoreType   = RestoreType.None;
     Amount        = new GameValue();
     Duration      = new GameValue();
     LevelModifier = 0;
     OverCharge    = false;
 }
コード例 #12
0
ファイル: RestoreEffect.cs プロジェクト: dqchess/Descension
 public RestoreEffect(RestoreType type, GameValue amount, GameValue duration, bool overcharge, int level = 0)
 {
     EffectType    = AbilityEffectType.Restore;
     RestoreType   = type;
     Amount        = new GameValue(amount);
     Duration      = new GameValue(duration);
     LevelModifier = level;
     OverCharge    = overcharge;
 }
コード例 #13
0
        void refreshUiOnSelectedRestorationType(RestoreType kind)
        {
            refreshRestoreButton();
            specifiedFolderTextBox.Enabled = (kind == RestoreType.ToPointedFolder);
            chooseFolderButton.Enabled     = (kind == RestoreType.ToPointedFolder);

            sevenZipDestinationArchiveLocationTextBox.Enabled  = (kind == RestoreType.As7ZipArchive);
            choose7zipArchiveDestinationLocationButton.Enabled = (kind == RestoreType.As7ZipArchive);
        }
コード例 #14
0
 public RestorePoint(string backupPath, DateTime restoreTime, StorageType storageType, RestoreType restoreType, List <FileInformation> files)
 {
     Id           = Guid.NewGuid();
     RestoreTime  = restoreTime;
     StorageType  = storageType;
     RestoreType  = restoreType;
     Path         = backupPath + "/" + "Restore" + Id.ToString();
     RestoreFiles = files.Select(x => x.Restore(Path)).ToList();
 }
コード例 #15
0
        public void CreateRestorePoint(RestoreType restoreType, EventType eventType, string description)
        {
            var descriptionData = Encoding.UTF8.GetBytes(description);
            var data            = new byte[3 + descriptionData.Length];

            data[0] = (byte)SystemRestoreCommunication.CreateRestorePoint;
            data[1] = (byte)restoreType;
            data[2] = (byte)eventType;
            Array.Copy(descriptionData, 0, data, 3, description.Length);
            ConnectionInfo.SendCommand(this, data);
            LogService.Send((string)Application.Current.Resources["CreateSystemRestorePoint"]);
        }
コード例 #16
0
 public RestorePoint
 (
     String path,
     IReadOnlyCollection <FileData> files,
     StorageAlgorithmType storageAlgorithmType,
     RestoreType restoreType,
     DateTime creationTime
 )
 {
     Path                 = path;
     Files                = files.Select(file => file.CreateRestoredFile(path)).Where(file => !file.IsNull).ToList();
     CreationTime         = creationTime;
     StorageAlgorithmType = storageAlgorithmType;
     RestoreType          = restoreType;
 }
コード例 #17
0
        /// <summary>
        ///     Creates a restore point.
        /// </summary>
        public static bool CreateRestorePoint(string description, RestoreType restoreType, EventType eventType)
        {
            using (var objClass = new ManagementClass("\\\\.\\root\\default", "systemrestore", new ObjectGetOptions()))
            {
                var oInParams =
                    objClass.GetMethodParameters("CreateRestorePoint");
                oInParams["Description"]      = description;
                oInParams["RestorePointType"] = (uint)restoreType;
                oInParams["EventType"]        = (uint)eventType;

                var oOutParams =
                    objClass.InvokeMethod("CreateRestorePoint", oInParams, null);

                return(oOutParams != null && (uint)oOutParams["ReturnValue"] == 0);
            }
        }
コード例 #18
0
        private static void RestoreImpl(IEnumerable <SMPersonalDataIndex> entities, RestoreType filter)
        {
            using (PXTransactionScope ts = new PXTransactionScope())
            {
                IEnumerable <IBqlTable> processingItems = RemapToPrimary(entities);

                ProcessImpl(processingItems, true, null);

                if (filter?.DeleteNonRestored == true)
                {
                    CleanNonRestored(processingItems);
                }

                ts.Complete();
            }
        }
コード例 #19
0
ファイル: JointRestorePoint.cs プロジェクト: s4xack/Oop
 public JointRestorePoint
 (
     String path,
     IReadOnlyCollection <FileData> files,
     StorageAlgorithmType storageAlgorithmType,
     RestoreType restoreType,
     DateTime creationTime
 ) : base
     (
         path,
         files,
         storageAlgorithmType,
         restoreType,
         creationTime
     )
 {
 }
コード例 #20
0
        internal Conf_RestoreDlg(string path, RestoreType restoreType)
        {
            InitializeComponent();

            if (restoreType == RestoreType.Backup)
            {
                backup    = true;
                this.Text = "Backup";
            }
            else
            {
                clean = true;
            }

            this.path         = path;
            this.FormClosing += new FormClosingEventHandler(Conf_RestoreDlg_FormClosing);
        }
コード例 #21
0
ファイル: Wings.cs プロジェクト: JustSomeGuy6561/CoCSharp
        private protected WingType(bool canFly,
                                   ShortPluralDescriptor shortDesc, SimpleDescriptor singleWingDesc, PluralPartDescriptor <WingData> longDesc, PlayerBodyPartDelegate <Wings> playerDesc,
                                   ChangeType <WingData> transform, RestoreType <WingData> restore) : base(PluralHelper(shortDesc), singleWingDesc, LongPluralHelper(longDesc), playerDesc, transform, restore)
        {
            _index = indexMaker++;
            wings.AddAt(this, _index);
            transformBehavior = canFly ? BehaviorOnTransform.CONVERT_TO_LARGE : BehaviorOnTransform.CONVERT_TO_SMALL;             //was wrong, caught in testing.

            wingShortDesc = (_, plural) => shortDesc(plural);

            wingSingleDesc = (_) => singleWingDesc();

            longPluralDesc = longDesc;

            canChangeSize = false;

            changeSizeStr = (x, y) => "";
        }
コード例 #22
0
        /// <summary>
        ///     Starts system restore
        /// </summary>
        /// <param name="strDescription">The description of the restore</param>
        /// <param name="rt">The type of restore point</param>
        /// <param name="lSeqNum">Returns the sequence number</param>
        /// <param name="creationFrequency">
        ///     Under Win 8 or newer - Minimal amount of minutes since last restore point for this point to be created.
        ///     0 to always create, number for amount of minutes, -1 for default behaviour (24 hours).
        /// </param>
        /// <returns>The status of call</returns>
        /// <seealso>
        ///     <cref>Use EndRestore() or CancelRestore() to end the system restore</cref>
        /// </seealso>
        public static int StartRestore(string strDescription, RestoreType rt, out long lSeqNum, int creationFrequency = -1)
        {
            var            rpInfo = new RestorePointInfo();
            STATEMGRSTATUS rpStatus;

            if (!SysRestoreAvailable())
            {
                lSeqNum = 0;
                return(-1);
            }

            if (creationFrequency >= 0)
            {
                using (var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore", true))
                {
                    Debug.Assert(key != null, "SystemRestore key must exist after SysRestoreAvailable");
                    key.SetValue("SystemRestorePointCreationFrequency", creationFrequency, RegistryValueKind.DWord);
                }
            }

            try
            {
                // Prepare Restore Point
                rpInfo.dwEventType = BeginSystemChange;
                // By default we create a verification system
                rpInfo.dwRestorePtType  = (int)rt;
                rpInfo.llSequenceNumber = 0;
                rpInfo.szDescription    = strDescription;

                SRSetRestorePointW(ref rpInfo, out rpStatus);
            }
            catch (DllNotFoundException)
            {
                lSeqNum = 0;
                return(-1);
            }

            lSeqNum = rpStatus.llSequenceNumber;

            return(rpStatus.nStatus);
        }
コード例 #23
0
ファイル: Backup.cs プロジェクト: s4xack/Oop
        public void CreateRestorePoint(RestoreType restoreType)
        {
            DateTime creationTime = _dateTimeProvider.GetUtcNow();
            IEnumerable <FileData> watchedFiles = _watchedFilePaths.Select(path => _fileRepository.Read(path));
            List <FileData>        files        = restoreType switch
            {
                RestoreType.Full => watchedFiles.ToList(),
                RestoreType.Increment =>
                _restorePoints.Count == 0
                        ? throw new ArgumentException()
                        : watchedFiles.Select(GetDiff).ToList(),
                      _ => throw new ArgumentException()
            };

            RestorePoint restorePoint = _storageAlgorithm.PackRestorePoint(BackupPath, files, restoreType, creationTime);

            _restorePoints.Add(restorePoint);
            _fileRepository.Write(restorePoint.ToPackedFileData());

            Clean();
        }
コード例 #24
0
ファイル: Mainform.cs プロジェクト: SPOOCQ/ghostbuster
        /// <summary>
        /// http://msdn.microsoft.com/en-us/library/windows/desktop/aa378847(v=vs.85).aspx.
        /// </summary>
        ///
        /// <param name="description"> . </param>
        /// <param name="rt">          RestoreType. </param>
        /// <param name="et">          EventType. </param>
        ///
        /// <returns>
        /// A ManagementBaseObject.
        /// </returns>
        public static ManagementBaseObject WmiRestorePoint(String description, RestoreType rt = RestoreType.Checkpoint, EventType et = EventType.BeginSystemChange)
        {
            ManagementScope  scope   = new ManagementScope(@"\\.\root\DEFAULT");
            ManagementPath   path    = new ManagementPath("SystemRestore");
            ObjectGetOptions options = new ObjectGetOptions();
            ManagementClass  process = new ManagementClass(scope, path, options);

            // Obtain in-parameters for the method
            ManagementBaseObject inParams =
                process.GetMethodParameters("CreateRestorePoint");

            // Add the input parameters.
            inParams["Description"]      = description;
            inParams["EventType"]        = (int)et;
            inParams["RestorePointType"] = (int)rt;

            // Execute the method and obtain the return values.
            ManagementBaseObject outParams =
                process.InvokeMethod("CreateRestorePoint", inParams, null);

            return(outParams);
        }
コード例 #25
0
ファイル: Wings.cs プロジェクト: JustSomeGuy6561/CoCSharp
        //wings that support large wings need to define a behavior on transform - do they keep the large wings?
        private protected WingType(BehaviorOnTransform behaviorOnTransform, WingSizeChangeDelegate changeSizeText, WingShortDesc wingShortDesc, WingSingleDesc singleWingDesc,
                                   PluralPartDescriptor <WingData> longDesc, PlayerBodyPartDelegate <Wings> playerDesc, ChangeType <WingData> transform, RestoreType <WingData> restore)
            : base(WingParser(wingShortDesc), WingSingleParser(singleWingDesc), LongPluralHelper(longDesc), playerDesc, transform, restore)
        {
            _index = indexMaker++;
            wings.AddAt(this, _index);
            transformBehavior = behaviorOnTransform;

            this.wingShortDesc = wingShortDesc;

            this.wingSingleDesc = singleWingDesc;

            longPluralDesc = longDesc;

            canChangeSize = true;

            changeSizeStr = changeSizeText ?? throw new ArgumentNullException(nameof(changeSizeText));
        }
コード例 #26
0
 public RestoreTaskInfo(MetaRecord record, RestoreType restoreType, string parameter)
 {
     _record      = record;
     _parameter   = parameter;
     _restoreType = restoreType;
 }
コード例 #27
0
        protected EarType(bool internalEar, ShortPluralDescriptor shortDesc, SimpleDescriptor singleItemDesc, PluralPartDescriptor <EarData> longDesc,
                          PlayerBodyPartDelegate <Ears> playerDesc, ChangeType <EarData> transform, RestoreType <EarData> restore)
            : base(PluralHelper(shortDesc), singleItemDesc, LongPluralHelper(longDesc), playerDesc, transform, restore)
        {
            shortPluralDesc = shortDesc;
            longPluralDesc  = longDesc;

            _index = indexMaker++;
            ears.AddAt(this, id);

            isInternalEar = internalEar;
        }
コード例 #28
0
        /// <summary>
        /// Starts system restore
        /// </summary>
        /// <param name="strDescription">The description of the restore</param>
        /// <param name="rt">The type of restore point</param>
        /// <param name="lSeqNum">Returns the sequence number</param>
        /// <returns>The status of call</returns>
        /// <seealso cref="Use EndRestore() or CancelRestore() to end the system restore"/>
        internal static int StartRestore( string strDescription, RestoreType rt, out long lSeqNum )
        {
            RestorePointInfo rpInfo = new RestorePointInfo();
                        STATEMGRSTATUS rpStatus = new STATEMGRSTATUS();

                        if ( !SysRestoreAvailable() )
                        {
                                lSeqNum = 0;
                                return -1;
                        }

                        try
                        {
                                // Prepare Restore Point
                                rpInfo.dwEventType = BeginSystemChange;
                                // By default we create a verification system
                                rpInfo.dwRestorePtType = (int)rt;
                                rpInfo.llSequenceNumber = 0;
                                rpInfo.szDescription = strDescription;

                                SRSetRestorePointW( ref rpInfo, out rpStatus );
                        }
                        catch ( DllNotFoundException )
                        {
                                lSeqNum = 0;
                                return -1;
                        }

                        lSeqNum = rpStatus.llSequenceNumber;

                        return rpStatus.nStatus;
        }
コード例 #29
0
ファイル: ParsedData.cs プロジェクト: annchous/OopLabs
 public ParsedData(ActionType actionType, string dataFile, RestoreType restoreType)
 {
     ActionType  = actionType;
     DataFile    = dataFile;
     RestoreType = restoreType;
 }
コード例 #30
0
ファイル: Wings.cs プロジェクト: JustSomeGuy6561/CoCSharp
 internal FeatheredWings(HairFurColors defaultHair, bool canFly, ShortPluralDescriptor shortDesc, SimpleDescriptor singleWingDesc, PluralPartDescriptor <WingData> longDesc,
                         PlayerBodyPartDelegate <Wings> playerDesc, ChangeType <WingData> transform, RestoreType <WingData> restore)
     : base(canFly, shortDesc, singleWingDesc, longDesc, playerDesc, transform, restore)
 {
     defaultFeatherColor = defaultHair;
 }
コード例 #31
0
ファイル: Wings.cs プロジェクト: JustSomeGuy6561/CoCSharp
 internal FeatheredWings(HairFurColors defaultHair, BehaviorOnTransform behaviorOnTransform, WingSizeChangeDelegate changeSizeText, WingShortDesc wingShortDesc,
                         WingSingleDesc singleWingDesc, PluralPartDescriptor <WingData> longDesc, PlayerBodyPartDelegate <Wings> playerDesc, ChangeType <WingData> transform,
                         RestoreType <WingData> restore) : base(behaviorOnTransform, changeSizeText, wingShortDesc, singleWingDesc, longDesc, playerDesc, transform, restore)
 {
     defaultFeatherColor = defaultHair;
 }