示例#1
0
        /// <summary>
        /// Gets color 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 ColorScheme GetColorScheme(int slideNumber, StorageType storageType, string storageName)
        {
            //Build URI to get color scheme
            StringBuilder strURI = new StringBuilder(Product.BaseProductUri + "/slides/" +
                                                     FileName + "/slides/" + slideNumber + "/theme/colorScheme");

            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.
            ColorSchemeResponse colorSchemeResponse = JsonConvert.DeserializeObject <ColorSchemeResponse>(parsedJSON.ToString());

            return(colorSchemeResponse.ColorScheme);
        }
示例#2
0
        /// <summary>
        /// Get color scheme from the specified slide
        /// </summary>
        /// <param name="slideNumber"></param>
        /// <returns></returns>
        public ColorScheme GetColorScheme(int slideNumber)
        {
            //build URI to get color scheme
            string strURI = Product.BaseProductUri + "/slides/" + FileName + "/slides/" + slideNumber + "/theme/colorScheme";

            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.
            ColorSchemeResponse colorSchemeResponse = JsonConvert.DeserializeObject <ColorSchemeResponse>(parsedJSON.ToString());

            return(colorSchemeResponse.ColorScheme);
        }