Пример #1
0
        /// <summary>
        /// Get format scheme from the specified slide of a presentation from a third party storage
        /// </summary>
        /// <param name="slideNumber"></param>
        /// <param name="storageType"></param>
        /// <param name="storageName">Name of the storage</param>
        /// <returns></returns>
        public FormatScheme GetFormatScheme(int slideNumber, StorageType storageType, string storageName)
        {
            //build URI to get format scheme
            StringBuilder strURI = new StringBuilder(Product.BaseProductUri + "/slides/" +
                                                     FileName + "/slides/" + slideNumber + "/theme/formatScheme");

            switch (storageType)
            {
            case StorageType.AmazonS3:
                strURI.Append("?storage=" + storageName);
                break;
            }

            string signedURI = Utils.Sign(strURI.ToString());

            Stream responseStream = Utils.ProcessCommand(signedURI, "GET");

            StreamReader reader  = new StreamReader(responseStream);
            string       strJSON = reader.ReadToEnd();

            //Parse the json string to JObject
            JObject parsedJSON = JObject.Parse(strJSON);

            //Deserializes the JSON to a object.
            FormatSchemeResponse formatSchemeResponse = JsonConvert.DeserializeObject <FormatSchemeResponse>(parsedJSON.ToString());

            return(formatSchemeResponse.FormatScheme);
        }
Пример #2
0
        /// <summary>
        /// Get format scheme from the specified slide
        /// </summary>
        /// <param name="slideNumber"></param>
        /// <returns></returns>
        public void GetFormatScheme(int slideNumber)
        {
            //build URI to get format scheme
            string strURI = Product.BaseProductUri + "/slides/" + FileName + "/slides/" + slideNumber + "/theme/formatScheme";

            string signedURI = Utils.Sign(strURI);

            Stream responseStream = Utils.ProcessCommand(signedURI, "GET");

            StreamReader reader  = new StreamReader(responseStream);
            string       strJSON = reader.ReadToEnd();

            //Parse the json string to JObject
            JObject parsedJSON = JObject.Parse(strJSON);

            //Deserializes the JSON to a object.
            FormatSchemeResponse formatSchemeResponse = JsonConvert.DeserializeObject <FormatSchemeResponse>(parsedJSON.ToString());
            FormatScheme         formatscheme         = formatSchemeResponse.FormatScheme;
        }