Exemplo n.º 1
0
        private static void MainSvcThread()
        {
            try
            {
                DNScymbalSettings configSettings = DNScymbalSettings.Load();

                //SqlAzureRest sar = new SqlAzureRest();
                //sar.ServerName = "rfu3pk0bka";
                //sar.SubscriptionId = "9799e688-6fa7-4085-ab24-9b6d9233e2ad";
                //sar.SetServerFirewallRuleWithIpDetect();

                // Loop until we are stopping
                while (!_stopEvent.WaitOne(1000))
                {
                    foreach (RecordUpdateRequest rur in configSettings.RecordUpdateRequests)
                    {
                        UpdateRecordIfNeeded(rur);
                    }
                }
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads the DNScymbal applications config settings.
        /// </summary>
        /// <returns></returns>
        public static DNScymbalSettings Load()
        {
            DNScymbalSettings config;

            if (!File.Exists(DNScymbalSettings.FullName))
            {
                config = new DNScymbalSettings();
            }
            else
            {
                using (FileStream fileStream = new FileStream(DNScymbalSettings.FullName, FileMode.Open, FileAccess.Read))
                {
                    config = (DNScymbalSettings)s_xmlSerializer.Deserialize(fileStream);
                }
            }

            // Return
            return(config);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Loads the DNScymbal applications config settings.
        /// </summary>
        /// <returns></returns>
        public static DNScymbalSettings Load()
        {
            DNScymbalSettings config;
            if (!File.Exists(DNScymbalSettings.FullName))
            {
                config = new DNScymbalSettings();
            }
            else
            {
                using (FileStream fileStream = new FileStream(DNScymbalSettings.FullName, FileMode.Open, FileAccess.Read))
                {
                    config = (DNScymbalSettings)s_xmlSerializer.Deserialize(fileStream);
                }
            }

            // Return
            return config;
        }