public void Reset()
 {
     LastPrompt = new FormPrompt();
     Next = null;
     Step = 0;
     History = new Stack<int>();
     Phases = new StepPhase[Phases.Length];
     StepState = null;
     FieldInputs = null;
     ProcessInputs = false;
 }
Beispiel #2
0
 public void Reset()
 {
     LastPrompt    = new FormPrompt();
     Next          = null;
     Step          = 0;
     History       = new Stack <int>();
     Phases        = new StepPhase[Phases.Length];
     StepState     = null;
     FieldInputs   = null;
     ProcessInputs = false;
 }
Beispiel #3
0
        /// <summary>
        /// process command batch file
        /// </summary>
        /// <param name="lines"></param>
        public void DoBatch(string[] lines)
        {
            FlowControl flow = new FlowControl(lines);
            NextStep    next = flow.Execute(Run);

            if (next == NextStep.EXIT)
            {
                cout.WriteLine(ConsoleColor.Green, "completed.");
            }

            cout.Write($"{mgr}> ");
        }
Beispiel #4
0
 public void Execute()
 {
     try
     {
         InnerExecute();
         NextStep.Execute();
     }
     catch
     {
         OnErrorStep.Execute();
     }
 }
Beispiel #5
0
 public Form1()
 {
     InitializeComponent();
     N3liza = new Nliza(size, 1, 7, -1, 7, 0, 1, outPut);
     initializeUserSelection();
     InitializeBoardArray();
     NextStep.Hide();
     AutoPlayBot.Checked = true;
     changeCurrentPlayerOnScreen(parseID(N3liza.currentPlayer.id));
     if (N3liza.currentPlayer.GetType() != typeof(player.Human) && autoMoveBots)
     {
         N3liza.play();
     }
 }
Beispiel #6
0
        //启动
        public async Task Run(NetworkStream client, GeneralConfig configuration, ILogger logger,
                              CancellationToken token)
        {
            var result = Status.InitState;

            using var context = new ProxyContext(client, configuration, logger, token);
            do
            {
                try
                {
                    result = await NextStep[result](context);
                }
                catch (SocketException)
                {
                    result = Status.Exiting;
                }
            } while (result != Status.Exiting);

            while (LoggingTasks.Count > 0)
            {
                await LoggingTasks.Dequeue();
            }
        }
Beispiel #7
0
        public async Task <NextStep> GetNextStep(StepRequest request, string idToken)
        {
            var stepRequestResult = (await SendPostRequest("/api/steps/assignment-requests", request, true));

            if (stepRequestResult == null)
            {
                return(null);
            }
            NextStep result = new NextStep();

            result.Step          = stepRequestResult["result"].ToObject <Step>();
            result.EncryptionKey = stepRequestResult["encryptionKey"].ToObject <string>();
            return(result);
        }
Beispiel #8
0
        public override DTOModelB Execute(DTOModelB dtoModelB)
        {
            // Read

            // Do

            // Write

            if (NextStep != null)
            {
                NextStep.Execute(dtoModelB);
            }

            return(dtoModelB);
        }
Beispiel #9
0
        public override DTOModelA Execute(DTOModelA dtoModelA)
        {
            // Read

            // Do

            // Write

            if (NextStep != null)
            {
                dtoModelA = NextStep.Execute(dtoModelA);
            }

            return(dtoModelA);
        }
        public override Task ProcessAsync(CommandProcessorInput input)
        {
            if (!_config.PrefixIsSet)
            {
                return(NextStep.ProcessAsync(input));
            }

            if (input.Message.StartsWith(_config.CommandPrefix))
            {
                input.PrefixOffset = (uint)_config.CommandPrefix.Length;
                return(NextStep.ProcessAsync(input));
            }

            return(Task.CompletedTask);
        }
Beispiel #11
0
        public override Task ProcessAsync(CommandProcessorInput input)
        {
            var commands = _serviceCollection.GetAvailableCommands();

            if (commands is null || !commands.Any())
            {
                _logWriter.Log("Service Location did not get any available commands.");
                return(Task.CompletedTask);
            }

            var prompt = input.Message.Substring((int)input.PrefixOffset).Trim();

            input.TargetedCommands = commands.Where(c => prompt.StartsWith(c.Prompt));
            return(NextStep.ProcessAsync(input));
        }
        public async Task <IActionResult> CreateNewNextStep([FromBody] CreateNextstepDto createNextstepDto)
        {
            var UsersId           = int.Parse(User.FindFirst("UsersId").Value);
            var amountOfNextSteps = await _context.NextStep.Where(x => x.ActivityId == createNextstepDto.ActivityId).ToListAsync();

            if (amountOfNextSteps.Count > 0)
            {
                return(BadRequest("A nextstep already exists for this activity"));
            }

            var activity = await _context.Activities.SingleOrDefaultAsync(x => x.Id == createNextstepDto.ActivityId);

            var splittedTime = createNextstepDto.Time.Split(":");
            var nextStepDate = DateTime.Parse(createNextstepDto.Date).AddHours(double.Parse(splittedTime[0])).AddMinutes(double.Parse(splittedTime[1]));

            int result = 10;

            if (nextStepDate != null)
            {
                result = DateTime.Compare(activity.Date, nextStepDate);
            }

            if (result > 0 && result < 10)
            {
                //aktiviteten är senare än nextstep
                return(BadRequest("Nextsteps date is earlier than the activity, please change to a valid date"));
            }

            var newNextStep = new NextStep()
            {
                Title       = createNextstepDto.Title,
                Description = createNextstepDto.Description,
                Date        = nextStepDate,
                Type        = createNextstepDto.Type,
                CreatorId   = UsersId,
                ActivityId  = activity.Id
            };

            await _context.NextStep.AddAsync(newNextStep);

            await _context.SaveChangesAsync();


            activity.NextStepId = newNextStep.Id;
            await _context.SaveChangesAsync();

            return(Ok(newNextStep));
        }
