Inheritance: Interactive
Example #1
0
    public static void Main()
    {
        Tweet     tweet     = new Tweet("Hello");
        Microwave microwave = new Microwave();

        microwave.ReceiveMessage(tweet);
    }
        public AddPublisher(Publisher pub)
        {
            InitializeComponent();
            this.btn_add.Image = global::Microwave_v1._0.Properties.Resources.pencil__1_;

            main_page = (Microwave)Application.OpenForms["Microwave"];
            System.IO.Directory.CreateDirectory(pic_dest_path);
            picture_event = new Picture_Events(pic_dest_path, pic_default_file, ref this.pic_publisher);

            publisher_to_edit         = pub;
            this.lbl_pub_message.Text = "";


            // Make other properties default
            this.tb_pub_name.Text           = pub.Pub_name;
            this.tb_pub_name.ForeColor      = Color.LightGray;
            this.tb_pub_email.Text          = pub.Pub_email;
            this.tb_pub_email.ForeColor     = Color.LightGray;
            this.tb_pub_phone_num.Text      = pub.Pub_phone_num;
            this.tb_pub_phone_num.ForeColor = Color.LightGray;
            this.pub_date_of_est            = pub.Pub_date_of_est;
            dtp_publisher.Value             = new DateTime(int.Parse(pub_date_of_est), 1, 1);


            pic_new_source_path = picture_event.Pic_source_file = pub.Pub_cover_path_file;
            pic_publisher.Image = Picture_Events.Get_Copy_Image_Bitmap(pub.Pub_cover_path_file);

            is_edit = true;
        }
Example #3
0
        static void Main(string[] args)
        {
            Remote remote = new Remote();
            TV     tv     = new TV();

            remote.SetCommand(new TvOnCommand(tv));
            remote.PressButton();
            remote.PressUndo();

            Microwave micro = new Microwave();

            remote.SetCommand(new MicriwaveHeatCommand(micro, 2000));

            remote.PressButton();
            remote.PressUndo();

            Volume volume = new Volume();

            remote.SetCommand(new VolumeLevelCommand(volume));

            remote.PressButton();
            remote.PressButton();
            remote.PressButton();
            remote.PressButton();
            remote.PressButton();
            remote.PressButton();
            remote.PressButton();

            remote.PressUndo();

            Console.ReadKey();
        }
Example #4
0
        public AddAuthor(Author author)
        {
            InitializeComponent();
            this.btn_add.Image = global::Microwave_v1._0.Properties.Resources.pencil__1_;

            main_page = (Microwave)Application.OpenForms["Microwave"];
            System.IO.Directory.CreateDirectory(pic_dest_path);
            picture_event         = new Picture_Events(pic_dest_path, pic_default_file, ref this.pic_author);
            this.lbl_message.Text = "";

            author_to_edit = author;

            this.tb_name.Text           = author.Author_name;
            this.tb_name.ForeColor      = Color.LightGray;
            this.tb_country.Text        = author.Author_country;
            this.tb_country.ForeColor   = Color.LightGray;
            this.tb_biography.Text      = author.Author_biography;
            this.tb_biography.ForeColor = Color.LightGray;
            this.gender = author.Author_gender;
            if (author.Author_gender == "Male")
            {
                rdo_male.Checked = true;
            }
            else
            {
                rdo_female.Checked = true;
            }
            this.year        = author.Author_birthday;
            dtp_author.Value = new DateTime(int.Parse(year), 1, 1);

            pic_new_source_path = picture_event.Pic_source_file = author.Author_cover_path_file;
            pic_author.Image    = Picture_Events.Get_Copy_Image_Bitmap(author.Author_cover_path_file);

            is_edit = true;
        }
Example #5
0
        public static Soket CreateSoket()
        {
            Telephone telephone = new Telephone();

            telephone.Name = "Sony ericson";
            telephone.SetDigit(16);
            telephone.setTransducerResistance(50);
            Computer computer = new Computer();

            computer.Name = "HP1577";
            computer.SetDigit(32);
            computer.setVideoFrequency(1.7);
            Microwave microwave = new Microwave();

            microwave.Name = "Samsung c 1677";
            microwave.setTemperatureCoefficient(1.8);
            microwave.setMagnetronEfficiency(47);
            Refrigerator refrigerator = new Refrigerator();

            refrigerator.Name = "Birysa17";
            refrigerator.setTemperatureCoefficient(1.8);
            refrigerator.SetAnchorResistance(90);
            Soket soket = new Soket();

            soket.AddAppliance(telephone);
            soket.AddAppliance(computer);
            soket.AddAppliance(refrigerator);
            soket.AddAppliance(microwave);
            return(soket);
        }
