2011-10-06 42 views

回答

1

我最终制作了一个新的“导入库”项目 并定义了缺失的部分。

namespace KnockoutApi 
{ 
    [Imported] 
    [IgnoreNamespace] 
    [ScriptName("ko")] 
    public static class Ko 
    { 
     /// <summary> 
     /// Creates an observable with a value computed from one or more other values. 
     /// </summary> 
     /// <typeparam name="T">The type of the observable value.</typeparam> 
     /// <param name="options">Options for the dependent observable.</param> 
     public static DependentObservable<T> DependentObservable<T>(DependentObservableWritableOptions<T> options) 
     { 
      return null; 
     } 
    } 
} 


[IgnoreNamespace] 
[Imported] 
[ScriptName("Object")] 
public class DependentObservableWritableOptions<T> 
{ 
    public DependentObservableWritableOptions() 
    { } 

    // Summary: 
    //  Gets or sets whether the evaluation should be deferred, i.e. not performed 
    //  when the observable is first created. 
    [IntrinsicProperty] 
    public bool DeferEvaluation { get; set; } 

    // 
    // Summary: 
    //  Gets or sets the function to compute the value. 
    [ScriptName("read")] 
    [IntrinsicProperty] 
    public Func<T> GetValueFunction { get; set; } 

    // 
    // Summary: 
    // Gets or sets the function to compute the value. 
    [ScriptName("write")] 
    [IntrinsicProperty] 
    public Action<T> SetValueFunction { get; set; } 

    // 
    // Summary: 
    //  Gets the model instance which acts as 'this' in the get value function. 
    [IntrinsicProperty] 
    [ScriptName("owner")] 
    public object Model { get; set; } 
} 
+0

你应该通过github上的git仓库将这个回馈给项目。它可能会帮助其他人...... –