Exemple #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Username.Length != 0)
            {
                hash ^= Username.GetHashCode();
            }
            hash ^= emailAddresses_.GetHashCode();
            if (Type != global::Dogdata.CustomType.Roar)
            {
                hash ^= Type.GetHashCode();
            }
            if (testCase_ == TestOneofCase.Name)
            {
                hash ^= Name.GetHashCode();
            }
            if (testCase_ == TestOneofCase.Name2)
            {
                hash ^= Name2.GetHashCode();
            }
            hash ^= AnimalFood.GetHashCode();
            if (noDiffrentWhat_ != null)
            {
                hash ^= NoDiffrentWhat.GetHashCode();
            }
            hash ^= (int)testCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemple #2
0
        //Next button
        private void button1_Click(object sender, EventArgs e)
        {
            double fee = 0;

            ResultPanel.Visible = false;

            if (checkBox1.Checked)
            {
                MoesPanel.Visible       = true;
                this.MoesTitle.Location = new System.Drawing.Point(230, 10);
                MoesTitle.Text          = "MOE'S";
                fee = 3.0;
            }
            else if (checkBox2.Checked)
            {
                MoesPanel.Visible       = true;
                this.MoesTitle.Location = new System.Drawing.Point(210, 10);
                MoesTitle.Text          = "CHINESE";
                fee = 3.0;
            }
            else if (checkBox3.Checked)
            {
                MoesPanel.Visible       = true;
                this.MoesTitle.Location = new System.Drawing.Point(200, 10);
                MoesTitle.Text          = "SONNY && TONY'S";
                fee = 2.5;
            }
            else if (checkBox4.Checked)
            {
                MoesPanel.Visible       = true;
                this.MoesTitle.Location = new System.Drawing.Point(190, 10);
                MoesTitle.Text          = "CHICKEN && RIB CRIB";
                fee = 2.0;
            }
            else if (checkBox5.Checked)
            {
                MoesPanel.Visible = true;
                MoesTitle.Text    = " ";
            }
            else
            {
                showError("Check a box!");
                return;
            }

            tipBox.Text = "20";
            delBox.Text = Convert.ToString(fee);

            //Always empty the boxes when clicking next
            Name1.Clear();  price1.Clear();
            Name2.Clear();  price2.Clear();
            Name3.Clear();  price3.Clear();
            Name4.Clear();  price4.Clear();
            Name5.Clear();  price5.Clear();
            Name6.Clear();  price6.Clear();
            Name7.Clear();  price7.Clear();
            Name8.Clear();  price8.Clear();
            Name9.Clear();  price9.Clear();
            Name10.Clear(); price10.Clear();
        }
Exemple #3
0
 public Contact()
 {
     Name          = new Name2();
     ContactId     = new ContactId();
     FolderId      = new FolderId2();
     Title         = new Title();
     ContactMethod = new List <ContactMethod>();
 }
        public override bool Equals(object obj) //Implementação do Equals para comparar e confirmar o GetHashCode entre dois objetos.
        {
            if (!(obj is Product2))
            {
                return(false);
            }
            Product2 other = obj as Product2;

            return(Name2.Equals(other.Name2) && Price2.Equals(other.Price2));
        }
