• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Chummer.Contact类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Chummer.Contact的典型用法代码示例。如果您正苦于以下问题:C# Contact类的具体用法?C# Contact怎么用?C# Contact使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Contact类属于Chummer命名空间,在下文中一共展示了Contact类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: cmdAddPet_Click

        private void cmdAddPet_Click(object sender, EventArgs e)
        {
            Contact objContact = new Contact(_objCharacter);
            objContact.EntityType = ContactType.Pet;
            _objCharacter.Contacts.Add(objContact);

            PetControl objContactControl = new PetControl();
            objContactControl.ContactObject = objContact;

            // Attach an EventHandler for the DeleteContact and FileNameChanged Events.
            objContactControl.DeleteContact += objPet_DeleteContact;
            objContactControl.FileNameChanged += objPet_FileNameChanged;

            // Add the control to the Panel.
            panPets.Controls.Add(objContactControl);
            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:20,代码来源:frmCreate.cs


示例2: cmdAddContact_Click

        private void cmdAddContact_Click(object sender, EventArgs e)
        {
            Contact objContact = new Contact(_objCharacter);
            _objCharacter.Contacts.Add(objContact);

            int i = panContacts.Controls.Count;
            ContactControl objContactControl = new ContactControl(_objCharacter);
            objContactControl.ContactObject = objContact;
            objContactControl.EntityType = ContactType.Contact;

            // Attach an EventHandler for the ConnectionRatingChanged, LoyaltyRatingChanged, DeleteContact, FileNameChanged Events and OtherCostChangedEvent
            objContactControl.ConnectionRatingChanged += objContact_ConnectionRatingChanged;
            objContactControl.LoyaltyRatingChanged += objContact_LoyaltyRatingChanged;
            objContactControl.DeleteContact += objContact_DeleteContact;
            objContactControl.FileNameChanged += objContact_FileNameChanged;
            objContactControl.FreeRatingChanged += objContact_OtherCostChanged;
			objContactControl.MouseDown += panContactControl_MouseDown;

			panContacts.Controls.Add(objContactControl);
            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:24,代码来源:frmCreate.cs


示例3: cmdAddEnemy_Click

        private void cmdAddEnemy_Click(object sender, EventArgs e)
        {
            // Handle the ConnectionRatingChanged Event for the ContactControl object.
            int intNegativeQualityBP = 0;
            // Calculate the BP used for Negative Qualities.
            foreach (Quality objQuality in _objCharacter.Qualities)
            {
                if (objQuality.Type == QualityType.Negative && objQuality.ContributeToLimit)
                    intNegativeQualityBP += objQuality.BP;
            }
            // Include the amount of free Negative Qualities from Improvements.
            intNegativeQualityBP -= _objImprovementManager.ValueOf(Improvement.ImprovementType.FreeNegativeQualities);

            // Adjust for Karma build method.
            if (_objCharacter.BuildMethod == CharacterBuildMethod.Karma)
                intNegativeQualityBP *= _objOptions.KarmaQuality;

            int intBPUsed = 0;
            int intEnemyMax = 0;
            int intQualityMax = 0;
            string strEnemyPoints = "";
            string strQualityPoints = "";
            intBPUsed = -2 * _objOptions.KarmaQuality;
            intEnemyMax = 50;
            intQualityMax = 70;
            strEnemyPoints = "50 " + LanguageManager.Instance.GetString("String_Karma");
            strQualityPoints = "70 " + LanguageManager.Instance.GetString("String_Karma");

            foreach (ContactControl objEnemyControl in panEnemies.Controls)
            {
                intBPUsed -= (objEnemyControl.ConnectionRating + objEnemyControl.LoyaltyRating) * _objOptions.KarmaEnemy;
            }

            if (intBPUsed < (intEnemyMax * -1) && !_objCharacter.IgnoreRules)
            {
                MessageBox.Show(LanguageManager.Instance.GetString("Message_EnemyLimit").Replace("{0}", strEnemyPoints), LanguageManager.Instance.GetString("MessageTitle_EnemyLimit"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (!_objOptions.ExceedNegativeQualities)
            {
                if (intBPUsed + intNegativeQualityBP < (intQualityMax * -1) && !_objCharacter.IgnoreRules)
                {
                    MessageBox.Show(LanguageManager.Instance.GetString("Message_NegativeQualityLimit").Replace("{0}", strQualityPoints), LanguageManager.Instance.GetString("MessageTitle_NegativeQualityLimit"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }

            Contact objContact = new Contact(_objCharacter);
            _objCharacter.Contacts.Add(objContact);

            int i = panEnemies.Controls.Count;
            ContactControl objContactControl = new ContactControl(_objCharacter);
            objContactControl.ContactObject = objContact;
            objContactControl.EntityType = ContactType.Enemy;

            // Attach an EventHandler for the ConnectioNRatingChanged, LoyaltyRatingChanged, DeleteContact, FileNameChanged and OtherCostChanged(hackish) Events
            objContactControl.ConnectionRatingChanged += objEnemy_ConnectionRatingChanged;
            objContactControl.LoyaltyRatingChanged += objEnemy_LoyaltyRatingChanged;
            objContactControl.DeleteContact += objEnemy_DeleteContact;
            objContactControl.FileNameChanged += objEnemy_FileNameChanged;
            objContactControl.GroupStatusChanged += objEnemy_GroupStatusChanged;
            objContactControl.FreeRatingChanged += objEnemy_FreeStatusChanged;
            objContactControl.IsEnemy = true;

            // Set the ContactControl's Location since scrolling the Panel causes it to actually change the child Controls' Locations.
            objContactControl.Location = new Point(0, objContactControl.Height * i + panEnemies.AutoScrollPosition.Y);
            panEnemies.Controls.Add(objContactControl);

            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:74,代码来源:frmCreate.cs


示例4: Load


//.........这里部分代码省略.........
            {
            }
            try
            {
                _strPlayerName = objXmlCharacter["playername"].InnerText;
            }
            catch
            {
            }
            try
            {
                _strGameNotes = objXmlCharacter["gamenotes"].InnerText;
            }
            catch
            {
            }

            try
            {
                _strGameplayOption = objXmlCharacter["gameplayoption"].InnerText;
            }
            catch
            {
            }
            try
            {
                _intMaxNuyen = Convert.ToInt32(objXmlCharacter["maxnuyen"].InnerText);
            }
            catch
            {
            }
            try
            {
                _intContactMultiplier = Convert.ToInt32(objXmlCharacter["contactmultiplier"].InnerText);
            }
            catch
            {
            }
            try
            {
                _intMaxKarma = Convert.ToInt32(objXmlCharacter["maxkarma"].InnerText);
            }
            catch
            {
            }
            try
            {
                _strPriorityMetatype = objXmlCharacter["prioritymetatype"].InnerText;
            }
            catch
            {
            }
            try
            {
                _strPriorityAttributes = objXmlCharacter["priorityattributes"].InnerText;
            }
            catch
            {
            }
            try
            {
                _strPrioritySpecial = objXmlCharacter["priorityspecial"].InnerText;
            }
            catch
            {
            }
开发者ID:ercflemng,项目名称:chummer5a,代码行数:67,代码来源:clsCharacter.cs


示例5: ProcessBonus


//.........这里部分代码省略.........
                // Make sure the dialogue window was not canceled.
                if (frmPickSpell.DialogResult == DialogResult.Cancel)
                {
                    Rollback();
                    _strForcedValue = "";
                    _strLimitSelection = "";
                    return false;
                }

                _strSelectedValue = frmPickSpell.SelectedSpell;
                if (blnConcatSelectedValue)
                    strSourceName += " (" + _strSelectedValue + ")";

                Log.Info("_strSelectedValue = " + _strSelectedValue);
                Log.Info("strSourceName = " + strSourceName);

                Log.Info("Calling CreateImprovement");
                CreateImprovement(frmPickSpell.SelectedSpell, objImprovementSource, strSourceName, Improvement.ImprovementType.Text,
                    strUnique);
            }

            // Select a Contact
            if (bonusNode.LocalName == ("selectcontact"))
            {
                Log.Info("selectcontact");
                XmlNode nodSelect = bonusNode;

                frmSelectItem frmSelect = new frmSelectItem();

                String strMode = NodeExists(nodSelect, "type")
                    ? nodSelect["type"].InnerText
                    : "all";

                List<Contact> selectedContactsList;
                if (strMode == "all")
                {
                    selectedContactsList = new List<Contact>(_objCharacter.Contacts);
                }
                else if (strMode == "group" || strMode == "nongroup")
                {
                    bool blnGroup = strMode == "group";

                    //Select any contact where IsGroup equals blnGroup
                    //and add to a list
                    selectedContactsList =
                        new List<Contact>(from contact in _objCharacter.Contacts
                            where contact.IsGroup == blnGroup
                            select contact);
                }
                else
                {
                    Rollback();
                    return false;
                }

                if (selectedContactsList.Count == 0)
                {
                    MessageBox.Show(LanguageManager.Instance.GetString("Message_NoContactFound"),
                        LanguageManager.Instance.GetString("MessageTitle_NoContactFound"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Rollback();
                    return false;
                }

                int count = 0;
                //Black magic LINQ to cast content of list to another type
                List<ListItem> contacts = new List<ListItem>(from x in selectedContactsList
开发者ID:Rockzo,项目名称:chummer5a,代码行数:67,代码来源:clsImprovement.cs


示例6: cmdAddContact_Click

        private void cmdAddContact_Click(object sender, EventArgs e)
        {
            Contact objContact = new Contact(_objCharacter);
            _objCharacter.Contacts.Add(objContact);

            int i = panContacts.Controls.Count;
            ContactControl objContactControl = new ContactControl();
            objContactControl.ContactObject = objContact;
            objContactControl.EntityType = ContactType.Contact;

            // Attach an EventHandler for the ConnectionRatingChanged, LoyaltyRatingChanged, DeleteContact, and FileNameChanged Events.
            objContactControl.ConnectionRatingChanged += objContact_ConnectionRatingChanged;
            objContactControl.ConnectionGroupRatingChanged += objContact_ConnectionGroupRatingChanged;
            objContactControl.LoyaltyRatingChanged += objContact_LoyaltyRatingChanged;
            objContactControl.DeleteContact += objContact_DeleteContact;
            objContactControl.FileNameChanged += objContact_FileNameChanged;

            // Set the ContactControl's Location since scrolling the Panel causes it to actually change the child Controls' Locations.
            objContactControl.Location = new Point(0, objContactControl.Height * i + panContacts.AutoScrollPosition.Y);
            panContacts.Controls.Add(objContactControl);
            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
开发者ID:janhelke,项目名称:chummer2,代码行数:25,代码来源:frmCreate.cs


示例7: cmdAddEnemy_Click

        private void cmdAddEnemy_Click(object sender, EventArgs e)
        {
            // Handle the ConnectionRatingChanged Event for the ContactControl object.
            Contact objContact = new Contact(_objCharacter);
            _objCharacter.Contacts.Add(objContact);

            int i = panEnemies.Controls.Count;
            ContactControl objContactControl = new ContactControl(_objCharacter);
            objContactControl.ContactObject = objContact;
            objContactControl.EntityType = ContactType.Enemy;

            // Attach an EventHandler for the ConnectioNRatingChanged, LoyaltyRatingChanged, DeleteContact, and FileNameChanged Events.
            objContactControl.ConnectionRatingChanged += objEnemy_ConnectionRatingChanged;
            objContactControl.LoyaltyRatingChanged += objEnemy_LoyaltyRatingChanged;
            objContactControl.DeleteContact += objEnemy_DeleteContact;
            objContactControl.FileNameChanged += objEnemy_FileNameChanged;
            objContactControl.IsEnemy = true;

            panEnemies.Controls.Add(objContactControl);
            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:24,代码来源:frmCareer.cs


示例8: Load


//.........这里部分代码省略.........
                if (objXmlSkill != null)
                {
                    objGroup.Load(objXmlSkill);
                    // If the character is set to ignore rules or is in Career Mode, Skill Groups should have a maximum Rating of 6 unless they have been given a higher maximum Rating already.
                    if ((_blnIgnoreRules || _blnCreated) && objGroup.RatingMaximum < 6)
                        objGroup.RatingMaximum = 6;
                }
            }

            // Knowledge Skills.
            List<ListItem> lstKnowledgeSkillOrder = new List<ListItem>();
            objXmlNodeList = objXmlDocument.SelectNodes("/character/skills/skill[knowledge = \"True\"]");
            // Sort the Knowledge Skills in alphabetical order.
            foreach (XmlNode objXmlSkill in objXmlNodeList)
            {
                ListItem objGroup = new ListItem();
                objGroup.Value = objXmlSkill["name"].InnerText;
                objGroup.Name = objXmlSkill["name"].InnerText;
                lstKnowledgeSkillOrder.Add(objGroup);
            }
            SortListItem objSort = new SortListItem();
            lstKnowledgeSkillOrder.Sort(objSort.Compare);

            foreach (ListItem objItem in lstKnowledgeSkillOrder)
            {
                Skill objSkill = new Skill(this);
                XmlNode objNode = objXmlDocument.SelectSingleNode("/character/skills/skill[knowledge = \"True\" and name = " + CleanXPath(objItem.Value) + "]");
                objSkill.Load(objNode);
                _lstSkills.Add(objSkill);
            }

            // Contacts.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/contacts/contact");
            foreach (XmlNode objXmlContact in objXmlNodeList)
            {
                Contact objContact = new Contact(this);
                objContact.Load(objXmlContact);
                _lstContacts.Add(objContact);
            }

            // Armor.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/armors/armor");
            foreach (XmlNode objXmlArmor in objXmlNodeList)
            {
                Armor objArmor = new Armor(this);
                objArmor.Load(objXmlArmor);
                _lstArmor.Add(objArmor);
            }

            // Weapons.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/weapons/weapon");
            foreach (XmlNode objXmlWeapon in objXmlNodeList)
            {
                Weapon objWeapon = new Weapon(this);
                objWeapon.Load(objXmlWeapon);
                _lstWeapons.Add(objWeapon);
            }

            // Cyberware/Bioware.
            objXmlNodeList = objXmlDocument.SelectNodes("/character/cyberwares/cyberware");
            foreach (XmlNode objXmlCyberware in objXmlNodeList)
            {
                Cyberware objCyberware = new Cyberware(this);
                objCyberware.Load(objXmlCyberware);
                _lstCyberware.Add(objCyberware);
            }
开发者ID:Nebual,项目名称:chummer,代码行数:67,代码来源:clsCharacter.cs



注:本文中的Chummer.Contact类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Chummer.ContactControl类代码示例发布时间:2022-05-24
下一篇:
C# Chummer.ComplexForm类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap