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


C# Task.ToString方法代码示例

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


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

示例1: CompletedDate

        public void CompletedDate()
        {
            var task1 = new Task("x 2011-03-01 2010-12-31 This task should be completed");

            Assert.IsTrue(task1.CompletedDate != null);
            Assert.AreEqual(new DateTime(2011, 3, 1), task1.CompletedDate);

            var task2 = new Task("2010-12-31 This task should not be completed");

            Assert.IsNull(task2.CompletedDate);

            var task3 = new Task(task1.ToString());
            Assert.IsTrue(task3.CompletedDate != null);
            Assert.AreEqual(new DateTime(2011, 3, 1), task3.CompletedDate);
        }
开发者ID:srogovtsev,项目名称:todotxtlib.net,代码行数:15,代码来源:TaskTests.cs

示例2: AddTask

    public void AddTask(Task task) {
		Debug.Log("Added Task " + task.ToString());
		tasks.AddLast(task);
		tasksLeft.AddLast(task);
	}
开发者ID:Jerx,项目名称:FGJ2016,代码行数:5,代码来源:TaskManager.cs

示例3: ToString_From_Parameters

 public void ToString_From_Parameters()
 {
     var task = new Task("(A)", _projects, _contexts, "This is a test task");
     Assert.AreEqual("(A) This is a test task @work +test", task.ToString());
 }
开发者ID:srogovtsev,项目名称:todotxtlib.net,代码行数:5,代码来源:TaskTests.cs

示例4: ToString_From_Raw

 public void ToString_From_Raw()
 {
     var task = new Task("(A) @work +test This is a test task");
     Assert.AreEqual("(A) @work +test This is a test task", task.ToString());
 }
开发者ID:srogovtsev,项目名称:todotxtlib.net,代码行数:5,代码来源:TaskTests.cs

示例5: getStatusString

        public string getStatusString(Task runningTask)
        {
            string str = string.Empty;
            switch (runningTask)
            {
                case Task.Idle:
                    str = runningTask.ToString();
                    break;

                case Task.SetVoltage:
                    str = "Setting voltage";
                    break;

                case Task.ReadCurrent:
                    str = "Reading current";
                    break;

                case Task.Reset:
                    str = "Software reset";
                    break;

                case Task.IdentifyStart:
                case Task.IdentifyStop:
                    str = "Identifying the device";
                    break;

                case Task.Update:
                    str = "Sending update commands";
                    break;

                case Task.ReadPartFuncInfo:
                case Task.ReadInterruptStatus:
                case Task.ReadPhStatus:
                case Task.ReadModemPackStatus:
                case Task.ReadChipStatus:
                case Task.ReadFfr:
                    str = "Reading status";
                    break;

                case Task.InitTxFifo:
                    str = "Initializing TX buffer";
                    break;

                case Task.InitRxFifo:
                    str = "Initializing RX buffer";
                    break;

                case Task.LoadTxFifo:
                    str = "Loading data into TX buffer";
                    break;

                case Task.StartTX:
                    str = "Starting TX buffer transmission";
                    break;

                case Task.StartRX:
                    str = "Reading RX buffer";
                    break;

                case Task.PER:
                    str = "Running PER test";
                    break;

                case Task.ACK:
                    str = Task.Idle.ToString();
                    break;

                case Task.NACK:
                    str = Task.Idle.ToString();
                    break;

                default:
                    str = "Doing unknown process!";
                    break;
            }
            return ("Status: " + str);
        }
开发者ID:x893,项目名称:WDS,代码行数:77,代码来源:AppWin_Si4460_CP.cs

示例6: TestTaskToStringWithNullName

        public void TestTaskToStringWithNullName()
        {
            var p = new Task();
            p.Name = null;

            Assert.AreEqual(p.ToString(), "BrockSolutions.Ticker.Shared.Task"); //Default representation from base object
        }
开发者ID:brocksolutions,项目名称:Ticker,代码行数:7,代码来源:TaskTest.cs

示例7: TestTaskToStringWithName

        public void TestTaskToStringWithName()
        {
            var name = "Test Name";
            var p = new Task() { Name = name };

            Assert.AreEqual(p.ToString(), name);
        }
开发者ID:brocksolutions,项目名称:Ticker,代码行数:7,代码来源:TaskTest.cs


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