Exemplo n.º 1
0
    private void bind(string pk)
    {
        CheckInfo checkInfo = CheckAction.GetCheckInfo(pk);

        this.TextBox_jcdw.Text             = checkInfo.ExamineUnit;
        this.TextBox_sjdw.Text             = checkInfo.AcceptCheckUnit;
        this.TextBox_jcnr.Text             = checkInfo.AcceptCheckContent;
        this.TextBox_jcyj.Text             = checkInfo.AcceptCheckGist;
        this.DropDownList_lb.SelectedValue = checkInfo.AcceptCheckSort.ToString();
        this.TextBox_jcfzr.Text            = checkInfo.AcceptCheckAnswerForPerson;
        this.DateBox_jcrq.Text             = checkInfo.AcceptCheckDate.ToString("d");
        this.Textbox_jcjg.Text             = checkInfo.AcceptCheckResult;
        this.Textbox_zgnr.Text             = checkInfo.CompleteApplyContent;
        this.Textbox_bz.Text                = checkInfo.Remark;
        this.DateBox_yqwcsj.Text            = checkInfo.requestfinishtime.ToString("d");
        this.DateBox_jhwcsj.Text            = checkInfo.planfinishtime.ToString("d");
        this.DateBox_sjwcsj.Text            = checkInfo.factfinishtime.ToString("d");
        this.TextBox_sjjg.Text              = checkInfo.factresult;
        this.TextBox_xmjh.Text              = checkInfo.prjplan;
        this.ddlCheckResult.SelectedValue   = checkInfo.CheckResult.ToString();
        this.ddlCertifiResult.SelectedValue = checkInfo.CertifiResult.ToString();
        this.ddlCheckResults.SelectedValue  = checkInfo.checkResults.ToString();
        this.DDTClass.SelectedValue         = checkInfo.FilesType.ToString();
        this.ViewState["Mark"]              = checkInfo.Mark.ToString();
        if (checkInfo.Mark.ToString() != "2")
        {
            this.cbkmark.Checked = true;
        }
        else
        {
            this.cbkmark.Checked = false;
        }
        this.rectifyMarkID = checkInfo.RectifyMarkID;
    }
Exemplo n.º 2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (edit)
     {
         cbbType.SelectedValue      = WebAction.Id;
         parameters                 = WebAction.Parameters;
         btnSetParameters.IsEnabled = parameters == null;
         if (WebAction.Type == Interpic.Models.Behaviours.Action.ActionType.Check)
         {
             CheckAction checkWebAction = WebAction as CheckAction;
             cbbBehaviourWhenFalse.SelectedItem = checkWebAction.BehaviourWhenFalse;
             cbbBehaviourWhenTrue.SelectedItem  = checkWebAction.BehaviourWhenTrue;
         }
         else
         {
             cbbBehaviourWhenFalse.IsEnabled = false;
             cbbBehaviourWhenTrue.IsEnabled  = false;
         }
     }
     else
     {
         cbbBehaviourWhenFalse.SelectedIndex = 0;
         cbbBehaviourWhenTrue.SelectedIndex  = 0;
         cbbType.SelectedIndex = 0;
     }
 }
Exemplo n.º 3
0
 public SetStructItemModel()
 {
     this.WhenActivated(disposables =>
     {
         this.WhenAnyValue(item => item.IsChecked)
         .SubscribeWithLog(_ => { CheckAction?.Invoke(this); })
         .DisposeWith(disposables);
     });
 }
Exemplo n.º 4
0
    protected void Button_save_Click(object sender, EventArgs e)
    {
        if (this.TextBox_spyj.Text.Length > this.TextBox_spyj.MaxLength)
        {
            this.JavaScriptControl1.Text = "alert('审核意见输入的内容过长!')";
            return;
        }
        CheckInfo checkInfo = new CheckInfo();

        if (base.Request["pk"] != null)
        {
            checkInfo.ID = int.Parse(base.Request["pk"].ToString());
        }
        if (!string.IsNullOrEmpty(this.DateBox_sprq.Text.Trim().ToString()))
        {
            checkInfo.ExamineApproveDate = DateTime.Parse(this.DateBox_sprq.Text);
        }
        else
        {
            checkInfo.ExamineApproveDate = DateTime.Now;
        }
        checkInfo.ExamineApproveIdea   = this.TextBox_spyj.Text;
        checkInfo.ExamineApprovePerson = this.TextBox_spr.Text;
        if (this.RadioButton_ok.Checked)
        {
            checkInfo.ExamineApproveResult = 1;
        }
        else
        {
            checkInfo.ExamineApproveResult = -1;
        }
        bool flag = CheckAction.CheckInfoOp(checkInfo, "Sp");

        if (flag)
        {
            if (!this.RadioButton_ok.Checked)
            {
                CheckAction.UpdateThisSate(checkInfo.ID);
            }
            string text = " parent.desktop.flowclass.location='/EPC/17/Frame.aspx?url=../../epc/17/Entpm/PrjCheck/CheckList.aspx&Type=ShenHe&PrjState=0&Levels=0';";
            text += "alert('保存成功');";
            text += "top.frameWorkArea.window.desktop.getActive().close();";
            this.JavaScriptControl1.Text = text;
            return;
        }
        this.JavaScriptControl1.Text = "alert('保存失败!');";
    }
