Ejemplo n.º 1
0
 public Semaphore(Options options)
 {
     this.options = options;
     if (options.UseSemaphore)
     {
         OpenConnection();
     }
 }
Ejemplo n.º 2
0
        public WhoWasHereForm(Options options)
        {
            InitializeComponent();
            this.options = options;
            SetLastParticipant(options);
            var autocomplete = GetAutoCompleteSource(options);

            SetupAutoComplete(Person1Input, autocomplete);
            SetupAutoComplete(Person2Input, autocomplete);
            formTitleBar1.BindHandleTo(this);
        }
Ejemplo n.º 3
0
        public MainForm(Options options)
        {
            InitializeComponent();
            this.options = options;
            this.semaphore = new Semaphore(options);
            BindHotKey();

            Stop();
            this.Left = Screen.PrimaryScreen.WorkingArea.Right - Width;
            this.Top = Screen.PrimaryScreen.WorkingArea.Top + 2 * SystemInformation.CaptionHeight;
            scheme.ApplyToMain(this);
            TitleBar.BindHandleTo(this);
        }
Ejemplo n.º 4
0
 private void ShowOptions()
 {
     hook.Dispose();
     options = ShowOptionsForm();
     options.Save();
     BindHotKey();
     SetTime();
     ResetButton.Focus();
 }
Ejemplo n.º 5
0
        private void SetOptions(Options options)
        {
            this.options = options;
            MinutesInput.Text = ((int)options.Period.TotalMinutes).ToString("00");
            SecondsInput.Text = options.Period.Seconds.ToString("00");
            ShortcutInput.Text = (ShortcutInput.Tag = options.Shortcut).ToString();
            ScriptInput.Text = options.Script;
            WorkingDirectoryInput.Text = options.WorkingDirectory;

            ParticipantsInput.Lines = options.Participants;
            KeepTrackInput.Checked = options.KeepTrack;
            CommitScript.Text = options.CommitScript;
        }
Ejemplo n.º 6
0
 public OptionsForm(Options options)
 {
     InitializeComponent();
     SetOptions(options);
     formTitleBar1.BindHandleTo(this);
 }
Ejemplo n.º 7
0
 private static AutoCompleteStringCollection GetAutoCompleteSource(Options options)
 {
     var autocomplete = new AutoCompleteStringCollection();
     autocomplete.AddRange(options.Participants);
     return autocomplete;
 }
Ejemplo n.º 8
0
 private void SetLastParticipant(Options options)
 {
     if (options.Participants.Length > 0)
         Person2Input.Text = options.Participants[options.Participants.Length - 1];
 }
Ejemplo n.º 9
0
        private void SetOptions(Options options)
        {
            this.options = options;
            MinutesInput.Text = ((int)options.Period.TotalMinutes).ToString("00");
            SecondsInput.Text = options.Period.Seconds.ToString("00");
            ShortcutInput.Text = (ShortcutInput.Tag = options.Shortcut).ToString();
            ScriptInput.Text = options.Script;
            WorkingDirectoryInput.Text = options.WorkingDirectory;

            ParticipantsInput.Lines = options.Participants;
            KeepTrackInput.Checked = options.KeepTrack;
            UseSemaphoreInput.Checked = options.UseSemaphore;
            SemaphorePortInput.Text = options.SemaphorePort;
            SemaphoreGreenSignalInput.Text = options.GreenSignalChar.ToString();
            SemaphoreRedSignalInput.Text = options.RedSignalChar.ToString();
            SemaphoreBaudRateInput.Text = options.SemaphoreBaudRate.ToString();
            CommitScript.Text = options.CommitScript;
            AlarmSoundInput.Checked = options.PlayAlarmSound;
            TestResultSound.Checked = options.PlayTestResultSound;
        }
Ejemplo n.º 10
0
        public string contentPostTemplateToPublish(string local, string subject, string source, string resume, string dojoFacts, Options options)
        {
            StringBuilder postDojoResume = new StringBuilder();

                Title = local + " " + DateTime.Now;

                PostType = "post";

                postDojoResume.Append("<p>Boa noite, pessoas. O dojo de hoje terminou agora :D.</p>");

                if (subject.Length > 0)
                {
                    postDojoResume.Append("<p>");
                    postDojoResume.Append("O tema do dojo de hoje foi: ");
                    postDojoResume.Append(subject);
                    postDojoResume.Append(". ");
                    postDojoResume.Append("</p>");
                }
                if (source.Length > 0)
                {
                    postDojoResume.Append("<p>");
                    postDojoResume.Append("O problema de hoje pode ser encontrado no/em:  ");
                    postDojoResume.Append(source);
                    postDojoResume.Append(". ");
                    postDojoResume.Append("</p>");
                }
                if (resume.Length > 0)
                {
                    postDojoResume.Append("<p>");
                    postDojoResume.Append(resume);
                    postDojoResume.Append(". ");
                    postDojoResume.Append("</p>");
                }

                List<string> participants = options.GetNameParticipantsDay(DateTime.Today);

                if (participants.Count > 0)
                {
                    postDojoResume.Append("Os participantes de hoje foram:");

                    postDojoResume.Append("<p><lu>");

                    foreach (string participant in participants)
                    {
                        postDojoResume.Append("<li>" + participant);
                    }

                    postDojoResume.Append("</lu>");

                    postDojoResume.Append("</lu></p>");
                }

                if (dojoFacts.Length > 0)
                {
                    postDojoResume.Append("<p>");
                    postDojoResume.Append("E como facts, tivemos: ");
                    postDojoResume.Append(dojoFacts);
                    postDojoResume.Append(". ");
                    postDojoResume.Append("</p>");
                }

                Description = postDojoResume.ToString();

                return Description;
        }