예제 #1
0
        private IAsyncResult OnBeginDownloadBinaryContentByUser(object[] inValues, AsyncCallback callback, object asyncState)
        {
            string          itemIdOrTempFileId = (string)inValues[0];
            AccessTokenData accessToken        = (AccessTokenData)inValues[1];

            return(this.BeginDownloadBinaryContentByUser(itemIdOrTempFileId, accessToken, callback, asyncState));
        }
예제 #2
0
        private IAsyncResult OnBeginUploadBinaryByteArray(object[] inValues, AsyncCallback callback, object asyncState)
        {
            AccessTokenData accessToken = (AccessTokenData)inValues[0];

            byte[] data = (byte[])inValues[1];
            return(this.BeginUploadBinaryByteArray(accessToken, data, callback, asyncState));
        }
예제 #3
0
        private IAsyncResult OnBeginUploadBinaryContent(object[] inValues, AsyncCallback callback, object asyncState)
        {
            AccessTokenData accessToken   = (AccessTokenData)inValues[0];
            Stream          uploadContent = (Stream)inValues[1];

            return(this.BeginUploadBinaryContent(accessToken, uploadContent, callback, asyncState));
        }
예제 #4
0
 public string UploadBinaryContent(AccessTokenData AccessToken, Stream UploadContent)
 {
     return(((IStreamUpload)this).UploadBinaryContent(new UploadRequest
     {
         AccessToken = AccessToken,
         UploadContent = UploadContent
     }).FilePath);
 }
예제 #5
0
 public string UploadBinaryContent(AccessTokenData AccessToken, Stream UploadContent)
 {
     return(Channel.UploadBinaryContent(new UploadRequest201501
     {
         AccessToken = AccessToken,
         UploadContent = UploadContent
     }).FilePath);
 }
예제 #6
0
 public IAsyncResult BeginUploadBinaryContent(AccessTokenData AccessToken, Stream UploadContent, AsyncCallback callback, object asyncState)
 {
     return(((IStreamUpload)this).BeginUploadBinaryContent(new UploadRequest
     {
         AccessToken = AccessToken,
         UploadContent = UploadContent
     }, callback, asyncState));
 }
예제 #7
0
 public void UploadBinaryByteArrayAsync(AccessTokenData accessToken, byte[] data, object userState)
 {
     if (this.onBeginUploadBinaryByteArrayDelegate == null)
     {
         this.onBeginUploadBinaryByteArrayDelegate = new ClientBase <IStreamUpload> .BeginOperationDelegate(this.OnBeginUploadBinaryByteArray);
     }
     if (this.onEndUploadBinaryByteArrayDelegate == null)
     {
         this.onEndUploadBinaryByteArrayDelegate = new ClientBase <IStreamUpload> .EndOperationDelegate(this.OnEndUploadBinaryByteArray);
     }
     if (this.onUploadBinaryByteArrayCompletedDelegate == null)
     {
         this.onUploadBinaryByteArrayCompletedDelegate = new SendOrPostCallback(this.OnUploadBinaryByteArrayCompleted);
     }
     base.InvokeAsync(this.onBeginUploadBinaryByteArrayDelegate, new object[]
     {
         accessToken,
         data
     }, this.onEndUploadBinaryByteArrayDelegate, this.onUploadBinaryByteArrayCompletedDelegate, userState);
 }
예제 #8
0
 public void UploadBinaryContentAsync(AccessTokenData AccessToken, Stream UploadContent, object userState)
 {
     if (this.onBeginUploadBinaryContentDelegate == null)
     {
         this.onBeginUploadBinaryContentDelegate = new ClientBase <IStreamUpload> .BeginOperationDelegate(this.OnBeginUploadBinaryContent);
     }
     if (this.onEndUploadBinaryContentDelegate == null)
     {
         this.onEndUploadBinaryContentDelegate = new ClientBase <IStreamUpload> .EndOperationDelegate(this.OnEndUploadBinaryContent);
     }
     if (this.onUploadBinaryContentCompletedDelegate == null)
     {
         this.onUploadBinaryContentCompletedDelegate = new SendOrPostCallback(this.OnUploadBinaryContentCompleted);
     }
     base.InvokeAsync(this.onBeginUploadBinaryContentDelegate, new object[]
     {
         AccessToken,
         UploadContent
     }, this.onEndUploadBinaryContentDelegate, this.onUploadBinaryContentCompletedDelegate, userState);
 }
