public PowerShellResults ProcessUpload(UploadFileContext context, WebServiceParameters param) { param.FaultIfNull(); UploadUMParameter uploadUMParameter = (UploadUMParameter)param; uploadUMParameter.PromptFileStream = context.FileStream; uploadUMParameter.PromptFileName = Path.GetFileName(context.FileName); if (uploadUMParameter.UMAutoAttendant == null && uploadUMParameter.UMDialPlan == null) { uploadUMParameter.UMAutoAttendant.FaultIfNull(); } return(this.ImportObject(uploadUMParameter)); }
public PowerShellResults ProcessUpload(UploadFileContext context, WebServiceParameters param) { param.FaultIfNull(); SetUserPhotoParameters setUserPhotoParameters = (SetUserPhotoParameters)param; setUserPhotoParameters.PhotoStream = context.FileStream; Identity identity = Identity.ParseIdentity(setUserPhotoParameters.Identity); if (identity == null || string.IsNullOrEmpty(identity.RawIdentity)) { throw new BadQueryParameterException("Identity"); } return(this.SetPhoto(identity, context.FileStream)); }
public PowerShellResults ProcessUpload(UploadFileContext context, WebServiceParameters parameters) { parameters.FaultIfNull(); if (parameters is FingerprintUploadParameters) { FingerprintUploadParameters fingerprintUploadParameters = (FingerprintUploadParameters)parameters; byte[] array = new byte[context.FileStream.Length]; context.FileStream.Read(array, 0, array.Length); fingerprintUploadParameters.FileData = array; string description = context.FileName.Substring(context.FileName.LastIndexOf("\\") + 1); fingerprintUploadParameters.Description = description; return(base.NewObject <Fingerprint, FingerprintUploadParameters>("New-Fingerprint", fingerprintUploadParameters)); } return(null); }
public PowerShellResults ProcessUpload(UploadFileContext context, WebServiceParameters param) { param.FaultIfNull(); UploadExtensionParameter uploadExtensionParameter = (UploadExtensionParameter)param; uploadExtensionParameter.FileStream = context.FileStream; if (RbacPrincipal.Current.RbacConfiguration.HasRoleOfType(RoleType.MyReadWriteMailboxApps)) { uploadExtensionParameter.AllowReadWriteMailbox = new SwitchParameter(true); } PSCommand pscommand = new PSCommand().AddCommand("New-App"); this.AddParameters(pscommand, param); return(base.Invoke <ExtensionRow>(pscommand)); }