예제 #1
0
    protected void Refresh_click(object sender, EventArgs e)
    {
        if (RadioButtonList1.SelectedIndex == 0)
        {
            format = FooterFormat.LongDate;
        }
        else if (RadioButtonList1.SelectedIndex == 1)
        {
            format = FooterFormat.ShortTime;
        }

        lblFooter.Text = "This page was served at ";
        if (format == FooterFormat.LongDate)
        {
            lblFooter.Text += DateTime.Now.ToLongDateString();
        }
        else if (format == FooterFormat.ShortTime)
        {
            lblFooter.Text += DateTime.Now.ToShortTimeString();
        }
    }
예제 #2
0
        protected override void OnLoadSettings(ISettingsNode settings)
        {
            base.OnLoadSettings(settings);

            this.LogId = settings.GetValue(nameof(this.LogId), this.LogId);

            string value = settings.GetValue(nameof(this.RefreshInterval), this.RefreshInterval.ToString());

            if (TimeSpan.TryParse(value, out TimeSpan interval))
            {
                this.RefreshInterval = interval;
            }

            this.UseDefaultHeader = settings.GetValue(nameof(this.UseDefaultHeader), this.UseDefaultHeader);
            this.Header           = settings.GetValue(nameof(this.Header), this.Header);
            this.StatsFormat      = settings.GetValue(nameof(this.StatsFormat), this.StatsFormat);
            this.FooterFormat     = settings.GetValue(nameof(this.FooterFormat), this.FooterFormat);

            this.timer.IsEnabled = true;

            this.Dispatcher.InvokeAsync(this.UpdateDisplay, DispatcherPriority.ApplicationIdle);
        }