当前位置: 首页>>代码示例>>C#>>正文


C# Dict.Val方法代码示例

本文整理汇总了C#中Dict.Val方法的典型用法代码示例。如果您正苦于以下问题:C# Dict.Val方法的具体用法?C# Dict.Val怎么用?C# Dict.Val使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dict的用法示例。


在下文中一共展示了Dict.Val方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: V_VNA

 public static void V_VNA(NetwRunnable nr, ExecHm rc, Bys m, out string name, out IDictionary<string, Object> args)
 {
     var res = new Dict(m.V<Dictionary<string, object>>());
     name = res.Val("name", "");
     var obj = res["args"];
     args = res["args"] as IDictionary<string,object>;
 }
开发者ID:Centny,项目名称:cswf,代码行数:7,代码来源:ExecHm.cs

示例2: TestDoWord

        public void TestDoWord()
        {
            TaskPool.Shared.MaximumConcurrency = 3;
            FCfg cfg = new FCfg();
            DocCovT cov;
            cov = new DocCovT("DocCov", cfg);
            cov.DoCmd("a1", cfg, "Word test\\xx.docx docx_00-{0}.jpg 768 1024");
            while (cov.done == null)
            {
                Thread.Sleep(500);
            }

            var data_ = cov.done as IDictionary<string, object>;
            var data = new Dict(data_);
            Assert.AreEqual(0, data.Val("code", -1));
            Assert.AreEqual("a1", data.Val("tid", ""));
            var res = data["data"] as CovRes;
            Assert.AreEqual(true, res.Count > 0 && res.Count == res.Files.Count);
            Assert.AreNotEqual(0, cov.rate);
            //
            cov = new DocCovT("DocCov", cfg);
            cov.DoCmd("a2", cfg, "Word test\\xx.docxx docx_00-{0}.jpg 768 1024");
            while (cov.done == null)
            {
                Thread.Sleep(500);
            }
            data_ = cov.done as IDictionary<string, object>;
            data = new Dict(data_);
            Assert.AreNotEqual(0, data.Val("code", 0));
            Assert.AreEqual("a2", data.Val("tid", ""));
            var err = data["err"] as String;
            Assert.AreNotEqual(0, err.Length);
            //
            //
            cov = new DocCovT("DocCov", cfg);
            cov.error = true;
            cov.DoCmd("a2", cfg, "Word test\\xx.docx docx_01-{0}.jpg 768 1024");
            while (!cov.do_err)
            {
                Thread.Sleep(500);
            }
        }
开发者ID:Centny,项目名称:cswf.doc,代码行数:42,代码来源:DocCovTest.cs

示例3: TestDoPowerPoint

 public void TestDoPowerPoint()
 {
     FCfg cfg = new FCfg();
     DocCovT cov = new DocCovT("DocCov", cfg);
     cov.DoCmd("a1", cfg, "PowerPoint test\\xx.pptx pptx_00-{0}.jpg");
     while (cov.done == null)
     {
         Thread.Sleep(500);
     }
     var data_ = cov.done as IDictionary<string, object>;
     var data = new Dict(data_);
     Assert.AreEqual(0, data.Val("code", -1));
     Assert.AreEqual("a1", data.Val("tid", ""));
     var res = data["data"] as CovRes;
     Assert.AreEqual(true, res.Count > 0 && res.Count == res.Files.Count);
     Assert.AreNotEqual(0, cov.rate);
     //
     cov = new DocCovT("DocCov", cfg);
     cov.DoCmd("a2", cfg, "PowerPoint test\\xx.pptxx pptxx_00-{0}.jpg 768 1024");
     while (cov.done == null)
     {
         Thread.Sleep(500);
     }
     data_ = cov.done as IDictionary<string, object>;
     data = new Dict(data_);
     Assert.AreNotEqual(0, data.Val("code", 0));
     Assert.AreEqual("a2", data.Val("tid", ""));
     var err = data["err"] as String;
     Assert.AreNotEqual(0, err.Length);
 }
开发者ID:Centny,项目名称:cswf.doc,代码行数:30,代码来源:DocCovTest.cs

示例4: TestNormal

 public void TestNormal()
 {
     FCfg cfg = new FCfg();
     DocCovT cov = new DocCovT("DocCov", cfg);
     cov.DoCmd("a1", cfg, "test\\dtm_json.bat");
     while (cov.done == null)
     {
         Thread.Sleep(500);
     }
     var data_ = cov.done as IDictionary<string, object>;
     var data = new Dict(data_);
     Assert.AreEqual(0, data.Val("code", -1));
     Assert.AreEqual("a1", data.Val("tid", ""));
     var res = data["data"] as IDictionary<string, object>;
     Assert.AreEqual(true, res.Count > 0);
 }