Beispiel #13
0
        public override void Run()
        {
            logger.Debug("Creating a temporary folder for the compiling...");

            var temps = Directory.GetDirectories(CurrentDirectory).Where(X => X.Contains("temp"));
            var nxt   = temps.Count() + 1;
            var name  = $"temp{nxt}";
            var path  = Path.Combine(CurrentDirectory, name);

            Directory.CreateDirectory(path);


            logger.Debug("tempory folder created");

            NextStep?.Invoke();
        }
Beispiel #14
0
        //Fonction d'initialisation du système
        public void Init(Configuration.Configuration conf)
        {
            Screen.conf = conf;

            App             = new RenderWindow(new VideoMode(conf.WindowSize.X, conf.WindowSize.Y), "LA VIE"); //Construction de la fenetre
            App.Closed     += new EventHandler(OnClose);                                                       //Ajout de l'évènement de fermeture
            App.KeyPressed += OnKeyPressed;

            //Construction de la grille
            grid = InitStratege.Init(conf.InitStrategy, conf.Size);

            //Ajout de l'écoute de l'évenement de tick
            var next = new NextStep();

            Observable += new EventHandler(next.Run);
        }
Beispiel #15
0
 private void AutoPlayBot_CheckedChanged(object sender, EventArgs e)//it handles the changes of autoplay for the bot (if it is posible playes playes the bot)
 {
     autoMoveBots = AutoPlayBot.Checked;
     if (AutoPlayBot.Checked)
     {
         NextStep.Hide();
     }
     else
     {
         NextStep.Show();
     }
     if (N3liza.currentPlayer.GetType() != typeof(player.Human) && autoMoveBots)
     {
         N3liza.play();
     }
 }
Beispiel #16
0
        public override DTOModelA Execute(DTOModelA dtoModelA)
        {
            // Read

            // Do
            dtoModelA.Name = "pippo";

            // Write
            ABaseStep_CoreStoreInstance.CoreStore_DataSupplierInstance.GetActionRepositoryA.CreateValue(dtoModelA);

            if (NextStep != null)
            {
                dtoModelA = NextStep.Execute(dtoModelA);
            }

            return(dtoModelA);
        }
Beispiel #17
0
        //初期化
        private void frmMain_Load(object sender, EventArgs e) {
            this.Visible = false;
            dgvMain.ReadOnly = true;
            dgvMain.ContextMenuStrip = cmsTabsMenu;
            current_project = "";
            search_flag = false;
            is_multiple = false;
            tabs = new TabControl.TabPageCollection(tabControl);

            log = new LogManager(true);
            log.Write("dmpn Start--- " + DateTime.Now.ToShortDateString());

            log.Write("getEnvData " + DateTime.Now);
            env_data = new EnvData(new Documents("", ""), new Project("", false, "", false), new Master("", false, ""), this.Left, this.Top, this.Width, this.Height);
            GetEnvData();
            if (env_data.WindowLocation.X == 0 && env_data.WindowLocation.Y == 0) InitLocationAndSize();
            
            this.Location = env_data.WindowLocation;
            this.Size = env_data.WindowSize;

            //メニューバーは作成しない
            //log.Write("CreateUserMenuBar2");
            log.Write("OpenIndex " + DateTime.Now);
            log.Close();
            if (env_data.Documents.Path.Length == 0) {
                Documents doc = env_data.Documents;
                doc.Path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\docmaker.net2\index.xml";
                env_data.Documents = doc;
                Project pro = env_data.Project;
                pro.Folder=Path.GetDirectoryName(doc.Path)+@"\";
                env_data.Project = pro;
                env_data.SaveEnvData();
                if (!File.Exists(doc.Path)) {
                    next_step = NextStep.SPLASH;
                    MessageBox.Show("最初に環境設定をする必要があります。\n環境設定画面を表示します。\n You should set the environment first.", "警告", MessageBoxButtons.OK);
                    frm_sub = new frmSubWindow(env_data, log, OpenWindowType.ENV_SETTINGS);
                    frm_sub.FormClosed += new FormClosedEventHandler(frmSubWindow_Closed);
                    frm_sub.Show();
                    this.Enabled = false;
                } else
                    StartApplication();
            } else {
                StartApplication();
            }
        }
Beispiel #18
0
        private void LoadNextSteps(CurrentFlow ap)
        {
            foreach (NextStep ns1 in ap.NextSteps.Values)
            {
                NextStep ns = ABP.Workflow.SillyQuestion(ns1, fm);
                StepType st = (StepType)ns.acs.StepType;

                if (st == StepType.Activity && ns.Enabled)
                {
                    AcSeriesOKToAdd.Add(ns, 0);
                }

                if (ns.Children != null)
                {
                    LoadNextSteps(ns.Children);
                }
            }
        }
        public override DTOModelB Execute(DTOModelB dtoModelB)
        {
            // Read
            dtoModelB = ABaseStep_CoreStoreInstance.CoreStore_DataSupplierInstance.GetActionRepositoryB.ReadValue(dtoModelB);

            // Do
            dtoModelB.Email = "*****@*****.**";

            // Write
            ABaseStep_CoreStoreInstance.CoreStore_DataSupplierInstance.GetActionRepositoryB.CreateValue(dtoModelB);

            if (NextStep != null)
            {
                dtoModelB = NextStep.Execute(dtoModelB);
            }

            return(dtoModelB);
        }
