Ejemplo n.º 1
0
 public void SetText(string text, int highlightStart, int highlightLength)
 {
     if (highlightLength == 0 || highlightStart >= text.Length)
     {
         FirstPart.text = text;
         SecondPart.CheapDisable();
         ThirdPart.CheapDisable();
     }
     else
     {
         FirstPart.text = text.Substring(0, highlightStart);
         SecondPart.CheapEnable();
         SecondPart.text = text.Substring(highlightStart, highlightLength);
         int end = highlightStart + highlightLength;
         if (end < text.Length)
         {
             ThirdPart.CheapEnable();
             ThirdPart.text = text.Substring(end, text.Length - end);
         }
         else
         {
             ThirdPart.CheapDisable();
         }
     }
 }
Ejemplo n.º 2
0
 public override string ToSource()
 {
     return(string.Format
            (
                "({0}.Is{1}Than({2}))",
                FirstPart.ToSource(),
                ConditionText,
                SecondPart.ToSource()
            ));
 }
Ejemplo n.º 3
0
        public override string ToSource()
        {
            string firstPartStr  = FirstPart?.ToSource();
            string secondPartStr = SecondPart?.ToSource();

            if (!(FirstPart is GNumber))
            {
                firstPartStr += ".ToNumber()";
            }

            if (!(SecondPart is GNumber))
            {
                secondPartStr += ".ToNumber()";
            }

            return(string.Format("({0} {1} {2})", firstPartStr, OperatorText, secondPartStr));
        }
Ejemplo n.º 4
0
        public void CreateManyParametersTest()
        {
            FirstPart  f = new FirstPart();
            SecondPart s = new SecondPart();

            f.FirstName = "John";
            s.LastName  = "Pupkin";

            using (DbManager db = new DbManager())
            {
                Person p = (Person)db
                           .SetSpCommand("Person_SelectByName", db.CreateParameters(f), db.CreateParameters(s))
                           .ExecuteObject(typeof(Person));

                Assert.IsNotNull(p);
                Assert.AreEqual(f.FirstName, p.FirstName);
                Assert.AreEqual(s.LastName, p.LastName);
            }
        }
Ejemplo n.º 5
0
        public override string ToSource()
        {
            string firstPartStr  = FirstPart?.ToSource();
            string secondPartStr = SecondPart?.ToSource();

            if (!(FirstPart is GLogic))
            {
                firstPartStr += ".ToBool()";
            }

            if (!(SecondPart is GLogic))
            {
                secondPartStr += ".ToBool()";
            }


            return(string.Format
                   (
                       "({0} {1} {2})",
                       firstPartStr,
                       GateText,
                       secondPartStr
                   ));
        }
Ejemplo n.º 6
0
		public void CreateManyParametersTest()
		{
			FirstPart  f = new FirstPart();
			SecondPart s = new SecondPart();

			f.FirstName = "John";
			s.LastName = "Pupkin";

			using (DbManager db = new DbManager())
			{
				Person p = (Person)db
					.SetSpCommand ("Person_SelectByName", db.CreateParameters(f), db.CreateParameters(s))
					.ExecuteObject(typeof(Person));
				
				Assert.IsNotNull(p);
				Assert.AreEqual(f.FirstName, p.FirstName);
				Assert.AreEqual(s.LastName,  p.LastName);
			}
		}
Ejemplo n.º 7
0
 public override Expression ClearConstant(Dictionary <string, Expression> constMapping)
 {
     return(new Sequence(FirstPart.ClearConstant(constMapping), SecondPart.ClearConstant(constMapping)));
 }
Ejemplo n.º 8
0
 public override void GenerateMSIL(ILGenerator ilGenerator, TypeBuilder typeBuilder)
 {
     FirstPart.GenerateMSIL(ilGenerator, typeBuilder);
     SecondPart.GenerateMSIL(ilGenerator, typeBuilder);
 }
Ejemplo n.º 9
0
 public override bool HasExternalLibraryCall()
 {
     return(FirstPart.HasExternalLibraryCall() || SecondPart.HasExternalLibraryCall());
 }