Exemplo n.º 1
0
        private async void tsAttachCharacter_Click(object sender, EventArgs e)
        {
            // Prompt the user to select a save file to associate with this Contact.
            using (OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter = await LanguageManager.GetStringAsync("DialogFilter_Chum5") + '|' + await LanguageManager.GetStringAsync("DialogFilter_All")
            })
            {
                if (!string.IsNullOrEmpty(_objContact.FileName) && File.Exists(_objContact.FileName))
                {
                    openFileDialog.InitialDirectory = Path.GetDirectoryName(_objContact.FileName);
                    openFileDialog.FileName         = Path.GetFileName(_objContact.FileName);
                }

                if (openFileDialog.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }
                using (CursorWait.New(ParentForm))
                {
                    _objContact.FileName = openFileDialog.FileName;
                    cmdLink.ToolTipText  = await LanguageManager.GetStringAsync("Tip_Contact_OpenFile");

                    // Set the relative path.
                    Uri uriApplication = new Uri(Utils.GetStartupPath);
                    Uri uriFile        = new Uri(_objContact.FileName);
                    Uri uriRelative    = uriApplication.MakeRelativeUri(uriFile);
                    _objContact.RelativeFileName = "../" + uriRelative;

                    ContactDetailChanged?.Invoke(this, new TextEventArgs("File"));
                }
            }
        }
Exemplo n.º 2
0
 private void chkFamily_CheckedChanged(object sender, EventArgs e)
 {
     if (!_blnLoading && _blnStatBlockIsLoaded)
     {
         ContactDetailChanged?.Invoke(this, new TextEventArgs("Family"));
     }
 }
Exemplo n.º 3
0
        private void imgNotes_Click(object sender, EventArgs e)
        {
            using (frmNotes frmContactNotes = new frmNotes
            {
                Notes = _objContact.Notes
            })
            {
                frmContactNotes.ShowDialog(this);

                if (frmContactNotes.DialogResult != DialogResult.OK || _objContact.Notes == frmContactNotes.Notes)
                {
                    return;
                }
                _objContact.Notes = frmContactNotes.Notes;
            }

            string strTooltip = LanguageManager.GetString(_objContact.EntityType == ContactType.Enemy ? "Tip_Enemy_EditNotes" : "Tip_Contact_EditNotes");

            if (!string.IsNullOrEmpty(_objContact.Notes))
            {
                strTooltip += Environment.NewLine + Environment.NewLine + _objContact.Notes;
            }
            imgNotes.SetToolTip(strTooltip.WordWrap(100));
            ContactDetailChanged?.Invoke(this, new TextEventArgs("Notes"));
        }
Exemplo n.º 4
0
 private void cboPreferredPayment_TextChanged(object sender, EventArgs e)
 {
     if (!_blnLoading)
     {
         ContactDetailChanged?.Invoke(this, new TextEventArgs("PreferredPayment"));
     }
 }
Exemplo n.º 5
0
 private void cboHobbiesVice_TextChanged(object sender, EventArgs e)
 {
     if (!_blnLoading)
     {
         ContactDetailChanged?.Invoke(this, new TextEventArgs("HobbiesVice"));
     }
 }
Exemplo n.º 6
0
        private void tsAttachCharacter_Click(object sender, EventArgs e)
        {
            // Prompt the user to select a save file to associate with this Contact.
            using (OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter = LanguageManager.GetString("DialogFilter_Chum5") + '|' + LanguageManager.GetString("DialogFilter_All")
            })
            {
                if (!string.IsNullOrEmpty(_objContact.FileName) && File.Exists(_objContact.FileName))
                {
                    openFileDialog.InitialDirectory = Path.GetDirectoryName(_objContact.FileName);
                    openFileDialog.FileName         = Path.GetFileName(_objContact.FileName);
                }

                if (openFileDialog.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }
                _objContact.FileName = openFileDialog.FileName;
                imgLink.SetToolTip(_objContact.EntityType == ContactType.Enemy
                    ? LanguageManager.GetString("Tip_Enemy_OpenFile")
                    : LanguageManager.GetString("Tip_Contact_OpenFile"));
            }

            // Set the relative path.
            Uri uriApplication = new Uri(Utils.GetStartupPath);
            Uri uriFile        = new Uri(_objContact.FileName);
            Uri uriRelative    = uriApplication.MakeRelativeUri(uriFile);

            _objContact.RelativeFileName = "../" + uriRelative;

            ContactDetailChanged?.Invoke(this, new TextEventArgs("File"));
        }
Exemplo n.º 7
0
 private void cboPersonalLife_TextChanged(object sender, EventArgs e)
 {
     if (!_blnLoading)
     {
         ContactDetailChanged?.Invoke(this, new TextEventArgs("PersonalLife"));
     }
 }