Example #6
0
        // GET: Home/Delete/5/tv
        public ActionResult Delete(int?id, string device)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            switch (device)
            {
            case "Tv":
                Tv tv = db.Tvs.Find(id);
                if (tv != null)
                {
                    db.Tvs.Remove(tv);
                    db.SaveChanges();
                }
                break;

            case "Fridge":
                Fridge fridge = db.Fridges.Find(id);
                if (fridge != null)
                {
                    db.Fridges.Remove(fridge);
                    db.SaveChanges();
                }
                break;

            case "Lamp":
                Lamp lamp = db.Lamps.Find(id);
                if (lamp != null)
                {
                    db.Lamps.Remove(lamp);
                    db.SaveChanges();
                }
                break;

            case "Cooker":
                Cooker cooker = db.Cookers.Find(id);
                if (cooker != null)
                {
                    db.Cookers.Remove(cooker);
                    db.SaveChanges();
                }
                break;

            case "Microwave":
                Microwave microwave = db.Microwaves.Find(id);
                if (microwave != null)
                {
                    db.Microwaves.Remove(microwave);
                    db.SaveChanges();
                }
                break;

            default:
                break;
            }
            Session["SelectedDevice"] = null;
            Session["DeviceConsole"]  = null;
            return(RedirectToAction("Index"));
        }
Example #7
0
        public AddUser(User user)
        {
            InitializeComponent();
            this.btn_add.Image         = global::Microwave_v1._0.Properties.Resources.pencil__1_;
            this.lbl_user_message.Text = "";


            main_page    = (Microwave)Application.OpenForms["Microwave"];
            user_to_edit = user;

            this.tb_user_name.Text    = user.Name;
            this.tb_user_surname.Text = user.Surname;
            this.tb_user_email.Text   = user.Email;
            this.numUpDown_age.Value  = user.Age;

            this.tb_user_name.ForeColor    = Color.LightGray;
            this.tb_user_surname.ForeColor = Color.LightGray;
            this.tb_user_email.ForeColor   = Color.LightGray;

            if (user.Gender == "Male")
            {
                this.rb_male.Checked = true;
            }
            else
            {
                this.rb_female.Checked = true;
            }

            this.is_edit = true;

            this.BringToFront();
        }
Example #8
0
    public void CmdStartMicrowave(GameObject microwave, string mealName)
    {
        Microwave m = microwave.GetComponent <Microwave>();

        m.ServerSetOutputMeal(mealName);
        m.RpcStartCooking();
    }
        public List <T> GatherData <T>()
        {
            _driver.Navigate().GoToUrl(Url);
            _driver.FindElement(By.XPath(XpathCatalogue)).Click();
            _driver.FindElement(By.XPath(XpathAppliances)).Click();
            _driver.FindElement(By.XPath(XpathCooking)).Click();
            var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(10));

            wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.XPath(XpathMicrowaves)));
            _driver.FindElement(By.XPath(XpathMicrowaves)).Click();
            _driver.FindElement(By.XPath(XpathShowOptions)).Click();
            _driver.FindElement(By.XPath(XpathWithReviews)).Click();

            for (int i = 0; i < 40; i++)
            {
                try
                {
                    var microwave = new Microwave
                    {
                        Name = _driver.FindElement(By.CssSelector($"{CssSelectorProducts}:nth-child({i}) {CssSelectorName}"))
                               .Text.Substring(PrefixMicrowave.Length),
                        Price = _driver.FindElement(By.CssSelector($"{CssSelectorProducts}:nth-child({i}) {CssSelectorPrice}")).Text,
                        Link  = _driver.FindElement(By.CssSelector($"{CssSelectorProducts}:nth-child({i}) {CssSelectorLink}")).GetAttribute("href"),
                    };
                    _microwaves.Add(microwave);
                }
                catch (NoSuchElementException)
                {
                }
            }

            _driver.Quit();

            return((List <T>)Convert.ChangeType(_microwaves, typeof(List <T>)));
        }
