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


C# CommonFunctions.FindArmor方法代码示例

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


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

示例1: tsUndoNuyenExpense_Click


//.........这里部分代码省略.........

                                                // Remove the Weapon Mod from the Tree.
                                                foreach (TreeNode objVNode in treVehicles.Nodes[0].Nodes)
                                                {
                                                    foreach (TreeNode objNode in objVNode.Nodes)
                                                    {
                                                        foreach (TreeNode objWNode in objNode.Nodes)
                                                        {
                                                            foreach (TreeNode objChild in objWNode.Nodes)
                                                            {
                                                                foreach (TreeNode objSubChild in objChild.Nodes)
                                                                {
                                                                    if (objSubChild.Tag.ToString() == objEntry.Undo.ObjectId)
                                                                    {
                                                                        objSubChild.Remove();
                                                                        break;
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    break;
                case NuyenExpenseType.AddArmor:
                    // Locate the Armor that was added.
                    Armor objArmor = objCommon.FindArmor(objEntry.Undo.ObjectId, _objCharacter.Armor);

                    if (objArmor != null)
                    {
                        // Remove the Improvements for any child items.
                        foreach (ArmorMod objMod in objArmor.ArmorMods)
                            _objImprovementManager.RemoveImprovements(Improvement.ImprovementSource.ArmorMod, objMod.InternalId);

                        // Remove the Improvements for the Armor.
                        _objImprovementManager.RemoveImprovements(Improvement.ImprovementSource.Armor, objArmor.InternalId);

                        // Remove the Armor from the character.
                        _objCharacter.Armor.Remove(objArmor);

                        // Remove the Armor from the Tree.
                        TreeNode objArmorNode = objCommon.FindNode(objEntry.Undo.ObjectId, treArmor);
                        objArmorNode.Remove();
                    }

                    break;
                case NuyenExpenseType.AddArmorMod:
                    // Locate the Armor Mod that was added.
                    foreach (Armor objFoundArmor in _objCharacter.Armor)
                    {
                        foreach (ArmorMod objMod in objFoundArmor.ArmorMods)
                        {
                            if (objMod.InternalId == objEntry.Undo.ObjectId)
                            {
                                // Remove the Improtements for the Armor Mod.
                                _objImprovementManager.RemoveImprovements(Improvement.ImprovementSource.ArmorMod, objMod.InternalId);

                                // Remove the Armor Mod from the Armor.
                                objFoundArmor.ArmorMods.Remove(objMod);
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:67,代码来源:frmCareer.cs


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