Beispiel #1
0
        static void Main()
        {
            TrayAppContext appContext = new TrayAppContext();

            // Retrieve CircleToken on startup
            if (Properties.Settings.Default.CircleToken == "")
            {
                SetAPITokenForm form = new SetAPITokenForm(appContext);
                if (form.ShowDialog() != DialogResult.OK)
                {
                    appContext.Dispose(); return;
                }
            }

            // Set required user parameters on startup
            if (Properties.Settings.Default.Username == "" ||
                Properties.Settings.Default.ProjectName == "" ||
                Properties.Settings.Default.VCSType == "")
            {
                SetProjectDetailsForm form = new SetProjectDetailsForm(appContext, true);
                if (form.ShowDialog() != DialogResult.OK)
                {
                    appContext.Dispose(); return;
                }
            }

            // Populate tray icon if we have everything we need to do so.
            appContext.RefreshBuilds();
            appContext.RestartTimer();

            Application.Run(appContext);
        }
Beispiel #2
0
 public Requests(TrayAppContext appContext)
 {
     this.appContext = appContext;
     username        = Properties.Settings.Default.Username;
     vcsType         = Properties.Settings.Default.VCSType;
     projectName     = Properties.Settings.Default.ProjectName;
 }
Beispiel #3
0
        // Initializes and displays the NotifyIcon.
        public static void InitNotifyIcon(TrayAppContext appContext, Container components)
        {
            ContextMenuStrip strip = new CircleContextMenuStrip(appContext);

            notifyIcon = new NotifyIcon(components)
            {
                ContextMenuStrip = strip,
                Icon             = Properties.Resources.favicon_icon,
                Text             = DEFAULT_TOOLTIP_TEXT,
                Visible          = true
            };
        }
Beispiel #4
0
        public CircleContextMenuStrip(TrayAppContext appContext)
        {
            this.appContext = appContext;

            //MatchNumBuilds(appContext.NumBuilds, Properties.Settings.)

            Items.Add(toolStripSeparator);

            Items.Add("Refresh", null, new EventHandler(Refresh_OnClick));
            Items.Add("Set Circle API Token", null, SetAPIToken_OnClick);

            Items.Add(CreateNumBuildsDropDownMenu());

            Items.Add("Set Polling Interval", null, SetPollingInterval_OnClick);
            Items.Add("Set Project Details", null, SetProjectDetails_OnClick);
            Items.Add("Exit", null, new EventHandler(Exit_OnClick));

            ShowCheckMargin = false;
            ShowImageMargin = false;
        }
Beispiel #5
0
 public NotifyIconManager(TrayAppContext appContext)
 {
     this.appContext = appContext;
 }