Exemplo n.º 8
0
 private void cboType_TextChanged(object sender, EventArgs e)
 {
     if (!_blnLoading && _blnStatBlockIsLoaded)
     {
         ContactDetailChanged?.Invoke(this, new TextEventArgs("Type"));
     }
 }
Exemplo n.º 9
0
        private void tsAttachCharacter_Click(object sender, EventArgs e)
        {
            // Prompt the user to select a save file to associate with this Contact.
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter = LanguageManager.GetString("DialogFilter_Chum5", GlobalOptions.Language) + '|' + LanguageManager.GetString("DialogFilter_All", GlobalOptions.Language)
            };

            if (!string.IsNullOrEmpty(_objContact.FileName) && File.Exists(_objContact.FileName))
            {
                openFileDialog.InitialDirectory = Path.GetDirectoryName(_objContact.FileName);
                openFileDialog.FileName         = Path.GetFileName(_objContact.FileName);
            }
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                Cursor = Cursors.WaitCursor;
                _objContact.FileName = openFileDialog.FileName;
                tipTooltip.SetToolTip(imgLink, LanguageManager.GetString("Tip_Contact_OpenFile", GlobalOptions.Language));

                // Set the relative path.
                Uri uriApplication = new Uri(@Application.StartupPath);
                Uri uriFile        = new Uri(@_objContact.FileName);
                Uri uriRelative    = uriApplication.MakeRelativeUri(uriFile);
                _objContact.RelativeFileName = "../" + uriRelative.ToString();

                ContactDetailChanged?.Invoke(this, new TextEventArgs("File"));
                Cursor = Cursors.Default;
            }
        }
Exemplo n.º 10
0
        private void imgNotes_Click(object sender, EventArgs e)
        {
            string strOldValue = _objSpirit.Notes;

            using (frmNotes frmSpritNotes = new frmNotes {
                Notes = strOldValue
            })
            {
                frmSpritNotes.ShowDialog(this);
                if (frmSpritNotes.DialogResult != DialogResult.OK)
                {
                    return;
                }
                frmSpritNotes.ShowDialog(this);

                _objSpirit.Notes = frmSpritNotes.Notes;
                if (strOldValue == _objSpirit.Notes)
                {
                    return;
                }
            }

            string strTooltip = LanguageManager.GetString(_objSpirit.EntityType == SpiritType.Spirit ? "Tip_Spirit_EditNotes" : "Tip_Sprite_EditNotes");

            if (!string.IsNullOrEmpty(_objSpirit.Notes))
            {
                strTooltip += Environment.NewLine + Environment.NewLine + _objSpirit.Notes;
            }
            imgNotes.SetToolTip(strTooltip.WordWrap());

            ContactDetailChanged?.Invoke(this, e);
        }
Exemplo n.º 11
0
        private void tsRemoveCharacter_Click(object sender, EventArgs e)
        {
            // Remove the file association from the Contact.
            if (MessageBox.Show(LanguageManager.GetString("Message_RemoveCharacterAssociation", GlobalOptions.Language), LanguageManager.GetString("MessageTitle_RemoveCharacterAssociation", GlobalOptions.Language), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                _objSpirit.FileName         = string.Empty;
                _objSpirit.RelativeFileName = string.Empty;
                if (_objSpirit.EntityType == SpiritType.Spirit)
                {
                    tipTooltip.SetToolTip(imgLink, LanguageManager.GetString("Tip_Spirit_LinkSpirit", GlobalOptions.Language));
                }
                else
                {
                    tipTooltip.SetToolTip(imgLink, LanguageManager.GetString("Tip_Sprite_LinkSprite", GlobalOptions.Language));
                }

                // Set the relative path.
                Uri uriApplication = new Uri(@Application.StartupPath);
                Uri uriFile        = new Uri(@_objSpirit.FileName);
                Uri uriRelative    = uriApplication.MakeRelativeUri(uriFile);
                _objSpirit.RelativeFileName = "../" + uriRelative.ToString();

                ContactDetailChanged?.Invoke(this, e);
            }
        }
Exemplo n.º 12
0
        private void tsAttachCharacter_Click(object sender, EventArgs e)
        {
            // Prompt the user to select a save file to associate with this Contact.
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter = "Chummer5 Files (*.chum5)|*.chum5|All Files (*.*)|*.*"
            };

            if (!string.IsNullOrEmpty(_objSpirit.FileName) && File.Exists(_objSpirit.FileName))
            {
                openFileDialog.InitialDirectory = Path.GetDirectoryName(_objSpirit.FileName);
                openFileDialog.FileName         = Path.GetFileName(_objSpirit.FileName);
            }
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                _objSpirit.FileName = openFileDialog.FileName;
                if (_objSpirit.EntityType == SpiritType.Spirit)
                {
                    tipTooltip.SetToolTip(imgLink, LanguageManager.GetString("Tip_Spirit_OpenFile", GlobalOptions.Language));
                }
                else
                {
                    tipTooltip.SetToolTip(imgLink, LanguageManager.GetString("Tip_Sprite_OpenFile", GlobalOptions.Language));
                }
                ContactDetailChanged?.Invoke(this, e);
            }
        }
