本文整理汇总了C#中PwGroup.GetGroups方法的典型用法代码示例。如果您正苦于以下问题:C# PwGroup.GetGroups方法的具体用法?C# PwGroup.GetGroups怎么用?C# PwGroup.GetGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PwGroup
的用法示例。
在下文中一共展示了PwGroup.GetGroups方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: add_sub_groups
private void add_sub_groups(PwGroup group, int level, string cur_item_uuid)
{
PwObjectList<PwGroup> groups = group.GetGroups(false);
foreach (PwGroup sub_group in groups)
{
StartGroupDropdown item = new StartGroupDropdown(sub_group.Uuid.ToHexString(), sub_group.Name, level + 1);
if (sub_group.Uuid.ToHexString() == cur_item_uuid)
drop_cur_item = item;
drop_items.Add(item);
add_sub_groups(sub_group, level + 1, cur_item_uuid);
}
}
示例2: CreateSummaryList
public static string CreateSummaryList(PwGroup pgSubGroups, PwEntry[] vEntries)
{
int nMaxEntries = 10;
string strSummary = string.Empty;
if(pgSubGroups != null)
{
PwObjectList<PwGroup> vGroups = pgSubGroups.GetGroups(true);
if(vGroups.UCount > 0)
{
StringBuilder sbGroups = new StringBuilder();
sbGroups.Append("- ");
uint uToList = Math.Min(3U, vGroups.UCount);
for(uint u = 0; u < uToList; ++u)
{
if(sbGroups.Length > 2) sbGroups.Append(", ");
sbGroups.Append(vGroups.GetAt(u).Name);
}
if(uToList < vGroups.UCount) sbGroups.Append(", ...");
strSummary += sbGroups.ToString(); // New line below
nMaxEntries -= 2;
}
}
int nSummaryShow = Math.Min(nMaxEntries, vEntries.Length);
if(nSummaryShow == (vEntries.Length - 1)) --nSummaryShow; // Plural msg
for(int iSumEnum = 0; iSumEnum < nSummaryShow; ++iSumEnum)
{
if(strSummary.Length > 0) strSummary += MessageService.NewLine;
PwEntry pe = vEntries[iSumEnum];
strSummary += ("- " + StrUtil.CompactString3Dots(
pe.Strings.ReadSafe(PwDefs.TitleField), 39));
if(PwDefs.IsTanEntry(pe))
{
string strTanIdx = pe.Strings.ReadSafe(PwDefs.UserNameField);
if(!string.IsNullOrEmpty(strTanIdx))
strSummary += (@" (#" + strTanIdx + @")");
}
}
return strSummary;
}