Example #1
0
        public BaseOperation()
        {
            if (AllObservers == null)
            {
                AllObservers = new Dictionary <string, List <IOperationObserver> >();
            }

            Success = false;
            Message = "";

            ServerLink = "http://213.246.61.49/weel-web/api/";

            OperationWebClient = new HttpClient();
            OperationWebClient.DefaultRequestHeaders.Add("Api-Version", "1.0");
            OperationWebClient.DefaultRequestHeaders.Add("App-Version", "1.0");
            OperationWebClient.DefaultRequestHeaders.Add("User-Agent", "Windows Phone");
            var         cultureName   = new DateTimeFormatter("longdate", new[] { "US" }).ResolvedLanguage;
            CultureInfo cultureInfo   = CultureInfo.CurrentCulture;
            CultureInfo currentUIInfo = CultureInfo.CurrentUICulture;

            if (cultureName.ToString() == "en-US")
            {
                OperationWebClient.DefaultRequestHeaders.Add("User-Lang", "EN");
            }
            else if (cultureName.ToString() == "fr-FR")
            {
                OperationWebClient.DefaultRequestHeaders.Add("User-Lang", "FR");
            }
            else
            {
                OperationWebClient.DefaultRequestHeaders.Add("User-Lang", "FR");
            }

            string UniqueDeviceID = DeviceInfo.Instance.Id;

            OperationWebClient.DefaultRequestHeaders.Add("Device-UniqueId", UniqueDeviceID);
            OperationWebClient.DefaultRequestHeaders.Add("Timezone-Format", "UTC");
        }