Skip to content
This repository

Enumeration for Knockout CompareResult status #234

Merged
merged 1 commit into from almost 2 years ago

2 participants

Michael Aird Nikhil Kothari
Michael Aird

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

Nikhil Kothari nikhilk merged commit 8338fae into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 18, 2012
Michael Aird michaelaird Enumeration for Knockout CompareResult status a64ec9b
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 35 additions and 27 deletions. Show diff stats Hide diff stats

  1. +35 27 src/Libraries/Knockout/CompareResult.cs
62 src/Libraries/Knockout/CompareResult.cs
... ... @@ -1,27 +1,35 @@
1   -// CompareResult.cs
2   -// Script#/Libraries/Knockout
3   -// This source code is subject to terms and conditions of the Apache License, Version 2.0.
4   -//
5   -
6   -using System;
7   -using System.Runtime.CompilerServices;
8   -
9   -namespace KnockoutApi {
10   -
11   - [Imported]
12   - [IgnoreNamespace]
13   - public class CompareResult<T> {
14   -
15   - [IntrinsicProperty]
16   - public string Status {
17   - get;
18   - set;
19   - }
20   -
21   - [IntrinsicProperty]
22   - public T Value {
23   - get;
24   - set;
25   - }
26   - }
27   -}
  1 +// CompareResult.cs
  2 +// Script#/Libraries/Knockout
  3 +// This source code is subject to terms and conditions of the Apache License, Version 2.0.
  4 +//
  5 +
  6 +using System;
  7 +using System.Runtime.CompilerServices;
  8 +
  9 +namespace KnockoutApi {
  10 +
  11 + [Imported]
  12 + [IgnoreNamespace]
  13 + public class CompareResult<T> {
  14 +
  15 + [IntrinsicProperty]
  16 + public CompareResultStatus Status
  17 + {
  18 + get;
  19 + set;
  20 + }
  21 +
  22 + [IntrinsicProperty]
  23 + public T Value {
  24 + get;
  25 + set;
  26 + }
  27 + }
  28 +
  29 + [NamedValues]
  30 + public enum CompareResultStatus{
  31 + added,
  32 + deleted,
  33 + retained
  34 + }
  35 +}

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.