1

Caliburn.Micro で IResult コルーチンを使用しようとすると、この奇妙な例外がスローされます。何か間違っているのでしょうか、それともフレームワークが壊れているのでしょうか?

これは、カスタムクラスyield return resultで発生します。resultIResult

Locating source for 'C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\SequentialResult.cs'. Checksum: MD5 {a2 6e ce dd c5 8c b3 ec 9c 21 b7 9 29 24 e7 a5}
The file 'C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\SequentialResult.cs' does not exist.
Looking in script documents for 'C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\SequentialResult.cs'...
Looking in the projects for 'C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\SequentialResult.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\SequentialResult.cs.
The debugger could not locate the source file 'C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\SequentialResult.cs'  

編集

私はいくつかのコードを求められました。私はまだこれに取り組んでいますが、これを実行しようとしていました。私は基本的に、ページング メカニズムと CM IResult を連携させて WCF サービスを呼び出そうとしていました。

public class PagedRequestManager<T>: IResult where T : IPagedRequest
{
    public delegate IAsyncResult BeginRequestDelegate<T>(T request, AsyncCallback callback, object state);
    public delegate IPagedResponse EndRequestDelegate(IAsyncResult result);

    private BeginRequestDelegate<T> _beginRequest;
    private EndRequestDelegate _endRequest;
    private T _request;

    public IPagedResponse Response { get; private set; }

    public PagedRequestManager(BeginRequestDelegate<T> beginRequest, EndRequestDelegate endRequest, T request)
    {
        _beginRequest = beginRequest;
        _endRequest = endRequest;
        _request = request;
    }

    public event EventHandler<ResultCompletionEventArgs> Completed;

    public void Execute(ActionExecutionContext context)
    {
        _beginRequest(_request, PagedCallback, null);
    }

    private void PagedCallback(IAsyncResult result)
    {
        Response = _endRequest(result);
        OnCompleted();
    }

    private void OnCompleted()
    {
        var handler = Completed;
        if (handler != null)
        {
            handler(this, new ResultCompletionEventArgs());
        }
    }
}


public interface IPagedRequest
{
    PageContext PageInfo { get; set; }
}


public interface IPagedResponse
{
    PageContext PageInfo { get; }
    IEnumerable Result { get; }
}

と使用法:

public IEnumerable<IResult> TestWCF()
{
    var result = new PagedRequestManager<GetItemsRequest>(client.BeginGetItems, client.EndGetItems, new GetItemsRequest() { PageInfo = new PageContext() { Skip = 0, Take = 10 } });
    yield return result;
}

私たちがそれに取り組んでいる間、誰かがこれが良い解決策であるかどうかについて言及したいと思うかもしれません. CM の IResult メカニズムの使用方法と、各 WCF 呼び出しから取得したものをリストにプッシュする最善の方法が何であるかがよくわかりません。

4

0 に答える 0