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


C# CommonFunctions.FindNode方法代码示例

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


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

示例1: tsUndoNuyenExpense_Click


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

                                    // Remove the TreeNode for the Weapon.
                                    foreach (TreeNode objWeaponNode in treWeapons.Nodes[0].Nodes)
                                    {
                                        if (objWeaponNode.Tag.ToString() == objChild.WeaponID)
                                        {
                                            treWeapons.Nodes[0].Nodes.Remove(objWeaponNode);
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    break;
                case NuyenExpenseType.AddGear:
                    // Locate the Gear that was added.
                    //If the gear was already deleted manually we will not be able to locate it here
                    Gear objGear = objCommon.FindGear(objEntry.Undo.ObjectId, _objCharacter.Gear);
                    if (objGear == null)
                        break;
                    objGear.Quantity -= objEntry.Undo.Qty;

                    if (objGear.Quantity <= 0)
                    {
                        if (objGear.Parent != null)
                            objGear.Parent.Children.Remove(objGear);
                        else
                            _objCharacter.Gear.Remove(objGear);

                        objCommon.DeleteGear(objGear, treWeapons, _objImprovementManager);
                        TreeNode objNode = objCommon.FindNode(objGear.InternalId, treGear);
                        objNode.Remove();
                    }
                    else
                    {
                        TreeNode objNode = objCommon.FindNode(objGear.InternalId, treGear);
                        objNode.Text = objGear.DisplayName;
                    }

                    _objController.PopulateFocusList(treFoci);
                    break;
                case NuyenExpenseType.AddVehicle:
                    // Locate the Vehicle that was added.
                    foreach (Vehicle objVehicle in _objCharacter.Vehicles)
                    {
                        if (objVehicle.InternalId == objEntry.Undo.ObjectId)
                        {
                            // Remove the Vehicle.
                            _objCharacter.Vehicles.Remove(objVehicle);
                            foreach (TreeNode objNode in treVehicles.Nodes[0].Nodes)
                            {
                                if (objNode.Tag.ToString() == objEntry.Undo.ObjectId)
                                {
                                    objNode.Remove();
                                    break;
                                }
                            }
                            break;
                        }
                    }
                    break;
                case NuyenExpenseType.AddVehicleMod:
                    // Locate the Vehicle Mod that was added.
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:67,代码来源:frmCareer.cs


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