aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
diff options
context:
space:
mode:
authorJan Tattermusch <jtattermusch@users.noreply.github.com>2015-11-08 19:17:08 -0800
committerJan Tattermusch <jtattermusch@users.noreply.github.com>2015-11-08 19:17:08 -0800
commit64aa954daec2f6f2df460f9bcc1e2ca6ba42b640 (patch)
tree1516488c97abdffcf10dcd9f5b9c38b5f6eb1cc6 /csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
parent1e54dcfc707bc6ba23ac9a087336836f95d7fbd0 (diff)
parentcff900e8f9e4b8f3a8f314f0f44eab222ebb870b (diff)
downloadprotobuf-64aa954daec2f6f2df460f9bcc1e2ca6ba42b640.tar.gz
protobuf-64aa954daec2f6f2df460f9bcc1e2ca6ba42b640.tar.bz2
protobuf-64aa954daec2f6f2df460f9bcc1e2ca6ba42b640.zip
Merge pull request #954 from jskeet/blank-lines-in-comments
Stop removing all blank lines in doc comments.
Diffstat (limited to 'csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs')
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
index 39251e2e..cc2dfd26 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
@@ -48,12 +48,16 @@ namespace Google.Protobuf.WellKnownTypes {
/// or "month". It is related to Timestamp in that the difference between
/// two Timestamp values is a Duration and it can be added or subtracted
/// from a Timestamp. Range is approximately +-10,000 years.
+ ///
/// Example 1: Compute Duration from two Timestamps in pseudo code.
+ ///
/// Timestamp start = ...;
/// Timestamp end = ...;
/// Duration duration = ...;
+ ///
/// duration.seconds = end.seconds - start.seconds;
/// duration.nanos = end.nanos - start.nanos;
+ ///
/// if (duration.seconds &lt; 0 &amp;&amp; duration.nanos > 0) {
/// duration.seconds += 1;
/// duration.nanos -= 1000000000;
@@ -61,12 +65,16 @@ namespace Google.Protobuf.WellKnownTypes {
/// duration.seconds -= 1;
/// duration.nanos += 1000000000;
/// }
+ ///
/// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
+ ///
/// Timestamp start = ...;
/// Duration duration = ...;
/// Timestamp end = ...;
+ ///
/// end.seconds = start.seconds + duration.seconds;
/// end.nanos = start.nanos + duration.nanos;
+ ///
/// if (end.nanos &lt; 0) {
/// end.seconds -= 1;
/// end.nanos += 1000000000;