Esempio n. 1
0
		public void WithNotEmpty()
		{
			var source = new Dictionary<int, string> { { 1, "a" }, { 2, "b" }, { 3, "c" } };
			var result = source.With(2);

			Assert.AreEqual("b", result);
		}
Esempio n. 2
0
        public void WithEmpty()
        {
            Dictionary <int, string> source = null;
            var result = source.With(2);

            Assert.AreEqual(null, result);
        }
Esempio n. 3
0
        public void WithNotEmpty()
        {
            var source = new Dictionary <int, string> {
                { 1, "a" }, { 2, "b" }, { 3, "c" }
            };
            var result = source.With(2);

            Assert.AreEqual("b", result);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            MonadsForObjects.DoDemo();

            var data = new Dictionary<int, string>();
            //data.Add(1, "My Name");
            //data.With(1).Do(_ => Console.WriteLine($"已找到Key为1的结果:{_}"));
            data.With(1).Return(_ => $"已找到Key为1的结果:{_}", "未找到Key为1的结果").Do(_ => Console.WriteLine(_));
               data.Return(1, _ =>
               {
               Console.WriteLine("Key1不存在,添加Key1");
               _.
               })
            //data.TryWith(1)
            Console.Read();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            MonadsForObjects.DoDemo();

            var data = new Dictionary <int, string>();

            //data.Add(1, "My Name");
            //data.With(1).Do(_ => Console.WriteLine($"已找到Key为1的结果:{_}"));
            data.With(1).Return(_ => $"已找到Key为1的结果:{_}", "未找到Key为1的结果").Do(_ => Console.WriteLine(_));
            data.Return(1, _ =>
            {
                Console.WriteLine("Key1不存在,添加Key1");
                _.
            })
            //data.TryWith(1)
            Console.Read();
        }
Esempio n. 6
0
 public Item GetArmSlotItem(ArmSlotType armSlotType)
 {
     return(armSlotsInfo.With(armSlotType));
 }
Esempio n. 7
0
 public Item GetBodySlotItem(BodySlotType bodySlotType)
 {
     return(bodySlotsInfo.With(bodySlotType));
 }
Esempio n. 8
0
 public void FixOffset(long offset)
 {
     Offset     = offset;
     Dictionary = Dictionary.With(NameToken.Prev, new NumericToken(offset));
 }
Esempio n. 9
0
 public T GetArmSlotItem <T>(ArmSlotType armSlotType) where T : Item
 {
     return(armSlotsInfo.With(armSlotType) as T);
 }
Esempio n. 10
0
 public MethodDocumentation ForMethod(MethodInfo methodInfo)
 {
     return(methodDocs.With(methodInfo.GetDocStyleSignature()));
 }