public Microsoft.XLANGs.Core.StopConditions segment0(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment                  __seg__  = _segments[0];
            Microsoft.XLANGs.Core.Context                  __ctx__  = (Microsoft.XLANGs.Core.Context)_stateMgrs[0];
            __MTFMVISIONFM_MTFMVISIONLOCQUERYClient_1      __ctx1__ = (__MTFMVISIONFM_MTFMVISIONLOCQUERYClient_1)_stateMgrs[1];
            __MTFMVISIONFM_MTFMVISIONLOCQUERYClient_root_0 __ctx0__ = (__MTFMVISIONFM_MTFMVISIONLOCQUERYClient_root_0)_stateMgrs[0];

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

            case 1:
                __ctx1__      = new __MTFMVISIONFM_MTFMVISIONLOCQUERYClient_1(this);
                _stateMgrs[1] = __ctx1__;
                if (!PostProgressInc(__seg__, __ctx__, 2))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                goto case 2;

            case 2:
                __ctx0__.StartContext(__seg__, __ctx1__);
                if (!PostProgressInc(__seg__, __ctx__, 3))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                return(Microsoft.XLANGs.Core.StopConditions.Blocked);

            case 3:
                if (!__ctx0__.CleanupAndPrepareToCommit(__seg__))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Blocked);
                }
                if (!PostProgressInc(__seg__, __ctx__, 4))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                goto case 4;

            case 4:
                __ctx1__.Finally();
                ServiceDone(__seg__, (Microsoft.XLANGs.Core.Context)_stateMgrs[0]);
                __ctx0__.OnCommit();
                break;
            }
            return(Microsoft.XLANGs.Core.StopConditions.Completed);
        }
        private void ConstructorHelper()
        {
            _segments = new Microsoft.XLANGs.Core.Segment[] {
                new Microsoft.XLANGs.Core.Segment(new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment0), 0, 0, 0),
                new Microsoft.XLANGs.Core.Segment(new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment1), 1, 1, 1)
            };

            _Locks        = 0;
            _rootContext  = new __MTFMVISIONFM_MTFMVISIONLOCQUERYClient_root_0(this);
            _stateMgrs    = new Microsoft.XLANGs.Core.IStateManager[2];
            _stateMgrs[0] = _rootContext;
            FinalConstruct();
        }
        public Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment                  __seg__  = _segments[1];
            Microsoft.XLANGs.Core.Context                  __ctx__  = (Microsoft.XLANGs.Core.Context)_stateMgrs[1];
            __MTFMVISIONFM_MTFMVISIONLOCQUERYClient_1      __ctx1__ = (__MTFMVISIONFM_MTFMVISIONLOCQUERYClient_1)_stateMgrs[1];
            __MTFMVISIONFM_MTFMVISIONLOCQUERYClient_root_0 __ctx0__ = (__MTFMVISIONFM_MTFMVISIONLOCQUERYClient_root_0)_stateMgrs[0];

            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 (!__ctx1__.CleanupAndPrepareToCommit(__seg__))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Blocked);
                }
                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);
                }
                __ctx1__.OnCommit();
                goto case 5;

            case 5:
                __seg__.SegmentDone();
                _segments[0].PredecessorDone(this);
                break;
            }
            return(Microsoft.XLANGs.Core.StopConditions.Completed);
        }