Commit 617ac492 authored by David Kline's avatar David Kline
Browse files

fix code review and style issues

parent 219ec5c1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// Stops listneing for messages from the websocket and closes the connection to the websocket.
        /// </summary>
        /// <returns>The task of closing the websocket connection.</returns>
#pragma warning disable 1998
        private async Task StopListeningForMessagesInternal()
        {
            if (this.IsListeningForMessages)
@@ -68,6 +69,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
                }
            }
        }
#pragma warning restore 1998

        /// <summary>
        /// Connects to the websocket and starts listening for messages from the websocket.
+38 −18
Original line number Diff line number Diff line
@@ -62,10 +62,42 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// </summary>
        public static readonly string HolographicSimulationPlaybackDataTypesApi = "api/holographic/simulation/playback/session/types";

        /// <summary>
        /// Enumeration describing the available Holgraphic Simulation playback states.
        /// </summary>
        public enum HolographicSimulationPlaybackStates
        {
            /// <summary>
            /// The simulation has been stopped.
            /// </summary>
            Stopped = 0,

            /// <summary>
            /// The simulation is playing.
            /// </summary>
            Playing,

            /// <summary>
            /// The simulation has been paused.
            /// </summary>
            Paused,

            /// <summary>
            /// Playback has completed.
            /// </summary>
            Complete,

            /// <summary>
            /// Playback is in an unexpected / unknown state.
            /// </summary>
            Unexpected = 9999
        }

        /// <summary>
        /// Deletes the specified Holographic Simulation recording.
        /// </summary>
        /// <param name="name">The name of the recording to delete (ex: testsession.xef).</param>
        /// <returns>Task tracking completion of the REST call.</returns>
        /// <remarks>This method is only supported on HoloLens devices.</remarks>
        public async Task DeleteHolographicSimulationRecording(string name)
        {
@@ -94,7 +126,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
                throw new NotSupportedException("This method is only supported on HoloLens.");
            }

            HolographicSimulationPlaybackStates playbackState = HolographicSimulationPlaybackStates.Unknown;
            HolographicSimulationPlaybackStates playbackState = HolographicSimulationPlaybackStates.Unexpected;

            string payload = string.Format(
                "recording={0}",
@@ -135,6 +167,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// Loads the specified Holographic Simulation recording.
        /// </summary>
        /// <param name="name">The name of the recording to load (ex: testsession.xef).</param>
        /// <returns>Task tracking completion of the REST call.</returns>
        /// <remarks>This method is only supported on HoloLens devices.</remarks>
        public async Task LoadHolographicSimulationRecording(string name)
        {
@@ -154,6 +187,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// Unloads the specified Holographic Simulation recording.
        /// </summary>
        /// <param name="name">The name of the recording to unload (ex: testsession.xef).</param>
        /// <returns>Task tracking completion of the REST call.</returns>
        /// <remarks>This method is only supported on HoloLens devices.</remarks>
        public async Task UnloadHolographicSimulationRecording(string name)
        {
@@ -170,20 +204,6 @@ namespace Microsoft.Tools.WindowsDevicePortal
        }

        #region Data contract
        /// <summary>
        /// Enumeration describing the available Holgraphic Simulation playback states.
        /// </summary>
        public enum HolographicSimulationPlaybackStates
        {
            Unknown = -1,
            Stopped = 0,
            Playing,
            Paused,
            Complete,

            Unexpected = 9999
        }

        /// <summary>
        /// Object representation of the Holographic Simulation playback state
        /// </summary>
@@ -194,7 +214,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
            /// Gets the state value as a string
            /// </summary>
            [DataMember(Name = "state")]
            public string stateRaw { get; private set; }
            public string StateRaw { get; private set; }

            /// <summary>
            /// Gets the playback session state
@@ -203,9 +223,9 @@ namespace Microsoft.Tools.WindowsDevicePortal
            {
                get 
                {
                    HolographicSimulationPlaybackStates state = HolographicSimulationPlaybackStates.Unknown;
                    HolographicSimulationPlaybackStates state = HolographicSimulationPlaybackStates.Unexpected;

                    switch (stateRaw)
                    switch (this.StateRaw)
                    {
                        case "stopped":
                            state = HolographicSimulationPlaybackStates.Stopped;
+1 −1
Original line number Diff line number Diff line
@@ -56,8 +56,8 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// <param name="recordHands">Should hand data be recorded? The default value is true.</param>
        /// <param name="recordSpatialMapping">Should Spatial Mapping data be recorded? The default value is true.</param>
        /// <param name="recordEnvironment">Should environment data be recorded? The default value is true.</param>
        /// <remarks>This method is only supported on HoloLens devices.</remarks>
        /// <returns>Task tracking completion of the REST call.</returns>
        /// <remarks>This method is only supported on HoloLens devices.</remarks>
        public async Task StartHolographicSimulationRecording(
            string name,
            bool recordHead = true,
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// </summary>
        /// <param name="endpoint">The uri that the weboscket should connect to</param>
        /// <returns>The task of opening a connection to the websocket.</returns>
#pragma warning disable 1998
        private async Task StartListeningForMessagesInternal(
            Uri endpoint)
        {
@@ -74,6 +75,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
            // Do not wait on receiving messages.
            Task connectTask = this.ConnectAsync(endpoint);
        }
#pragma warning restore 1998

        /// <summary>
        /// Opens a connection to the specified websocket API.
@@ -127,6 +129,7 @@ namespace Microsoft.Tools.WindowsDevicePortal
        /// Closes the connection to the websocket.
        /// </summary>
        /// <returns>The task of closing the websocket connection.</returns>
#pragma warning disable 1998
        private async Task StopListeningForMessagesInternal()
        {
            if (this.IsListeningForMessages)
@@ -140,5 +143,6 @@ namespace Microsoft.Tools.WindowsDevicePortal
                }
            }
        }
#pragma warning restore 1998
    }
}