public void Start(Point pos)
        {
            _startPos = pos;

            switch (DrawStepType)
            {
            case DrawStep.DrawStepType.DrawRect:
                _nowDrawing = StartDrawRect();
                break;

            case DrawStep.DrawStepType.DrawEllipse:
                _nowDrawing = StartDrawEllipse();
                break;

            case DrawStep.DrawStepType.DrawLine:
                _nowDrawing = StartDrawLine();
                break;

            case DrawStep.DrawStepType.DrawText:
                _nowDrawing = StartDrawText();
                break;
            }

            StepManager.InsertNext(_nowDrawing);

            if (_nowDrawing.Iterations != -1)
            {
                StepManager.RefreshToCurrentStep();
            }
        }
Exemple #2
0
        public IStepResult Run(StepManager manager)
        {
            if (!ShouldBeShown(manager))
            {
                return(IStepResult.Skip);
            }

            Dialog = CreateDialog();

            IStepResult result;

            switch (Dialog.Show())
            {
            case DialogResult.Ok:
                result = IStepResult.Next;
                break;

            case DialogResult.Back:
                result = IStepResult.Previous;
                break;

            default:
                result = IStepResult.Cancel;
                break;
            }

            if (result == IStepResult.Next)
            {
                OnSuccess();
            }

            return(result);
        }
        public void Move(Point pos)
        {
            if (_nowDrawing != null)
            {
                switch (DrawStepType)
                {
                case DrawStep.DrawStepType.DrawRect:
                    ResizeDrawnRect(pos);
                    break;

                case DrawStep.DrawStepType.DrawEllipse:
                    ResizeDrawnEllipse(pos);
                    break;

                case DrawStep.DrawStepType.DrawLine:
                    ResizeDrawnLine(pos);
                    break;

                case DrawStep.DrawStepType.DrawText:
                    ResizeDrawnText(pos);
                    break;
                }
                if ((_nowDrawing.Iterations != -1) || (StepManager.FinalStep != null))
                {
                    StepManager.RefreshToCurrentStep();
                }
            }
        }
Exemple #4
0
    /// <summary>
    /// 仪器展示
    /// </summary>
    public IEnumerator EleIntroduceMove()
    {
        EleItem item    = EleDataBase.Instance().EleItems[_eleIntroduceMoveIndex];
        var     tweener = Camera.main.transform.DOMove(item.LookPos, 0.3f);

        tweener.OnStart(() =>
        {
            Camera.main.transform.DORotateQuaternion(item.LookQua, 0.3f);
            if (_eleIntroduceMoveIndex > 0 && _eleIntroduceMoveIndex < EleDataBase.Instance().EleItems.Count)
            {
                EleDataBase.Instance().EleItems[_eleIntroduceMoveIndex - 1].OffHighLighting();
            }
        });
        tweener.OnComplete(() =>
        {
            item.SetHighLighting(true);
            _eleIntroduceMoveIndex++;
        });
        yield return(new WaitForSeconds(2f));

        if (_eleIntroduceMoveIndex < EleDataBase.Instance().EleItems.Count)
        {
            StartCoroutine(EleIntroduceMove());
        }
        else
        {
            Camera.main.transform.DOMove(DefaultTran.position, 0.3f).OnStart(
                () => {
                Camera.main.transform.DORotateQuaternion(DefaultTran.rotation, 0.3f);
                EleDataBase.Instance().EleItems[_eleIntroduceMoveIndex - 1].OffHighLighting();
            }).OnComplete(
                () => StepManager.Instance().ChangeGameState(StepManager.StepState.Gameing));
        }
    }
Exemple #5
0
        public void Move(Figure selected, Point pos)
        {
            switch (selected.Type)
            {
            case Figure.FigureType.Rect:
                _moved = true;
                MoveRect((RectFigure)selected, pos);
                break;

            case Figure.FigureType.Ellipse:
                _moved = true;
                MoveEllipse((EllipseFigure)selected, pos);
                break;

            case Figure.FigureType.Line:
                _moved = true;
                MoveLine((LineFigure)selected, pos);
                break;

            case Figure.FigureType.Text:
                _moved = true;
                MoveText((TextFigure)selected, pos);
                break;
            }

            if ((_nowMoving != null) && ((_nowMoving.Iterations != -1) || (StepManager.FinalStep != null)))
            {
                StepManager.RefreshToCurrentStep();
            }
        }
Exemple #6
0
    public bool IsCurDragTarget(EleItem item)
    {
        int      index = StepManager.Instance().CurSetpIndex - 1;
        StepItem temp  = GetOneStepItem(index);

        return(temp.CurDragEleItem.Name.Equals(item.Name));
    }
Exemple #7
0
 private void Update()
 {
     if (StepManager.Instance().GameState == StepManager.StepState.Gameing)
     {
         if (Input.GetMouseButtonDown(0))
         {
             _mouseDown = true;
             Debug.Log("OnMouseDown0();");
             OnMouseDown0();
         }
         if (Input.GetMouseButtonUp(0))
         {
             _mouseDown = false;
             Debug.Log("OnMouseUp0();");
             OnMouseUp0();
         }
         if (_mouseDown)
         {
             if (Input.GetAxis("Mouse X") != 0 || Input.GetAxis("Mouse Y") != 0)
             {
                 Debug.Log("OnMouseDrag0();");
                 OnMouseDrag0();
             }
             else
             {
             }
         }
     }
 }
Exemple #8
0
    void Start()
    {
        Transform cameraPivotPoint = GameObject.FindGameObjectWithTag("CameraPivotPoint").transform;

        CameraMovementManager = new CameraMovementManager(cameraPivotPoint, CameraMovementManagerComponent);
        StepManager           = new StepManager(this);
    }
Exemple #9
0
    public StepItem GetCurStepItem()
    {
        int      index = StepManager.Instance().CurSetpIndex - 1;
        StepItem temp  = GetOneStepItem(index);

        return(temp);
    }
Exemple #10
0
    // Use this for initialization
    void Start()
    {
        StepManager stepManager = GameObject.FindObjectOfType <StepManager> ();

        stepManager.AddObserver(this);
        enemyController = GetComponent <PlayerControl> ();
    }
Exemple #11
0
 private void textBox5_TextChanged(object sender, EventArgs e)
 {
     if (_ignoreTextChanged)
     {
         return;
     }
     if (StepManager.CurrentStep is DrawStep)
     {
         var ds = (DrawStep) StepManager.CurrentStep;
         if (ds.StepType == DrawStep.DrawStepType.DrawRect)
         {
             ((DrawRectStep) ds).Figure.FigureColor.Parse(textBox5.Text);
         }
         else if (ds.StepType == DrawStep.DrawStepType.DrawLine)
         {
             ((DrawLineStep) ds).Figure.FigureColor.Parse(textBox5.Text);
         }
         else if (ds.StepType == DrawStep.DrawStepType.DrawText)
         {
             ((DrawTextStep) ds).Figure.FigureColor.Parse(textBox5.Text);
         }
     }
     if ((StepManager.CurrentStep.Iterations != -1) || (StepManager.FinalStep != null))
     {
         StepManager.RefreshToCurrentStep();
     }
     else
     {
         MainForm.RedrawNeeded?.Invoke();
     }
 }
 void OnDestroy()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
Exemple #13
0
        private static Configuration HandleCustomSolution(string outputPath, bool generateEntryProject, IEnumerable<string> directories)
        {
            var stepManager = new StepManager();
            var pathHelper = new PathHelper(directories.Select(Path.GetFullPath));

            var uiSelectionStep = new UiStep(pathHelper);
            var robotTestsStep = new RobotTestsStep("Choose robot tests:", pathHelper);
            stepManager
                .AddStep(uiSelectionStep)
                .AddStep(new ProjectsListStep<CpuCoreProject>("Choose supported architectures:", pathHelper))
                .AddStep(new ProjectsListStep<ExtensionProject>("Choose extensions libraries:", pathHelper))
                .AddStep(new PluginStep("Choose plugins:", pathHelper))
                .AddStep(new ProjectsListStep<TestsProject>("Choose tests:", pathHelper))
                .AddStep(robotTestsStep)
                .AddStep(new ProjectsListStep<UnknownProject>("Choose other projects:", pathHelper))
                .Run();
            
            if(stepManager.IsCancelled)
            {
                return null;
            }

            return new Configuration(
                SolutionGenerator.Generate(uiSelectionStep.UIProject, generateEntryProject, outputPath,
                    stepManager.GetSteps<ProjectsListStep>().SelectMany(x => x.AdditionalProjects).Union(uiSelectionStep.UIProject.GetAllReferences())),
                robotTestsStep.SelectedTests);
        }
        private void DoDelete(ICRMEvent context, Guid pluginStepId, mwo_PluginStepRegistration subject)
        {
            subject.mwo_ImageType = mwo_ImageType.None;
            DoManageImage(context, pluginStepId, subject);

            StepManager.Delete(pluginStepId);
            Tracer.Trace($"Deleted PluginStep: {pluginStepId}");
        }
Exemple #15
0
 static public void ReStart()
 {
     DungeonManager.ReStart();
     PlayerManager.ReStart();
     StepManager.ReStart();
     PlayerManager.instance.keyQueue.Clear();
     UIManger.instance.UpdateStepText();
 }
Exemple #16
0
 public static StepManager Instance()
 {
     if (_instance == null)
     {
         _instance = new StepManager();
     }
     return(_instance);
 }
Exemple #17
0
        internal void UpdateDesc()
        {
            string str = StepManager.Instance().GetCurStepDesc();

            SetCurDesc(str);
            string strAll = StepManager.Instance().GetAllDesc();

            SetAllDesc(strAll);
        }
Exemple #18
0
 private void guideLabel_Click(object sender, EventArgs e)
 {
     if (_selected != null)
     {
         _selected.IsGuide    = !_selected.IsGuide;
         guideLabel.ForeColor = _selected.IsGuide ? SystemColors.ControlText : SystemColors.ControlDark;
         StepManager.RefreshToCurrentStep();
     }
 }
Exemple #19
0
        public VendorIntegration()
        {
            StepManager
            .NewStep()
            .Message("Delete")
            .EntityName("account")
            .Stage(PluginStage.PostOperation)
            .RequiredPreImages("PreImage")
            .PluginAction(HandleDeleteVendor)
            .Register();

            StepManager
            .NewStep()
            .Message("Delete")
            .EntityName("contact")
            .Stage(PluginStage.PostOperation)
            .RequiredPreImages("PreImage")
            .PluginAction(HandleDeleteVendor)
            .Register();

            StepManager
            .NewStep()
            .Message("Update")
            .EntityName("account")
            .Stage(PluginStage.PostOperation)
            .RequiredPreImages("PreImage")
            .PluginAction(HandleUpdateVendor)
            .Register();

            StepManager
            .NewStep()
            .Message("Update")
            .EntityName("contact")
            .Stage(PluginStage.PostOperation)
            .RequiredPreImages("PreImage")
            .PluginAction(HandleUpdateVendor)
            .Register();

            StepManager
            .NewStep()
            .Message("Delete")
            .EntityName("uds_bankaccount")
            .Stage(PluginStage.PostOperation)
            .RequiredPreImages("PreImage")
            .PluginAction(HandleDeleteBankAccount)
            .Register();

            StepManager
            .NewStep()
            .Message("Update")
            .EntityName("uds_bankaccount")
            .Stage(PluginStage.PostOperation)
            .RequiredPreImages("PreImage")
            .PluginAction(HandleUpdateBankAccount)
            .Register();
        }
Exemple #20
0
        private void ScaleText(TextFigure tf, Point pos)
        {
            if (_nowScaling == null)
            {
                _originalX = tf.X.CachedValue.AsDouble;
                _originalY = tf.Y.CachedValue.AsDouble;
                _originalW = tf.Width.CachedValue.AsDouble;
                _originalH = tf.Height.CachedValue.AsDouble;
                var snappedTo   = StepManager.SnapTo(pos, tf.GetMagnets(), tf.Center);
                var bLenSquared = _originalW * _originalW + _originalH * _originalH;
                if ((snappedTo == tf.Start) && (Math.Abs(bLenSquared) > Utils.Tolerance))
                {
                    var ax = _originalX + _originalW - pos.X;
                    var ay = _originalY + _originalH - pos.Y;

                    _nowScaling = new ScaleTextStep(tf, ScaleTextStep.Side.End,
                                                    (ax * _originalW + ay * _originalH) / bLenSquared);
                }
                else if ((snappedTo == tf.End) && (Math.Abs(bLenSquared) > Utils.Tolerance))
                {
                    var ax = pos.X - _originalX;
                    var ay = pos.Y - _originalY;

                    _nowScaling = new ScaleTextStep(tf, ScaleTextStep.Side.Start,
                                                    (ax * _originalW + ay * _originalH) / bLenSquared);
                }
                if (_nowScaling == null)
                {
                    return;
                }
                StepManager.InsertNext(_nowScaling);
            }
            else
            {
                var sts = (ScaleTextStep)_nowScaling;

                if (sts.ScaleAround == ScaleTextStep.Side.Start)
                {
                    var bLenSquared = _originalW * _originalW + _originalH * _originalH;

                    var ax = pos.X - _originalX;
                    var ay = pos.Y - _originalY;

                    sts.Scale((ax * _originalW + ay * _originalH) / bLenSquared);
                }
                else if (sts.ScaleAround == ScaleTextStep.Side.End)
                {
                    var bLenSquared = _originalW * _originalW + _originalH * _originalH;

                    var ax = _originalX + _originalW - pos.X;
                    var ay = _originalY + _originalH - pos.Y;

                    sts.Scale((ax * _originalW + ay * _originalH) / bLenSquared);
                }
            }
        }
        private DrawTextStep StartDrawText()
        {
            var snapped = StepManager.Snap(_startPos);

            if (snapped == null)
            {
                return(new DrawTextStep(_startPos.X, _startPos.Y, 0, 0));
            }
            return(new DrawTextStep(snapped.X.ExprString, snapped.Y.ExprString, "0", "0", snapped.Def));
        }
Exemple #22
0
 // Use this for initialization
 void Start()
 {
     globalControl = GetComponent <Puppet2D_GlobalControl> ();
     animator      = GetComponent <Animator> ();
     //gunTop = transform.Find ("gunTop");
     stepManager    = GameObject.FindObjectOfType <StepManager> ();
     originPosition = transform.position;
     Debug.Log("originPosition" + originPosition);
     Debug.Log("originPosition.local" + transform.localPosition);
 }
Exemple #23
0
        public void SetUp()
        {
            this.stepManager = new StepManager();

            var stepInfo = new Mock <IStepInformation>();

            stepInfo.SetupGet(m => m.Keyword).Returns("abc");

            this.stepManager.Register(stepInfo.Object);
        }
Exemple #24
0
        private void ScaleEllipse(EllipseFigure ef, Point pos)
        {
            if (_nowScaling == null)
            {
                _originalW = ef.Radius1.CachedValue.AsDouble;
                _originalH = ef.Radius2.CachedValue.AsDouble;
                var snappedTo = StepManager.SnapTo(pos, ef.GetMagnets(), ef.Center);
                if ((snappedTo == ef.Left) && (Math.Abs(_originalW) > Utils.Tolerance))
                {
                    _nowScaling = new ScaleEllipseStep(ef, ScaleEllipseStep.Side.Right,
                                                       1 - (pos.X - _downPos.X) / _originalW);
                }
                else if ((snappedTo == ef.Right) && (Math.Abs(_originalW) > Utils.Tolerance))
                {
                    _nowScaling = new ScaleEllipseStep(ef, ScaleEllipseStep.Side.Left,
                                                       1 + (pos.X - _downPos.X) / _originalW);
                }
                else if ((snappedTo == ef.Top) && (Math.Abs(_originalH) > Utils.Tolerance))
                {
                    _nowScaling = new ScaleEllipseStep(ef, ScaleEllipseStep.Side.Bottom,
                                                       1 - (pos.Y - _downPos.Y) / _originalH);
                }
                else if ((snappedTo == ef.Bottom) && (Math.Abs(_originalH) > Utils.Tolerance))
                {
                    _nowScaling = new ScaleEllipseStep(ef, ScaleEllipseStep.Side.Top,
                                                       1 + (pos.Y - _downPos.Y) / _originalH);
                }
                if (_nowScaling == null)
                {
                    return;
                }
                StepManager.InsertNext(_nowScaling);
            }
            else
            {
                var srs = (ScaleEllipseStep)_nowScaling;

                if (srs.ScaleAround == ScaleEllipseStep.Side.Right)
                {
                    srs.Scale(1 - (pos.X - _downPos.X) / _originalW);
                }
                else if (srs.ScaleAround == ScaleEllipseStep.Side.Left)
                {
                    srs.Scale(1 + (pos.X - _downPos.X) / _originalW);
                }
                else if (srs.ScaleAround == ScaleEllipseStep.Side.Top)
                {
                    srs.Scale(1 + (pos.Y - _downPos.Y) / _originalH);
                }
                else if (srs.ScaleAround == ScaleEllipseStep.Side.Bottom)
                {
                    srs.Scale(1 - (pos.Y - _downPos.Y) / _originalH);
                }
            }
        }
        private void RotateText(TextFigure tf, Point pos)
        {
            if (_nowRotating == null)
            {
                var snappedTo = StepManager.SnapTo(pos, tf.GetMagnets(), tf.Center);
                if (snappedTo == tf.Start)
                {
                    var angle = Utils.AngleBetween(tf.X.CachedValue.AsDouble + tf.Width.CachedValue.AsDouble - pos.X,
                                                   tf.Y.CachedValue.AsDouble + tf.Height.CachedValue.AsDouble - pos.Y,
                                                   tf.Width.CachedValue.AsDouble,
                                                   tf.Height.CachedValue.AsDouble);

                    _nowRotating = new RotateTextStep(tf, RotateTextStep.Side.End,
                                                      angle / (2 * Math.PI));
                }
                else if (snappedTo == tf.End)
                {
                    var angle = Utils.AngleBetween(pos.X - tf.X.CachedValue.AsDouble, pos.Y - tf.Y.CachedValue.AsDouble,
                                                   tf.Width.CachedValue.AsDouble, tf.Height.CachedValue.AsDouble);

                    _nowRotating = new RotateTextStep(tf, RotateTextStep.Side.Start,
                                                      angle / (2 * Math.PI));
                }
                if (_nowRotating == null)
                {
                    return;
                }
                _originalX = tf.X.CachedValue.AsDouble;
                _originalY = tf.Y.CachedValue.AsDouble;
                _originalW = tf.Width.CachedValue.AsDouble;
                _originalH = tf.Height.CachedValue.AsDouble;
                StepManager.InsertNext(_nowRotating);
            }
            else
            {
                var rls = (RotateTextStep)_nowRotating;

                if (rls.RotateAround == RotateTextStep.Side.Start)
                {
                    var angle = Utils.AngleBetween(pos.X - _originalX, pos.Y - _originalY,
                                                   _originalW, _originalH);

                    rls.Rotate(angle / (2 * Math.PI));
                }
                else if (rls.RotateAround == RotateTextStep.Side.End)
                {
                    var angle = Utils.AngleBetween(_originalX + _originalW - pos.X,
                                                   _originalY + _originalH - pos.Y,
                                                   _originalW, _originalH);

                    rls.Rotate(angle / (2 * Math.PI));
                }
            }
        }
Exemple #26
0
 public GeoWizardViewModel()
 {
     _stepManager = new StepManager <WizardBusinessObject>();
     RegionMgr    = ServiceLocator.Current.GetInstance <IRegionManager>();
     Events       = ServiceLocator.Current.GetInstance <IEventAggregator>();
     Events.GetEvent <WizardNavigateSelectStatesEvent>().Subscribe(uri =>
     {
         RegionMgr.RequestNavigate(RegionNames.HospitalsMainRegion, new Uri(ViewNames.GeoContextWizard, UriKind.Relative));
         _stepManager.Navigate(_stepManager.Steps.First());
     });
 }
Exemple #27
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Exemple #28
0
 private void MainGraphicsOnSizeChanged(object sender, SizeChangedEventArgs sizeChangedEventArgs)
 {
     Drawer.SetHostRectSize(_mainGraphics.ActualWidth, _mainGraphics.ActualHeight);
     if (StepManager.CurrentStep == null)
     {
         _mainGraphics.InvalidateVisual();
     }
     else
     {
         StepManager.RefreshToCurrentStep();
     }
 }
Exemple #29
0
    protected virtual void OnEnable()
    {
        stepManager        = GetComponentInParent <StepManager>();
        rb                 = GetComponentInParent <Rigidbody2D>();
        input              = GetComponentInParent <IInput>();
        triggerBroadcaster = GetComponentInParent <TriggerBroadcaster>();
        animator           = GetComponentInParent <Animator>();

        UpdateStepComponents();

        DebugMenu.OnStepChange += UpdateStepComponents;
    }
Exemple #30
0
    void Start()
    {
        board       = FindObjectOfType <Board>();
        findMatches = FindObjectOfType <FindMatches>();

        if (SceneManager.GetActiveScene().name == "lvl04" || SceneManager.GetActiveScene().name == "lvl09" ||
            SceneManager.GetActiveScene().name == "lvl14" || SceneManager.GetActiveScene().name == "lvl19" ||
            SceneManager.GetActiveScene().name == "lvl24")
        {
            stepManager = FindObjectOfType <StepManager>();
        }
    }
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         DestroyImmediate(Instance);
         Instance = this;
     }
 }
Exemple #32
0
        private static Solution HandleCustomSolution(IEnumerable<string> directories)
        {
            var stepManager = new StepManager();
            var pathHelper = new PathHelper(directories.Select(Path.GetFullPath));

            stepManager.AddStep(new UiStep(pathHelper));
            stepManager.AddStep(new ProjectsListStep<ExtensionProject>("Choose extensions libraries:", pathHelper));
            stepManager.AddStep(new PluginStep("Choose plugins:", pathHelper));
            stepManager.AddStep(new ProjectsListStep<TestsProject>("Choose tests:", pathHelper));
            stepManager.AddStep(new ProjectsListStep<UnknownProject>("Choose other projects:", pathHelper));

            stepManager.Run();
            return stepManager.IsCancelled ? null 
                    : SolutionGenerator.Generate(stepManager.GetStep<UiStep>().UIProject,
                stepManager.GetSteps<ProjectsListStep>().SelectMany(x => x.AdditionalProjects).Union(stepManager.GetStep<UiStep>().UIProject.GetAllReferences()));
        }
        //
        //
        //

        internal void InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) {
            Debug.Assert(context != null, "context != null");

            // Remember state
            _state = state;

            PerfCounters.IncrementCounter(AppPerfCounter.PIPELINES);

            try {
                try {
                    // Remember context for config lookups
                    _initContext = context;
                    _initContext.ApplicationInstance = this;

                    // Set config path to be application path for the application initialization
                    context.ConfigurationPath = context.Request.ApplicationPathObject;

                    // keep HttpContext.Current working while running user code
                    using (new DisposableHttpContextWrapper(context)) {

                        // Build module list from config
                        if (HttpRuntime.UseIntegratedPipeline) {

                            Debug.Assert(_moduleConfigInfo != null, "_moduleConfigInfo != null");
                            Debug.Assert(_moduleConfigInfo.Count >= 0, "_moduleConfigInfo.Count >= 0");

                            try {
                                context.HideRequestResponse = true;
                                _hideRequestResponse = true;
                                InitIntegratedModules();
                            }
                            finally {
                                context.HideRequestResponse = false;
                                _hideRequestResponse = false;
                            }
                        }
                        else {
                            InitModules();

                            // this is used exclusively for integrated mode
                            Debug.Assert(null == _moduleContainers, "null == _moduleContainers");
                        }

                        // Hookup event handlers via reflection
                        if (handlers != null)
                            HookupEventHandlersForApplicationAndModules(handlers);

                        // Initialization of the derived class
                        _context = context;
                        if (HttpRuntime.UseIntegratedPipeline && _context != null) {
                            _context.HideRequestResponse = true;
                        }
                        _hideRequestResponse = true;

                        try {
                            Init();
                        }
                        catch (Exception e) {
                            RecordError(e);
                        }
                    }

                    if (HttpRuntime.UseIntegratedPipeline && _context != null) {
                        _context.HideRequestResponse = false;
                    }
                    _hideRequestResponse = false;
                    _context = null;
                    _resumeStepsWaitCallback= new WaitCallback(this.ResumeStepsWaitCallback);

                    // Construct the execution steps array
                    if (HttpRuntime.UseIntegratedPipeline) {
                        _stepManager = new PipelineStepManager(this);
                    }
                    else {
                        _stepManager = new ApplicationStepManager(this);
                    }

                    _stepManager.BuildSteps(_resumeStepsWaitCallback);
                }
                finally {
                    _initInternalCompleted = true;

                    // Reset config path
                    context.ConfigurationPath = null;

                    // don't hold on to the context
                    _initContext.ApplicationInstance = null;
                    _initContext = null;
                }
            }
            catch { // Protect against exception filters
                throw;
            }
        }
Exemple #34
0
        private void StepButton_Click(object sender, EventArgs e)
        {
            var manager = new StepManager(new RequestManager(bodyMediaAuthControl1.Manager));
            var dt = StartDate.Value;
            while (dt <= EndDate.Value)
            {
                var path = Path.Combine(OutputFolderTextBox.Text, string.Format("Step.{0}.xml", dt.ToString("yyyyMMdd")));
                if (!File.Exists(path))
                {
                    var data = manager.GetData(dt);
                    WriteToFile(path, data);
                }

                Thread.Sleep(500);
                dt = dt.AddDays(1);
            }

            MessageBox.Show("Done with steps.");
        }
 internal void InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers)
 {
     this._state = state;
     PerfCounters.IncrementCounter(AppPerfCounter.PIPELINES);
     try
     {
         try
         {
             this._initContext = context;
             this._initContext.ApplicationInstance = this;
             context.ConfigurationPath = context.Request.ApplicationPathObject;
             using (new DisposableHttpContextWrapper(context))
             {
                 if (HttpRuntime.UseIntegratedPipeline)
                 {
                     try
                     {
                         context.HideRequestResponse = true;
                         this._hideRequestResponse = true;
                         this.InitIntegratedModules();
                         goto Label_006B;
                     }
                     finally
                     {
                         context.HideRequestResponse = false;
                         this._hideRequestResponse = false;
                     }
                 }
                 this.InitModules();
             Label_006B:
                 if (handlers != null)
                 {
                     this.HookupEventHandlersForApplicationAndModules(handlers);
                 }
                 this._context = context;
                 if (HttpRuntime.UseIntegratedPipeline && (this._context != null))
                 {
                     this._context.HideRequestResponse = true;
                 }
                 this._hideRequestResponse = true;
                 try
                 {
                     this.Init();
                 }
                 catch (Exception exception)
                 {
                     this.RecordError(exception);
                 }
             }
             if (HttpRuntime.UseIntegratedPipeline && (this._context != null))
             {
                 this._context.HideRequestResponse = false;
             }
             this._hideRequestResponse = false;
             this._context = null;
             this._resumeStepsWaitCallback = new WaitCallback(this.ResumeStepsWaitCallback);
             if (HttpRuntime.UseIntegratedPipeline)
             {
                 this._stepManager = new PipelineStepManager(this);
             }
             else
             {
                 this._stepManager = new ApplicationStepManager(this);
             }
             this._stepManager.BuildSteps(this._resumeStepsWaitCallback);
         }
         finally
         {
             this._initInternalCompleted = true;
             context.ConfigurationPath = null;
             this._initContext.ApplicationInstance = null;
             this._initContext = null;
         }
     }
     catch
     {
         throw;
     }
 }
 public StepCounterViewController() : base("StepCounterViewController", null)
 {
     _stepManager = new StepManager();
 }