Exemplo n.º 5
0
    private void bind()
    {
        if (base.Request["PrjCode"] == null || base.Request["Levels"] == null)
        {
            this.gvItemInpect.DataSource = "";
            this.gvItemInpect.DataBind();
            this.Button_add.Visible = false;
            return;
        }
        string    strwhere         = "prjcode in (" + this.getprjCodeList() + ") and Flags=" + base.Request["Levels"].ToString();
        DataTable checkCollections = CheckAction.GetCheckCollections(strwhere);
        int       arg_89_0         = checkCollections.Rows.Count;

        this.ViewState[CheckList.resourceTable] = checkCollections;
        this.gvItemInpect.DataSource            = checkCollections;
        this.gvItemInpect.DataBind();
    }
Exemplo n.º 6
0
    private void bind(string pk)
    {
        CheckInfo checkInfo = CheckAction.GetCheckInfo(pk);
        DateTime  now       = DateTime.Now;

        this.DateBox_sprq.Text = string.Format("{0:yyyy-MM-dd}", now);
        this.TextBox_spyj.Text = checkInfo.ExamineApproveIdea;
        this.TextBox_spr.Text  = checkInfo.ExamineApprovePerson;
        if (checkInfo.ExamineApproveResult == 1)
        {
            this.RadioButton_ok.Checked = true;
            return;
        }
        if (checkInfo.ExamineApproveResult == 0)
        {
            this.RadioButton_no.Checked = true;
        }
    }
Exemplo n.º 7
0
 private void Run()
 {
     try
     {
         WebAction.Execute(Context);
         if (WebAction.Type == Models.Behaviours.Action.ActionType.Check)
         {
             CheckAction checkWebAction     = (CheckAction)WebAction;
             Behaviour   behaviourToExecute = checkWebAction.CheckResult ? checkWebAction.BehaviourWhenTrue : checkWebAction.BehaviourWhenFalse;
             if (behaviourToExecute != null)
             {
                 studio.ExecuteBehaviour(behaviourToExecute, Context);
             }
         }
     }
     catch (Exception ex)
     {
         Dialog.CancelAllTasks($"Error while executing action: {ex.Message}");
     }
 }
Exemplo n.º 8
0
    protected void Button_query_Click(object sender, EventArgs e)
    {
        if (base.Request["PrjCode"] == null || base.Request["Levels"] == null)
        {
            this.gvItemInpect.DataSource = "";
            this.gvItemInpect.DataBind();
            return;
        }
        string text = "prjcode='" + base.Request["PrjCode"].ToString() + "' and Flags=" + base.Request["Levels"].ToString();

        if (this.TextBox_sjdw.Text.Trim() != "")
        {
            text = text + " and AcceptCheckUnit like '%" + this.TextBox_sjdw.Text.Trim() + "%'";
        }
        if (this.TextBox_jcdw.Text.Trim() != "")
        {
            text = text + " and ExamineUnit like '%" + this.TextBox_jcdw.Text.Trim() + "%'";
        }
        this.gvItemInpect.DataSource = CheckAction.GetCheckCollections(text);
        this.gvItemInpect.DataBind();
    }
