예제 #1
0
        /// <summary>
        /// Implemented by inheritors to perform the request on the provided web client.
        /// </summary>
        /// <param name="connection"></param>
        protected override async Task OnProcessRequest(IWebChannelConnection connection)
        {
            byte[] requestedHubConfigurationRawData = await connection.DownloadData("/Hub/Configuration.xml").ConfigureAwait(false);

            //and now do it without using XMLSerializer since that doesn't work in the agent.
            Configuration = DataConverter.ByteArrayToHubConfigurationXml(requestedHubConfigurationRawData);
        }
        /// <summary>
        /// Implemented by inheritors to perform the request on the provided web client.
        /// </summary>
        /// <param name="connection"></param>
        protected override async Task OnProcessRequest(IWebChannelConnection connection)
        {
            byte[] requestedSessionsRawData = await connection.DownloadData(string.Format("/Hub/Hosts/{0}/RequestedSessions.xml", ClientId)).ConfigureAwait(false);

            //even though it's a session list we can't actually deserialize it directly - because we cant use XmlSerializer
            //since the types will not necessarily be public.
            RequestedSessions = DataConverter.ByteArrayToSessionsListXml(requestedSessionsRawData);
        }
        /// <summary>
        /// Implemented by inheritors to perform the request on the provided web client.
        /// </summary>
        /// <param name="connection"></param>
        protected override async Task OnProcessRequest(IWebChannelConnection connection)
        {
            string url;

            if (ClientId.HasValue)
            {
                url = string.Format("/Hub/Hosts/{0}/{1}", ClientId, GenerateResourceUri());
            }
            else
            {
                url = string.Format("/Hub/{0}", GenerateResourceUri());
            }

            byte[] sessionFilesListRawData = await connection.DownloadData(url).ConfigureAwait(false);

            //even though it's a session list we can't actually deserialize it directly - because we cant use XmlSerializer
            //since the types will not necessarily be public.
            Files = DataConverter.ByteArrayToSessionFilesListXml(sessionFilesListRawData);
        }