Example #10
0
 public AddUser()
 {
     InitializeComponent();
     main_page = (Microwave)Application.OpenForms["Microwave"];
     this.lbl_user_message.Text = "";
     this.rb_male.Checked       = true;
     this.BringToFront();
 }
Example #11
0
    public void CmdStartMicrowave(EquipSlot equipSlot, GameObject microwave, string mealName)
    {
        Microwave m = microwave.GetComponent <Microwave>();

        m.ServerSetOutputMeal(mealName);
        InventoryManager.ClearInvSlot(Inventory[equipSlot]);
        m.RpcStartCooking();
    }
    public void CmdStartMicrowave(string slotName, GameObject microwave, string mealName)
    {
        Microwave m = microwave.GetComponent <Microwave>();

        m.ServerSetOutputMeal(mealName);
        ClearInventorySlot(slotName);
        m.RpcStartCooking();
    }
    public void TestClientReceivingMessage()
    {
        Tweet tweet = new Tweet("Hello");

        Microwave microwave = new Microwave();

        Assert.AreEqual(microwave.FormatMessage(tweet), tweet.Message);
    }
Example #14
0
 public void Draw_Book_Tag()
 {
     main_page     = (Microwave)Application.OpenForms["Microwave"];
     this.Location = new System.Drawing.Point(0, 0);
     this.Size     = new Size(main_page.Pnl_tag.Width, main_page.Pnl_tag.Height);
     main_page.Pnl_tag.Controls.Add(this);
     this.BringToFront();
 }
Example #15
0
 public void Edit_Book_Tag(string name, string description, string author, string book_id)
 {
     main_page            = (Microwave)Application.OpenForms["Microwave"];
     lbl_bookname.Text    = name;
     lbl_description.Text = description;
     lbl_author.Text      = "- " + author;
     this.pic_book.Image  = main_page.Cover_image_list.Images[book_id];
 }
 public Book_Info_For_Shelf(Shelf shelf)
 {
     InitializeComponent();
     main_page       = (Microwave)Application.OpenForms["Microwave"];
     main_shelf_list = main_page.Main_shelf_list;
     this.shelf      = shelf;
     shelf.Shelf_ınfo.Pnl_book_detail.Hide();
 }
Example #17
0
 public MicrowaveRunning(Microwave microwave)
 {
     this.microwave     = microwave;
     StateMsgForExamine = "running";
     microwave.ScreenGlow.SetActive(true);
     microwave.OvenGlow.SetActive(true);
     microwave.spriteHandler.ChangeSprite(2);
 }
 public async Task CreateMicrowaveAsync(int modeQuantity, bool isEmbed)
 {
     var microwave = new Microwave()
     {
         ModeQuantity = modeQuantity, IsEmbed = isEmbed
     };
     await _microwaveRepository.AddAsync(microwave);
 }
Example #19
0
 public MicrowaveIdle(Microwave microwave)
 {
     this.microwave     = microwave;
     StateMsgForExamine = "idle";
     microwave.spriteHandler.ChangeSprite(0);
     microwave.ScreenGlow.SetActive(true);
     microwave.OvenGlow.SetActive(false);
     microwave.HaltMicrowave();
 }
Example #20
0
 public MicrowaveBrokenOpen(Microwave microwave)
 {
     this.microwave     = microwave;
     StateMsgForExamine = "broken and open";
     microwave.spriteHandler.ChangeSprite(6);
     microwave.ScreenGlow.SetActive(false);
     microwave.OvenGlow.SetActive(false);
     microwave.HaltMicrowave();
 }
Example #21
0
 public MicrowaveUnpoweredOpen(Microwave microwave)
 {
     this.microwave     = microwave;
     StateMsgForExamine = "unpowered and open";
     microwave.spriteHandler.ChangeSprite(4);
     microwave.ScreenGlow.SetActive(false);
     microwave.OvenGlow.SetActive(false);
     microwave.HaltMicrowave();
 }
Example #22
0
 public AddPublisher()
 {
     InitializeComponent();
     main_page = (Microwave)Application.OpenForms["Microwave"];
     System.IO.Directory.CreateDirectory(pic_dest_path);
     picture_event             = new Picture_Events(pic_dest_path, pic_default_file, ref this.pic_publisher);
     pic_new_source_path       = picture_event.Pic_source_file;
     this.lbl_pub_message.Text = "";
 }