Beispiel #20
0
        //Click on NextStep
        public static void ClickOnNextStep()
        {
            log4net.Config.XmlConfigurator.Configure();
            ILog logger = LogManager.GetLogger(typeof(CreateDesignPage));

            try
            {
                Wait.WaitVisible(NextStep, 20);
                NextStep.Click();
                test.Pass("Click on next step passed.");
            }
            catch (Exception e)
            {
                logger.Error("Cancel Design name pop-up failed due to : " + e);
                test.Fail("Cancel Design name pop-up failed");
                //**Closing browser
                Driver.Quit();
                throw e;
            }
        }
        public IEnumerable <NextStep> GetNextSteps(int documentDecisionID)
        {
            List <NextStep> data = new List <NextStep>();

            using (OracleConnection cn = new OracleConnection(ConfigurationManager.ConnectionStrings["OracleDatabase"].ConnectionString))
            {
                cn.Open();
                OracleCommand cmd = new OracleCommand();
                cmd.Connection           = cn;
                cmd.InitialLONGFetchSize = 1000;

                cmd.CommandText = String.Format("select * from dm_next_steps t WHERE decisionid = '{0}'", documentDecisionID);
                cmd.CommandType = CommandType.Text;
                var reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    var step = new NextStep();


                    step.ID             = Convert.ToInt32(reader["ID"]);
                    step.Mission        = Convert.ToString(reader["mission"]);
                    step.Responsibility = Convert.ToString(reader["responsibility"]);
                    step.Due_date       = Convert.ToString(reader["due_date"]);
                    step.Date_postponed = Convert.ToString(reader["date_postponed"]);
                    step.DecisionID     = Convert.ToInt32(reader["decisionid"]);

                    //   newElement.MANDATORY = Convert.ToString(reader["MANDATORY"]);
                    //      newElement.WEIGHT = Convert.ToString(reader["WEIGHT"]);
                    //    newElement.expresion = Convert.ToString(reader["expresion"]);
                    //    newElement.expresionfeild = Convert.ToString(reader["expresionfeild"]);
                    //     newElement.expresion = "";//should be new implementation
                    //     newElement.expresionfeild = "";  //should be new implementation


                    data.Add(step);
                }
                cn.Close();
            }

            return(data);
        }
        public void AddNextStepToDecision(NextStep nextStep)
        {
            DateTime    due_date, date_postponed;
            CultureInfo provider = new CultureInfo("he-IL");

            try
            {
                due_date = nextStep.Date_postponed != null?DateTime.ParseExact(nextStep.Date_postponed, "dd/MM/yyyy", provider) : DateTime.MinValue;

                date_postponed = nextStep.Due_date != null?DateTime.ParseExact(nextStep.Due_date, "dd/MM/yyyy", provider) : DateTime.MinValue;
            }
            catch (Exception e)
            {
                throw new Exception("##Error to convert dates ##: " + e.Message);
            }

            using (OracleConnection cn = new OracleConnection(ConfigurationManager.ConnectionStrings["OracleDatabase"].ConnectionString))
            {
                int result;
                OracleDataAdapter da  = new OracleDataAdapter();
                OracleCommand     cmd = new OracleCommand();
                cmd.Connection           = cn;
                cmd.InitialLONGFetchSize = 1000;
                cmd.CommandType          = CommandType.Text;
                cmd.CommandText          = String.Format("INSERT INTO dm_next_steps (mission,responsibility,due_date,date_postponed,decisionid)" +
                                                         " VALUES ('{0}','{1}',TO_DATE('{2}','dd/mm/yyyy HH24:MI:SS'),TO_DATE('{3}','dd/mm/yyyy HH24:MI:SS'),'{4}')"
                                                         , nextStep.Mission, nextStep.Responsibility, due_date, date_postponed, nextStep.DecisionID);
                try
                {
                    cmd.Connection.Open();
                    result = cmd.ExecuteNonQuery();
                    cmd.Connection.Close();
                }
                catch (Exception)
                {
                    throw new Exception("##Error save to DB## : " + cmd.CommandText);
                }
            }
        }
Beispiel #23
0
 public override string ToString()
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     sb.Append("progress:{");
     for (int i = 0; i < StepProgresss.Count; ++i)
     {
         sb.Append(string.Format("[{0}]:{1}", i, StepProgresss[i].ToString()));
     }
     sb.Append("}");
     if (FirstStep != null)
     {
         sb.Append(",first_step:{");
         sb.Append(FirstStep.ToString());
         sb.Append("}");
     }
     if (NextStep != null)
     {
         sb.Append(",next_step:{");
         sb.Append(NextStep.ToString());
         sb.Append("}");
     }
     return(sb.ToString());
 }
