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


C# UserAction.ExecutePreOperation方法代码示例

本文整理汇总了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);
				}
			}
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:59,代码来源:OguFullImportAction.cs


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