Exemple #5
0
        public static Name2 SetupBasicInfoName()
        {
            Name2 name2 = new Name2();

            name2.first  = "John";
            name2.middle = "P";
            name2.last   = "Smith";
            name2.title  = "Mr";
            return(name2);
        }
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (Name1 != null ? Name1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Name2 != null ? Name2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Name3 != null ? Name3.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemple #7
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name1 != null ? Name1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Name2 != null ? Name2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Name3 != null ? Name3.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Course;
         hashCode = (hashCode * 397) ^ (Group != null ? Group.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Title != null ? Title.GetHashCode() : 0);
         return(hashCode);
     }
 }
 protected virtual void draw_data(SpriteBatch sprite_batch)
 {
     foreach (TextSprite label in Stat_Labels)
     {
         label.draw(sprite_batch, -Loc);
     }
     foreach (Sprite stat in Stats)
     {
         stat.draw(sprite_batch, -Loc);
     }
     Name1.draw(sprite_batch, -Loc);
     Name2.draw(sprite_batch, -Loc);
     if (Weapon_Name_Visible)
     {
         Target_Weapon.draw(sprite_batch, -Loc);
     }
 }
 private void Name2_Tick_1(object sender, EventArgs e)
 {
     this.Text = "Services Hosted By: " + txtIp.Text;
     Name3.Start();
     Name2.Stop();
 }
 public override void draw(SpriteBatch sprite_batch, Vector2 draw_offset = default(Vector2))
 {
     //if ((textures.Count == 3) && Global.game_map.units.ContainsKey(Data.Battler_1_Id))
     if ((textures.Count == 3) && unit_1 != null)
     {
         if (visible)
         {
             Vector2 loc    = this.loc + new Vector2(0, Data == null ? 8 : 0);
             Vector2 offset = this.offset;
             int     width;
             bool    two_units = false;
             if (unit_2 != null)
             {
                 if (Global.game_map.attackable_map_object(battler_2_id) != null)
                 {
                     two_units = true;
                 }
             }
             // Window 1 - top
             sprite_batch.Draw(textures[0], loc + new Vector2(1, 0),
                               new Rectangle(0, 64 * (team1 - 1), 88, 32), tint,
                               0f, offset + Window_Offset, 1f, SpriteEffects.None, 0f);
             // HP gauge 1
             sprite_batch.Draw(textures[0], loc + new Vector2(24, 16),
                               new Rectangle(88, 0, 56, 8), tint,
                               0f, offset + Data_Offset, 1f, SpriteEffects.None, 0f);
             width = (Hp1 * 49) / maxhp1;
             sprite_batch.Draw(textures[0], loc + new Vector2(24 + 4, 16),
                               new Rectangle(88 + 4, 8, width, 8), tint,
                               0f, offset + Data_Offset, 1f, SpriteEffects.None, 0f);
             if (Data != null)
             {
                 // Window 1 - bottom
                 sprite_batch.Draw(textures[0], loc + new Vector2(1, 24),
                                   new Rectangle(0, 64 * (team1 - 1) + 32, 88, 32), tint,
                                   0f, offset + Window_Offset, 1f, SpriteEffects.None, 0f);
                 // Labels 1
                 sprite_batch.Draw(textures[0], loc + new Vector2(4, 28),
                                   new Rectangle(88, 16, 56, 16), tint,
                                   0f, offset + Data_Offset, 1f, SpriteEffects.None, 0f);
                 // Stats 1
                 for (int i = 0; i < 4; i++)
                 {
                     Stat_Imgs[i].loc = loc + new Vector2(42, 28);
                     Stat_Imgs[i].draw(sprite_batch, Data_Offset);
                 }
             }
             // Name 1
             Name1.loc = loc + new Vector2(44, 0);
             Name1.draw(sprite_batch, Data_Offset);
             // HP 1
             HP_Counter1.loc = loc + new Vector2(24, 16);
             HP_Counter1.draw(sprite_batch, Data_Offset);
             if (two_units)
             {
                 loc += new Vector2(88, 0);
                 // Window 2 - top
                 sprite_batch.Draw(textures[0], loc + new Vector2(0, 0),
                                   new Rectangle(0, 64 * (team2 - 1), 88, 32), tint,
                                   0f, offset + Window_Offset, 1f, SpriteEffects.None, 0f);
                 // HP Gauge 2
                 sprite_batch.Draw(textures[0], loc + new Vector2(24, 16),
                                   new Rectangle(88, 0, 56, 8), tint,
                                   0f, offset + Data_Offset, 1f, SpriteEffects.None, 0f);
                 width = (Hp2 * 49) / maxhp2;
                 sprite_batch.Draw(textures[0], loc + new Vector2(24 + 4, 16),
                                   new Rectangle(88 + 4, 8, width, 8), tint,
                                   0f, offset + Data_Offset, 1f, SpriteEffects.None, 0f);
                 if (Data != null)
                 {
                     // Window 2 - bottom
                     sprite_batch.Draw(textures[0], loc + new Vector2(0, 24),
                                       new Rectangle(0, 64 * (team2 - 1) + 32, 88, 32), tint,
                                       0f, offset + Window_Offset, 1f, SpriteEffects.None, 0f);
                     // Labels 2
                     sprite_batch.Draw(textures[0], loc + new Vector2(4, 28),
                                       new Rectangle(88, 16, 56, 16), tint,
                                       0f, offset + Data_Offset, 1f, SpriteEffects.None, 0f);
                     // Stats 2
                     for (int i = 4; i < 8; i++)
                     {
                         Stat_Imgs[i].loc = loc + new Vector2(42, 28);
                         Stat_Imgs[i].draw(sprite_batch, Data_Offset);
                     }
                 }
                 // Name 2
                 Name2.loc = loc + new Vector2(44, 0);
                 Name2.draw(sprite_batch, Data_Offset);
                 // HP 2
                 HP_Counter2.loc = loc + new Vector2(24, 16);
                 HP_Counter2.draw(sprite_batch, Data_Offset);
             }
         }
     }
 }