开发者ID:Centny,项目名称:cswf.doc,代码行数:16,代码来源:DocCovTest.cs

示例5: TestStartDTM_C

        public void TestStartDTM_C()
        {
            var cfg = new FCfg();
            cfg["proc_env"] = "a=1,b=2";
            var dtmc = new DTM_C_t("c", cfg);
            var args = Util.NewDict();
            var res = Util.NewDict();
            var tres = new Dict();
            var tid = "xx1";
            args["tid"] = tid;
            args["cmds"] = "test/dtm_json.bat abc";
            //

            var bs = new PrintStream();
            RCM_Cmd cmd;
            //
            cmd = new RCM_Cmd(null, "", args);
            res = dtmc.StartTask(cmd) as Dictionary<String, object>;
            tres = new Dict(res);
            Console.WriteLine(Json.stringify(res));
            Assert.AreEqual(0, tres.Val("code", -1));
            while (dtmc.Tasks.Count > 0)
            {
                Thread.Sleep(500);
            }
            Assert.AreNotEqual(null, dtmc.Done);
            res = dtmc.Done as Dictionary<String, object>;
            tres = new Dict(res);
            Console.WriteLine(Json.stringify(res));
            Assert.AreEqual(0, tres.Val("code", -1));
            Assert.AreEqual(tid, tres.Val("tid", ""));
            //
            args["cmds"] = "test/dtm_json_err.bat abc";
            res = dtmc.StartTask(cmd) as Dictionary<String, object>;
            tres = new Dict(res);
            Console.WriteLine(Json.stringify(res));
            Assert.AreEqual(0, tres.Val("code", -1));
            while (dtmc.Tasks.Count > 0)
            {
                Thread.Sleep(500);
            }
            Assert.AreNotEqual(null, dtmc.Done);
            res = dtmc.Done as Dictionary<String, object>;
            tres = new Dict(res);
            Console.WriteLine(Json.stringify(res));
            Assert.AreNotEqual(0, tres.Val("code", 0));
            Assert.AreEqual(tid, tres.Val("tid", ""));
            //
            //
            args["cmds"] = "sdfkfk";
            res = dtmc.StartTask(cmd) as Dictionary<String, object>;
            tres = new Dict(res);
            Console.WriteLine(Json.stringify(res));
            Assert.AreNotEqual(0, tres.Val("code", 0));
            //Assert.AreEqual(tid, tres.Val("tid", ""));
            //
            args["cmds"] = "";
            res = dtmc.StartTask(cmd) as Dictionary<String, object>;
            tres = new Dict(res);
            Console.WriteLine(Json.stringify(res));
            Assert.AreNotEqual(0, tres.Val("code", 0));
            //Assert.AreEqual(tid, tres.Val("tid", ""));
            Console.WriteLine("Done...");
        }
开发者ID:Centny,项目名称:cswf,代码行数:64,代码来源:DTM_C_jTest.cs

示例6: OnFfProc

 public virtual HResult OnFfProc(Request r)
 {
     var args = HttpUtility.ParseQueryString(r.req.Url.Query);
     var tid = args.Get("tid");
     var duration_ = args.Get("duration");
     if (String.IsNullOrWhiteSpace(tid) || String.IsNullOrWhiteSpace(duration_))
     {
         r.res.StatusCode = 400;
         r.WriteLine("the tid/duration is required");
         return HResult.HRES_RETURN;
     }
     float duration = 0;
     if (!float.TryParse(duration_, out duration))
     {
         r.res.StatusCode = 400;
         r.WriteLine("the duration must be float");
         return HResult.HRES_RETURN;
     }
     StreamReader reader = new StreamReader(r.req.InputStream);
     String line = null;
     var frame = new Dict();
     while ((line = reader.ReadLine()) != null)
     {
         line = line.Trim();
         if (line.Length < 1)
         {
             continue;
         }
         var kvs = line.Split(new char[] { '=' }, 2);
         var key = kvs[0].Trim();
         if (kvs.Length < 2)
         {
             frame[key] = "";
         }
         else
         {
             frame[key] = kvs[1].Trim();
         }
         if (key != "progress")
         {
             continue;
         }
         var ms = frame.Val<float>("out_time_ms", 0);
         this.DTMC.NotifyProc(tid, ms / duration);
     }
     r.res.StatusCode = 200;
     r.WriteLine("OK");
     r.Flush();
     return HResult.HRES_RETURN;
 }
开发者ID:Centny,项目名称:ffcm,代码行数:50,代码来源:FFCM.cs


注:本文中的Dict.Val方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。