Exemplo n.º 9
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            if (parameters.Validate())
            {
                WebAction            = availableActions.Find(webaction => webaction.Id == cbbType.SelectedValue.ToString());
                WebAction.Parameters = parameters;

                if (WebAction.Type == Interpic.Models.Behaviours.Action.ActionType.Check)
                {
                    CheckAction checkWebAction = WebAction as CheckAction;
                    checkWebAction.BehaviourWhenFalse = (Behaviour)cbbBehaviourWhenFalse.SelectedItem;
                    checkWebAction.BehaviourWhenTrue  = (Behaviour)cbbBehaviourWhenTrue.SelectedItem;
                    WebAction = checkWebAction;
                }
                Close();
            }
            else
            {
                WarningAlert.Show("Not all parameters have been set!");
            }
        }
Exemplo n.º 10
0
    protected void Button_del_Click(object sender, EventArgs e)
    {
        if (this.hidenSortID.Value.Trim() == "")
        {
            this.JavaScriptControl1.Text = "alert('请选择删除的记录!')";
            return;
        }
        int checkCount = CheckAction.GetCheckCount("AcceptCheckSort=" + this.hidenSortID.Value);

        if (checkCount > 0)
        {
            this.JavaScriptControl1.Text = "alert('该类别对应的有检查记录,请删除对应的检查记录后再删除该类别!');";
            return;
        }
        bool flag = CheckClassAction.Delete(this.hidenSortID.Value);

        if (flag)
        {
            this.JavaScriptControl1.Text = "alert('删除成功!');window.location.href=window.location.href";
            return;
        }
        this.JavaScriptControl1.Text = "alert('删除失败!')";
    }
Exemplo n.º 11
0
    //异步实例化模型
    public static void AsyncInstantiateModel(string name, CheckAction check, UnityAction <GameObject> omComplete)
    {
        name = name.toLower();
        var obj = modelPools.PopItem(name);

        if (obj != null)
        {
            obj.transform.localScale = Vector3.one;
            if (check == null || check(name))
            {
                omComplete(obj);
            }
            else
            {
                ResHelper.DestroyGameObject(ref obj);
            }
        }
        else
        {
            UnityAction <UnityEngine.Object> onLoadComplete = (UnityEngine.Object mainAsset) =>
            {
                if (check != null && !check(name))
                {
                    return;
                }
                var        prefab = mainAsset as GameObject;
                GameObject newObj = null;
                if (prefab != null)
                {
                    newObj = GameObject.Instantiate(prefab);
                    newObj.transform.resetLocal();
                }
                omComplete(newObj);
            };
            AsyncLoadModel(name, onLoadComplete);
        }
    }
