Skip to content

Loading…

Enumeration for Knockout CompareResult status #234

Merged
merged 1 commit into from

2 participants

@michaelaird

adding an enum to "strongly type" the status on CompareResult

@nikhilk nikhilk merged commit 8338fae into nikhilk:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 18, 2012
  1. @michaelaird
Showing with 35 additions and 27 deletions.
  1. +35 −27 src/Libraries/Knockout/CompareResult.cs
View
62 src/Libraries/Knockout/CompareResult.cs
@@ -1,27 +1,35 @@
-// CompareResult.cs
-// Script#/Libraries/Knockout
-// This source code is subject to terms and conditions of the Apache License, Version 2.0.
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace KnockoutApi {
-
- [Imported]
- [IgnoreNamespace]
- public class CompareResult<T> {
-
- [IntrinsicProperty]
- public string Status {
- get;
- set;
- }
-
- [IntrinsicProperty]
- public T Value {
- get;
- set;
- }
- }
-}
+// CompareResult.cs
+// Script#/Libraries/Knockout
+// This source code is subject to terms and conditions of the Apache License, Version 2.0.
+//
+
+using System;
+using System.Runtime.CompilerServices;
+
+namespace KnockoutApi {
+
+ [Imported]
+ [IgnoreNamespace]
+ public class CompareResult<T> {
+
+ [IntrinsicProperty]
+ public CompareResultStatus Status
+ {
+ get;
+ set;
+ }
+
+ [IntrinsicProperty]
+ public T Value {
+ get;
+ set;
+ }
+ }
+
+ [NamedValues]
+ public enum CompareResultStatus{
+ added,
+ deleted,
+ retained
+ }
+}
Something went wrong with that request. Please try again.