示例#1
0
        public PowerShellResults CancelPhoto(Identity identity)
        {
            PSCommand pscommand = new PSCommand();

            pscommand.AddCommand("Set-UserPhoto");
            SetUserPhotoParameters setUserPhotoParameters = new SetUserPhotoParameters();

            setUserPhotoParameters.Cancel = new SwitchParameter(true);
            return(base.Invoke(pscommand, new Identity[]
            {
                identity
            }, setUserPhotoParameters));
        }
示例#2
0
        public PowerShellResults SetPhoto(Identity identity, Stream stream)
        {
            PSCommand pscommand = new PSCommand();

            pscommand.AddCommand("Set-UserPhoto");
            SetUserPhotoParameters setUserPhotoParameters = new SetUserPhotoParameters();

            setUserPhotoParameters.PhotoStream = stream;
            setUserPhotoParameters.Preview     = new SwitchParameter(true);
            return(base.Invoke(pscommand, new Identity[]
            {
                identity
            }, setUserPhotoParameters));
        }
示例#3
0
        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));
        }