Beispiel #24
0
    /// <summary>
    /// Move to keys definition.
    /// </summary>
    private void goToDefineKeys()
    {
        if (modified)
        {
            askSaving=!askSaving;

            if (askSaving)
            {
                saveDialogRect=new Rect(Screen.width*0.3f, Screen.height*0.3f, Screen.width*0.4f, Screen.height*0.4f);
                nextStep=NextStep.ToDefineKeys;
            }
        }
        else
        {
            Debug.Log("Go to define keys");

            scrollPosition = Vector2.zero;
            currentState   = State.InDefineKeys;
            currentItem    = 0;
            itemsCount     = controlSetters.Count+1;

            int cur=0;

            foreach (KeyMapping key in InputControl.getKeys())
            {
                controlSetters[cur].keyMapping=key;

                ++cur;
            }
        }
    }
Beispiel #25
0
 private void _personalInfoViewModel_ErrorsChanged(object sender, System.ComponentModel.DataErrorsChangedEventArgs e)
 {
     NextStep.OnCanExecuteChanged();
 }
 public ErrorMessageEventArgs(string strErrorMessage, EventHandler handleMe, NextStep nxtStep)
 {
     this.ErrorMessage = strErrorMessage;
     this.TheEvent = handleMe;
     theNextStep = nxtStep;
 }
Beispiel #27
0
 //プロジェクト一覧の表示
 private void ShowProjectData() {
     dgvMain.DefaultCellStyle.SelectionBackColor = SystemColors.Highlight;
     dgvMain.DefaultCellStyle.SelectionForeColor = SystemColors.HighlightText;
     dgvMain.MultiSelect = false;
     ds_main = new DataSet();
     if (Path.GetExtension(env_data.Documents.Path) == ".xml" && File.Exists(env_data.Documents.Path)) {
         try {
             ds_main.ReadXml(env_data.Documents.Path);
         } catch (Exception e) {
             MessageBox.Show(e.Message);
             return;
         }
         DataView dv=new DataView(ds_main.Tables["ProjectData"].Copy());
         if (search_flag) {
             if (tbx1.Text != "") dv.RowFilter = "案件名 Like '%"+tbx1.Text+"%'";
         }
         search_flag = false;
         InitDatagridView(dv);
         dgvMain.DataSource = dv;
         dgvMain.Columns.RemoveAt(2);
         int[] widths = { 120, 405, 80, 85, 85, 100, 60 };
         for (int i = 0; i < dgvMain.Columns.Count; i++) {
             dgvMain.Columns[i].Width = widths[i];
         }
         dgvMain.Rows[0].Selected = true;
         SetTaskRowsColor();
         SetButtons();
     } else {
         DialogResult result;
         result = MessageBox.Show("index.xmlファイルが見つかりません", "警告", MessageBoxButtons.OK,MessageBoxIcon.Error);
         if (result == DialogResult.OK) {
             if (frm_sub == null) {
                 frm_sub = new frmSubWindow(env_data, log,OpenWindowType.ENV_SETTINGS);
                 frm_sub.FormClosed += new FormClosedEventHandler(frmSubWindow_Closed);
             }
             next_step = NextStep.PROJECT;
             frm_sub.Show();
             this.Enabled = false;
         }
     }
 }
Beispiel #28
0
        public override async Task MainAction(BotUpdate update, IBotClient client)
        {
            await NextStep.Execute(update, client);

            NextStep = NextStep.NextStep;
        }
 public void SendNextStep(NextStep next)
 {
     NextStep = next;
     EventAggregator.SendMessage(next);
     _messages.Add(next);
 }
 public ErrorMessageEventArgs(string strErrorMessage, EventHandler handleMe, NextStep nxtStep)
 {
     this.ErrorMessage = strErrorMessage;
     this.TheEvent     = handleMe;
     theNextStep       = nxtStep;
 }
Beispiel #31
0
        protected override void OnCompleted(IShellResult result)
        {
            Helper.ThrowIf(result.Error, "Failed to install typescript");

            NextStep?.Invoke();
        }
Beispiel #32
0
        /// <summary>
        /// Formatiert den Wert der aktuellen Instanz unter Verwendung des angegebenen Formats.
        /// </summary>
        /// <returns>
        /// Der Wert der aktuellen Instanz im angegebenen Format.
        /// </returns>
        /// <param name="format">Das zu verwendende Format.– oder – Ein NULL-Verweis (Nothing in Visual Basic),
        ///  wenn das für den Typ der <see cref="T:System.IFormattable"/> -Implementierung definierte Standardformat verwendet werden soll. </param>
        /// <param name="formatProvider">Der zum Formatieren des Werts zu verwendende Anbieter.– oder – Ein NULL-Verweis (Nothing in Visual Basic),
        ///  wenn die Informationen über numerische Formate dem aktuellen Gebietsschema des Betriebssystems entnommen werden sollen. </param>
        /// <filterpriority>2</filterpriority>
        public string ToString(string format, IFormatProvider formatProvider)
        {
            string result = string.Empty;

            result += string.Format(AppSettings.CInfo, "JobName:            {0:s} {1:s}", JobName, Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "BaseName:           {0:s} {1:s}", BaseName, Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "InputFile:          {0:s} {1:s}", InputFile, Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "InputType:          {0:s} {1:s}", Input.ToString(),
                                    Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "OutputFile:         {0:s} {1:s}", OutputFile,
                                    Environment.NewLine);
            result += Environment.NewLine;

            result += string.Format(AppSettings.CInfo, "AudioStreams:       {0:s}", Environment.NewLine);

            result = AudioStreams.Aggregate(result,
                                            (current, item) =>
                                            current +
                                            string.Format(AppSettings.CInfo, "{0:s} {1:s}", item, Environment.NewLine));

            result += Environment.NewLine;

            result += string.Format(AppSettings.CInfo, "SubtitleStreams:    {0:s}", Environment.NewLine);

            result = SubtitleStreams.Aggregate(result,
                                               (current, item) =>
                                               current +
                                               string.Format(AppSettings.CInfo, "{0:s} {1:s}", item, Environment.NewLine));

            result += Environment.NewLine;

            result += string.Format(AppSettings.CInfo, "Chapters:           {0:s} {1:s}",
                                    string.Join(",", (from item in Chapters
                                                      let dt = new DateTime()
                                                               select DateTime.MinValue.Add(item)
                                                               into dt select dt.ToString("H:mm:ss.fff")).ToArray()),
                                    Environment.NewLine);

            result += string.Format(AppSettings.CInfo, "NextStep:           {0:s} {1:s}", NextStep.ToString(),
                                    Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "CompletedStep:      {0:s} {1:s}", CompletedStep.ToString(),
                                    Environment.NewLine);
            result += Environment.NewLine;

            result += string.Format(AppSettings.CInfo, "VideoStream:        {0:s}", Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "{0:s} {1:s}", VideoStream, Environment.NewLine);
            result += Environment.NewLine;

            result += string.Format(AppSettings.CInfo, "StreamID:           {0:g} {1:s}", StreamId, Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "TrackID:            {0:g} {1:s}", TrackId, Environment.NewLine);

            result += string.Format(AppSettings.CInfo, "TempInput:          {0:s} {1:s}", TempInput, Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "TempOutput:         {0:s} {1:s}", TempOutput,
                                    Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "DumpOutput:         {0:s} {1:s}", DumpOutput,
                                    Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "SelectedDVDChapters:{0:s} {1:s}", SelectedDvdChapters,
                                    Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "TempFiles:          {0:s} {1:s}",
                                    string.Join(",", TempFiles.ToArray()), Environment.NewLine);
            result += string.Format(AppSettings.CInfo, "ReturnValue:        {0:g} {1:s}", ExitCode, Environment.NewLine);

            return(result);
        }
Beispiel #33
0
    /// <summary>
    /// Move to the upper level.
    /// </summary>
    private void goBack()
    {
        if (modified)
        {
            askSaving=!askSaving;

            if (askSaving)
            {
                saveDialogRect=new Rect(Screen.width*0.3f, Screen.height*0.3f, Screen.width*0.4f, Screen.height*0.4f);
                nextStep=NextStep.ToBack;
            }
        }
        else
        {
            if (currentState==State.InOptionsList)
            {
                save();

                SendMessage("OnOptionsClosed");
            }
#if MENU_DEFINE_KEYS
            else
            if (currentState==State.InDefineKeys)
            {
                goToControlsOptions();
            }
#endif
            else
            {
                goToOptionsList((int)currentState-1);
            }
        }
    }
Beispiel #34
0
        public TutorialWindow(string contentPath, Lifetime tutorialLifetime, TutorialWindowManager windowManager,
                              ISolution solution, IPsiFiles psiFiles,
                              ChangeManager changeManager, TextControlManager textControlManager, IShellLocks shellLocks,
                              IEditorManager editorManager,
                              DocumentManager documentManager, IUIApplication environment, IActionManager actionManager,
                              TabbedToolWindowClass toolWindowClass,
                              WindowsHookManager windowsHookManager,
                              IColorThemeManager colorThemeManager)
        {
            _windowManager     = windowManager;
            _htmlGenerator     = new HtmlGenerator(tutorialLifetime, colorThemeManager);
            _tutorialLifetime  = tutorialLifetime;
            _shellLocks        = shellLocks;
            _colorThemeManager = colorThemeManager;

            if (!solution.GetComponent <ISolutionOwner>().IsRealSolutionOwner)
            {
                return;
            }

            _toolWindowInstance = toolWindowClass.RegisterInstance(
                tutorialLifetime, null, null,
                (lt, twi) =>
            {
                twi.QueryClose.Value = true;

                var containerControl = new TutorialPanel(environment).BindToLifetime(lt);

                var viewControl = new HtmlViewControl(windowsHookManager, actionManager)
                {
                    Dock = DockStyle.Fill,
                    WebBrowserShortcutsEnabled = false
                }.BindToLifetime(lt);

                var webControlHandler = new WebBrowserHostUiHandler(viewControl)
                {
                    Flags = HostUIFlags.DPI_AWARE,
                    IsWebBrowserContextMenuEnabled = false
                };

                lt.AddBracket(
                    () => _containerControl = containerControl,
                    () => _containerControl = null);

                lt.AddAction(() => _progressBar = null);

                lt.AddBracket(
                    () => _viewControl = viewControl,
                    () => _viewControl = null);

                lt.AddBracket(
                    () =>
                {
                    _containerControl.Controls.Add(_viewControl);
                    _containerControl.Controls.Add(_progressBar);
                },
                    () =>
                {
                    _containerControl.Controls.Remove(_viewControl);
                    _containerControl.Controls.Remove(_progressBar);
                });

                _colorThemeManager.ColorThemeChanged.Advise(tutorialLifetime, RefreshKeepContent);

                SetColors();

                _htmlMediator = new HtmlMediator(tutorialLifetime, this);
                _htmlMediator.OnNextStepButtonClick.Advise(tutorialLifetime,
                                                           () => NextStep?.Invoke(null, EventArgs.Empty));
                _htmlMediator.OnRunStepNavigationLinkClick.Advise(tutorialLifetime, NavigateToCodeByLink);

                var focusTracker = new WindowFocusTracker(tutorialLifetime);
                focusTracker.IsFocusOnEditor.Change.Advise(tutorialLifetime,
                                                           () => _htmlMediator.ChangeNextStepButtonText(focusTracker.IsFocusOnEditor.Value));

                _htmlMediator.OnPageHasFullyLoaded.Advise(tutorialLifetime,
                                                          () => { _htmlMediator.ChangeNextStepButtonText(focusTracker.IsFocusOnEditor.Value); });

                return(new EitherControl(lt, containerControl));
            });

            _stepPresenter = new TutorialStepPresenter(this, contentPath, tutorialLifetime, solution, psiFiles,
                                                       changeManager,
                                                       textControlManager, shellLocks, editorManager, documentManager, environment, actionManager);

            _toolWindowInstance.Title.Value = _stepPresenter.Title;
        }
Beispiel #35
0
 protected override void OnCompleted(IShellResult result)
 {
     logger.Debug("Installed typescript");
     NextStep?.Invoke();
 }
Beispiel #36
0
        /// <summary>
        /// 由于最后都是项目负责人/生产经理,和总经理,所以在没有先后关系的情况下,currentUser为-1,currentPage为Null
        /// 但是用state中加以区分,
        /// -1:作废,
        /// 0:完成,
        /// 1:等待总经理处理,
        /// 2:等待项目负责人/生产经理处理,
        /// 3,4:正处于流程中,
        /// 5:该单据被退回到填表人手中。
        ///
        /// 总经理可以看到所有状态>=0的表单
        /// 但是处理只能是状态1单据。
        /// 对于质量,安全这两个单据的填表人修改,不影响表单流程。且只能修改整改状态和问题等级。
        /// step默认填表后的值为4
        /// projectleaderid
        /// productleaderid
        /// accountantid
        /// constructionleaderid
        /// safetyleaderid
        /// qualityleaderid
        /// storekeeperid
        /// buildingleaderid
        /// </summary>
        /// <param name="projectId"></param>
        /// <param name="buildingid"></param>
        /// <param name="formType"></param>
        /// <param name="step"></param>
        /// <returns></returns>
        public static NextStep GetNextStep(int projectId, int buildingid, string formType, int step, int teamleaderid = 0)
        {
            NextStep result = null;

            switch (formType)
            {
            case "problem_sercurity":
                switch (step)
                {
                case 3:        //班组长处理消费工时和材料
                    result = new NextStep
                    {
                        CurrentPage = "SecurityQuestionForm_Team.aspx?formId=",
                        CurrentUser = teamleaderid,
                        State       = step,
                        Status      = "等待班组长处理"
                    };
                    break;

                case 2:        //项目负责人/生产经理处理
                    result = new NextStep
                    {
                        CurrentPage = "SecurityQuestionForm_Remark.aspx?formId=",
                        CurrentUser = GetUserIdByCondition(projectId, buildingid, "projectleaderid"),
                        State       = step,
                        Status      = "等待项目负责人/生产经理处理"
                    };
                    break;

                case 1:        //总经理处理
                    result = new NextStep
                    {
                        CurrentPage = "SecurityQuestionForm_Summary.aspx?formId=",
                        CurrentUser = GetGeId(),
                        State       = step,
                        Status      = "等待总经理处理"
                    };
                    break;

                case 0:        //总经理处理完成
                    result = new NextStep()
                    {
                        CurrentPage = "",
                        CurrentUser = -1,
                        State       = step,
                        Status      = "表单处理完成"
                    };
                    break;
                }
                break;

            case "problem_quality":
                switch (step)
                {
                case 3:        //班组长处理消费工时和材料
                    result = new NextStep
                    {
                        CurrentPage = "QualityQuestionForm_Team.aspx?formId=",
                        CurrentUser = teamleaderid,
                        State       = step,
                        Status      = "等待班组长处理"
                    };
                    break;

                case 2:        //项目负责人/生产经理处理
                    result = new NextStep
                    {
                        CurrentPage = "QualityQuestionForm_Remark.aspx?formId=",
                        CurrentUser = GetUserIdByCondition(projectId, buildingid, "projectleaderid"),
                        State       = step,
                        Status      = "等待项目负责人/生产经理处理"
                    };
                    break;

                case 1:        //总经理处理
                    result = new NextStep
                    {
                        CurrentPage = "QualityQuestionForm_Summary.aspx?formId=",
                        CurrentUser = GetGeId(),
                        State       = step,
                        Status      = "等待总经理处理"
                    };
                    break;

                case 0:        //总经理处理完成
                    result = new NextStep()
                    {
                        CurrentPage = "",
                        CurrentUser = -1,
                        State       = step,
                        Status      = "表单处理完成"
                    };
                    break;
                }
                break;

            case "cost_labor":
                switch (step)
                {
                case 5:        //退回到填表人
                    result = new NextStep
                    {
                        CurrentPage = "LaborCostForm_Update.aspx?formId=",
                        CurrentUser = -2,        //表示为当前表单的提交人
                        State       = step,
                        Status      = "退回到填表人"
                    };
                    break;

                case 4:        //班组长确认
                    result = new NextStep
                    {
                        CurrentPage = "LaborCostForm_Comfirm.aspx?formId=",
                        CurrentUser = -3,        //表示为当天表单的班组长ID
                        State       = step,
                        Status      = "等待班组长处理"
                    };
                    break;

                case 3:        //栋号长确认
                    result = new NextStep
                    {
                        CurrentPage = "LaborCostForm_ReComfirm.aspx?formId=",
                        CurrentUser = GetUserIdByCondition(projectId, buildingid, "buildingleaderid"),
                        State       = step,
                        Status      = "等待栋号长处理"
                    };
                    break;

                case 2:        //项目负责人/生产经理处理
                    result = new NextStep
                    {
                        CurrentPage = "LaborCostForm_Remark.aspx?formId=",
                        CurrentUser = GetUserIdByCondition(projectId, buildingid, "projectleaderid"),
                        State       = step,
                        Status      = "等待项目负责人/生产经理处理"
                    };
                    break;

                case 1:        //总经理处理
                    result = new NextStep
                    {
                        CurrentPage = "LaborCostForm_Summary.aspx?formId=",
                        CurrentUser = GetGeId(),
                        State       = step,
                        Status      = "等待总经理处理"
                    };
                    break;

                case 0:        //总经理处理完成
                    result = new NextStep()
                    {
                        CurrentPage = "",
                        CurrentUser = -1,
                        State       = step,
                        Status      = "表单处理完成"
                    };
                    break;
                }
                break;

            case "cost_management":
                switch (step)
                {
                case 5:        //退回到填表人
                    result = new NextStep
                    {
                        CurrentPage = "ManageCostForm_Update.aspx?formId=",
                        CurrentUser = -2,        //表示为当前表单的提交人
                        State       = step,
                        Status      = "退回到填表人"
                    };
                    break;

                case 2:        //项目负责人/生产经理处理
                    result = new NextStep
                    {
                        CurrentPage = "ManageCostForm_Remark.aspx?formId=",
                        CurrentUser = GetUserIdByCondition(projectId, buildingid, "projectleaderid"),
                        State       = step,
                        Status      = "等待项目负责人/生产经理处理"
                    };
                    break;

                case 1:        //总经理处理
                    result = new NextStep
                    {
                        CurrentPage = "ManageCostForm_Summary.aspx?formId=",
                        CurrentUser = GetGeId(),
                        State       = step,
                        Status      = "等待总经理处理"
                    };
                    break;

                case 0:        //总经理处理完成
                    result = new NextStep()
                    {
                        CurrentPage = "",
                        CurrentUser = -1,
                        State       = step,
                        Status      = "表单处理完成"
                    };
                    break;
                }
                break;

            case "cost_material":
                switch (step)
                {
                case 5:        //退回到填表人
                    result = new NextStep
                    {
                        CurrentPage = "MaterialCostForm_Update.aspx?formId=",
                        CurrentUser = -2,        //表示为当前表单的提交人
                        State       = step,
                        Status      = "退回到填表人"
                    };
                    break;

                case 4:        //班组长确认
                    result = new NextStep
                    {
                        CurrentPage = "MaterialCostForm_Comfirm.aspx?formId=",
                        CurrentUser = -3,        //表示为当天表单的班组长ID
                        State       = step,
                        Status      = "等待班组长处理"
                    };
                    break;

                case 3:        //栋号长确认
                    result = new NextStep
                    {
                        CurrentPage = "MaterialCostForm_ReComfirm.aspx?formId=",
                        CurrentUser = GetUserIdByCondition(projectId, buildingid, "buildingleaderid"),
                        State       = step,
                        Status      = "等待栋号长处理"
                    };
                    break;

                case 2:        //项目负责人/生产经理处理
                    result = new NextStep
                    {
                        CurrentPage = "MaterialCostForm_Remark.aspx?formId=",
                        CurrentUser = GetUserIdByCondition(projectId, buildingid, "projectleaderid"),
                        State       = step,
                        Status      = "等待项目负责人/生产经理处理"
                    };
                    break;

                case 1:        //总经理处理
                    result = new NextStep
                    {
                        CurrentPage = "MaterialCostForm_Summary.aspx?formId=",
                        CurrentUser = GetGeId(),
                        State       = step,
                        Status      = "等待总经理处理"
                    };
                    break;

                case 0:        //总经理处理完成
                    result = new NextStep()
                    {
                        CurrentPage = "",
                        CurrentUser = -1,
                        State       = step,
                        Status      = "表单处理完成"
                    };
                    break;
                }
                break;

            case "cost_materialauxiliary":
                switch (step)
                {
                case 5:        //退回到填表人
                    result = new NextStep
                    {
                        CurrentPage = "MaterialAuxiliaryCostForm_Update.aspx?formId=",
                        CurrentUser = -2,        //表示为当前表单的提交人
                        State       = step,
                        Status      = "退回到填表人"
                    };
                    break;

                case 4:        //班组长确认
                    result = new NextStep
                    {
                        CurrentPage = "MaterialAuxiliaryCostForm_Comfirm.aspx?formId=",
                        CurrentUser = -3,        //表示为当天表单的班组长ID
                        State       = step,
                        Status      = "等待班组长处理"
                    };
                    break;

                case 3:        //栋号长确认
                    result = new NextStep
                    {
                        CurrentPage = "MaterialAuxiliaryCostForm_ReComfirm.aspx?formId=",
                        CurrentUser = GetUserIdByCondition(projectId, buildingid, "buildingleaderid"),
                        State       = step,
                        Status      = "等待栋号长处理"
                    };
                    break;

                case 2:        //项目负责人/生产经理处理
                    result = new NextStep
                    {
                        CurrentPage = "MaterialAuxiliaryCostForm_Remark.aspx?formId=",
                        CurrentUser = GetUserIdByCondition(projectId, buildingid, "projectleaderid"),
                        State       = step,
                        Status      = "等待项目负责人/生产经理处理"
                    };
                    break;

                case 1:        //总经理处理
                    result = new NextStep
                    {
                        CurrentPage = "MaterialAuxiliaryCostForm_Summary.aspx?formId=",
                        CurrentUser = GetGeId(),
                        State       = step,
                        Status      = "等待总经理处理"
                    };
                    break;

                case 0:        //总经理处理完成
                    result = new NextStep()
                    {
                        CurrentPage = "",
                        CurrentUser = -1,
                        State       = step,
                        Status      = "表单处理完成"
                    };
                    break;
                }
                break;
            }
            return(result);
        }
Beispiel #37
0
 //メニューバーの「メニュー」下アイテムをクリックした際の処理
 private void menuToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) {
     DialogResult result;
     switch (e.ClickedItem.Name) {
         //環境設定
         case "tsmiSettings":
             if (tabs.Count>1)
                 result = MessageBox.Show("環境設定を開く前に開いているプロジェクトを閉じる必要があります。よろしいですか?", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
             else
                 result = DialogResult.Yes;
             if (result == DialogResult.Yes) {
                 ClearTabs();
                 next_step = NextStep.PROJECT;
                 frm_sub = new frmSubWindow(env_data, log, OpenWindowType.ENV_SETTINGS);
                 frm_sub.FormClosed += new FormClosedEventHandler(frmSubWindow_Closed);
                 frm_sub.Show();
                 this.Enabled = false;
             }  
             break;
         //事業所マスタを編集
         case "tsmiOfficeMaster":
             try {
                 frm_sub = new frmSubWindow(env_data, log, OpenWindowType.OFFICE_MASTER);
             } catch (Exception ex) {
                 if (MessageBox.Show(ex.Message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK) {
                     break;
                 }
             }
             frm_sub.FormClosed += new FormClosedEventHandler(frmSubWindow_Closed);
             frm_sub.Show();
             this.Enabled = false;
             break;
         //担当者マスタを編集
         case "tsmiPersonMaster":
             try {
                 frm_sub = new frmSubWindow(env_data, log, OpenWindowType.PERSON_MASTER);
             } catch (Exception ex) {
                 if (MessageBox.Show(ex.Message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK) {
                     break;
                 }
             }
             frm_sub.FormClosed += new FormClosedEventHandler(frmSubWindow_Closed);
             frm_sub.Show();
             this.Enabled = false;
             break;
         //処理内容マスタを編集
         case "tsmiTaskMaster":
             try {
                 frm_sub = new frmSubWindow(env_data, log, OpenWindowType.CATEGORY_MASTER);
             } catch (Exception ex) {
                 if (MessageBox.Show(ex.Message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK) {
                     break;
                 }
             }
             frm_sub.FormClosed += new FormClosedEventHandler(frmSubWindow_Closed);
             frm_sub.Show();
             this.Enabled = false;
             break;
         //状態マスタを編集
         case "tsmiProgressMaster":
             try {
                 frm_sub = new frmSubWindow(env_data, log, OpenWindowType.STATUS_MASTER);
             } catch (Exception ex) {
                 if (MessageBox.Show(ex.Message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK) {
                     break;
                 }
             }
             frm_sub.FormClosed += new FormClosedEventHandler(frmSubWindow_Closed);
             frm_sub.Show();
             this.Enabled = false;
             break;
         //画面関係ユーティリティ
         case "tsmiUtilities":
             break;
         //画面解像度
         case "tsmiScreenResolution":
             MessageBox.Show("画面の解像度:" + Screen.PrimaryScreen.Bounds.Width + "×" + Screen.PrimaryScreen.Bounds.Height,"画面の解像度");
             break;
         //リポジトリ
         case "tsmiRepository":
             SvnManager svn = new SvnManager(env_data);
             svn.TortoiseSvn("Project", "repobrowser", env_data.Project.Folder, env_data.Project.URL);
             break;
         //質問受付フォーム
         case "tsmiInquiry":
             string strMyURL = "http://www.docmaker.net/contact_us.html";
             Process.Start(GetDefaultBrowser(), strMyURL);
             break;
         //docmaker.net メンバー検索
         case "tsmiMember":
             string strMyURL2 = "http://www.docmaker.net/member/";
             Process.Start(GetDefaultBrowser(), strMyURL2);
             break;
         //バージョン情報
         case "tsmiVersion":
             frm_sub = new frmSubWindow(env_data, log, OpenWindowType.VERSION);
             frm_sub.FormClosed += new FormClosedEventHandler(frmSubWindow_Closed);
             frm_sub.Show();
             this.Enabled = false;
             break;
         //docmaker.netホームページ
         case "tsmiHomepage":
             string strMyURL3 = "http://www.docmaker.net/";
             Process.Start(GetDefaultBrowser(), strMyURL3);
             break;
     }
 }