Exemple #1
0
        protected sealed override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
        {
            CancellationTokenSource cts = new CancellationTokenSource();

            context.UserState = cts;
            return(AsyncFactory.ToBegin(ExecuteAsync(context, cts.Token), callback, state));
        }
        protected sealed override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
        {
            TState activityState = PreExecute(context);

            context.UserState = activityState;
            return(AsyncFactory.ToBegin(ExecuteAsync(activityState), callback, state));
        }
Exemple #3
0
        protected sealed override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
        {
            TState activityState        = PreExecute(context);
            CancellationTokenSource cts = new CancellationTokenSource();

            context.UserState = new Tuple <TState, CancellationTokenSource>(activityState, cts);
            return(AsyncFactory.ToBegin(ExecuteAsync(activityState, cts.Token), callback, state));
        }
 public static IAsyncResult BeginOpen(
     string fileName,
     Encoding fallbackEncoding,
     AsyncCallback callback,
     object state)
 {
     return(AsyncFactory.ToBegin(DicomDirectory.OpenAsync(fileName, fallbackEncoding), callback, state));
 }
 public static IAsyncResult BeginSend(
     this DicomClient @this,
     INetworkStream stream,
     string callingAe,
     string calledAe,
     AsyncCallback callback,
     object state)
 {
     return(AsyncFactory.ToBegin(@this.SendAsync(stream, callingAe, calledAe), callback, state));
 }
Exemple #6
0
 public static IAsyncResult BeginRead(
     this DicomReader @this,
     IByteSource source,
     IDicomReaderObserver observer,
     Func <ParseState, bool> stop,
     AsyncCallback callback,
     object state)
 {
     return(AsyncFactory.ToBegin(@this.ReadAsync(source, observer, stop), callback, state));
 }
 public static IAsyncResult BeginRead(
     this DicomFileReader @this,
     IByteSource source,
     IDicomReaderObserver fileMetaInfo,
     IDicomReaderObserver dataset,
     AsyncCallback callback,
     object state)
 {
     return(AsyncFactory.ToBegin(@this.ReadAsync(source, fileMetaInfo, dataset), callback, state));
 }
 public static IAsyncResult BeginWrite(
     this DicomFileWriter @this,
     IByteTarget target,
     DicomFileMetaInformation fileMetaInfo,
     DicomDataset dataset,
     AsyncCallback callback,
     object state)
 {
     return(AsyncFactory.ToBegin(@this.WriteAsync(target, fileMetaInfo, dataset), callback, state));
 }
 public static IAsyncResult BeginSend(
     this DicomClient @this,
     string host,
     int port,
     bool useTls,
     string callingAe,
     string calledAe,
     AsyncCallback callback,
     object state)
 {
     return(AsyncFactory.ToBegin(@this.SendAsync(host, port, useTls, callingAe, calledAe), callback, state));
 }
Exemple #10
0
 private IAsyncResult BeginCancel0(AsyncCallback callback, object state)
 {
     return(AsyncFactory.ToBegin(Cancel0(), callback, state));
 }
Exemple #11
0
 private IAsyncResult BeginSuccess14(IntReference a, IntReference a1, IntReference a2, IntReference a3, IntReference a4, IntReference a5, IntReference a6, IntReference a7, IntReference a8, IntReference a9, IntReference a10, IntReference a11, IntReference a12, IntReference a13, AsyncCallback callback, object state)
 {
     return(AsyncFactory.ToBegin(Success14(a, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13), callback, state));
 }
Exemple #12
0
 private IAsyncResult BeginSuccess8(IntReference a, IntReference a1, IntReference a2, IntReference a3, IntReference a4, IntReference a5, IntReference a6, IntReference a7, AsyncCallback callback, object state)
 {
     return(AsyncFactory.ToBegin(Success8(a, a1, a2, a3, a4, a5, a6, a7), callback, state));
 }
Exemple #13
0
 private IAsyncResult BeginSuccess4(IntReference a, IntReference a1, IntReference a2, IntReference a3, AsyncCallback callback, object state)
 {
     return(AsyncFactory.ToBegin(Success4(a, a1, a2, a3), callback, state));
 }
Exemple #14
0
 private IAsyncResult BeginSuccess1(IntReference a, AsyncCallback callback, object state)
 {
     return(AsyncFactory.ToBegin(Success1(a), callback, state));
 }
 protected override IAsyncResult OnBeginResumeBookmark(Bookmark bookmark, object value, TimeSpan timeout, AsyncCallback callback, object state)
 => AsyncFactory <BookmarkResumptionResult> .ToBegin(this.host.ResumeBookmarkAsync(bookmark, value, timeout), callback, state);
 public override IAsyncResult BegincloseConnection(string ticket, AsyncCallback callback, object state)
 {
     return(AsyncFactory <string> .ToBegin(closeConnectionAsync(ticket), callback, state));
 }
 public override IAsyncResult BegingetLastError(string ticket, AsyncCallback callback, object state)
 {
     return(AsyncFactory <string> .ToBegin(getLastErrorAsync(ticket), callback, state));
 }
 protected sealed override IAsyncResult BeginTrack(TrackingRecord record, TimeSpan timeout, AsyncCallback callback, object state)
 => AsyncFactory.ToBegin(TrackAsync(record, timeout), callback, state);
 public override IAsyncResult Beginauthenticate(string strUserName, string strPassword, AsyncCallback callback, object state)
 {
     return(AsyncFactory <string[]> .ToBegin(authenticateAsync(strUserName, strPassword), callback, state));
 }
 public override IAsyncResult BeginconnectionError(string ticket, string hresult, string message, AsyncCallback callback, object state)
 {
     return(AsyncFactory <string> .ToBegin(connectionErrorAsync(ticket, hresult, message), callback, state));
 }
 public override IAsyncResult BeginsendRequestXML(string ticket, string strHCPResponse, string strCompanyFileName, string qbXMLCountry, int qbXMLMajorVers, int qbXMLMinorVers, AsyncCallback callback, object state)
 {
     return(AsyncFactory <string> .ToBegin(sendRequestXMLAsync(ticket, strHCPResponse, strCompanyFileName, qbXMLCountry, qbXMLMajorVers, qbXMLMinorVers), callback, state));
 }
 protected sealed override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) =>
 AsyncFactory.ToBegin(ExecuteAsync(context), callback, state);
 protected override IAsyncResult OnBeginPersist(AsyncCallback callback, object state)
 => AsyncFactory.ToBegin(SaveAsync(), callback, state);
Exemple #24
0
 private IAsyncResult BeginSuccess0(AsyncCallback callback, object state)
 {
     return(AsyncFactory.ToBegin(Success0(), callback, state));
 }
 public override IAsyncResult BeginreceiveResponseXML(string ticket, string response, string hresult, string message, AsyncCallback callback, object state)
 {
     return(AsyncFactory <int> .ToBegin(receiveResponseXMLAsync(ticket, response, hresult, message), callback, state));
 }
    protected sealed override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
    {
        var task = ExecuteAsync(context);

        return(AsyncFactory <T> .ToBegin(task, callback, state));
    }