Example #23
0
 public MicrowaveOpen(Microwave microwave)
 {
     this.microwave     = microwave;
     StateMsgForExamine = "open";
     microwave.spriteHandler.ChangeSprite(1);
     microwave.ScreenGlow.SetActive(true);
     microwave.OvenGlow.SetActive(true);
     microwave.HaltMicrowave();
 }
Example #24
0
 public Publisher(int publisher_id, string pub_name, string pub_email, string pub_phone_num, string pub_date_of_est, string pub_pic_path_file)
 {
     main_page                = (Microwave)Application.OpenForms["Microwave"];
     this.Publisher_id        = publisher_id;
     this.pub_name            = pub_name;
     this.pub_email           = pub_email;
     this.pub_phone_num       = pub_phone_num;
     this.pub_date_of_est     = pub_date_of_est;
     this.Pub_cover_path_file = pub_pic_path_file;
 }
Example #25
0
        public static void AddInteractions(GameObject obj)
        {
            Grill         grill     = obj as Grill;
            Stove         stove     = obj as Stove;
            Fridge        fridge    = obj as Fridge;
            Microwave     micro     = obj as Microwave;
            FoodProcessor processor = obj as FoodProcessor;

            if (obj != null && obj.Interactions != null)
            {
                if (fridge != null)
                {
                    InteractionObjectPair i2 = new InteractionObjectPair(OverridedFridge_Have.Singleton, obj);
                    if (!obj.Interactions.Contains(i2))
                    {
                        obj.RemoveInteractionByType(Fridge_Have.Singleton);
                        // obj.Interactions.RemoveAt(0);
                        obj.AddInteraction(OverridedFridge_Have.Singleton);
                        obj.AddInteraction(OverridedFridge_Prepare.PrepareSingleton);
                    }
                }
                else if (micro != null)
                {
                    InteractionObjectPair i2 = new InteractionObjectPair(OverridedMicrowave_Have.Singleton, obj);
                    if (!obj.Interactions.Contains(i2))
                    {
                        obj.AddInteraction(OverridedMicrowave_Have.Singleton);
                    }
                }
                else if (processor != null)
                {
                    InteractionObjectPair i2 = new InteractionObjectPair(OverridedFoodProcessor_Have.Singleton, obj);
                    if (!obj.Interactions.Contains(i2))
                    {
                        obj.AddInteraction(OverridedFoodProcessor_Have.Singleton);
                    }
                }
                else if (stove != null)
                {
                    InteractionObjectPair i2 = new InteractionObjectPair(OverridedStove_Have.Singleton, obj);
                    if (!obj.Interactions.Contains(i2))
                    {
                        obj.AddInteraction(OverridedStove_Have.Singleton);
                    }
                }
                else if (grill != null)
                {
                    InteractionObjectPair i2 = new InteractionObjectPair(OverridedGrill_Have.Singleton, obj);
                    if (!obj.Interactions.Contains(i2))
                    {
                        obj.AddInteraction(OverridedGrill_Have.Singleton);
                    }
                }
            }
        }
            public override bool Run()
            {
                if (this.CheckForCancelAndCleanup())
                {
                    return(false);
                }

                Microwave microwave = GlobalFunctions.GetClosestObject <Microwave>(Actor, false, true, null, null);

                if (microwave == null)
                {
                    return(false);
                }
                if (Target.Parent == Actor)
                {
                    if (microwave.RouteToMicrowave(this))
                    {
                        string actorNameForMicrowave = (Target as IMicrowavable).ActorNameForMicrowave;
                        microwave.AddToUseList(Actor);
                        try
                        {
                            microwave.SimStateMachineClient.SetActor(actorNameForMicrowave, Target);
                            microwave.SimStateMachineClient.SetActor("x", Actor);
                            microwave.SimStateMachineClient.AddOneShotScriptEventHandler(1001u, new SacsEventHandler(microwave.StartLoopSoundCallback));
                            microwave.SimStateMachineClient.EnterState("x", "Enter - Holding " + actorNameForMicrowave);
                            microwave.SimStateMachineClient.RequestState("x", "Start Microwave");
                            microwave.MicrowaveSelfStateMachineClient.EnterState("Microwave", "Enter");
                            microwave.MicrowaveSelfStateMachineClient.RequestState("Microwave", "Loop - Cook");
                            microwave.On = true;
                            microwave.AddCookingAlarm((Target as IPartOfCookingProcess).CookingProcess.CookTimeLeftMinutes / microwave.CookTimeSpeedMultiplier);
                            microwave.SimStateMachineClient.RequestState("x", "Exit - Hands Empty");
                        }
                        finally
                        {
                            microwave.RemoveFromUseList(Actor);
                        }
                        if (Actor.HasExitReason(ExitReason.Canceled))
                        {
                            return(false);
                        }
                        Actor.InteractionQueue.PushAsContinuation(TakeBloodFromMicrowave.Singleton, microwave, true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }

                return(true);
            }
Example #27
0
        public PartialViewResult Add(string catchhall)
        {
            var    catchs = catchhall.Split('/');
            Device newDevice;

            if (!String.IsNullOrEmpty(catchs[0]))
            {
                using (DeviceContext db = new DeviceContext())
                {
                    switch (catchs[0])
                    {
                    case "light":
                        newDevice = new Light("Лампа", new Modeslvl(new string[] { "низкий", "средний", "высокий", "макс." }));
                        db.Devices.Add(newDevice);
                        db.SaveChanges();
                        return(PartialView("PartLight", newDevice));

                    case "tv":
                        newDevice = new TV("TV", new Modeslvl(new string[] { "низкий", "средний", "высокий", "макс." }), new Volume100(), new Channel100());
                        db.Devices.Add(newDevice);
                        db.SaveChanges();
                        return(PartialView("PartTV", newDevice));

                    case "cond":
                        newDevice = new Conditioner("Cond", new Termostat());
                        db.Devices.Add(newDevice);
                        db.SaveChanges();
                        return(PartialView("PartCond", newDevice));

                    case "ref":
                        newDevice = new Refrigerator("Ref", new Modeslvl(new string[] { "эконом.", "авто", "интенс." }), new RefTemp(), new RefrigeratorSpace(50));
                        db.Devices.Add(newDevice);
                        db.SaveChanges();
                        return(PartialView("PartRef", newDevice));

                    case "ref_add":
                        return(PartialView("PartRefItem", new int[] { Convert.ToInt32(catchs[1]), Convert.ToInt32(catchs[2]) }));

                    case "micr":
                        newDevice = new Microwave("Micr", new Modeslvl((new string[] { "разморозка", "низкий", "средний", "макс" })), new NetTimer());
                        db.Devices.Add(newDevice);
                        db.SaveChanges();
                        return(PartialView("PartMicrowave", newDevice));

                    default:
                        throw new Exception("Bad Request");
                    }
                }
            }
            else
            {
                throw new Exception("Bad Request");
            }
        }
Example #28
0
        private Microwave GetMicrowave(int index)
        {
            Microwave microwave = new Microwave
            {
                Name  = this.GetItemName(index).Remove(0, 19),
                Price = "от " + this.GetItemPrice(index),
                Url   = this.GetItemLink(index)
            };

            return(microwave);
        }
Example #29
0
        public GivePenalty(SystemManager manager, Detail dt_form, Book book, User user)
        {
            InitializeComponent();
            main_page = (Microwave)Application.OpenForms["Microwave"];
            Fill_Combobox();
            this.cb_penalties.SelectedIndex = 0;

            this.manager     = manager;
            this.detail_form = dt_form;
            this.book        = book;
            this.user        = user;
        }
Example #30
0
 public Author(int author_id, int popularity_id, string author_name, string author_country, string author_gender, string author_birthday, string author_biography, string author_cover_path_file)
 {
     main_page                   = (Microwave)Application.OpenForms["Microwave"];
     this.author_id              = author_id;
     this.popularity_id          = popularity_id;
     this.author_name            = author_name;
     this.author_country         = author_country;
     this.author_gender          = author_gender;
     this.author_birthday        = author_birthday;
     this.author_biography       = author_biography;
     this.author_cover_path_file = author_cover_path_file;
 }
 private void AddWarmupInteractionToMicrowave(Microwave micro)
 {
     micro.AddInteraction(WarmUpBloodInMicrowave.Singleton);
 }