/// <summary> /// 生成副本 /// </summary> /// <returns>生成的副本</returns> public Material GenerateCopyVersion() { ExceptionHelper.TrueThrow <ArgumentNullException>(this == null, "this"); Material material = new Material(); material.id = Guid.NewGuid().ToString(); material.Department = this.department; material.resourceID = this.resourceID; material.sortID = this.sortID; material.materialClass = this.materialClass; material.title = this.title; material.pageQuantity = this.pageQuantity; material.relativeFilePath = this.relativeFilePath.Replace(this.id, material.ID); material.originalName = this.originalName; if (DeluxePrincipal.IsAuthenticated) { material.Creator = (IUser)OguUser.CreateWrapperObject(DeluxeIdentity.CurrentRealUser); } material.lastUploadTag = this.lastUploadTag; material.createDateTime = SNTPClient.AdjustedTime; material.modifyTime = this.modifyTime; material.wfProcessID = this.wfProcessID; material.wfActivityID = this.wfActivityID; material.wfActivityName = this.wfActivityName; material.parentID = this.id; material.sourceMaterial = this; material.versionType = MaterialVersionType.CopyVersion; material.extraData = this.extraData; material.showFileUrl = this.showFileUrl; return(material); }
private static void FillMatchedUsers(IEnumerable <string> objectIDs, Dictionary <string, IUser> userDicts, OguDataCollection <IUser> target) { foreach (string id in objectIDs) { IUser user = null; if (userDicts.TryGetValue(id, out user)) { target.Add((IUser)OguUser.CreateWrapperObject(user)); } } }