Ejemplo n.º 1
0
        public Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Envelope __msgEnv__ = null;
            Microsoft.XLANGs.Core.Segment  __seg__    = _segments[1];
            Microsoft.XLANGs.Core.Context  __ctx__    = (Microsoft.XLANGs.Core.Context)_stateMgrs[1];
            __QuoteService_root_0          __ctx0__   = (__QuoteService_root_0)_stateMgrs[0];
            __QuoteService_1 __ctx1__ = (__QuoteService_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx__.PrologueCompleted = true;
                if (!PostProgressInc(__seg__, __ctx__, 1))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                goto case 1;

            case 1:
                if (!PreProgressInc(__seg__, __ctx__, 2))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                Tracker.FireEvent(__eventLocations[0], __eventData[0], _stateMgrs[1].TrackDataStream);
                if (IsDebugged)
                {
                    return(Microsoft.XLANGs.Core.StopConditions.InBreakpoint);
                }
                goto case 2;

            case 2:
                if (!PreProgressInc(__seg__, __ctx__, 3))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                Tracker.FireEvent(__eventLocations[1], __eventData[1], _stateMgrs[1].TrackDataStream);
                if (IsDebugged)
                {
                    return(Microsoft.XLANGs.Core.StopConditions.InBreakpoint);
                }
                goto case 3;

            case 3:
                if (!Port_1.GetMessageId(__ctx0__.__subWrapper0.getSubscription(this), __seg__, __ctx1__, out __msgEnv__))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Blocked);
                }
                if (__ctx1__.__msgQuote != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__msgQuote);
                }
                __ctx1__.__msgQuote = new __messagetype_StockQuoteService_StockQuote("msgQuote", __ctx1__);
                __ctx1__.RefMessage(__ctx1__.__msgQuote);
                Port_1.ReceiveMessage(0, __msgEnv__, __ctx1__.__msgQuote, null, (Microsoft.XLANGs.Core.Context)_stateMgrs[1], __seg__);
                if (!PostProgressInc(__seg__, __ctx__, 4))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                goto case 4;

            case 4:
                if (!PreProgressInc(__seg__, __ctx__, 5))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Receive);
                    __edata.Messages.Add(__ctx1__.__msgQuote);
                    __edata.PortName = @"Port_1";
                    Tracker.FireEvent(__eventLocations[2], __edata, _stateMgrs[1].TrackDataStream);
                }
                if (IsDebugged)
                {
                    return(Microsoft.XLANGs.Core.StopConditions.InBreakpoint);
                }
                goto case 5;

            case 5:
                if (!PreProgressInc(__seg__, __ctx__, 6))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                Tracker.FireEvent(__eventLocations[3], __eventData[2], _stateMgrs[1].TrackDataStream);
                if (IsDebugged)
                {
                    return(Microsoft.XLANGs.Core.StopConditions.InBreakpoint);
                }
                goto case 6;

            case 6:
            {
                __messagetype_StockQuoteService_StockQuote __msgResponse = new __messagetype_StockQuoteService_StockQuote("msgResponse", __ctx1__);

                __msgResponse.CopyFrom(__ctx1__.__msgQuote);
                RootService.CommitStateManager.UserCodeCalled = true;
                __msgResponse.CopyContextPropertiesFrom(__ctx1__.__msgQuote);
                RootService.CommitStateManager.UserCodeCalled = true;
                if (__ctx1__ != null && __ctx1__.__msgQuote != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__msgQuote);
                    __ctx1__.__msgQuote = null;
                }
                __msgResponse.part.SetDistinguishedField("LastPrice", "29.29");
                RootService.CommitStateManager.UserCodeCalled = true;

                if (__ctx1__.__msgResponse != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__msgResponse);
                }
                __ctx1__.__msgResponse = __msgResponse;
                __ctx1__.RefMessage(__ctx1__.__msgResponse);
            }
                __ctx1__.__msgResponse.ConstructionCompleteEvent(false);
                if (!PostProgressInc(__seg__, __ctx__, 7))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                goto case 7;

            case 7:
                if (!PreProgressInc(__seg__, __ctx__, 8))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx1__.__msgResponse);
                    Tracker.FireEvent(__eventLocations[4], __edata, _stateMgrs[1].TrackDataStream);
                }
                if (IsDebugged)
                {
                    return(Microsoft.XLANGs.Core.StopConditions.InBreakpoint);
                }
                goto case 8;

            case 8:
                if (!PreProgressInc(__seg__, __ctx__, 9))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                Tracker.FireEvent(__eventLocations[5], __eventData[3], _stateMgrs[1].TrackDataStream);
                if (IsDebugged)
                {
                    return(Microsoft.XLANGs.Core.StopConditions.InBreakpoint);
                }
                goto case 9;

            case 9:
                if (!__ctx1__.PrepareToPendingCommit(__seg__))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Blocked);
                }
                if (!PostProgressInc(__seg__, __ctx__, 10))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                goto case 10;

            case 10:
                if (!PreProgressInc(__seg__, __ctx__, 11))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                Port_1.SendMessage(0, __ctx1__.__msgResponse, null, null, __ctx1__, __seg__, Microsoft.XLANGs.Core.ActivityFlags.NextActivityPersists);
                if (Port_1 != null)
                {
                    Port_1.Close(__ctx1__, __seg__);
                    Port_1 = null;
                }
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingResp) != 0)
                {
                    return(Microsoft.XLANGs.Core.StopConditions.OutgoingResp);
                }
                goto case 11;

            case 11:
                if (!PreProgressInc(__seg__, __ctx__, 12))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Send);
                    __edata.Messages.Add(__ctx1__.__msgResponse);
                    __edata.PortName = @"Port_1";
                    Tracker.FireEvent(__eventLocations[6], __edata, _stateMgrs[1].TrackDataStream);
                }
                if (__ctx1__ != null && __ctx1__.__msgResponse != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__msgResponse);
                    __ctx1__.__msgResponse = null;
                }
                if (IsDebugged)
                {
                    return(Microsoft.XLANGs.Core.StopConditions.InBreakpoint);
                }
                goto case 12;

            case 12:
                if (!PreProgressInc(__seg__, __ctx__, 13))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                Tracker.FireEvent(__eventLocations[7], __eventData[4], _stateMgrs[1].TrackDataStream);
                if (IsDebugged)
                {
                    return(Microsoft.XLANGs.Core.StopConditions.InBreakpoint);
                }
                goto case 13;

            case 13:
                if (!__ctx1__.CleanupAndPrepareToCommit(__seg__))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Blocked);
                }
                if (!PostProgressInc(__seg__, __ctx__, 14))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                goto case 14;

            case 14:
                if (!PreProgressInc(__seg__, __ctx__, 15))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                __ctx1__.OnCommit();
                goto case 15;

            case 15:
                __seg__.SegmentDone();
                _segments[0].PredecessorDone(this);
                break;
            }
            return(Microsoft.XLANGs.Core.StopConditions.Completed);
        }
