本文整理汇总了C#中ItemList.All方法的典型用法代码示例。如果您正苦于以下问题:C# ItemList.All方法的具体用法?C# ItemList.All怎么用?C# ItemList.All使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemList
的用法示例。
在下文中一共展示了ItemList.All方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSharedInfo
//.........这里部分代码省略.........
}
else
{
var u = CoreContext.UserManager.GetUsers(r.Subject);
var isgroup = false;
var title = u.DisplayUserName(false);
if (u.ID == ASC.Core.Users.Constants.LostUser.ID)
{
var g = CoreContext.GroupManager.GetGroupInfo(r.Subject);
isgroup = true;
title = g.Name;
if (g.ID == ASC.Core.Users.Constants.GroupAdmin.ID)
title = FilesCommonResource.Admin;
if (g.ID == ASC.Core.Users.Constants.GroupEveryone.ID)
title = FilesCommonResource.Everyone;
if (g.ID == ASC.Core.Users.Constants.LostGroupInfo.ID)
{
FileSecurity.RemoveSubject(r.Subject);
continue;
}
}
var w = new AceWrapper
{
SubjectId = r.Subject,
SubjectName = title,
SubjectGroup = isgroup,
Share = r.Share,
Owner =
entry.RootFolderType == FolderType.USER
? entry.RootFolderCreator == r.Subject
: entry.CreateBy == r.Subject,
};
result.Add(w);
}
}
if (entryType == FileEntryType.File && !result.Any(w => w.SubjectId == FileConstant.ShareLinkId))
{
var w = new AceWrapper
{
SubjectId = FileConstant.ShareLinkId,
SubjectName = DocumentUtils.GetShareLinkParam(entryId),
SubjectGroup = true,
Share = shareLink,
Owner = false
};
result.Add(w);
}
if (!result.Any(w => w.Owner))
{
var ownerId = entry.RootFolderType == FolderType.USER ? entry.RootFolderCreator : entry.CreateBy;
var w = new AceWrapper
{
SubjectId = ownerId,
SubjectName = FileEntry.GetUserName(ownerId),
SubjectGroup = false,
Share = FileShare.ReadWrite,
Owner = true,
};
result.Add(w);
}
if (entry.RootFolderType == FolderType.COMMON)
{
if (result.All(w => w.SubjectId != ASC.Core.Users.Constants.GroupAdmin.ID))
{
var w = new AceWrapper
{
SubjectId = ASC.Core.Users.Constants.GroupAdmin.ID,
SubjectName = FilesCommonResource.Admin,
SubjectGroup = true,
Share = FileShare.ReadWrite,
Owner = false,
LockedRights = true,
};
result.Add(w);
}
if (result.All(w => w.SubjectId != ASC.Core.Users.Constants.GroupEveryone.ID))
{
var w = new AceWrapper
{
SubjectId = ASC.Core.Users.Constants.GroupEveryone.ID,
SubjectName = FilesCommonResource.Everyone,
SubjectGroup = true,
Share = FileSecurity.DefaultCommonShare,
Owner = false,
};
result.Add(w);
}
}
}
result.Sort((x, y) => string.Compare(x.SubjectName, y.SubjectName));
return result;
}