Exemple #11
0
 // Method of наследник has access to protected variable
 void test()
 {
     Console.WriteLine(Name2.GetType());
 }
 public override int GetHashCode() //Implementação do GetHashCode para ver se o HashCode de dois produtos são iguais.
 {
     return(Name2.GetHashCode() + Price2.GetHashCode());
 }
 public bool Equals(Entry other)
 {
     return(Name1.Equals(other.Name1) && Name2.Equals(other.Name2) && Score == other.Score && Mode == other.Mode);
 }
Exemple #14
0
        public void PrintLabelOpt(cPrice parPrice, PrintPageEventArgs e)
        {
            int    LengthName = 28;
            string Name1, Name2 = "";

            if (parPrice.Name.Length < LengthName)
            {
                Name1 = parPrice.Name;
            }
            else
            {
                int pos = parPrice.Name.Substring(0, LengthName).LastIndexOf(" ");
                Name1 = parPrice.Name.Substring(0, pos);
                Name2 = parPrice.Name.Substring(pos);
                if (Name2.Length < LengthName)
                {
                    Name2 = new string(' ', (LengthName - Name2.Length) / 2) + Name2;
                }
            }
            Name1 = new string(' ', ((LengthName - Name1.Length) / 2)) + Name1;
            if (Name2.Length > LengthName + 3)
            {
                Name2 = Name2.Substring(0, LengthName + 3);
            }

            if (CurLogo != null)
            {
                e.Graphics.DrawImage(CurLogo, 245, 5);
            }
            e.Graphics.DrawString(DateTime.Now.ToString("dd/MM/yyyy H:mm"), new Font("Arial", 8), Brushes.Black, 215, 120); //Час

            //string BarCodePrice = parPrice.Code.ToString() + "-" + parPrice.Price.ToString() + (parPrice.PriceOpt == 0 ? "" : "-" + parPrice.PriceOpt.ToString());
            int strPrice   = ((int)(parPrice.Price * 100M));
            var qrCodeData = qrGenerator.CreateQrCode($"{parPrice.Code}-{strPrice}", QRCodeGenerator.ECCLevel.Q);
            var qrCode     = new QRCode(qrCodeData);

            e.Graphics.DrawImage(qrCode.GetGraphic(2), 250, 25);

            e.Graphics.DrawString(Name1, new Font("Arial", 11, FontStyle.Bold), Brushes.Black, 5, 0);
            e.Graphics.DrawString(Name2, new Font("Arial", 11, FontStyle.Bold), Brushes.Black, 5, 16);

            int   LeftBill = 0, LeftCoin = 135, LeftBillTwo = 0, LeftCoinTwo = 135;
            float coef     = 1;
            var   price    = parPrice.StrPrice.Split('.');
            var   priceOpt = parPrice.StrPriceOpt.Split('.');

            //var price = "5.90".Split('.');
            //var priceOpt = "2.90".Split('.');

            //price[0] = "4293";
            switch (price[0].Count())
            {
            case 1:
                LeftBill    = 30;
                LeftCoin    = 75;
                LeftBillTwo = 130;
                LeftCoinTwo = 190;
                if (parPrice.QuantityOpt == 0)
                {
                    LeftBillTwo = 130;
                    LeftCoinTwo = 210;
                }
                break;

            case 2:
                LeftBill    = 10;
                LeftCoin    = 90;
                LeftBillTwo = 120;
                LeftCoinTwo = 220;
                if (parPrice.QuantityOpt == 0)
                {
                    LeftBillTwo = 90;
                    LeftCoinTwo = 230;
                }
                break;

            case 3:
                LeftBill    = 5;
                LeftCoin    = 90;
                LeftBillTwo = 170;
                LeftCoinTwo = 220;
                if (parPrice.QuantityOpt == 0)
                {
                    LeftBillTwo = 110;
                    LeftCoinTwo = 230;
                }
                coef = 0.7f;
                break;

            default:
                LeftBill    = 0;
                LeftCoin    = 75;
                LeftBillTwo = 230;
                LeftCoinTwo = 210;
                if (parPrice.QuantityOpt == 0)
                {
                    LeftBillTwo = 150;
                    LeftCoinTwo = 230;
                }
                coef = 0.50f;
                break;
            }

            Graphics      gr    = e.Graphics;
            GraphicsState state = gr.Save();

            if (parPrice.QuantityOpt != 0)
            {
                gr.ResetTransform();
                gr.ScaleTransform(coef, 1.0f);
                e.Graphics.DrawString(price[0], new Font("Arial Black", 40), Brushes.Black, LeftBill, 15);
                e.Graphics.DrawString(priceOpt[0], new Font("Arial Black", 50), Brushes.Black, LeftBillTwo, 40);
                gr.Restore(state);

                //e.Graphics.DrawString(price[0], new Font("Arial Black", 35), Brushes.Black, LeftBill, 35);
                e.Graphics.DrawString(price[1], new Font("Arial Black", 16), Brushes.Black, LeftCoin, 25);
                e.Graphics.DrawString("грн", new Font("Arial", 10, FontStyle.Bold), Brushes.Black, LeftCoin + 3, 47);
                e.Graphics.DrawString(parPrice.StrUnit, new Font("Arial", 10), Brushes.Black, LeftCoin + 3, 60);

                //ОПТОВА ЦІНА
                e.Graphics.DrawString(priceOpt[1], new Font("Arial Black", 18), Brushes.Black, LeftCoinTwo, 55);
                e.Graphics.DrawString("від", new Font("Arial", 12, FontStyle.Bold), Brushes.Black, LeftCoinTwo + 3, 80);
                e.Graphics.DrawString(parPrice.QuantityOpt.ToString() + " шт.", new Font("Arial", 12), Brushes.Black, LeftCoinTwo + 3, 100);
            }
            else
            {
                gr.ResetTransform();
                gr.ScaleTransform(coef, 1.0f);
                e.Graphics.DrawString(price[0], new Font("Arial Black", 70), Brushes.Black, LeftBillTwo - 50, 10);
                gr.Restore(state);
                e.Graphics.DrawString(price[1], new Font("Arial Black", 26), Brushes.Black, LeftCoinTwo - 50, 35);
                e.Graphics.DrawString("грн", new Font("Arial", 16, FontStyle.Bold), Brushes.Black, LeftCoinTwo + 3 - 50, 70);
                e.Graphics.DrawString(parPrice.StrUnit, new Font("Arial", 16), Brushes.Black, LeftCoinTwo + 3 - 50, 90);
            }

            if (parPrice.BarCodes != null)
            {
                if (parPrice.BarCodes.Length > 27)
                {
                    parPrice.BarCodes = parPrice.BarCodes.Substring(0, 27);
                }
                e.Graphics.DrawString(parPrice.BarCodes, new Font("Arial", 7), Brushes.Black, 10, 120);
            }
            e.Graphics.DrawString(parPrice.Article.ToString(), new Font("Arial", 8, FontStyle.Bold), Brushes.Black, 270, 80);
            //e.Graphics.DrawLine(new Pen(Color.Black, 1), 0, 129, 150, 130);
            //e.Graphics.DrawString(parPrice.Article.ToString(), new Font("Arial", 8), Brushes.Black, 170, 120);
        }
Exemple #15
0
        public void PrintLabel(cPrice parPrice, PrintPageEventArgs e)
        {
            int    LengthName = 28;
            string Name1, Name2 = "";

            if (parPrice.Name.Length < LengthName)
            {
                Name1 = parPrice.Name;
            }
            else
            {
                int pos = parPrice.Name.Substring(0, LengthName).LastIndexOf(" ");
                Name1 = parPrice.Name.Substring(0, pos);
                Name2 = parPrice.Name.Substring(pos);
                if (Name2.Length < LengthName)
                {
                    Name2 = new string(' ', (LengthName - Name2.Length) / 2) + Name2;
                }
            }
            Name1 = new string(' ', ((LengthName - Name1.Length) / 2)) + Name1;
            if (Name2.Length > LengthName + 3)
            {
                Name2 = Name2.Substring(0, LengthName + 3);
            }

            if (CurLogo != null)
            {
                e.Graphics.DrawImage(CurLogo, 10, 0);
            }
            e.Graphics.DrawString(DateTime.Now.ToString("dd/MM/yyyy H:mm"), new Font("Arial", 8), Brushes.Black, 120, 0); //Час

            //string BarCodePrice = parPrice.Code.ToString() + "-" + parPrice.Price.ToString() + (parPrice.PriceOpt == 0 ? "" : "-" + parPrice.PriceOpt.ToString());
            int strPrice   = ((int)(parPrice.Price * 100M));
            var qrCodeData = qrGenerator.CreateQrCode($"{parPrice.Code}-{strPrice}", QRCodeGenerator.ECCLevel.Q);
            var qrCode     = new QRCode(qrCodeData);

            e.Graphics.DrawImage(qrCode.GetGraphic(2), 165, 50);

            e.Graphics.DrawString(Name1, new Font("Arial", 11, FontStyle.Bold), Brushes.Black, 0, 16);
            e.Graphics.DrawString(Name2, new Font("Arial", 11, FontStyle.Bold), Brushes.Black, 0, 33);

            int   LeftBill = 0, LeftCoin = 135;
            float coef  = 1;
            var   price = parPrice.StrPrice.Split('.');

            //price[0] = "4293";
            switch (price[0].Count())
            {
            case 1:
                LeftBill = 40;
                LeftCoin = 100;
                break;

            case 2:
                LeftBill = 20;
                LeftCoin = 120;
                break;

            case 3:
                LeftBill = 5;
                LeftCoin = 135;
                coef     = 0.9f;
                break;

            default:
                LeftBill = 0;
                LeftCoin = 135;
                coef     = 0.70f;
                break;
            }

            Graphics      gr    = e.Graphics;
            GraphicsState state = gr.Save();

            gr.ResetTransform();
            gr.ScaleTransform(coef, 1.0f);
            e.Graphics.DrawString(price[0], new Font("Arial Black", 50), Brushes.Black, LeftBill, 35);
            gr.Restore(state);

            //e.Graphics.DrawString(price[0], new Font("Arial Black", 35), Brushes.Black, LeftBill, 35);
            e.Graphics.DrawString(price[1], new Font("Arial Black", 18), Brushes.Black, LeftCoin, 50);
            e.Graphics.DrawString("грн", new Font("Arial", 13, FontStyle.Bold), Brushes.Black, LeftCoin + 3, 75);

            e.Graphics.DrawString(parPrice.StrUnit, new Font("Arial", 14), Brushes.Black, LeftCoin + 3, 93);
            if (parPrice.BarCodes != null)
            {
                if (parPrice.BarCodes.Length > 27)
                {
                    parPrice.BarCodes = parPrice.BarCodes.Substring(0, 27);
                }
                e.Graphics.DrawString(parPrice.BarCodes, new Font("Arial", 7), Brushes.Black, 10, 120);
            }
            e.Graphics.DrawString(parPrice.Article.ToString(), new Font("Arial", 8, FontStyle.Bold), Brushes.Black, 170, 110);
            e.Graphics.DrawLine(new Pen(Color.Black, 1), 0, 133, 150, 133);
            //e.Graphics.DrawString(parPrice.Article.ToString(), new Font("Arial", 8), Brushes.Black, 170, 120);
        }
        public override void update()
        {
            if (Window_Shake.Count > 0)
            {
                Window_Offset = Window_Shake.shift();
            }
            if (Data_Shake.Count > 0)
            {
                Data_Offset = Data_Shake.shift();
            }

            if (Timer < TIMER_MAX)
            {
                Timer++;
            }

            if (Hp1 != this.hp1 || (unit_2 != null && Hp2 != this.hp2))
            {
                if (Global.Input.triggered(Inputs.A) ||
                    Global.Input.mouse_triggered(MouseButtons.Left) ||
                    Global.Input.gesture_triggered(TouchGestures.Tap))
                {
                    if (Hp1 < this.hp1 || (unit_2 != null && Hp2 < this.hp2))
                    {
                        Global.game_system.play_se(System_Sounds.HP_Recovery);
                    }
                    Hp1 = this.hp1;
                    if (unit_2 != null)
                    {
                        Hp2 = this.hp2;
                    }
                }
            }

            if (Hp1_Timer == 0)
            {
                if (Hp1 < hp1)
                {
                    Global.game_system.play_se(System_Sounds.HP_Recovery);
                    Hp1_Timer = HP_GAIN_TIME;
                }
                Hp1 = Additional_Math.int_closer(Hp1, hp1, 1);
            }
            if (unit_2 != null && Hp2_Timer == 0)
            {
                if (Hp2 < hp2)
                {
                    Global.game_system.play_se(System_Sounds.HP_Recovery);
                    Hp2_Timer = HP_GAIN_TIME;
                }
                Hp2 = Additional_Math.int_closer(Hp2, hp2, 1);
            }
            if (Hp1_Timer > 0)
            {
                Hp1_Timer--;
            }
            if (Hp2_Timer > 0)
            {
                Hp2_Timer--;
            }
            Name1.update();
            HP_Counter1.text = (Hp1 > 99 ? "??" : Hp1.ToString());
            HP_Counter1.update();
            if (unit_2 != null)
            {
                Name2.update();
                HP_Counter2.text = (Hp2 > 99 ? "??" : Hp2.ToString());
                HP_Counter2.update();
            }
            // Update stats
            if (!stat_update_done())
            {
                if (Stat_Timer == 0)
                {
                    update_stats();
                    refresh_battle_stats();
                    Stat_Timer = 2;
                }
            }
            if (Stat_Timer > 0)
            {
                Stat_Timer--;
            }
            foreach (RightAdjustedText text in Stat_Imgs)
            {
                text.update();
            }
        }
 private void Name1_Tick_1(object sender, EventArgs e)
 {
     this.Text = "Running...";
     Name2.Start();
     Name1.Stop();
 }