diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-02-20 16:45:00 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-02-20 16:45:00 +0200 |
| commit | 6c208c90bc45aff4a7fa214356a42fe7757c5e6f (patch) | |
| tree | 0d77bc6a0ecfbb53cf42c5462ee19212197ee1bd /Software/Visual_Studio/Web/Tango.MachineService | |
| parent | b0823127f152fe97a6e8fce29e427c7f3db9cf5a (diff) | |
| parent | 1a573aaa346ec4b8bd58a0e35ab9df571a09b855 (diff) | |
| download | Tango-6c208c90bc45aff4a7fa214356a42fe7757c5e6f.tar.gz Tango-6c208c90bc45aff4a7fa214356a42fe7757c5e6f.zip | |
MERGE
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService')
| -rw-r--r-- | Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db | bin | 602112 -> 274432 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs | 5 | ||||
| -rw-r--r-- | Software/Visual_Studio/Web/Tango.MachineService/ProtoBufFormatter.cs | 44 |
3 files changed, 49 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db b/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db Binary files differindex 12c88039d..82b936014 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db +++ b/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs index 8b5bee7ae..fb937f52e 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs @@ -18,6 +18,11 @@ namespace Tango.MachineService.Controllers { public class SynchronizationController : ApiController { + /// <summary> + /// Expects a DB synchronization request from a remote machine and returns the synchronized version of the machine database. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> [HttpPost] public SynchronizeDBResponse Synchronize(SynchronizeDBRequest request) { diff --git a/Software/Visual_Studio/Web/Tango.MachineService/ProtoBufFormatter.cs b/Software/Visual_Studio/Web/Tango.MachineService/ProtoBufFormatter.cs index 1edf01acf..8078f1d8f 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/ProtoBufFormatter.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/ProtoBufFormatter.cs @@ -10,30 +10,65 @@ using Tango.PMR.Stubs; namespace Tango.MachineService { + /// <summary> + /// Represents a protobuf web request/response formatter capable of formatting messages using protobuf. + /// </summary> + /// <seealso cref="System.Net.Http.Formatting.MediaTypeFormatter" /> public class ProtoBufFormatter : MediaTypeFormatter { private static readonly MediaTypeHeaderValue mediaType = new MediaTypeHeaderValue("application/x-protobuf"); + /// <summary> + /// Initializes a new instance of the <see cref="ProtoBufFormatter"/> class. + /// </summary> public ProtoBufFormatter() { SupportedMediaTypes.Add(mediaType); } + /// <summary> + /// Gets the default type of the media. + /// </summary> + /// <value> + /// The default type of the media. + /// </value> public static MediaTypeHeaderValue DefaultMediaType { get { return mediaType; } } + /// <summary> + /// Queries whether this <see cref="T:System.Net.Http.Formatting.MediaTypeFormatter" /> can deserializean object of the specified type. + /// </summary> + /// <param name="type">The type to deserialize.</param> + /// <returns> + /// true if the <see cref="T:System.Net.Http.Formatting.MediaTypeFormatter" /> can deserialize the type; otherwise, false. + /// </returns> public override bool CanReadType(Type type) { return true; } + /// <summary> + /// Queries whether this <see cref="T:System.Net.Http.Formatting.MediaTypeFormatter" /> can serializean object of the specified type. + /// </summary> + /// <param name="type">The type to serialize.</param> + /// <returns> + /// true if the <see cref="T:System.Net.Http.Formatting.MediaTypeFormatter" /> can serialize the type; otherwise, false. + /// </returns> public override bool CanWriteType(Type type) { return true; } + /// <summary> + /// Reads from stream asynchronous. + /// </summary> + /// <param name="type">The type.</param> + /// <param name="stream">The stream.</param> + /// <param name="content">The content.</param> + /// <param name="formatterLogger">The formatter logger.</param> + /// <returns></returns> public override Task<object> ReadFromStreamAsync(Type type, Stream stream, HttpContent content, IFormatterLogger formatterLogger) { var tcs = new TaskCompletionSource<object>(); @@ -52,6 +87,15 @@ namespace Tango.MachineService return tcs.Task; } + /// <summary> + /// Writes to stream asynchronous. + /// </summary> + /// <param name="type">The type.</param> + /// <param name="value">The value.</param> + /// <param name="stream">The stream.</param> + /// <param name="content">The content.</param> + /// <param name="transportContext">The transport context.</param> + /// <returns></returns> public override Task WriteToStreamAsync(Type type, object value, Stream stream, HttpContent content, TransportContext transportContext) { var tcs = new TaskCompletionSource<object>(); |