Exemplo n.º 12
0
    protected void Button_save_Click(object sender, EventArgs e)
    {
        if (this.TextBox_jcnr.Text.Length > this.TextBox_jcnr.MaxLength)
        {
            this.JavaScriptControl1.Text = "top.ui.alert('检查内容输入的内容过长!')";
            return;
        }
        if (this.TextBox_jcyj.Text.Length > this.TextBox_jcyj.MaxLength)
        {
            this.JavaScriptControl1.Text = "top.ui.alert('检查依据输入的内容过长!')";
            return;
        }
        if (this.Textbox_jcjg.Text.Length > this.Textbox_jcjg.MaxLength)
        {
            this.JavaScriptControl1.Text = "top.ui.alert('检查结果输入的内容过长!')";
            return;
        }
        if (this.Textbox_zgnr.Text.Length > this.Textbox_zgnr.MaxLength)
        {
            this.JavaScriptControl1.Text = "top.ui.alert('整改要求输入的内容过长!')";
            return;
        }
        if (this.TextBox_xmjh.Text.Length > this.TextBox_xmjh.MaxLength)
        {
            this.JavaScriptControl1.Text = "top.ui.alert('项目部整改计划输入的内容过长!')";
            return;
        }
        if (this.TextBox_sjjg.Text.Length > this.TextBox_sjjg.MaxLength)
        {
            this.JavaScriptControl1.Text = "top.ui.alert('实际整改结果输入的内容过长!')";
            return;
        }
        if (this.Textbox_bz.Text.Length > this.Textbox_bz.MaxLength)
        {
            this.JavaScriptControl1.Text = "top.ui.alert('备注输入的内容过长!')";
            return;
        }
        CheckInfo checkInfo = new CheckInfo();

        if (base.Request["pk"] != null)
        {
            checkInfo.ID = int.Parse(base.Request["pk"].ToString());
        }
        checkInfo.Flags       = 2;
        checkInfo.ExamineUnit = this.TextBox_jcdw.Text;
        checkInfo.AcceptCheckAnswerForPerson = this.TextBox_jcfzr.Text;
        checkInfo.AcceptCheckContent         = this.TextBox_jcnr.Text;
        if (!string.IsNullOrEmpty(this.DateBox_jcrq.Text))
        {
            checkInfo.AcceptCheckDate = DateTime.Parse(this.DateBox_jcrq.Text);
        }
        else
        {
            checkInfo.AcceptCheckDate = DateTime.Now;
        }
        checkInfo.AcceptCheckGist   = this.TextBox_jcyj.Text;
        checkInfo.AcceptCheckResult = this.Textbox_jcjg.Text;
        if (this.DropDownList_lb.SelectedValue != "")
        {
            checkInfo.AcceptCheckSort = int.Parse(this.DropDownList_lb.SelectedValue);
        }
        checkInfo.AcceptCheckUnit      = this.TextBox_sjdw.Text;
        checkInfo.CompleteApplyContent = this.Textbox_zgnr.Text;
        checkInfo.Remark = this.Textbox_bz.Text;
        if (this.DateBox_yqwcsj.Text != "")
        {
            checkInfo.requestfinishtime = DateTime.Parse(this.DateBox_yqwcsj.Text);
        }
        if (this.DateBox_jhwcsj.Text != "")
        {
            checkInfo.planfinishtime = DateTime.Parse(this.DateBox_jhwcsj.Text);
        }
        if (this.DateBox_sjwcsj.Text != "")
        {
            checkInfo.factfinishtime = DateTime.Parse(this.DateBox_sjwcsj.Text);
        }
        checkInfo.prjplan      = this.TextBox_xmjh.Text;
        checkInfo.factresult   = this.TextBox_sjjg.Text;
        checkInfo.IsRectified  = false;
        checkInfo.checkResults = int.Parse(this.ddlCheckResults.SelectedValue);
        base.Request.Params["Type"].ToString();
        if (base.Request.Params["Type"].ToString() == PageType.Rectify.ToString())
        {
            checkInfo.IsRectified = true;
        }
        else
        {
            if (base.Request.Params["Type"].ToString() == PageType.Certify.ToString())
            {
                checkInfo.IsRectified = (this.ddlCertifiResult.SelectedValue == "2");
            }
        }
        checkInfo.CertifiResult = int.Parse(this.ddlCertifiResult.SelectedValue);
        checkInfo.CheckResult   = int.Parse(this.ddlCheckResult.SelectedValue);
        int mark = 2;

        if (this.cbkmark.Checked)
        {
            mark = 3;
        }
        if (this.ViewState["Mark"].ToString().Equals("1"))
        {
            mark = 1;
        }
        checkInfo.Mark          = mark;
        checkInfo.FilesType     = int.Parse(this.DDTClass.SelectedValue.ToString());
        checkInfo.RectifyMarkID = this.FileLink2.FID;
        if (base.Request["Levels"] != null)
        {
            checkInfo.Flags = int.Parse(base.Request["Levels"].ToString());
        }
        if (base.Request["Prjcode"] != null)
        {
            checkInfo.PrjCode = base.Request["Prjcode"].ToString();
        }
        new StringBuilder();
        bool flag;

        if (base.Request["pk"] == null)
        {
            flag = CheckAction.CheckInfoOp(checkInfo, "Insert");
        }
        else
        {
            flag = CheckAction.CheckInfoOp(checkInfo, "Update");
        }
        if (flag)
        {
            base.RegisterScript("top.ui.tabSuccess({ parentName: '_checklist' });");
            return;
        }
        base.RegisterScript("top.ui.alert('保存失败!');");
    }
