当前位置: 首页>>代码示例>>C#>>正文


C# PowerControl.RefreshTooltip方法代码示例

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


在下文中一共展示了PowerControl.RefreshTooltip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: cmdAddPower_Click

        private void cmdAddPower_Click(object sender, EventArgs e)
        {
            frmSelectPower frmPickPower = new frmSelectPower(_objCharacter);
            frmPickPower.ShowDialog(this);

            // Make sure the dialogue window was not canceled.
            if (frmPickPower.DialogResult == DialogResult.Cancel)
                return;

            int i = panPowers.Controls.Count;

            Power objPower = new Power(_objCharacter);
            _objCharacter.Powers.Add(objPower);

            PowerControl objPowerControl = new PowerControl();
            objPowerControl.PowerObject = objPower;

            // Attach an EventHandler for the PowerRatingChanged Event.
            objPowerControl.PowerRatingChanged += objPower_PowerRatingChanged;
            objPowerControl.DeletePower += objPower_DeletePower;
            objPowerControl.PowerName = frmPickPower.SelectedPower;
            objPowerControl.PointsPerLevel = frmPickPower.PointsPerLevel;
            objPowerControl.AdeptWayDiscount = frmPickPower.AdeptWayDiscount;
            objPowerControl.LevelEnabled = frmPickPower.LevelEnabled;

			if (frmPickPower.MaxLevels() > 0)
				if (objPower.Name == "Improved Ability (skill)")
				{
					foreach (Skill objSkill in _objCharacter.Skills)
					{
						if (objPower.Extra == objSkill.Name || (objSkill.ExoticSkill && objPower.Extra == (objSkill.DisplayName + " (" + objSkill.Specialization + ")")))
						{
							int intImprovedAbilityMaximum = objSkill.Rating + (objSkill.Rating / 2);
							if (intImprovedAbilityMaximum == 0)
							{
								intImprovedAbilityMaximum = 1;
							}
							objPower.MaxLevels = intImprovedAbilityMaximum;
						}
					}
				}
				else
				{
					objPowerControl.MaxLevels = frmPickPower.MaxLevels();
				}

			// Open the Cyberware XML file and locate the selected piece.
			XmlDocument objXmlDocument = XmlManager.Instance.Load("powers.xml");

            XmlNode objXmlPower = objXmlDocument.SelectSingleNode("/chummer/powers/power[name = \"" + frmPickPower.SelectedPower + "\"]");

            objPower.Source = objXmlPower["source"].InnerText;
            objPower.Page = objXmlPower["page"].InnerText;
            if (objXmlPower["doublecost"] != null)
                objPower.DoubleCost = false;

            if (objXmlPower.InnerXml.Contains("bonus"))
            {
                objPower.Bonus = objXmlPower["bonus"];
                if (!_objImprovementManager.CreateImprovements(Improvement.ImprovementSource.Power, objPower.InternalId, objPower.Bonus, false, Convert.ToInt32(objPower.Rating), objPower.DisplayNameShort))
                {
                    _objCharacter.Powers.Remove(objPower);
                    return;
                }
                objPowerControl.Extra = _objImprovementManager.SelectedValue;
            }

            // Set the control's Maximum.
            objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
            objPowerControl.Top = i * objPowerControl.Height;
            objPowerControl.RefreshTooltip();
            panPowers.Controls.Add(objPowerControl);

            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();

            if (frmPickPower.AddAgain)
                cmdAddPower_Click(sender, e);
        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:81,代码来源:frmCreate.cs

示例2: cmdAddPower_Click

        private void cmdAddPower_Click(object sender, EventArgs e)
        {
            frmSelectPower frmPickPower = new frmSelectPower(_objCharacter);
            frmPickPower.ShowDialog(this);

            // Make sure the dialogue window was not canceled.
            if (frmPickPower.DialogResult == DialogResult.Cancel)
                return;

            int i = panPowers.Controls.Count;

            // Open the Cyberware XML file and locate the selected piece.
            XmlDocument objXmlDocument = XmlManager.Instance.Load("powers.xml");

            XmlNode objXmlPower = objXmlDocument.SelectSingleNode("/chummer/powers/power[id = \"" + frmPickPower.SelectedPower + "\"]");

            Power objPower = new Power(_objCharacter);
            objPower.Create(objXmlPower, _objCharacter);
            _objCharacter.Powers.Add(objPower);

            PowerControl objPowerControl = new PowerControl();
            objPowerControl.PowerObject = objPower;

            // Attach an EventHandler for the PowerRatingChanged Event.
            objPowerControl.PowerRatingChanged += objPower_PowerRatingChanged;
            objPowerControl.DeletePower += objPower_DeletePower;

            objPower.Source = objXmlPower["source"].InnerText;
            objPower.Page = objXmlPower["page"].InnerText;
            if (objXmlPower["doublecost"] != null)
                objPower.DoubleCost = false;

            // Set the control's Maximum.
            objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
            objPowerControl.Top = i * objPowerControl.Height;
            objPowerControl.RefreshTooltip();
            panPowers.Controls.Add(objPowerControl);

            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();

            if (frmPickPower.AddAgain)
                cmdAddPower_Click(sender, e);
        }
开发者ID:janhelke,项目名称:chummer2,代码行数:46,代码来源:frmCreate.cs


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