Ejemplo n.º 2
0
        public Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Envelope __msgEnv__ = null;
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[1];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[1];
            __QuoteService_root_0 __ctx0__ = (__QuoteService_root_0)_stateMgrs[0];
            __QuoteService_1 __ctx1__ = (__QuoteService_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[0],__eventData[0],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[1],__eventData[1],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                if (!Port_1.GetMessageId(__ctx0__.__subWrapper0.getSubscription(this), __seg__, __ctx1__, out __msgEnv__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if (__ctx1__.__msgQuote != null)
                    __ctx1__.UnrefMessage(__ctx1__.__msgQuote);
                __ctx1__.__msgQuote = new __messagetype_StockQuoteService_StockQuote("msgQuote", __ctx1__);
                __ctx1__.RefMessage(__ctx1__.__msgQuote);
                Port_1.ReceiveMessage(0, __msgEnv__, __ctx1__.__msgQuote, null, (Microsoft.XLANGs.Core.Context)_stateMgrs[1], __seg__);
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Receive);
                    __edata.Messages.Add(__ctx1__.__msgQuote);
                    __edata.PortName = @"Port_1";
                    Tracker.FireEvent(__eventLocations[2],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                if ( !PreProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[3],__eventData[2],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 6;
            case 6:
                {
                    __messagetype_StockQuoteService_StockQuote __msgResponse = new __messagetype_StockQuoteService_StockQuote("msgResponse", __ctx1__);

                    __msgResponse.CopyFrom(__ctx1__.__msgQuote);
                    RootService.CommitStateManager.UserCodeCalled = true;
                    __msgResponse.CopyContextPropertiesFrom(__ctx1__.__msgQuote);
                    RootService.CommitStateManager.UserCodeCalled = true;
                    if (__ctx1__ != null && __ctx1__.__msgQuote != null)
                    {
                        __ctx1__.UnrefMessage(__ctx1__.__msgQuote);
                        __ctx1__.__msgQuote = null;
                    }
                    __msgResponse.part.SetDistinguishedField("LastPrice", "29.29");
                    RootService.CommitStateManager.UserCodeCalled = true;

                    if (__ctx1__.__msgResponse != null)
                        __ctx1__.UnrefMessage(__ctx1__.__msgResponse);
                    __ctx1__.__msgResponse = __msgResponse;
                    __ctx1__.RefMessage(__ctx1__.__msgResponse);
                }
                __ctx1__.__msgResponse.ConstructionCompleteEvent(false);
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx1__.__msgResponse);
                    Tracker.FireEvent(__eventLocations[4],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[5],__eventData[3],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 9;
            case 9:
                if (!__ctx1__.PrepareToPendingCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 10;
            case 10:
                if ( !PreProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Port_1.SendMessage(0, __ctx1__.__msgResponse, null, null, __ctx1__, __seg__ , Microsoft.XLANGs.Core.ActivityFlags.NextActivityPersists );
                if (Port_1 != null)
                {
                    Port_1.Close(__ctx1__, __seg__);
                    Port_1 = null;
                }
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingResp) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.OutgoingResp;
                goto case 11;
            case 11:
                if ( !PreProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Send);
                    __edata.Messages.Add(__ctx1__.__msgResponse);
                    __edata.PortName = @"Port_1";
                    Tracker.FireEvent(__eventLocations[6],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (__ctx1__ != null && __ctx1__.__msgResponse != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__msgResponse);
                    __ctx1__.__msgResponse = null;
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 12;
            case 12:
                if ( !PreProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[7],__eventData[4],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 13;
            case 13:
                if (!__ctx1__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 14 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 14;
            case 14:
                if ( !PreProgressInc( __seg__, __ctx__, 15 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx1__.OnCommit();
                goto case 15;
            case 15:
                __seg__.SegmentDone();
                _segments[0].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }