Example #1
0
 private void Second_Tick(object sender, EventArgs e)
 {
     Second.Stop();
     SetMousePos(779, 538);
     mouse_event(MOUSEEVENTF_LEFTDOWN, 779, 538, 0, 0);
     mouse_event(MOUSEEVENTF_LEFTUP, 779, 538, 0, 0);
     Third.Start();
 }
Example #2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     First.Clear();
     Second.Clear();
     Third.Clear();
     Fourth.Clear();
     MessageBox.Show("The data has been cleared!", "Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
 }
Example #3
0
 public override int GetHashCode()
 {
     //TODO: Fix. Copy from Manbil::Vector4f.
     return(unchecked (First.GetHashCode() ^
                       Second.GetHashCode() ^
                       Third.GetHashCode() ^
                       Inversion.GetHashCode()));
 }
Example #4
0
 public bool IsThreePrimeTuple()
 {
     return             /*IsTwoPrimeTuple() &&*/
            (Primes.IsPrimeInLine(Int64.Parse(First.ToString() + Third.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Second.ToString() + Third.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Third.ToString() + First.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Third.ToString() + Second.ToString())));
 }
 static void Main()
 {
     Base B = new Base();
     Derived D = new Derived();
     Third T = new Third();
     B.Message();
     D.Message();
     T.Message();
 }
Example #6
0
 public static void Test()
 {
     using (Third t = new Third()) {
         Console.WriteLine("Now everything will be ok, after leaving this block");
         Console.WriteLine("t object will be dispose");
     }
     Thread.Sleep(1000);
     System.GC.Collect();
     Assert.AreEqual(111, i);
 }
Example #7
0
        public override int GetHashCode()
        {
            var a = First.GetHashCode();
            var c = Third.GetHashCode();

            var ab = ((a << 5) + a) ^ Second.GetHashCode();
            var cd = ((c << 5) + a) ^ Third.GetHashCode();

            return(((ab << 5) + ab) ^ cd.GetHashCode());
        }
Example #8
0
 /// <inheritdoc cref="object.ToString" />
 public override string ToString()
 {
     return(string.Format
            (
                "{0};{1};{2};{3}",
                First.ToVisibleString(),
                Second.ToVisibleString(),
                Third.ToVisibleString(),
                Fourth.ToVisibleString()
            ));
 }
Example #9
0
        static void Main(string[] args)
        {
            Third t = new Third();


            /* Run with F5 then check Output Window
             *  Third's destructor is called.
             *  Second's destructor is called.
             *  First's destructor is called.
             */
        }
Example #10
0
 public bool IsFivePrimeTuple()
 {
     return             /*IsFourPrimeTuple() &&*/
            (Primes.IsPrimeInLine(Int64.Parse(First.ToString() + Fifth.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Second.ToString() + Fifth.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Third.ToString() + Fifth.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Fourth.ToString() + Fifth.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Fifth.ToString() + First.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Fifth.ToString() + Second.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Fifth.ToString() + Third.ToString())) &&
             Primes.IsPrimeInLine(Int64.Parse(Fifth.ToString() + Fourth.ToString())));
 }
Example #11
0
        public override byte Eval()
        {
            int res = 0;

            for (int i = 0; i < 8; i++)
            {
                res *= 2;
                res += F.EvalAt(First.EvalAt(i) * 4 + Second.EvalAt(i) * 2 + Third.EvalAt(i));
            }

            return((byte)res);
        }
Example #12
0
        public ActionResult DeleteConfirm(int id)
        {
            Third th = tc.Third.Find(id);

            if (th == null)
            {
                return(HttpNotFound());
            }
            tc.Third.Remove(th);
            tc.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #13
0
        static void Main(string[] args)
        {
            First first = new First()
            {
                CarPrice = 2000000, CarName = "Porshe"
            };
            First first2 = new First()
            {
                CarPrice = 5000000, CarName = "Запорожец"
            };
            Second second = new Second()
            {
                Age = 55, Name = "Saule"
            };
            Second second2 = new Second()
            {
                Age = 23, Name = "Vasia"
            };
            Third third = new Third()
            {
                SchoolName = "NIS", SchoolNum = 1
            };
            Third third2 = new Third()
            {
                SchoolNum = 2, SchoolName = "QSI"
            };
            XmlSerializer xmlSerializable = new XmlSerializer(typeof(First));

            using (FileStream file = new FileStream("Files.xml", FileMode.OpenOrCreate))
            {
                xmlSerializable.Serialize(file, first);
                xmlSerializable.Serialize(file, first2);
                xmlSerializable = new XmlSerializer(typeof(Second));
                xmlSerializable.Serialize(file, second);
                xmlSerializable.Serialize(file, second2);
                xmlSerializable = new XmlSerializer(typeof(Third));
                xmlSerializable.Serialize(file, third);
                xmlSerializable.Serialize(file, third2);
            }
            JsonSerializer serializer = new JsonSerializer();

            using (StreamWriter stream = new StreamWriter("json.txt"))
                using (JsonWriter writer = new JsonTextWriter(stream))
                {
                    serializer.Serialize(writer, first);
                    serializer.Serialize(writer, first2);
                    serializer.Serialize(writer, second);
                    serializer.Serialize(writer, second2);
                    serializer.Serialize(writer, third);
                    serializer.Serialize(writer, third2);
                }
        }
Example #14
0
        static void Main(string[] args)
        {
            Employees myEmp = new Employees();

            myEmp.PrintName();
            myEmp = new Managers();
            myEmp.PrintName();
            myEmp = new HuRes();
            myEmp.PrintName();
            Third t = new Third();

            Console.ReadKey();
        }
Example #15
0
        private void Server_ClientConnected(object sender, System.Net.Sockets.TcpClient e)
        {
            var third = new Third();

            third.Run(Constants.GameServerPort);
            this.server.AddUser(new ServerManager.PAFrame
            {
                client = e,
                third  = third,
                thread = third.client._rxThread
            });
            third.client.DataReceived += third_DataReceived;
        }
Example #16
0
        private void Third_Tick(object sender, EventArgs e)
        {
            Third.Stop();
            SetMousePos(947, 630);
            mouse_event(MOUSEEVENTF_LEFTDOWN, 947, 630, 0, 0);
            mouse_event(MOUSEEVENTF_LEFTUP, 947, 630, 0, 0);

            SetMousePos(0, 320);
            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 320, 0, 0);
            mouse_event(MOUSEEVENTF_LEFTUP, 0, 320, 0, 0);

            First.Interval = 2000;
            First.Start();
        }
Example #17
0
        static void Main(string[] args)
        {
            //Second Task
            Second s        = new Second();
            String coef1str = s.coef[1] >= 0 ? " + " + s.coef[1] : " - " + (-s.coef[1]);

            Console.WriteLine("(" + s.coef[0] + coef1str + "x)/(1 + " + s.coef[2] + "x)");
            //Third task
            Third t = new Third();

            Console.WriteLine(t.quadCoef[0] + " + " + t.quadCoef[1] + "x + " + t.quadCoef[2] + "x^2");
            Console.WriteLine(t.linearCoef[0] + "x + " + t.linearCoef[1]);
            Console.ReadKey();
        }
Example #18
0
        static void Main()
        {
            Console.OutputEncoding = Encoding.Unicode;
            Console.InputEncoding  = Encoding.Unicode;
            First f = new First();

            f.Output();
            Second s = new Second();

            s.Output();
            Third t = new Third();

            t.Output();
        }
        public List <Scroll> ConvertToList()
        {
            List <Scroll> list = new List <Scroll>();

            list.AddRange(First.Where(_ => _.Number > 0).ToList());
            list.AddRange(Second.Where(_ => _.Number > 0).ToList());
            list.AddRange(Third.Where(_ => _.Number > 0).ToList());
            list.AddRange(Fourth.Where(_ => _.Number > 0).ToList());
            list.AddRange(Fifth.Where(_ => _.Number > 0).ToList());
            list.AddRange(Sixth.Where(_ => _.Number > 0).ToList());
            list.AddRange(Seventh.Where(_ => _.Number > 0).ToList());
            list.AddRange(Eigth.Where(_ => _.Number > 0).ToList());
            list.AddRange(Ninth.Where(_ => _.Number > 0).ToList());
            return(list);
        }
Example #20
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            Third th = tc.Third.Include(city => city.Cities).Include(country => country.Countries).FirstOrDefault(idd => idd.Id == id);

            if (th == null)
            {
                return(HttpNotFound());
            }

            return(View(th));
        }
Example #21
0
        public void MappingCache3()
        {
            // Arrange
            var first = new First();
            var second = new Second();
            var third = new Third();

            var map = MappingCache<First, Second, Third>.Map;

            // Act
            var result = map(first, second, third);

            // Assert
            Assert.Equal(result.Second.Third, third);
        }
Example #22
0
        public void MappingCache3_2()
        {
            // Arrange
            var first = new First();
            Second second = null;
            var third = new Third();

            var map = MappingCache<First, Second, Third>.Map;

            // Act
            var result = map(first, second, third);

            // Assert
            Assert.Null(result.Second);
        }
        public void MappingCache3()
        {
            // Arrange
            var first  = new First();
            var second = new Second();
            var third  = new Third();

            var map = MappingCache <First, Second, Third> .Map;

            // Act
            var result = map(first, second, third);

            // Assert
            Assert.AreEqual(result.Second.Third, third);
        }
        public void MappingCache3_2()
        {
            // Arrange
            var    first  = new First();
            Second second = null;
            var    third  = new Third();

            var map = MappingCache <First, Second, Third> .Map;

            // Act
            var result = map(first, second, third);

            // Assert
            Assert.IsNull(result.Second);
        }
Example #25
0
 public void chi()
 {
     if (!info)
     {
         CHInfo.gameObject.SetActive(true);
         First.SetActive(true);
         Second.SetActive(true);
         Third.SetActive(true);
         info = true;
     }
     else
     {
         CHInfo.gameObject.SetActive(false);
         info = false;
     }
 }
Example #26
0
        static void Main(string[] args)
        {
            Info       info       = new Info();
            Firstdeleg delDisplay = info.Display;
            Third      delThird   = info.DisplayInfo;
            ATM        aTM        = new ATM(delDisplay, delThird);


            aTM.Added       += info.DisplayInfo;
            aTM.Withdrowned += info.DisplayInfo;



            aTM.Add(150);
            aTM.Withdrawn(50);
        }
Example #27
0
        public ActionResult Delete(int id)
        {
            Third th = tc.Third.Include(city => city.Cities).Include(country => country.Countries).FirstOrDefault(p => p.Id == id);

            if (th == null)
            {
                return(HttpNotFound());
            }
            SelectList countries = new SelectList(tc.Countries, "Id", "Name");

            ViewBag.Countries = countries;
            SelectList cities = new SelectList(tc.Cities, "Id", "Name");

            ViewBag.Cities = cities;
            return(View(th));
        }
Example #28
0
        public void MappingCache4()
        {
            // Arrange
            var first  = new First();
            var second = new Second();
            var third  = new Third();
            var fourth = new Fourth();

            var map = MappingCache <First, Second, Third, Fourth> .Map;

            // Act
            var result = map(first, second, third, fourth);

            // Assert
            Assert.Equal(result.Second.Third.Fourth, fourth);
        }
 public int CompareTo(object obj)
 {
     if (ReferenceEquals(null, obj))
     {
         return(1);
     }
     if (ReferenceEquals(this, obj))
     {
         return(0);
     }
     if (obj is ComparableInterFakeType other)
     {
         return(Third.CompareTo(other.Third));
     }
     return(1);
 }
        public void MappingCache5_2()
        {
            // Arrange
            var    first  = new First();
            Second second = null;
            var    third  = new Third();
            var    fourth = new Fourth();
            var    fifth  = new Fifth();

            var map = MappingCache <First, Second, Third, Fourth, Fifth> .Map;

            // Act
            var result = map(first, second, third, fourth, fifth);

            // Assert
            Assert.IsNull(result.Second);
        }
Example #31
0
 public void ch3()
 {
     CHInfo.gameObject.SetActive(false);
     First.SetActive(true);
     Second.SetActive(true);
     if (!bool3)
     {
         Third.SetActive(false);
         bool3 = true;
         bool2 = false;
         bool1 = false;
     }
     else
     {
         bool3 = false;
         Third.SetActive(true);
     }
 }
        public void MappingCache7()
        {
            // Arrange
            var first   = new First();
            var second  = new Second();
            var third   = new Third();
            var fourth  = new Fourth();
            var fifth   = new Fifth();
            var sixth   = new Sixth();
            var seventh = new Seventh();

            var map = MappingCache <First, Second, Third, Fourth, Fifth, Sixth, Seventh> .Map;

            // Act
            var result = map(first, second, third, fourth, fifth, sixth, seventh);

            // Assert
            Assert.AreEqual(result.Second.Third.Fourth.Fifth.Sixth.Seventh, seventh);
        }
Example #33
0
        public delegate void Fifth(string sayHi);                         //委托

        public void Do()
        {
            First first = new First(FirstMethod);

            first.Invoke();
            Second second = new Second(SecondMethod);

            second.Invoke("你好");
            Third  third   = new Third(ThirdMethod);
            int    tResult = third.Invoke();
            Fourth fourth  = new Fourth(FourthMethod);
            string outstr  = "";
            string refstr  = "";

            fourth.Invoke(out outstr, ref refstr);
            //把委托当做参数传递
            Fifth fifth = new Fifth(FifthMethod);

            SayHi("小安", fifth);
        }
Example #34
0
        public void TwoWayBindingDemo()
        {
            Console.WriteLine("Demoing two-way binding...");

            IntegerLeft left = new IntegerLeft(5);
            IntegerRight right = new IntegerRight(5);
            BindingManager.CreateBinding(left, "magic", right, "spiffy");
            left.magic = 10;
            Console.WriteLine(right.spiffy);
            right.spiffy = 20;
            Console.WriteLine(left.magic);

            // Make a chain of bindings
            Third theThird = new Third();
            BindingManager.CreateBinding(right, "spiffy", theThird, "third");
            left.magic = 1;
            Console.WriteLine(theThird.third);
        }
Example #35
0
        public void MappingCache6()
        {
            // Arrange
            var first = new First();
            var second = new Second();
            var third = new Third();
            var fourth = new Fourth();
            var fifth = new Fifth();
            var sixth = new Sixth();

            var map = MappingCache<First, Second, Third, Fourth, Fifth, Sixth>.Map;

            // Act
            var result = map(first, second, third, fourth, fifth, sixth);

            // Assert
            Assert.Equal(result.Second.Third.Fourth.Fifth.Sixth, sixth);
        }
Example #36
0
        public void MappingCache7_2()
        {
            // Arrange
            var first = new First();
            Second second = null;
            var third = new Third();
            var fourth = new Fourth();
            var fifth = new Fifth();
            var sixth = new Sixth();
            var seventh = new Seventh();

            var map = MappingCache<First, Second, Third, Fourth, Fifth, Sixth, Seventh>.Map;

            // Act
            var result = map(first, second, third, fourth, fifth, sixth, seventh);

            // Assert
            Assert.Null(result.Second);
        }
 static void Main()
 {
     Third t = new Third();
 }