本文整理汇总了C#中PwGroup.DuplicateTo方法的典型用法代码示例。如果您正苦于以下问题:C# PwGroup.DuplicateTo方法的具体用法?C# PwGroup.DuplicateTo怎么用?C# PwGroup.DuplicateTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PwGroup
的用法示例。
在下文中一共展示了PwGroup.DuplicateTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DuplicateGroupTo
/// <summary>
/// The function finds a specified group (by Uuid) in the copyDb.
/// The function creates the group if it was not present in the
/// copyDB yet and ensures the correct path.
/// </summary>
/// <param name="originalDB">Ausgangsdatenbank</param>
/// <param name="originalGroup">The parent PwGroup in the original Database.</param>
/// <param name="copyDB">The Database where we want to copy the group to.</param>
/// <returns>The Group in the copy of the database that represents the origGrp in
/// the original database.</returns>
public static PwGroup DuplicateGroupTo(this PwDatabase originalDB, PwGroup originalGroup, PwDatabase copyDB)
{
if (originalGroup == originalDB.RootGroup)
{
return copyDB.RootGroup;
}
PwGroup copyGroup = copyDB.RootGroup.FindGroup(originalGroup.Uuid, true);
if (copyGroup != null)
{
return copyGroup;
}
PwGroup copyParent = originalDB.DuplicateGroupTo(originalGroup.ParentGroup, copyDB);
copyGroup = originalGroup.DuplicateTo(copyParent);
return copyGroup;
}