Exemplo n.º 1
0
 private static void AddAttibutes(StringBuilder sb, KOModel model)
 {
     foreach (var attribute in model.Attributes)
     {
         var line = "\tthis." + attribute.Key + ": " + KOUtils.WrapObservable(KOUtils.ToJavascriptValue(attribute.Value.Value), attribute.Value.Observable);
         line += ";";
         sb.AppendLine(line);
     }
 }
Exemplo n.º 2
0
 private static void AddObjects(StringBuilder sb, KOModel model)
 {
     foreach (var observable in model.Objects)
     {
         var line = "\tthis." + observable.Key + ": " +
                    KOUtils.WrapObservable(observable.Value.Value.ToJavascript(), observable.Value.Observable);
         line += ";";
         sb.AppendLine(line);
     }
 }
Exemplo n.º 3
0
 private static void AddAttibutes(StringBuilder sb, KOModel model)
 {
     foreach (var attribute in model.Attributes)
     {
         var line = "\t" + attribute.Key + ": " + KOUtils.WrapObservable(KOUtils.ToJavascriptValue(attribute.Value.Value), attribute.Value.Observable);
         if (attribute.Key != model.Attributes.Last().Key || model.Objects.Any() || model.Arrays.Any())
         {
             line += ", ";
         }
         sb.AppendLine(line);
     }
 }
Exemplo n.º 4
0
 private static void AddObjects(StringBuilder sb, KOModel model)
 {
     foreach (var observable in model.Objects)
     {
         var line = "\t" + observable.Key + ": " +
                    KOUtils.WrapObservable(observable.Value.Value.ToJavascript(), observable.Value.Observable);
         if (observable.Key != model.Objects.Last().Key || model.Arrays.Any())
         {
             line += ", ";
         }
         sb.AppendLine(line);
     }
 }