コード例 #1
0
 /// <summary>
 /// Creates a share with specified parameters 
 /// </summary>
 /// <param name="api_object">Object which have request data</param>
 /// <param name="parameters">Share parameters</param>
 /// <returns>Link to downloading shared files </returns>
 public static string CreateShare( this IQuatrixRequest api_object, ShareParameters parameters )
 {
     if (!parameters.isInited()) {
         return string.Empty;
     }
     return CreateDownloadLink( CreateShareAction( api_object, parameters ) );
 }
コード例 #2
0
        /// <summary>
        /// Creates the share action.
        /// </summary>
        /// <param name="e">Web request for share action creating.</param>
        /// <param name="parameters">Share parameters.</param>
        /// <returns>New instance of <see cref="ShareAction"/>  class which contains information about new share action</returns>
        public static ShareAction CreateShareAction( this IQuatrixRequest e, ShareParameters parameters )
        {
            QEntity share = e.MakeApiCall<ShareAction>( "/is/create_share", Encoding.UTF8.GetBytes( parameters.GetJsonParameters() ) );

            return new ShareAction {
                id = share.id,
                download = string.Format( "/download/{0}", share.id ),
                links = string.Format( "/is/list_links/{0}", share.id ),
                Request = e
            };
        }