Example #1
0
        private static string GetRequestFlickerUrl()
        {
            string url;
            string configuredUrl = MyConfiguration.GetString(ConfigurationKeys.RequestFlickerUrl.ToString(), "ws://localhost:8181/");

            if (configuredUrl.StartsWith("http://"))
            {
                //Dynamic retrieval!
                string urlRequest     = string.Format("{0}?get=RequestFlicker", configuredUrl);
                var    result         = WebRequest.Create(urlRequest).GetResponse().GetResponseStream();
                var    stream         = new StreamReader(result);
                String ContenuPageWeb = stream.ReadToEnd();
                logger.Info(string.Format("Response : {0}", ContenuPageWeb));
                url = String.Format("ws://{0}/", ContenuPageWeb.Trim());

                logger.Info(String.Format("Dynamic Url found: {0}", url));
            }
            else
            {
                if (configuredUrl.StartsWith("ws://"))
                {
                    url = configuredUrl;
                    logger.Info(String.Format("Url found in configuration {0}", url));
                }
                else
                {
                    throw new ApplicationException(string.Format("Invalid RequestFlicker Url : {0}", configuredUrl));
                }
            }
            return(url);
        }
Example #2
0
 public TableCache()
     : this(MyConfiguration.GetString("MikMakDbConnection", @"Data Source=|DataDirectory|\..\..\Mikmak.DAO.SqlCe\LocalDb.sdf"))
 {
 }