Esempio n. 1
0
 private void OnEnable()
 {
     TimeZones = TimeZoneInfo.GetSystemTimeZones().OrderBy(tz => tz.BaseUtcOffset).ToArray();
     NPCSizes  = Enum.GetNames(typeof(NPCSizeType));
 }
Esempio n. 2
0
        public long GetTotalLocationNameCount(ServiceCtx Context)
        {
            Context.ResponseData.Write(TimeZoneInfo.GetSystemTimeZones().Count);

            return(0);
        }
Esempio n. 3
0
        private void Setting35_Load(object sender, EventArgs e)
        {
            SystemEvents.TimeChanged += new EventHandler(SystemEvent_TimeChanged);

            lbl_LoggerDate.Text = DateTime.Now.ToShortDateString();
            lbl_LoggerTime.Text = DateTime.Now.ToShortTimeString();

            cbbTimeZone.Text = TimeZoneInfo.Local.ToString();

            cbbTimeZone.Items.Clear();

            ReadOnlyCollection <TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();

            foreach (TimeZoneInfo timeZoneInfo in timeZones)
            {
                cbbTimeZone.Items.Add(timeZoneInfo.DisplayName);
            }

            TimeZone zone  = TimeZone.CurrentTimeZone;
            DateTime local = zone.ToLocalTime(DateTime.Now);

            Tim_UpdateClock.Enabled = true;

            byte[] bufSetting = new byte[360];

            string FileName = "";

            FileName = mGlobal.app_patch(FileName);


            if (System.IO.File.Exists(FileName + "\\dataSetting.txt") == true)
            {
                bufSetting = System.IO.File.ReadAllBytes(FileName + "\\dataSetting.txt");
                device35.openSetting(bufSetting);
                txtSerial.Text      = device35.Serial;
                txtDescription.Text = device35.Description;
                txtLocation.Text    = device35.Location;
                if (device35.Duration != 65535)
                {
                    int sec1 = 0;
                    int min2 = 0;

                    if (Convert.ToInt32(device35.Duration) > 60)
                    {
                        min2             = Convert.ToInt32(device35.Duration) / 60;
                        sec1             = Convert.ToInt32(device35.Duration) % 60;
                        lb_interval.Text = string.Format("{0}: {1} min {2} sec.", "Sample interval", min2, sec1);
                    }
                    else
                    {
                        lb_interval.Text = string.Format("{0}: {1} sec.", "Sample interval", Convert.ToInt32(device35.Duration));
                    }
                }
                else
                {
                    lb_interval.Text = 0.ToString();
                }

                if (device35.Delay == 255)
                {
                    cbbStartDelay.Text = cbbStartDelay.Items[0].ToString();
                }
                else
                {
                    cbbStartDelay.Text = device35.Delay.ToString();
                }

                if (device35.Duration == 65535)
                {
                    cbbDuration.Text = cbbDuration.Items[0].ToString();
                }
                else
                {
                    cbbDuration.Text = device35.Duration.ToString();
                }

                string Zone = mGlobal.FindSystemTimeZoneFromString(device35.Timezone.ToString()).ToString();
                for (int i = 0; i <= cbbTimeZone.Items.Count - 1; i++)
                {
                    if (cbbTimeZone.Items[i].ToString() == Zone)
                    {
                        cbbTimeZone.Text = cbbTimeZone.Items[i].ToString();
                    }
                }
            }
            else
            {
                btnReadSetting_Click(sender, e);
            }

            cbbChannel.Items.Clear();
            for (int i = 1; i <= 4; i++)
            {
                cbbChannel.Items.Add(i);
            }

            cbbChannel.Text          = cbbChannel.Items[0].ToString();
            cbbChannel.SelectedIndex = 0;

            if (device35.numOfChannel != 8)
            {
                cbbUnit.Items.Clear();
                cbbUnit.Items.AddRange(new string[] { "Not Use", "Celsius", "Fahrenheit", "CO2", "%RH", "G" });
            }
            cbbChannel_SelectedIndexChanged(sender, e);
            cbbUnit_SelectedIndexChanged(sender, e);

            cbbDuration.DropDownStyle   = ComboBoxStyle.DropDownList;
            cbbStartDelay.DropDownStyle = ComboBoxStyle.DropDownList;
            cbbUnit.DropDownStyle       = ComboBoxStyle.DropDownList;

            chkRecord.Checked  = false;
            chkDes.Checked     = false;
            chkLoc.Checked     = false;
            chkChannel.Checked = false;

            mGlobal.len = 64;
        }
