private void InitHttpClient()
        {
            var headers = AppInfo.DevMode() ? developmentHeaders : productionHeaders;

            this.http = new HttpClient(AppInfo.ApiEntryPoint, headers);
        }
示例#2
0
        static public void Show()
        {
            Form dialog = new Form()
            {
                StartPosition   = FormStartPosition.CenterScreen,
                FormBorderStyle = FormBorderStyle.FixedSingle,
                MaximizeBox     = false,
                Width           = 390,
                Height          = 200,
                Text            = "About"
            };

            Label textLabel = new Label()
            {
                Left   = 15,
                Top    = 20,
                Width  = 370,
                Height = 100,
                Text   = "Daily Events v" + AppInfo.CurrentVersion + " is brought to you by Tiago Fernandez.\n\n" +
                         "This app has been developed entirely on my wife's \"budget\" so far, " +
                         "so please consider donating to actually buy me some extra time to keep " +
                         "working on it.\n\nThanks!"
            };

            Button feedbackButton = new Button()
            {
                Left  = 15,
                Width = 80,
                Top   = 130,
                Text  = "Feedback"
            };

            feedbackButton.Click += (object sender, EventArgs e) =>
            {
                System.Diagnostics.Process.Start(AppInfo.FeedbackUrl());
                dialog.Close();
            };

            Button websiteButton = new Button()
            {
                Left  = 105,
                Width = 80,
                Top   = 130,
                Text  = "Website"
            };

            websiteButton.Click += (object sender, EventArgs e) =>
            {
                System.Diagnostics.Process.Start(AppInfo.MarketingUrl());
                dialog.Close();
            };

            Button donateButton = new Button()
            {
                Left  = 200,
                Width = 80,
                Top   = 130,
                Text  = "Donate"
            };

            donateButton.Click += (object sender, EventArgs e) =>
            {
                System.Diagnostics.Process.Start(AppInfo.DonationUrl());
                dialog.Close();
            };

            Button closeButton = new Button()
            {
                Left  = 290,
                Width = 80,
                Top   = 130,
                Text  = "Close"
            };

            closeButton.Click += (object sender, EventArgs e) =>
            {
                dialog.Close();
            };

            dialog.Controls.Add(textLabel);
            dialog.Controls.Add(feedbackButton);
            dialog.Controls.Add(websiteButton);
            dialog.Controls.Add(donateButton);
            dialog.Controls.Add(closeButton);
            dialog.ShowDialog();
        }
 public static Dictionary <string, string> GetApiHeaders()
 {
     return(AppInfo.DevMode() ? developmentHeaders : productionHeaders);
 }
示例#4
0
        static public void Show(string group, string name)
        {
            Form dialog = new Form()
            {
                StartPosition   = FormStartPosition.CenterScreen,
                FormBorderStyle = FormBorderStyle.FixedSingle,
                MaximizeBox     = false,
                Width           = 410,
                Height          = 200,
                Text            = "Online version"
            };

            RichTextBox textBox = new RichTextBox()
            {
                Left      = 15,
                Top       = 20,
                Width     = 360,
                Height    = 100,
                ReadOnly  = true,
                BackColor = Color.LightGray,
                Text      = "You can use the following url to check this group online:\n" + AppInfo.OnlineUrl(group, name) + "\n\nOr click on the \"Online version\" button below for direct access."
            };

            Button websiteButton = new Button()
            {
                Left  = 140,
                Width = 120,
                Top   = 130,
                Text  = "Online version"
            };

            websiteButton.Click += (object sender, EventArgs e) =>
            {
                System.Diagnostics.Process.Start(AppInfo.OnlineUrl(group, name));
                dialog.Close();
            };

            Button closeButton = new Button()
            {
                Left  = 290,
                Width = 80,
                Top   = 130,
                Text  = "Close"
            };

            closeButton.Click += (object sender, EventArgs e) =>
            {
                dialog.Close();
            };

            dialog.Controls.Add(textBox);
            dialog.Controls.Add(websiteButton);
            dialog.Controls.Add(closeButton);
            dialog.ShowDialog();
        }