本文整理汇总了C#中UserAction.ExecutePreOperation方法的典型用法代码示例。如果您正苦于以下问题:C# UserAction.ExecutePreOperation方法的具体用法?C# UserAction.ExecutePreOperation怎么用?C# UserAction.ExecutePreOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserAction
的用法示例。
在下文中一共展示了UserAction.ExecutePreOperation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoImport
public override void DoImport(SCObjectSet objectSet, IImportContext context)
{
if (objectSet.HasRelations && objectSet.HasObjects)
{
context.SetStatus(0, 1, "正在分析数据。");
// 查找组织关系
var pendingOperations = new List<Action<object>>();
var objects = objectSet.Objects;
Dictionary<string, IList<PC.SCOrganization>> orgToOrgRelations = new Dictionary<string, IList<PC.SCOrganization>>();
Dictionary<string, IList<PC.SCUser>> orgToUserRelations = new Dictionary<string, IList<PC.SCUser>>();
Dictionary<string, IList<PC.SCGroup>> orgToGroupRelations = new Dictionary<string, IList<PC.SCGroup>>();
Dictionary<string, PC.SchemaObjectBase> knownObjects = new Dictionary<string, PC.SchemaObjectBase>(); // 缓存已知对象,避免多次往返
context.SetStatus(0, 1, "正在统计需要导入的对象");
Stat stat = new Stat(); // 统计信息
FindFullOURelations(objectSet, orgToOrgRelations, orgToUserRelations, orgToGroupRelations, new PC.SCOrganization[] { this.Parent }, stat); // 爬出所有组织关系
Dictionary<PC.SCOrganization, IList<PC.SCRelationObject>> userToOrgRelations = new Dictionary<PC.SCOrganization, IList<PC.SCRelationObject>>();
this.allSteps = this.CalculateSteps(stat);
this.currentSteps = 0;
bool orgValid = false; // 必须校验组织
context.SetStatus(0, this.allSteps, "正在导入数据。");
// 递归导入组织,并剔除错误的数据
orgValid = this.PrepareOrganizations(objectSet, context, knownObjects, orgToOrgRelations, this.Parent, this.IncludeOrganizations == false);
if (this.IncludeAcl)
{
// 递归导入Acl
var action = new AclAction(this);
action.ExecutePreOperation(objectSet, context, knownObjects, this.Parent, orgToOrgRelations, orgToUserRelations, orgToGroupRelations);
this.DoHierarchicalAction(objectSet, context, knownObjects, orgToOrgRelations, orgToUserRelations, orgToGroupRelations, this.Parent, action);
action.ExecutePostOperation(objectSet, context, knownObjects, this.Parent, orgToOrgRelations, orgToUserRelations, orgToGroupRelations);
}
if (this.IncludeUser)
{
var action = new UserAction(this);
action.ImportSecretaries = this.IncludeSecretaries;
action.ExecutePreOperation(objectSet, context, knownObjects, this.Parent, orgToOrgRelations, orgToUserRelations, orgToGroupRelations);
this.DoHierarchicalAction(objectSet, context, knownObjects, orgToOrgRelations, orgToUserRelations, orgToGroupRelations, this.Parent, action);
action.ExecutePostOperation(objectSet, context, knownObjects, this.Parent, orgToOrgRelations, orgToUserRelations, orgToGroupRelations);
}
if (this.IncludeGroup)
{
var action = new GroupAction(this);
action.ImportMembers = this.IncludeGroupMembers;
action.ImportConditions = this.IncludeGroupConditions;
action.ExecutePreOperation(objectSet, context, knownObjects, this.Parent, orgToOrgRelations, orgToUserRelations, orgToGroupRelations);
this.DoHierarchicalAction(objectSet, context, knownObjects, orgToOrgRelations, orgToUserRelations, orgToGroupRelations, this.Parent, action);
action.ExecutePostOperation(objectSet, context, knownObjects, this.Parent, orgToOrgRelations, orgToUserRelations, orgToGroupRelations);
}
}
}