Exemplo n.º 13
0
        /// <summary>
        /// 比较两个DataTable数据
        /// </summary>
        /// <param name="dtSource">主库数据</param>
        /// <param name="dtSrc">目标库数据</param>
        /// <param name="dtDiff">对比结果</param>
        /// <param name="defaultKey">对比表主键</param>
        /// <param name="keyFields">对比表字段</param>
        public static void CompareTable(DataTable dtSource, DataTable dtSrc, out DataTable dtDiff, string defaultKey, List <string> keyFields)
        {
            //源记录集与目标记录集有一个为null则退出
            if (dtSource == null || dtSrc == null)
            {
                dtDiff = null;
                return;
            }

            //keyFields.ForEach(t => dtSource.Columns.Remove(t.ToString()));
            //keyFields.ForEach(t => dtSrc.Columns.Remove(t.ToString()));
            foreach (string t in keyFields)
            {
                if (dtSource.Columns.Contains(t.ToString()))
                {
                    dtSource.Columns.Remove(t.ToString());
                }
                if (dtSrc.Columns.Contains(t.ToString()))
                {
                    dtSrc.Columns.Remove(t.ToString());
                }
            }

            #region 排除表差异

            List <String> listSourceColumns = new List <string>();
            foreach (var sourceColumns in dtSource.Columns)
            {
                listSourceColumns.Add(sourceColumns.ToString());
            }

            List <String> listSrcColumns = new List <string>();
            foreach (var srcColumns in dtSrc.Columns)
            {
                listSrcColumns.Add(srcColumns.ToString());
            }

            var listDiffSource = listSourceColumns.Except(listSrcColumns);
            var listDiffSrc    = listSrcColumns.Except(listSourceColumns);

            listDiffSource.ToList().ForEach(t => dtSource.Columns.Remove(t.ToString()));
            listDiffSrc.ToList().ForEach(t => dtSrc.Columns.Remove(t.ToString()));

            #endregion

            dtDiff = dtSource.Clone();
            object oSource;
            object oSrc;
            for (int i = 0; i < dtDiff.Columns.Count; i++)
            {
                dtSrc.Columns[dtDiff.Columns[i].ColumnName].SetOrdinal(i);
            }

            List <String> removeProps = new List <string>();

            //增加和修改的情况只需要检查主库
            foreach (DataRow item in dtSource.Rows)
            {
                string filterQuery = string.Empty;
                var    keyArray    = defaultKey.Split(',');

                if (keyArray.Length == 1 && keyArray[0] != string.Empty)
                {
                    filterQuery = string.Format("{0}='{1}'", defaultKey, item[0]);
                }
                else
                {
                    for (int i = 0; i < keyArray.Length; i++)
                    {
                        if (keyArray[i] != string.Empty)
                        {
                            filterQuery += string.Format("{0}='{1}' And ", keyArray[i], item[i]);
                        }
                    }
                    filterQuery += "1=1";
                }

                var hasRow = dtSrc.Select(filterQuery);

                CheckAction checkAction = CheckAction.Equal;
                if (hasRow.Count() > 0)
                {
                    //循环比对列值
                    foreach (var itemColumns in dtSource.Columns)
                    {
                        //获得列值
                        oSource = item[itemColumns.ToString()];
                        oSrc    = hasRow[0][itemColumns.ToString()];

                        if (oSource != null && oSrc != null)
                        {
                            if (oSource.ToString() != oSrc.ToString())
                            {
                                checkAction = CheckAction.Update;
                                break;//某一列不同就跳出
                            }
                        }
                        else if (!oSource.Equals(oSrc))
                        {
                            checkAction = CheckAction.Update;
                            break;//某一列不同就跳出
                        }
                    }
                }
                else
                {
                    checkAction = CheckAction.Add;
                }

                //不相等的才写入差异
                if (!checkAction.Equals(CheckAction.Equal))
                {
                    item["CheckAction"] = checkAction.ToString();
                    dtDiff.Rows.Add(item.ItemArray);
                }
            }

            foreach (var removeProp in removeProps.Distinct())
            {
                dtDiff.Columns.Remove(removeProp);
            }

            //删除需要以子库为主
            foreach (DataRow item in dtSrc.Rows)
            {
                string filterQuery = string.Empty;
                var    keyArray    = defaultKey.Split(',');

                if (keyArray.Length == 1 && keyArray[0] != string.Empty)
                {
                    filterQuery = string.Format("{0}='{1}'", defaultKey, item[0]);
                }
                else
                {
                    for (int i = 0; i < keyArray.Length; i++)
                    {
                        if (keyArray[i] != string.Empty)
                        {
                            filterQuery += string.Format("{0}='{1}' And ", keyArray[i], item[i]);
                        }
                    }
                    filterQuery += "1=1";
                }

                var hasRow = dtSource.Select(filterQuery);

                if (hasRow.Count() < 1)
                {
                    item["CheckAction"] = CheckAction.Delete.ToString();
                    dtDiff.Rows.Add(item.ItemArray);
                }
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Intialize ImageCaster commands, parse arguments,
        /// and process the command the user input.
        ///
        /// This method also times the time taken to perform
        /// the command to help optimizations in development
        /// or user configurations.
        /// </summary>
        /// <param name="args">Command line arguments.</param>
        /// <returns>The exit code.</returns>
        public static async Task <int> Main(string[] args)
        {
            RootCommand command = new RootCommand("Perform aggregate tasks against a collection of images")
            {
                new Command("archive", "Archive collections of images or files into compressed archives")
                {
                    Handler = CommandHandler.Create <FileInfo>((file) =>
                    {
                        try
                        {
                            ImageCasterConfig config = ConfigurationFile.LoadFromFile(file.FullName);
                            IAction action           = new ArchiveAction(config);

                            try
                            {
                                action.Execute();
                            }
                            catch (ConfigurationException ex)
                            {
                                Logger.Error(ex.Message);
                                return((int)ExitCode.MalformedConfigFields);
                            }
                            catch (FileNotFoundException ex)
                            {
                                Logger.Error(ex.Message);
                                return((int)ExitCode.MalformedConfigFields);
                            }
                            catch (Exception ex)
                            {
                                return(OnInternalException(ex));
                            }
                        }
                        catch (JsonException ex)
                        {
                            return(OnJsonException(ex));
                        }

                        return((int)ExitCode.Normal);
                    })
                },
                new Command("build", "Export the output images from the source")
                {
                    Handler = CommandHandler.Create <FileInfo>((file) =>
                    {
                        try
                        {
                            ImageCasterConfig config = ConfigurationFile.LoadFromFile(file.FullName);
                            IAction action           = new BuildAction(config);

                            try
                            {
                                action.Execute();
                            }
                            catch (ConfigurationException ex)
                            {
                                Logger.Error(ex.Message);
                                return((int)ExitCode.MalformedConfigFields);
                            }
                            catch (Exception ex)
                            {
                                return(OnInternalException(ex));
                            }

                            return((int)ExitCode.Normal);
                        }
                        catch (JsonException ex)
                        {
                            return(OnJsonException(ex));
                        }
                    })
                },
                new Command("check", "Validate that the project structure and standards are maintained")
                {
                    Handler = CommandHandler.Create <FileInfo>((file) =>
                    {
                        try
                        {
                            ImageCasterConfig config = ConfigurationFile.LoadFromFile(file.FullName);
                            IAction action           = new CheckAction(config.Checks);

                            try
                            {
                                action.Execute();
                            }
                            catch (ConfigurationException ex)
                            {
                                Logger.Error(ex.Message);
                                return((int)ExitCode.MalformedConfigFields);
                            }
                            catch (ValidationException ex)
                            {
                                Logger.Error(ex.Message);
                                return((int)ExitCode.CheckFailures);
                            }
                            catch (Exception ex)
                            {
                                return(OnInternalException(ex));
                            }
                        }
                        catch (JsonException ex)
                        {
                            return(OnJsonException(ex));
                        }

                        return((int)ExitCode.Normal);
                    })
                },
                new Command("montage", "Export a single image comprised of all matching output images")
                {
                    Handler = CommandHandler.Create <FileInfo>((file) =>
                    {
                        try
                        {
                            ImageCasterConfig config = ConfigurationFile.LoadFromFile(file.FullName);
                            IAction action           = new MontageAction(config);

                            try
                            {
                                action.Execute();
                            }
                            catch (ConfigurationException ex)
                            {
                                Logger.Error(ex.Message);
                                return((int)ExitCode.MalformedConfigFields);
                            }
                            catch (Exception ex)
                            {
                                return(OnInternalException(ex));
                            }
                        }
                        catch (JsonException ex)
                        {
                            return(OnJsonException(ex));
                        }

                        return((int)ExitCode.Normal);
                    })
                }
            };

            command.Name = "imagecaster";

            CommandLineBuilder commandLineBuilder = new CommandLineBuilder(command)
            {
                EnableDirectives = false
            };

            // Default middlewares we want to add to our console application.
            commandLineBuilder.UseVersionOption().UseHelp().UseParseErrorReporting().CancelOnProcessTermination();

            // These are our own defined middlewares.
            commandLineBuilder.UseLogger().UseTimer().UseLicense().UseImageCaster();

            Parser parser = commandLineBuilder.Build();

            return(await parser.InvokeAsync(args));
        }
Exemplo n.º 15
0
 public CheckActionTest()
 {
     action         = new CheckAction();
     controllerMock = new Mock <IGameController>();
 }
Exemplo n.º 16
0
        public void Check([FromBody] ImageCasterConfig config)
        {
            CheckAction check = new CheckAction(config.Checks);

            check.Execute();
        }