예제 #9
0
 public void DownloadBinaryContentByUserAsync(string itemIdOrTempFileId, AccessTokenData accessToken, object userState)
 {
     if (this.onBeginDownloadBinaryContentByUserDelegate == null)
     {
         this.onBeginDownloadBinaryContentByUserDelegate = new ClientBase <IStreamDownload> .BeginOperationDelegate(this.OnBeginDownloadBinaryContentByUser);
     }
     if (this.onEndDownloadBinaryContentByUserDelegate == null)
     {
         this.onEndDownloadBinaryContentByUserDelegate = new ClientBase <IStreamDownload> .EndOperationDelegate(this.OnEndDownloadBinaryContentByUser);
     }
     if (this.onDownloadBinaryContentByUserCompletedDelegate == null)
     {
         this.onDownloadBinaryContentByUserCompletedDelegate = new SendOrPostCallback(this.OnDownloadBinaryContentByUserCompleted);
     }
     base.InvokeAsync(this.onBeginDownloadBinaryContentByUserDelegate, new object[]
     {
         itemIdOrTempFileId,
         accessToken
     }, this.onEndDownloadBinaryContentByUserDelegate, this.onDownloadBinaryContentByUserCompletedDelegate, userState);
 }
예제 #10
0
 public void UploadBinaryByteArrayAsync(AccessTokenData accessToken, byte[] data)
 {
     this.UploadBinaryByteArrayAsync(accessToken, data, null);
 }
예제 #11
0
 public UploadRequest(AccessTokenData AccessToken, Stream UploadContent)
 {
     this.AccessToken   = AccessToken;
     this.UploadContent = UploadContent;
 }
예제 #12
0
 public IAsyncResult BeginUploadBinaryByteArray(AccessTokenData accessToken, byte[] data, AsyncCallback callback, object asyncState)
 {
     return(base.Channel.BeginUploadBinaryByteArray(accessToken, data, callback, asyncState));
 }
예제 #13
0
 public string UploadBinaryByteArray(AccessTokenData accessToken, byte[] data)
 {
     return(base.Channel.UploadBinaryByteArray(accessToken, data));
 }
 public static bool IsSystemAdministrator(this AccessTokenData accessToken)
 {
     return((accessToken.Privileges & 1) != 0 || accessToken.HasSystemPrivilege("tcm:SystemAdministration"));
 }
 public async Task <Stream> DownloadBinaryContentByUserAsync(string itemIdOrTempFileId, AccessTokenData accessToken)
 {
     return(await Task <Stream> .Factory.FromAsync(Channel.BeginDownloadBinaryContentByUser, Channel.EndDownloadBinaryContentByUser, itemIdOrTempFileId, accessToken, null));
 }
 public Stream DownloadBinaryContentByUser(string itemIdOrTempFileId, AccessTokenData accessToken)
 {
     return(Channel.DownloadBinaryContentByUser(itemIdOrTempFileId, accessToken));
 }
예제 #17
0
 public void DownloadBinaryContentByUserAsync(string itemIdOrTempFileId, AccessTokenData accessToken)
 {
     this.DownloadBinaryContentByUserAsync(itemIdOrTempFileId, accessToken, null);
 }
예제 #18
0
 public IAsyncResult BeginDownloadBinaryContentByUser(string itemIdOrTempFileId, AccessTokenData accessToken, AsyncCallback callback, object asyncState)
 {
     return(base.Channel.BeginDownloadBinaryContentByUser(itemIdOrTempFileId, accessToken, callback, asyncState));
 }
예제 #19
0
 public void UploadBinaryContentAsync(AccessTokenData AccessToken, Stream UploadContent)
 {
     this.UploadBinaryContentAsync(AccessToken, UploadContent, null);
 }
 public static bool HasSystemPrivilege(this AccessTokenData accessToken, string privilegeKey = "tcm:SystemAdministration")
 {
     return(accessToken.InheritedSystemPrivileges != null && accessToken.InheritedSystemPrivileges.Keys.Any((SystemPrivilege sysPriv) => sysPriv.Key == privilegeKey || sysPriv.Key == "tcm:SystemAdministration"));
 }