コード例 #1
0
        private void laborNameLabel_Click(object sender, EventArgs e)
        {
            var dialog = new TextInputForm {
                initialValue = laborNameLabel.Text, Text = "Choose new name"
            };

            if (dialog.ShowDialog(out string newName) == DialogResult.OK)
            {
                inner.name = newName;
                sync();
                informOfChange(LaborChange.NameChanged);
            }
        }
コード例 #2
0
        private void ProfileNameLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var dialog = new TextInputForm {
                initialValue = ProfileNameLinkLabel.Text, Text = "Choose new name"
            };

            if (dialog.ShowDialog(out string newName) == DialogResult.OK)
            {
                profile.name = newName;
                ProfileNameLinkLabel.Text = profile.name;
            }
            resetSaveTimer();
        }
コード例 #3
0
 private void linkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if ((e.Button & MouseButtons.Right) != 0)
     {
         var dialog = new TextInputForm {
             initialValue = inner.link, Text = "Choose new link"
         };
         if (dialog.ShowDialog(out string newLink) == DialogResult.OK)
         {
             inner.link = newLink;
             sync();
             informOfChange(LaborChange.LinkChanged);
         }
     }
     else
     {
         if (inner.link == null)
         {
             return;
         }
         System.Diagnostics.Process.Start(inner.link);
     }
 }