Exemplo n.º 13
0
 private void txtCritterName_TextChanged(object sender, EventArgs e)
 {
     if (!_blnLoading)
     {
         ContactDetailChanged?.Invoke(this, e);
     }
 }
Exemplo n.º 14
0
 private void cboSpiritName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!_blnLoading)
     {
         ContactDetailChanged?.Invoke(this, e);
     }
 }
Exemplo n.º 15
0
 private void chkGroup_CheckedChanged(object sender, EventArgs e)
 {
     if (!_blnLoading)
     {
         ContactDetailChanged?.Invoke(this, new TextEventArgs("Group"));
     }
 }
Exemplo n.º 16
0
 private void txtContactName_TextChanged(object sender, EventArgs e)
 {
     if (!_blnLoading)
     {
         ContactDetailChanged?.Invoke(this, new TextEventArgs("Name"));
     }
 }
 private void nudConnection_ValueChanged(object sender, EventArgs e)
 {
     // Raise the ContactDetailChanged Event when the NumericUpDown's Value changes.
     if (!_blnLoading)
     {
         ContactDetailChanged?.Invoke(this, new TextEventArgs("Connection"));
     }
 }
Exemplo n.º 18
0
 private void txtContactLocation_TextChanged(object sender, EventArgs e)
 {
     if (_blnLoading)
     {
         return;
     }
     ContactDetailChanged?.Invoke(this, new TextEventArgs("Location"));
 }
Exemplo n.º 19
0
 private void cboContactRole_TextChanged(object sender, EventArgs e)
 {
     if (_blnLoading)
     {
         return;
     }
     ContactDetailChanged?.Invoke(this, new TextEventArgs("Role"));
 }
 private void nudLoyalty_ValueChanged(object sender, EventArgs e)
 {
     // Raise the ContactDetailChanged Event when the NumericUpDown's Value changes.
     // The entire ContactControl is passed as an argument so the handling event can evaluate its contents.
     if (!_blnLoading)
     {
         ContactDetailChanged?.Invoke(this, new TextEventArgs("Loyalty"));
     }
 }
Exemplo n.º 21
0
 private void chkBound_CheckedChanged(object sender, EventArgs e)
 {
     // Raise the ContactDetailChanged Event when the Checkbox's Checked status changes.
     // The entire SpiritControl is passed as an argument so the handling event can evaluate its contents.
     if (!_blnLoading)
     {
         ContactDetailChanged?.Invoke(this, e);
     }
 }
