Exemple #1
0
        private static void RestoreStationId()
        {
            string oldStationId = (string)StationRegistry.GetValue("oldStationId", null);

            if (oldStationId != null)
            {
                StationRegistry.SetValue("stationId", oldStationId);
            }
            StationRegistry.DeleteValue("oldStationId");
        }
Exemple #2
0
        private static void RestoreDriverAccount()
        {
            string oldDriver = (string)StationRegistry.GetValue("olddriver", null);

            if (oldDriver != null)
            {
                StationRegistry.SetValue("driver", oldDriver);
            }
            StationRegistry.DeleteValue("olddriver");
        }
Exemple #3
0
        private static void RemoveBackupData(string dumpFolder)
        {
            try
            {
                RemoveDirectory(dumpFolder);

                if (StationRegistry.GetValue("oldStationId", null) != null)
                {
                    StationRegistry.DeleteValue("oldStattionId");
                }
                if (StationRegistry.GetValue("olddriver", null) != null)
                {
                    StationRegistry.DeleteValue("olddriver");
                }
            }
            catch (Exception e)
            {
                Logger.Warn("Unable to clean up backup data", e);
            }
        }
Exemple #4
0
        public static ActionResult CleanStationInfo(Session session)
        {
            string wavefaceDir = session["INSTALLLOCATION"];

            if (wavefaceDir == null)
            {
                return(ActionResult.Failure);
            }

            try
            {
                StationRegistry.DeleteValue("stationId");
            }
            catch (Exception e)
            {
                Logger.Warn("Unable to delete station id in registry", e);
            }

            try
            {
                StationRegistry.DeleteValue("driver");
            }
            catch (Exception e)
            {
                Logger.Warn("Unable to delete driver account in registry", e);
            }

            try
            {
                DriverCollection.Instance.RemoveAll();
            }
            catch (Exception e)
            {
                Logger.Warn("Unable to delete station driver from MongoDB", e);
            }

            try
            {
                StationCollection.Instance.RemoveAll();
            }
            catch (Exception e)
            {
                Logger.Warn("Unable to delete station info from MongoDB", e);
            }

            try
            {
                CloudStorageCollection.Instance.RemoveAll();
            }
            catch (Exception e)
            {
                Logger.Warn("Unable to delete cloud storage from MongoDB", e);
            }

            try
            {
                ServiceCollection.Instance.RemoveAll();
            }
            catch (Exception e)
            {
                Logger.Warn("Unable to delete service collection from MongoDB", e);
            }

            RemoveDirectory(Path.Combine(
                                Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                                "waveface"));

            RemoveDirectory(Path.Combine(
                                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                "waveface"));

            return(ActionResult.Success);
        }