Exemplo n.º 1
0
        private static void RestoreDriverAccount()
        {
            string oldDriver = (string)StationRegistry.GetValue("olddriver", null);

            if (oldDriver != null)
            {
                StationRegistry.SetValue("driver", oldDriver);
            }
            StationRegistry.DeleteValue("olddriver");
        }
Exemplo n.º 2
0
        private static void RestoreStationId()
        {
            string oldStationId = (string)StationRegistry.GetValue("oldStationId", null);

            if (oldStationId != null)
            {
                StationRegistry.SetValue("stationId", oldStationId);
            }
            StationRegistry.DeleteValue("oldStationId");
        }
Exemplo n.º 3
0
        private PublicPortMapping()
        {
            this.hasDriver = (Model.DriverCollection.Instance.FindOne() != null);

            TCMPortMapper.PortMapper.SharedInstance.DidChangeMappingStatus     += new PortMapper.PMDidChangeMappingStatus(PortMappingChanged);
            TCMPortMapper.PortMapper.SharedInstance.ExternalIPAddressDidChange += new PortMapper.PMExternalIPAddressDidChange(ExternalIPChanged);
            TCMPortMapper.PortMapper.SharedInstance.WillStartSearchForRouter   += new PortMapper.PMWillStartSearchForRouter(WillStartSearchForRouter);
            TCMPortMapper.PortMapper.SharedInstance.DidStartWork += new PortMapper.PMDidStartWork(DidStartWork);
            TCMPortMapper.PortMapper.SharedInstance.AllowMultithreadedCallbacks = true;
            TCMPortMapper.PortMapper.SharedInstance.Start();


            this.state = new NoUPnPDeviceFoundState();
            int checkIntervalSec = (int)StationRegistry.GetValue("UPnPCheckInterval", 120);

            this.checkTimer = new Timer(this.CheckState, null, 30 * 1000, checkIntervalSec * 1000);
        }
Exemplo n.º 4
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);
            }
        }