Esempio n. 4
0
        public ActionResult StudentProfile()
        {
            if (!string.IsNullOrEmpty(ApplicationSession.Current.UserID))
            {
                StudentVM studObj = new StudentVM();
                try
                {
                    using (var _db = new SchoolMSEntities())
                    {
                        studObj.TimeZoneInfos = TimeZoneInfo.GetSystemTimeZones()
                                                .Select(t => new
                                                        SelectListItem()
                        {
                            Text  = t.DisplayName,
                            Value = t.Id
                        }).ToList();

                        studObj.GradeList = _db.SchoolGrades.ToList()
                                            .Select(g => new SelectListItem()
                        {
                            Text  = g.Grade,
                            Value = g.Id.ToString()
                        }).ToList();

                        var student = _db.Students.Find(Guid.Parse(ApplicationSession.Current.UserID));

                        if (student != null)
                        {
                            studObj.BirthDate = student.BirthDate;

                            if (studObj.BirthDate != null)
                            {
                                DateTime dtBirth = Convert.ToDateTime(student.BirthDate);
                                studObj.BirthDateOnly  = dtBirth.Day;
                                studObj.BirthMonthOnly = dtBirth.Month;
                                studObj.BirthYearOnly  = dtBirth.Year;
                            }
                            else
                            {
                                DateTime dt = new DateTime();
                                dt = DateTime.Today;
                                studObj.BirthYearOnly  = dt.Year - 60;
                                studObj.BirthMonthOnly = dt.Month;
                                studObj.BirthDateOnly  = dt.Day;
                            }

                            studObj.Email             = student.Email;
                            studObj.Facetime          = student.Facetime;
                            studObj.FromCountry       = student.FromCountry;
                            studObj.FromState         = student.FromState;
                            studObj.Gender            = student.Gender;
                            studObj.GoogleHangout     = student.GoogleHangout;
                            studObj.Id                = student.Id;
                            studObj.LivingCountry     = student.LivingCountry;
                            studObj.LivingState       = student.LivingState;
                            studObj.Name              = student.Name;
                            studObj.NativeLanguage    = student.NativeLanguage;
                            studObj.ProfilePhoto      = student.ProfilePhoto;
                            studObj.QQ                = student.QQ;
                            studObj.SchoolGrade       = student.SchoolGrade;
                            studObj.Skype             = student.Skype;
                            studObj.TimeZone          = student.TimeZone;
                            studObj.Webchat           = student.Webchat;
                            studObj.SchoolName        = student.SchoolName;
                            studObj.ShortIntroduction = student.ShortIntroduction;
                            studObj.LongIntroduction  = student.LongIntroduction;
                            studObj.LookingFor        = student.LookingFor;

                            var StudentSubjects = _db.StudentSubjects.Where(s => s.StudentId == studObj.Id).ToList();

                            foreach (var item in StudentSubjects)
                            {
                                var SubjectList = _db.SchoolSubjects.Where(s => s.GradeId == item.SchoolGradeId).ToList().Select(s => new SelectListItem()
                                {
                                    Text  = s.Subject,
                                    Value = s.Id
                                }).ToList();

                                studObj.StudentSubjectList.Add(new StudentSchoolSubjects()
                                {
                                    GradeId     = item.SchoolGradeId,
                                    SubjectId   = item.SchoolSubjectId,
                                    IsLearning  = item.IsLearning,
                                    IsPrimary   = item.IsPrimary,
                                    SubjectList = SubjectList
                                });
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    return(RedirectToAction("Home", "Dashboard"));
                }
                return(View(studObj));
            }
            else
            {
                return(RedirectToAction("Home", "Dashboard"));
            }
            //return View();
        }
 public IEnumerable <ITimeZoneEx> GetAllTimeZones()
 {
     return(TimeZoneInfo.GetSystemTimeZones().Select(tz => new TimeZoneEx(tz)));
 }
Esempio n. 6
0
        /// <summary>
        ///     Gets a TimeZoneInfo by name.
        /// </summary>
        public static TimeZoneInfo GetTimeZoneInfo(string timeZoneName)
        {
            if (timeZoneName == null)
            {
                return(null);
            }

            if (_timeZonesDisplayNamesDict == null)
            {
                lock (typeof(TimeZoneHelper))
                {
                    if (_timeZonesDisplayNamesDict == null)
                    {
                        CultureInfo culture = CultureInfo.CurrentCulture;
                        try
                        {
                            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
                            _timeZonesDisplayNamesDict          = TimeZoneInfo.GetSystemTimeZones().ToDictionary(tz => tz.DisplayName);
                        }
                        finally
                        {
                            Thread.CurrentThread.CurrentCulture = culture;
                        }
                    }
                }
            }

            if (_timeZonesStandardNamesDict == null)
            {
                lock (typeof(TimeZoneHelper))
                {
                    if (_timeZonesStandardNamesDict == null)
                    {
                        CultureInfo culture = CultureInfo.CurrentCulture;
                        try
                        {
                            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
                            _timeZonesStandardNamesDict         = TimeZoneInfo.GetSystemTimeZones().ToDictionary(tz => tz.StandardName);
                        }
                        finally
                        {
                            Thread.CurrentThread.CurrentCulture = culture;
                        }
                    }
                }
            }

            TimeZoneInfo timeZone;

            if (!_timeZonesDisplayNamesDict.TryGetValue(timeZoneName, out timeZone))      // check in displayNamesDict
            {
                if (!_timeZonesStandardNamesDict.TryGetValue(timeZoneName, out timeZone)) // check in standardNamesDict
                {
                    // if an Olson timezone name is passed in then get the corresponding Windows timezone name
                    string msTimeZoneName = GetMsTimeZoneNameByOlsonName(timeZoneName);

                    if (!string.IsNullOrEmpty(msTimeZoneName))
                    {
                        try
                        {
                            return(TimeZoneInfo.FindSystemTimeZoneById(msTimeZoneName));
                        }
                        catch (TimeZoneNotFoundException ex)
                        {
                            ReadiNow.Diagnostics.EventLog.Application.WriteError("Unable to find the windows timezone.\r\n{0}", ex);
                        }
                    }
                }
            }

            return(timeZone);
        }
Esempio n. 7
0
        private void SetChoiceHash(
            int tenantId,
            long siteId,
            Dictionary <string, IEnumerable <string> > linkHash,
            IEnumerable <string> searchIndexes,
            int index,
            string line)
        {
            switch (line)
            {
            case "[[Depts]]":
                SiteInfo.TenantCaches[tenantId].DeptHash
                .Where(o => o.Value.TenantId == tenantId)
                .ForEach(o => AddToChoiceHash(
                             o.Key.ToString(),
                             SiteInfo.Dept(o.Key).Name));
                break;

            case "[[Users]]":
                SiteInfo.SiteUsers(tenantId, siteId)
                .ToDictionary(o => o.ToString(), o => SiteInfo.UserName(o))
                .Where(o => searchIndexes?.Any() != true ||
                       searchIndexes.All(p =>
                                         o.Key.Contains(p) ||
                                         o.Value.Contains(p)))
                .ForEach(o => AddToChoiceHash(o.Key, o.Value));
                break;

            case "[[Users*]]":
                SiteInfo.TenantCaches[tenantId].UserHash
                .Where(o => o.Value.TenantId == tenantId)
                .ToDictionary(o => o.Key.ToString(), o => o.Value.Name)
                .Where(o => searchIndexes?.Any() != true ||
                       searchIndexes.All(p =>
                                         o.Key.Contains(p) ||
                                         o.Value.Contains(p)))
                .ForEach(o => AddToChoiceHash(o.Key, o.Value));
                break;

            case "[[TimeZones]]":
                TimeZoneInfo.GetSystemTimeZones()
                .ForEach(o => AddToChoiceHash(
                             o.Id,
                             o.StandardName));
                break;

            default:
                if (linkHash != null && linkHash.ContainsKey(line))
                {
                    linkHash[line].ForEach(value =>
                                           AddToChoiceHash(value));
                }
                else if (TypeName != "bit")
                {
                    if (searchIndexes == null ||
                        searchIndexes.All(o => line.Contains(o)))
                    {
                        AddToChoiceHash(line);
                    }
                }
                else
                {
                    AddToChoiceHash((index == 0).ToOneOrZeroString(), line);
                }
                break;
            }
        }
        /// <summary>
        ///     Creates a list of all valid time zones
        /// </summary>
        public void Build()
        {
            TimeZones = new Dictionary <string, ITimeZoneTO>();
            const string UctShort = "UCT";
            const string UctLong  = "Coordinated Universal Time";

            TimeZones.Add(UctShort.ToLower(), new TimeZoneTO(UctShort, UctShort, UctLong));
            TimeZones.Add(UctLong.ToLower(), new TimeZoneTO(UctShort, UctShort, UctLong));

            for (int hours = -12; hours < 13; hours++)
            {
                if (hours != 0)
                {
                    for (int minutes = 0; minutes < 2; minutes++)
                    {
                        string min = minutes == 0 ? "00" : "30";
                        string hrs = string.Concat(hours / Math.Abs(hours) < 0 ? "-" : "+",
                                                   Math.Abs(hours).ToString(CultureInfo.InvariantCulture).PadLeft(2, '0'));
                        string uct = string.Concat(UctShort, hrs, ":", min);
                        TimeZones.Add(uct.ToLower(), new TimeZoneTO(UctShort, uct, UctLong));
                    }
                }
                else
                {
                    TimeZones.Add(UctShort + "-00:30", new TimeZoneTO(UctShort, UctShort + "-00:30", UctLong));
                    TimeZones.Add(UctShort + "+00:30", new TimeZoneTO(UctShort, UctShort + "+00:30", UctLong));
                }
            }

            //
            // Create GMT entries
            //
            const string GmtShort = "GMT";
            const string GmtLong  = "Greenwich Mean Time";

            TimeZones.Add(GmtShort.ToLower(), new TimeZoneTO(GmtShort, GmtShort, GmtLong));
            TimeZones.Add(GmtLong.ToLower(), new TimeZoneTO(GmtShort, GmtShort, GmtLong));

            for (int hours = -12; hours < 13; hours++)
            {
                if (hours != 0)
                {
                    for (int minutes = 0; minutes < 2; minutes++)
                    {
                        string min = minutes == 0 ? "00" : "30";
                        string hrs = string.Concat(hours / Math.Abs(hours) < 0 ? "-" : "+",
                                                   Math.Abs(hours).ToString(CultureInfo.InvariantCulture).PadLeft(2, '0'));
                        string gmt = string.Concat(GmtShort, hrs, ":", min);
                        TimeZones.Add(gmt.ToLower(), new TimeZoneTO(GmtShort, gmt, GmtLong));
                    }
                }
                else
                {
                    TimeZones.Add(GmtShort + "-00:30", new TimeZoneTO(GmtShort, GmtShort + "-00:30", GmtLong));
                    TimeZones.Add(GmtShort + "+00:30", new TimeZoneTO(GmtShort, GmtShort + "+00:30", GmtLong));
                }
            }

            //
            // Read in system time zones
            //
            foreach (TimeZoneInfo timeZoneInfo in TimeZoneInfo.GetSystemTimeZones())
            {
                ITimeZoneTO timeZoneTo;
                if (!TimeZones.TryGetValue(timeZoneInfo.DisplayName.ToLower(), out timeZoneTo))
                {
                    TimeZones.Add(timeZoneInfo.DisplayName.ToLower(),
                                  new TimeZoneTO(timeZoneInfo.StandardName, timeZoneInfo.StandardName, timeZoneInfo.DisplayName));
                }

                if (!TimeZones.TryGetValue(timeZoneInfo.DaylightName.ToLower(), out timeZoneTo))
                {
                    TimeZones.Add(timeZoneInfo.DaylightName.ToLower(),
                                  new TimeZoneTO(timeZoneInfo.DaylightName, timeZoneInfo.DaylightName, timeZoneInfo.DisplayName));
                }

                if (!TimeZones.TryGetValue(timeZoneInfo.StandardName.ToLower(), out timeZoneTo))
                {
                    TimeZones.Add(timeZoneInfo.StandardName.ToLower(),
                                  new TimeZoneTO(timeZoneInfo.StandardName, timeZoneInfo.StandardName, timeZoneInfo.DisplayName));
                }
            }
        }
Esempio n. 9
0
        public async Task <ActionResult> Register(RegisterViewModel model, HttpPostedFileBase image)
        {
            var pPic = "/assets/ProfilePics/avatar-template.png";

            if (image != null && image.ContentLength > 0)
            {
                var ext = Path.GetExtension(image.FileName).ToLower();
                if (ext != ".png" && ext != ".jpg" && ext != ".jpeg" && ext != ".gif" && ext != ".bmp")
                {
                    ModelState.AddModelError("image", "Invalid Format.");
                }
            }

            if (ModelState.IsValid)
            {
                var timezones       = TimeZoneInfo.GetSystemTimeZones();                   /*jw 10/27/17*/
                var defaulttimezone = TimeZoneInfo.FindSystemTimeZoneById("US Eastern Standard Time");
                ViewBag.TimeZone = new SelectList(timezones, "Id", "Id", defaulttimezone); /*jw 10/27/17*/

                if (image != null)
                {
                    //Counter
                    var num = 0;
                    //Gets Filename without the extension
                    var fileName = Path.GetFileNameWithoutExtension(image.FileName);
                    pPic = Path.Combine("/assets/ProfilePics/", fileName + Path.GetExtension(image.FileName));
                    //Checks if pPic matches any of the current attachments,
                    //if so it will loop and add a (number) to the end of the filename
                    while (db.Users.Any(u => u.ProfilePic == pPic))
                    {
                        //Sets "filename" back to the default value
                        fileName = Path.GetFileNameWithoutExtension(image.FileName);
                        //Add's parentheses after the name with a number ex. filename(4)
                        fileName = string.Format(fileName + "(" + ++num + ")");
                        //Makes sure pPic gets updated with the new filename so it could check
                        pPic = Path.Combine("/assets/ProfilePics/", fileName + Path.GetExtension(image.FileName));
                    }
                    image.SaveAs(Path.Combine(Server.MapPath("~/assets/ProfilePics/"), fileName + Path.GetExtension(image.FileName)));
                }

                var user = new ApplicationUser
                {
                    UserName    = model.Email,
                    Email       = model.Email,
                    TimeZone    = model.TimeZone,
                    FirstName   = model.FirstName,
                    LastName    = model.LastName,
                    ProfilePic  = pPic,
                    HouseholdId = model.HouseholdId
                };

                var result = await UserManager.CreateAsync(user, model.Password);

                if (result.Succeeded)
                {
                    await SignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false);

                    // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771
                    // Send an email with this link
                    // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                    // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                    // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");

                    return(RedirectToAction("Index", "Households"));
                }
                AddErrors(result);
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Esempio n. 10
0
        public static TimeZoneInfo GetTimeZone(string tzone)
        {
            if (tzone.Equals("GMT"))
            {
                tzone = "GMT Standard Time";
            }

            try
            {
                TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById(tzone);
                return(tz);
            }
            catch
            {
                // Not found
            }

            // Mono and Java allow you to specify timezones by short id (i.e. EST instead of Eastern Standard Time).
            // Mono on Windows and the microsoft framewokr on windows do not allow this. This hack is to compensate
            // for that and allow you to match 'EST' to 'Eastern Standard Time' by matching the first letter of each
            // word to the corresponding character in the short string. Bleh.
            if (tzone.Length <= 4)
            {
                foreach (var timezone in TimeZoneInfo.GetSystemTimeZones())
                {
                    var parts = timezone.Id.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                    if (parts.Length == tzone.Length)
                    {
                        bool found = true;
                        for (int i = 0; i < parts.Length; i++)
                        {
                            found &= parts[i][0] == tzone[i];
                        }

                        if (found)
                        {
                            return(timezone);
                        }
                    }
                }
            }
            char[]   separator = new char[] { ':' };
            string[] strArray = tzone.Substring(4).Split(separator);
            int      hours, minutes;

            if (strArray.Length == 1 && strArray[0].Length > 2)
            {
                hours   = int.Parse(strArray[0].Substring(0, 2));
                minutes = int.Parse(strArray[0].Substring(2));
            }
            else
            {
                hours   = int.Parse(strArray[0]);
                minutes = (strArray.Length <= 1) ? 0 : int.Parse(strArray[1]);
            }
            TimeSpan t = new TimeSpan(0, hours, minutes, 0, 0);

            if (tzone[3] == '-')
            {
                t = -t;
            }
            return(TimeZoneInfo.CreateCustomTimeZone(tzone, t, tzone, tzone));
        }
        /// <summary>
        /// Implementation of the ProcessRecord method for Get-TimeZone.
        /// </summary>
        protected override void ProcessRecord()
        {
            // make sure we've got the latest time zone settings
            TimeZoneInfo.ClearCachedData();

            if (this.ParameterSetName.Equals("ListAvailable", StringComparison.OrdinalIgnoreCase))
            {
                // output the list of all available time zones
                WriteObject(TimeZoneInfo.GetSystemTimeZones(), true);
            }
            else if (this.ParameterSetName.Equals("Id", StringComparison.OrdinalIgnoreCase))
            {
                // lookup each time zone id
                foreach (string tzid in Id)
                {
                    try
                    {
                        WriteObject(TimeZoneInfo.FindSystemTimeZoneById(tzid));
                    }
                    catch (TimeZoneNotFoundException e)
                    {
                        WriteError(new ErrorRecord(e, TimeZoneHelper.TimeZoneNotFoundError,
                                                   ErrorCategory.InvalidArgument, "Id"));
                    }
                }
            }
            else // ParameterSetName == "Name"
            {
                if (Name != null)
                {
                    // lookup each time zone name (or wildcard pattern)
                    foreach (string tzname in Name)
                    {
                        TimeZoneInfo[] timeZones = TimeZoneHelper.LookupSystemTimeZoneInfoByName(tzname);
                        if (0 < timeZones.Length)
                        {
                            // manually process each object in the array, so if there is only a single
                            // entry then the returned type is TimeZoneInfo and not TimeZoneInfo[], and
                            // it can be pipelined to Set-TimeZone more easily
                            foreach (TimeZoneInfo timeZone in timeZones)
                            {
                                WriteObject(timeZone);
                            }
                        }
                        else
                        {
                            string message = string.Format(CultureInfo.InvariantCulture,
                                                           TimeZoneResources.TimeZoneNameNotFound, tzname);

                            Exception e = new TimeZoneNotFoundException(message);
                            WriteError(new ErrorRecord(e, TimeZoneHelper.TimeZoneNotFoundError,
                                                       ErrorCategory.InvalidArgument, "Name"));
                        }
                    }
                }
                else
                {
                    // return the current system local time zone
                    WriteObject(TimeZoneInfo.Local);
                }
            }
        }
Esempio n. 12
0
 public string GetSelectedTimeZone()
 {
     return(TimeZoneInfo.GetSystemTimeZones().Any(tz => tz.Id == TimeZoneId) ? TimeZoneId : "device");
 }
Esempio n. 13
0
        private void LoadContext()
        {
            serverTextBox.Text   = Context.ServerUrl ?? string.Empty;
            apiTokenTextBox.Text = Context.ApiToken ?? string.Empty;

            bulkImportIndicatorTextBox.Text  = Context.BulkImportIndicator;
            fieldResultPrefixTextBox.Text    = Context.FieldResultPrefix;
            stopOnFirstErrorCheckBox.Checked = Context.StopOnFirstError;
            errorLimitNumericUpDown.Value    = Context.ErrorLimit;

            SetDateTimeControl(startDateTimePicker, Context.StartTime);
            SetDateTimeControl(endDateTimePicker, Context.EndTime);

            UtcOffsets = TimeZoneInfo
                         .GetSystemTimeZones()
                         .Select(z => z.BaseUtcOffset)
                         .Distinct()
                         .OrderBy(ts => ts)
                         .Select(ts => $"{ts}")
                         .ToList();

            utcOffsetComboBox.DataSource = UtcOffsets;

            var utcIndex = UtcOffsets
                           .IndexOf($"{Context.UtcOffset.ToTimeSpan()}");

            utcOffsetComboBox.SelectedIndex = utcIndex;

            dryRunCheckBox.Checked        = Context.DryRun;
            verboseErrorsCheckBox.Checked = Context.VerboseErrors;

            maxObservationsCheckBox.Checked    = Context.MaximumObservations.HasValue;
            maxObservationsNumericUpDown.Value = Context.MaximumObservations ?? 0;

            resultGradeTextBox.Text        = Context.ResultGrade;
            estimatedGradeTextBox.Text     = Context.EstimatedGrade;
            fieldResultStatusTextBox.Text  = Context.FieldResultStatus;
            labResultStatusTextBox.Text    = Context.LabResultStatus;
            defaultLaboratoryTextBox.Text  = Context.DefaultLaboratory;
            defaultMediumTextBox.Text      = Context.DefaultMedium;
            nonDetectConditionTextBox.Text = Context.NonDetectCondition;
            labSpecimenNameTextBox.Text    = Context.LabSpecimenName;

            overwriteCheckBox.Checked = Context.Overwrite;
            CsvOutputPathTextBox.Text = Context.CsvOutputPath;

            locationAliasesLabel.Text = $@"{"location alias".ToQuantity(Context.LocationAliases.Count)} defined.";

            foreach (var kvp in Context.LocationAliases.OrderBy(kvp => kvp.Key))
            {
                locationAliasesListView.Items.Add(CreateListViewItem(kvp.Key, kvp.Value));
            }

            propertyAliasesLabel.Text = $@"{"observed property alias".ToQuantity(Context.ObservedPropertyAliases.Count)} defined.";

            foreach (var alias in Context.ObservedPropertyAliases.Values.OrderBy(alias => alias.AliasedPropertyId).ThenBy(alias => alias.AliasedUnitId))
            {
                propertyAliasesListView.Items.Add(CreateListViewItem(alias.AliasedPropertyId, alias.AliasedUnitId, alias.PropertyId, alias.UnitId));
            }

            methodAliasesLabel.Text = $@"{"method alias".ToQuantity(Context.MethodAliases.Count)} defined.";

            foreach (var kvp in Context.MethodAliases.OrderBy(kvp => kvp.Key))
            {
                methodAliasesListView.Items.Add(CreateListViewItem(kvp.Key, kvp.Value));
            }

            qcTypeAliasesLabel.Text = $@"{"quality control alias".ToQuantity(Context.QCTypeAliases.Count)} defined.";

            foreach (var kvp in Context.QCTypeAliases.OrderBy(kvp => kvp.Key))
            {
                qcTypeAliasesListView.Items.Add(CreateListViewItem(kvp.Key, $"{kvp.Value}"));
            }

            OnServerConfigChanged();
        }
Esempio n. 14
0
        private static IEnumerable <TimeZoneInfoItem> /*!!*/ InitialTimeZones()
        {
            // time zone cache:
            var tzcache = new Dictionary <string, TimeZoneInfo>(128, StringComparer.OrdinalIgnoreCase);
            Func <string, TimeZoneInfo> cachelookup = (id) =>
            {
                TimeZoneInfo tz;
                if (!tzcache.TryGetValue(id, out tz))
                {
                    TimeZoneInfo winTZ = null;
                    try
                    {
                        winTZ = TimeZoneInfo.FindSystemTimeZoneById(id);
                    }
                    catch { }

                    tzcache[id] = tz = winTZ;   // null in case "id" is not defined in Windows registry (probably missing Windows Update)
                }

                return(tz);
            };

            // system timezones:
            var tzns = TimeZoneInfo.GetSystemTimeZones();

            if (tzns != null)
            {
                foreach (var x in tzns)
                {
                    bool isAlias = !x.Id.Contains('/') || x.Id.Contains("GMT");   // whether to display such tz within timezone_identifiers_list()
                    yield return(new TimeZoneInfoItem(x.Id, x, null, isAlias));
                }
            }

            //// collect php time zone names and match them with Windows TZ IDs:
            //var tzdoc = new XmlDocument();
            //tzdoc.LoadXml(Resources.Resources.WindowsTZ);
            //foreach (var tz in tzdoc.DocumentElement.SelectNodes(@"//windowsZones/mapTimezones/mapZone"))
            //{
            //    // <mapZone other="Dateline Standard Time" type="Etc/GMT+12"/>
            //    // @other = Windows TZ ID
            //    // @type = PHP TZ names, separated by space

            //    var windowsId = tz.Attributes["other"].Value;
            //    var phpIds = tz.Attributes["type"].Value;

            //    var windowsTZ = cachelookup(windowsId);
            //    if (windowsTZ != null)  // TZ not defined in Windows registry, ignore such time zone // TODO: show a warning
            //        foreach (var phpTzName in phpIds.Split(' '))
            //        {
            //            Debug.Assert(!string.IsNullOrWhiteSpace(phpTzName));

            //            bool isAlias = !phpTzName.Contains('/') || phpTzName.Contains("GMT");   // whether to display such tz within timezone_identifiers_list()
            //            yield return new TimeZoneInfoItem(phpTzName, windowsTZ, null, isAlias);
            //        }
            //}

            //
            //{ "US/Alaska"
            //{ "US/Aleutian"
            //{ "US/Arizona"
            yield return(new TimeZoneInfoItem("US/Central", cachelookup("Central Standard Time"), null, true));

            //{ "US/East-Indiana"
            //{ "US/Eastern"
            yield return(new TimeZoneInfoItem("US/Hawaii", cachelookup("Hawaiian Standard Time"), null, true));
            //{ "US/Indiana-Starke"
            //{ "US/Michigan"
            //{ "US/Mountain"
            //{ "US/Pacific"
            //{ "US/Pacific-New"
            //{ "US/Samoa"
        }
Esempio n. 15
0
    public static void Main()
    {
        ReadOnlyCollection <TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();
        DateTimeFormatInfo dateInfo = CultureInfo.CurrentCulture.DateTimeFormat;

        foreach (var zone in timeZones)
        {
            Console.WriteLine("{0} transition time information:", zone.StandardName);
            Console.WriteLine("   Time zone information: ");
            Console.WriteLine("      Base UTC Offset: {0}", zone.BaseUtcOffset);
            Console.WriteLine("      Supports DST: {0}", zone.SupportsDaylightSavingTime);

            TimeZoneInfo.AdjustmentRule[] adjustmentRules = zone.GetAdjustmentRules();

            // Indicate that time zone has no adjustment rules
            if (adjustmentRules.Length == 0)
            {
                Console.WriteLine("      No adjustment rules defined.");
            }
            else
            {
                Console.WriteLine("      Adjustment Rules: {0}", adjustmentRules.Length);
                // Iterate adjustment rules
                foreach (var adjustmentRule in adjustmentRules)
                {
                    Console.WriteLine("   Adjustment rule from {0:d} to {1:d}:",
                                      adjustmentRule.DateStart,
                                      adjustmentRule.DateEnd);
                    Console.WriteLine("      Delta: {0}", adjustmentRule.DaylightDelta);
                    // Get start of transition
                    TimeZoneInfo.TransitionTime daylightStart = adjustmentRule.DaylightTransitionStart;
                    // Display information on floating date rule
                    if (!daylightStart.IsFixedDateRule)
                    {
                        Console.WriteLine("      Begins at {0:t} on the {1} {2} of {3}",
                                          daylightStart.TimeOfDay,
                                          (WeekOfMonth)daylightStart.Week,
                                          daylightStart.DayOfWeek,
                                          dateInfo.GetMonthName(daylightStart.Month));
                    }
                    // Display information on fixed date rule
                    else
                    {
                        Console.WriteLine("      Begins at {0:t} on {1} {2}",
                                          daylightStart.TimeOfDay,
                                          dateInfo.GetMonthName(daylightStart.Month),
                                          daylightStart.Day);
                    }

                    // Get end of transition.
                    TimeZoneInfo.TransitionTime daylightEnd = adjustmentRule.DaylightTransitionEnd;
                    // Display information on floating date rule.
                    if (!daylightEnd.IsFixedDateRule)
                    {
                        Console.WriteLine("      Ends at {0:t} on the {1} {2} of {3}",
                                          daylightEnd.TimeOfDay,
                                          (WeekOfMonth)daylightEnd.Week,
                                          daylightEnd.DayOfWeek,
                                          dateInfo.GetMonthName(daylightEnd.Month));
                    }
                    // Display information on fixed date rule.
                    else
                    {
                        Console.WriteLine("      Ends at {0:t} on {1} {2}",
                                          daylightEnd.TimeOfDay,
                                          dateInfo.GetMonthName(daylightEnd.Month),
                                          daylightEnd.Day);
                    }
                }
            }
        }
    }
Esempio n. 16
0
 public static TimeZoneInfo GetTargetTimeZone()
 {
     return(TimeZoneInfo.GetSystemTimeZones().ToList().Any(x => x.Id == TIMEZONE_WINDOWS_SOUTH_AMERICA) ?
            TimeZoneInfo.FindSystemTimeZoneById(TIMEZONE_WINDOWS_SOUTH_AMERICA) :
            TimeZoneInfo.FindSystemTimeZoneById(TIMEZONE_UNIX_SOUTH_AMERICA));
 }
Esempio n. 17
0
 public IEnumerable <TimeZoneInfo> GetTimeZones()
 {
     return(TimeZoneInfo.GetSystemTimeZones());
 }
Esempio n. 18
0
 private static TimeZoneInfo GetMoscowTimeZoneInternal()
 {
     return(TimeZoneInfo
            .GetSystemTimeZones()
            .First(IsMockowTimezone));
 }
Esempio n. 19
0
 public static DateTime UtcToLocal(this DateTime UtcDateTime, string TimezoneName)
 {
     return
         (TimeZoneInfo.ConvertTimeFromUtc(UtcDateTime, TimeZoneInfo.GetSystemTimeZones().Where(tz => TimezoneName.MatchSubstring(tz.StandardName, false)).Single()));
 }
Esempio n. 20
0
 public ReadOnlyCollection <TimeZoneInfo> GetSystemTimeZones() => TimeZoneInfo.GetSystemTimeZones();
Esempio n. 21
0
 public IActionResult Register()
 {
     ViewData["TimeZoneId"] = new SelectList(TimeZoneInfo.GetSystemTimeZones());
     return(View());
 }
Esempio n. 22
0
 public void GetSystemTimeZones()
 {
     Assert.That(TimeZoneInfo.GetSystemTimeZones().Count, Is.GreaterThan(400), "GetSystemTimeZones");
 }
Esempio n. 23
0
        /// <summary>
        /// 获取系统的所有时区
        /// </summary>
        /// <returns></returns>
        public static ICollection <TimeZoneInfo> GetTimeZones()
        {
            ICollection <TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();

            return(timeZones);
        }
Esempio n. 24
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            UIApplication.SharedApplication.RegisterForRemoteNotifications();

            global::Xamarin.Forms.Forms.Init();
            CarouselViewRenderer.Init();

            var x = typeof(Behaviors.EventHandlerBehavior);

            //Azure services
            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();

            //Zxing barcode scanning lib
            global::ZXing.Net.Mobile.Forms.iOS.Platform.Init();

            TimeZoneInfo.GetSystemTimeZones();
            var builder = new ContainerBuilder();

            RegisterDeviceSpecificImpl(builder);
            var TEKUtsavApp = new App(builder);

            // Monitor token generation
            InstanceId.Notifications.ObserveTokenRefresh(TokenRefreshNotification); 

            ////Firebase implementation////
                
 // get permission for notification
            if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
            {
                // iOS 10
                var authOptions = UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound;
                UNUserNotificationCenter.Current.RequestAuthorization(authOptions, (granted, error) =>
                {
                    Console.WriteLine(granted);
                });

                // For iOS 10 display notification (sent via APNS)
                UNUserNotificationCenter.Current.Delegate = this;
            }
            else
            {
                var allNotificationTypes = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound;
                var settings             = UIUserNotificationSettings.GetSettingsForTypes(allNotificationTypes, null);


                UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
            }

            UIApplication.SharedApplication.RegisterForRemoteNotifications();

            // Firebase component initialize
            Firebase.Core.App.Configure();

            Firebase.InstanceID.InstanceId.Notifications.ObserveTokenRefresh((sender, e) =>
            {
                var newToken = Firebase.InstanceID.InstanceId.SharedInstance.Token;
                // if you want to send notification per user, use this token
                System.Diagnostics.Debug.WriteLine(newToken);

                connectFCM();
            });
            //////
            LoadApplication(TEKUtsavApp);

            CurrentDomain_UnhandledException(App.AppLogger);

            return(base.FinishedLaunching(app, options));
        }
Esempio n. 25
0
 protected virtual TimeZoneInfo randomTimeZone(Random random)
 {
     return(RandomInts.RandomFrom(random, TimeZoneInfo.GetSystemTimeZones()));
 }
Esempio n. 26
0
    public static void Main()
    {
        const string OUTPUTFILENAME = @"C:\Temp\WindowsTimeZoneInfo.txt";

        CultureInfo        culture     = System.Globalization.CultureInfo.GetCultureInfo("en-GB"); // fix date strings as per UK culture
        DateTimeFormatInfo dateFormats = CultureInfo.CurrentCulture.DateTimeFormat;
        ReadOnlyCollection <TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();
        StreamWriter sw = new StreamWriter(OUTPUTFILENAME, false);

        foreach (TimeZoneInfo timeZone in timeZones)
        {
            bool     hasDST        = timeZone.SupportsDaylightSavingTime;
            TimeSpan offsetFromUtc = timeZone.BaseUtcOffset;
            TimeZoneInfo.AdjustmentRule[] adjustRules;
            string offsetString;

            sw.WriteLine("ID: {0}", timeZone.Id);
            sw.WriteLine("   Display Name: {0, 40}", timeZone.DisplayName);
            sw.WriteLine("   Standard Name: {0, 39}", timeZone.StandardName);
            sw.Write("   Daylight Name: {0, 39}", timeZone.DaylightName);
            sw.Write(hasDST ? "   ***Has " : "   ***Does Not Have ");
            sw.WriteLine("Daylight Saving Time***");
            offsetString = String.Format("{0} hours, {1} minutes", offsetFromUtc.Hours, offsetFromUtc.Minutes);
            sw.WriteLine("   Offset from UTC: {0, 40}", offsetString);
            adjustRules = timeZone.GetAdjustmentRules();
            sw.WriteLine("   Number of adjustment rules: {0, 26}", adjustRules.Length);
            if (adjustRules.Length > 0)
            {
                sw.WriteLine("   Adjustment Rules:");
                foreach (TimeZoneInfo.AdjustmentRule rule in adjustRules)
                {
                    TimeZoneInfo.TransitionTime transTimeStart = rule.DaylightTransitionStart;
                    TimeZoneInfo.TransitionTime transTimeEnd   = rule.DaylightTransitionEnd;

                    sw.WriteLine("      From {0} to {1}", rule.DateStart.ToString(culture.DateTimeFormat), rule.DateEnd.ToString(culture.DateTimeFormat));
                    sw.WriteLine("      Delta: {0}", rule.DaylightDelta);
                    if (!transTimeStart.IsFixedDateRule)
                    {
                        sw.WriteLine("      Begins at {0:t} on {1} of week {2} of {3}", transTimeStart.TimeOfDay,
                                     transTimeStart.DayOfWeek,
                                     transTimeStart.Week,
                                     dateFormats.MonthNames[transTimeStart.Month - 1]);
                        sw.WriteLine("      Ends at {0:t} on {1} of week {2} of {3}", transTimeEnd.TimeOfDay,
                                     transTimeEnd.DayOfWeek,
                                     transTimeEnd.Week,
                                     dateFormats.MonthNames[transTimeEnd.Month - 1]);
                    }
                    else
                    {
                        sw.WriteLine("      Begins at {0:t} on {1} {2}", transTimeStart.TimeOfDay,
                                     transTimeStart.Day,
                                     dateFormats.MonthNames[transTimeStart.Month - 1]);
                        sw.WriteLine("      Ends at {0:t} on {1} {2}", transTimeEnd.TimeOfDay,
                                     transTimeEnd.Day,
                                     dateFormats.MonthNames[transTimeEnd.Month - 1]);
                    }
                }
            }
        }
        sw.Close();
    }
        public ProjectOnlineAccessService(string projectOnlineUrl, string projectOnlineUserName,
                                          string projectOnlinePassword, bool isOnline, Guid winServiceIterationUid)
        {
            logger.LogAndSendMessage(null, "ProjectOnlineAccessService START",
                                     null, winServiceIterationUid,
                                     $"ProjectOnlineAccessService START ProjectOnlineUrl: {ProjectOnlineUrl}; " +
                                     $"projectOnlineUserName: {projectOnlineUserName}; projectOnlinePassword: {projectOnlinePassword}; " +
                                     $"isOnline: {isOnline};",
                                     false, null);

            ProjectOnlineUrl            = projectOnlineUrl;
            this.isOnline               = isOnline;
            this.winServiceIterationUid = winServiceIterationUid;
            var securePassword = new SecureString();

            foreach (char c in projectOnlinePassword)
            {
                securePassword.AppendChar(c);
            }
            if (isOnline)
            {
                ProjectContext = new ProjectContext(ProjectOnlineUrl)
                {
                    Credentials = new SharePointOnlineCredentials(projectOnlineUserName, securePassword)
                };
            }
            else
            {
                ProjectContext = new ProjectContext(ProjectOnlineUrl)
                {
                    Credentials = new NetworkCredential(projectOnlineUserName, projectOnlinePassword)
                };
            }
            ProjectContext.RequestTimeout = RequestTimeout;
            ProjectContext.PendingRequest.RequestExecutor.WebRequest.Timeout          = RequestTimeout;
            ProjectContext.PendingRequest.RequestExecutor.WebRequest.ReadWriteTimeout = RequestTimeout;

            //SPClientCallableSettings

            //TODO:!!!!!!!!!!!!!
            //The underlying connection was closed: A connection that was expected to be kept alive was closed by the server." >>
            //"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
            //In my case, this solved the problem: **System.Net.ServicePointManager.Expect100Continue = false; **
            ServicePointManager.Expect100Continue = false;

            //One more solution. Add into Register
            //HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ DWORD SynAttackProtect 00000000

            Web web = ProjectContext.Web;
            RegionalSettings regSettings = web.RegionalSettings;

            ProjectContext.Load(web);
            ProjectContext.Load(regSettings); //To get regional settings properties
            Microsoft.SharePoint.Client.TimeZone projectOnlineTimeZone = regSettings.TimeZone;
            ProjectContext.Load(projectOnlineTimeZone);
            //To get the TimeZone propeties for the current web region settings
            ExecuteQuery();
            TimeSpan projectOnlineUtcOffset =
                TimeSpan.Parse(projectOnlineTimeZone.Description.Substring(4,
                                                                           projectOnlineTimeZone.Description.IndexOf(")", StringComparison.Ordinal) - 4));
            ReadOnlyCollection <TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();

            ProjectOnlineTimeZoneInfo =
                timeZones.FirstOrDefault(x => x.BaseUtcOffset == projectOnlineUtcOffset);
            CurrentDateForCompare = ProjectOnlineTimeZoneInfo != null
                ? TimeZoneInfo.ConvertTime(DateTime.Now, ProjectOnlineTimeZoneInfo)
                : DateTime.Now;

            logger.LogAndSendMessage(null, "ProjectOnlineAccessService END",
                                     null, winServiceIterationUid, "ProjectOnlineAccessService END", false, null);
        }
Esempio n. 28
0
 /// <summary>
 /// Returns a sorted collection of all the time zones
 /// </summary>
 /// <returns>A read-only collection of System.TimeZoneInfo objects.</returns>
 public virtual ReadOnlyCollection <TimeZoneInfo> GetSystemTimeZones()
 {
     return(TimeZoneInfo.GetSystemTimeZones());
 }
Esempio n. 29
0
        public async Task Show(CommandContext ctx)
        {
            Config.Log.Info(System.Environment.StackTrace);
            var embed = new DiscordEmbedBuilder
            {
                Color = DiscordColor.Purple,
            }
            .AddField("Current Uptime", Config.Uptime.Elapsed.AsShortTimespan(), true)
            .AddField("Discord Latency", $"{ctx.Client.Ping} ms", true);

            if (!string.IsNullOrEmpty(Config.AzureComputerVisionKey))
            {
                embed.AddField("Max OCR Queue", MediaScreenshotMonitor.MaxQueueLength.ToString(), true);
            }
            embed.AddField("API Tokens", GetConfiguredApiStats(), true)
            .AddField("Memory Usage", $"GC: {GC.GetTotalMemory(false).AsStorageUnit()}\n" +
                      $"API pools: L: {ApiConfig.MemoryStreamManager.LargePoolInUseSize.AsStorageUnit()}/{(ApiConfig.MemoryStreamManager.LargePoolInUseSize + ApiConfig.MemoryStreamManager.LargePoolFreeSize).AsStorageUnit()}" +
                      $" S: {ApiConfig.MemoryStreamManager.SmallPoolInUseSize.AsStorageUnit()}/{(ApiConfig.MemoryStreamManager.SmallPoolInUseSize + ApiConfig.MemoryStreamManager.SmallPoolFreeSize).AsStorageUnit()}\n" +
                      $"Bot pools: L: {Config.MemoryStreamManager.LargePoolInUseSize.AsStorageUnit()}/{(Config.MemoryStreamManager.LargePoolInUseSize + Config.MemoryStreamManager.LargePoolFreeSize).AsStorageUnit()}" +
                      $" S: {Config.MemoryStreamManager.SmallPoolInUseSize.AsStorageUnit()}/{(Config.MemoryStreamManager.SmallPoolInUseSize + Config.MemoryStreamManager.SmallPoolFreeSize).AsStorageUnit()}", true)
            .AddField("GitHub Rate Limit", $"{GithubClient.Client.RateLimitRemaining} out of {GithubClient.Client.RateLimit} calls available\nReset in {(GithubClient.Client.RateLimitResetTime - DateTime.UtcNow).AsShortTimespan()}", true)
            .AddField(".NET Info", $"{System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}\n" +
                      $"{(System.Runtime.GCSettings.IsServerGC ? "Server" : "Workstation")} GC Mode", true)
            .AddField("Runtime Info", $"Confinement: {SandboxDetector.Detect()}\n" +
                      $"OS: {RuntimeEnvironment.OperatingSystem} {RuntimeEnvironment.OperatingSystemVersion}\n" +
                      $"CPUs: {Environment.ProcessorCount}\n" +
                      $"Time zones: {TimeParser.TimeZoneMap.Count} out of {TimeParser.TimeZoneAcronyms.Count} resolved, {TimeZoneInfo.GetSystemTimeZones().Count} total", true);
            AppendPiracyStats(embed);
            AppendCmdStats(ctx, embed);
            AppendExplainStats(embed);
            AppendGameLookupStats(embed);
            AppendSyscallsStats(embed);
            AppendPawStats(embed);
#if DEBUG
            embed.WithFooter("Test Instance");
#endif
            var ch = await ctx.GetChannelForSpamAsync().ConfigureAwait(false);

            await ch.SendMessageAsync(embed : embed).ConfigureAwait(false);
        }
Esempio n. 30
0
 /// <summary>
 /// Returns a sorted collection of all the time zones
 /// </summary>
 /// <returns>A read-only collection of System.TimeZoneInfo objects.</returns>
 public static ReadOnlyCollection <TimeZoneInfo> GetSystemTimeZones()
 {
     return(TimeZoneInfo.GetSystemTimeZones());
 }