Exemplo n.º 22
0
 private void tsRemoveCharacter_Click(object sender, EventArgs e)
 {
     // Remove the file association from the Contact.
     if (Program.MainForm.ShowMessageBox(LanguageManager.GetString("Message_RemoveCharacterAssociation"), LanguageManager.GetString("MessageTitle_RemoveCharacterAssociation"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         _objContact.FileName         = string.Empty;
         _objContact.RelativeFileName = string.Empty;
         imgLink.SetToolTip(LanguageManager.GetString("Tip_Contact_LinkFile"));
         ContactDetailChanged?.Invoke(this, new TextEventArgs("File"));
     }
 }
Exemplo n.º 23
0
 private void tsRemoveCharacter_Click(object sender, EventArgs e)
 {
     // Remove the file association from the Contact.
     if (MessageBox.Show(LanguageManager.GetString("Message_RemoveCharacterAssociation", GlobalOptions.Language), LanguageManager.GetString("MessageTitle_RemoveCharacterAssociation", GlobalOptions.Language), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         _objContact.FileName         = string.Empty;
         _objContact.RelativeFileName = string.Empty;
         imgLink.SetToolTip(_objContact.EntityType == ContactType.Enemy
                 ? LanguageManager.GetString("Tip_Enemy_LinkFile", GlobalOptions.Language)
                 : LanguageManager.GetString("Tip_Contact_LinkFile", GlobalOptions.Language));
         ContactDetailChanged?.Invoke(this, new TextEventArgs("File"));
     }
 }
Exemplo n.º 24
0
 private void UpdateGender(object sender, EventArgs e)
 {
     if (_blnLoading || !_blnStatBlockIsLoaded || _objContact.DisplayGender == cboGender.Text)
     {
         return;
     }
     _objContact.DisplayGender = cboGender.Text;
     if (_objContact.DisplayGender != cboGender.Text)
     {
         _blnLoading    = true;
         cboGender.Text = _objContact.DisplayGender;
         _blnLoading    = false;
     }
     ContactDetailChanged?.Invoke(this, new TextEventArgs("Gender"));
 }
Exemplo n.º 25
0
 private void UpdateMetatype(object sender, EventArgs e)
 {
     if (_blnLoading || _objContact.DisplayMetatype == cboMetatype.Text)
     {
         return;
     }
     _objContact.DisplayMetatype = cboMetatype.Text;
     if (_objContact.DisplayMetatype != cboMetatype.Text)
     {
         _blnLoading      = true;
         cboMetatype.Text = _objContact.DisplayMetatype;
         _blnLoading      = false;
     }
     ContactDetailChanged?.Invoke(this, new TextEventArgs("Metatype"));
 }
Exemplo n.º 26
0
 private void UpdatePersonalLife(object sender, EventArgs e)
 {
     if (_blnLoading || !_blnStatBlockIsLoaded || _objContact.DisplayPersonalLife == cboPersonalLife.Text)
     {
         return;
     }
     _objContact.DisplayPersonalLife = cboPersonalLife.Text;
     if (_objContact.DisplayPersonalLife != cboPersonalLife.Text)
     {
         _blnLoading          = true;
         cboPersonalLife.Text = _objContact.DisplayPersonalLife;
         _blnLoading          = false;
     }
     ContactDetailChanged?.Invoke(this, new TextEventArgs("PersonalLife"));
 }
Exemplo n.º 27
0
 private void UpdatePreferredPayment(object sender, EventArgs e)
 {
     if (_blnLoading || !_blnStatBlockIsLoaded || _objContact.DisplayPreferredPayment == cboPreferredPayment.Text)
     {
         return;
     }
     _objContact.DisplayPreferredPayment = cboPreferredPayment.Text;
     if (_objContact.DisplayPreferredPayment != cboPreferredPayment.Text)
     {
         _blnLoading = true;
         cboPreferredPayment.Text = _objContact.DisplayPreferredPayment;
         _blnLoading = false;
     }
     ContactDetailChanged?.Invoke(this, new TextEventArgs("PreferredPayment"));
 }
Exemplo n.º 28
0
 private void UpdateHobbiesVice(object sender, EventArgs e)
 {
     if (_blnLoading || !_blnStatBlockIsLoaded || _objContact.DisplayHobbiesVice == cboHobbiesVice.Text)
     {
         return;
     }
     _objContact.DisplayHobbiesVice = cboHobbiesVice.Text;
     if (_objContact.DisplayHobbiesVice != cboHobbiesVice.Text)
     {
         _blnLoading         = true;
         cboHobbiesVice.Text = _objContact.DisplayHobbiesVice;
         _blnLoading         = false;
     }
     ContactDetailChanged?.Invoke(this, new TextEventArgs("HobbiesVice"));
 }
Exemplo n.º 29
0
        private void tsRemoveCharacter_Click(object sender, EventArgs e)
        {
            // Remove the file association from the Contact.
            if (Program.MainForm.ShowMessageBox(LanguageManager.GetString("Message_RemoveCharacterAssociation"), LanguageManager.GetString("MessageTitle_RemoveCharacterAssociation"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                _objSpirit.FileName         = string.Empty;
                _objSpirit.RelativeFileName = string.Empty;
                imgLink.SetToolTip(LanguageManager.GetString(_objSpirit.EntityType == SpiritType.Spirit ? "Tip_Spirit_LinkSpirit" : "Tip_Sprite_LinkSprite"));

                // Set the relative path.
                Uri uriApplication = new Uri(Utils.GetStartupPath);
                Uri uriFile        = new Uri(_objSpirit.FileName);
                Uri uriRelative    = uriApplication.MakeRelativeUri(uriFile);
                _objSpirit.RelativeFileName = "../" + uriRelative;

                ContactDetailChanged?.Invoke(this, e);
            }
        }
Exemplo n.º 30
0
        private void tsAttachCharacter_Click(object sender, EventArgs e)
        {
            // Prompt the user to select a save file to associate with this Contact.
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter = LanguageManager.GetString("DialogFilter_Chum5", GlobalOptions.Language) + '|' + LanguageManager.GetString("DialogFilter_All", GlobalOptions.Language)
            };

            if (!string.IsNullOrEmpty(_objSpirit.FileName) && File.Exists(_objSpirit.FileName))
            {
                openFileDialog.InitialDirectory = Path.GetDirectoryName(_objSpirit.FileName);
                openFileDialog.FileName         = Path.GetFileName(_objSpirit.FileName);
            }
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                _objSpirit.FileName = openFileDialog.FileName;
                GlobalOptions.ToolTipProcessor.SetToolTip(imgLink, LanguageManager.GetString(_objSpirit.EntityType == SpiritType.Spirit ? "Tip_Spirit_OpenFile" : "Tip_Sprite_OpenFile", GlobalOptions.Language));
                ContactDetailChanged?.Invoke(this, e);
            }
        }