상속: System.Web.UI.Page
예제 #1
0
파일: Home.cs 프로젝트: leon196/MystJamGame
	void Start ()
	{
		instance = this;
		pageList = new List<Transform>();
		statueList = new List<Transform>();
		pageCount = GameObject.FindObjectsOfType<Page>().Length;
		statueCount = GameObject.FindObjectsOfType<Statue>().Length;
	}
 void HomePanel(Home home)
 {
     GUIStyle style = new GUIStyle(GUI.skin.box);
     style.normal.background = home.getTexture();
     GUILayout.BeginHorizontal();
         GUILayout.FlexibleSpace();
             GUILayout.Box("", style, GUILayout.Width(15), GUILayout.Height(15));
             GUILayout.Label(home.content.Count.ToString());
         GUILayout.FlexibleSpace();
     GUILayout.EndHorizontal();
 }
        public ActionResult Index()
        {
            var model = new Home();

            if (IsAuthenticated)
            {
                var userId = getUserId();

                model.Categories = dataContext.FindCategories(userId);
                model.Accounts = dataContext.FindAccounts(userId);
            }

            return View(model);
        }
예제 #4
0
        public void Scen01_LaunchKarmaLoopSite()
        {
            try
            {
                Results.WriteScenarioHeading("Home_01 - Launch Karmaloop Site and Navigate to Home Page");

                home = home.NavigateToApplication();

                Results.EndReport();
            }
            catch(Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #5
0
        public void Scen02_ViewNewStylesBrandsProducts()
        {
            try
            {
                Results.WriteScenarioHeading("Home_02 - Click a Brand link from New Styles Panel and View Products");

                home = home.NavigateToApplication();
                Products products = home.ClickNewStyle();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #6
0
        public void Scen03_SubscribeToEListFromHomePage()
        {
            try
            {
                Results.WriteScenarioHeading("Home_03 - Subscribe to E-List from Home Page");

                home = home.NavigateToApplication();
                home = home.JoinOurEList();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #7
0
        public void Scen01_ViewProductInfo_RandomProduct()
        {
            try
            {
                Results.WriteScenarioHeading("ViewProduct_01 - View Product Information(Brand, Title, Size, etc) of any Random Product.");

                home = home.NavigateToApplication().VerifyHomePage();
                ViewProduct view = home.ViewProduct().VerifyViewProductPage();

                Results.EndReport();
            }
            catch(Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #8
0
        public void Scen02_ViewProductInfo_SpecificProduct()
        {
            try
            {

                Results.WriteScenarioHeading("ViewProduct_02 - View Product Information(Brand, Title, Size, etc). of ProductID: " + Common.productID);

                home = home.NavigateToApplication().VerifyHomePage();
                ViewProduct view = home.ViewSpecificProduct(Common.productID).VerifyViewProductPage();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #9
0
        public void Scen03_CreateAccount()
        {
            try
            {
                Results.WriteScenarioHeading("TopHeader_03 - Create an Account");

                home = home.NavigateToApplication().VerifyHomePage();
                CreateAccount c = header.ClickSignInAndCreateAccount();
                c.EnterValidAccountInfo();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #10
0
        public void Scen02_SubscribeToEListFromTopNav()
        {
            try
            {
                Results.WriteScenarioHeading("TopHeader_02 - Subscribe To E-List From Top Nav");

                home = home.NavigateToApplication().VerifyHomePage();
                SubscribeElist s = header.ClickSubscribeToElist().VerifySubscribePopup();
                s.EntervalidDataAndClickSubscribe();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #11
0
        public void Scen01_LoginAsMember()
        {
            try
            {
                Results.WriteScenarioHeading("TopHeader_01 - Login As existing Member in Karmaloop Site");

                home = home.NavigateToApplication().VerifyHomePage();
                Login log = home.ClickSignIn();
                log.LoginAs();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #12
0
        public void Scen03_AddProductToShoppingBag()
        {
            try
            {

                Results.WriteScenarioHeading("ViewProduct_03 - Add a Product to shopping bag");

                home = home.NavigateToApplication().VerifyHomePage();
                ViewProduct view = home.ViewProduct().VerifyViewProductPage();
                view = view.SelectSizeAndClickAddToShoppingBag();
                ViewBag bag = view.OpenShoppingBag().VerifyShoppingBagPage();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #13
0
        public IActionResult Create(CreateHomeViewModel vm)
        {
            // if(ModelState.IsValid) add annotations later [Required] in model for attributes
            Home      newHome = vm.Home;
            IFormFile image   = vm.Image;

            // upload image
            if (image != null && image.Length > 0)
            {
                // _environment.WebRootPath --> ~/webroot/images/homes
                string storageFolder = Path.Combine(_environment.WebRootPath, "images/homes");

                // 000-1234-dsaf-asgsa.jpg
                string newImageName = $"{Guid.NewGuid().ToString()}{Path.GetExtension(image.FileName)}";

                // ~/wwwroot/images/home/000-1234-dsaf-asgsa.jpg
                string fullPath = Path.Combine(storageFolder, newImageName);

                using (var stream = new FileStream(fullPath, FileMode.Create))
                {
                    image.CopyTo(stream);
                }

                // append new image location to new Home
                newHome.ImageURL = $"/images/homes/{newImageName}";
            }

            // Add the landlord
            newHome.LandlordId = _userManager.GetUserId(User);

            // save newHome
            _homeService.Create(newHome);


            return(RedirectToAction("List"));
        }
예제 #14
0
        public ActionResult home(int?page, string testSelect)
        {
            getViewBag();
            Models.Items l = new Models.Items();
            l.List       = Login.getData();
            ViewBag.home = "đây là trang home" + testSelect;
            if (page == null)
            {
                page = 1;
            }
            int pageSize   = 5;
            int pageNumber = (page ?? 1);

            //IEnumerable<Object.Items> list = l.OrderBy();

            doiTuong.Items[] pets = l.List.ToArray();

            IEnumerable <doiTuong.Items> query = pets.OrderByDescending(pet => pet.Id);
            Home h = new Home();

            h.List = query.ToPagedList(pageNumber, pageSize);

            return(View(h));
        }
예제 #15
0
    void Load()
    {
        Home   dh            = Home.GetADefaultHome();
        string defaultString = JsonUtility.ToJson(dh);
        string value         = PlayerPrefs.GetString(HOME_KEY, defaultString);

        goldCount    = PlayerPrefs.GetInt(GOLD_KEY, 0);
        diamondCount = PlayerPrefs.GetInt(DIAMOND_KEY, 0);
        //OutLog.Log ("读取:"+value);

        try{
            //myHome= JsonReader.Deserialize<Home> (value);
            myHome = JsonUtility.FromJson <Home>(value);
            if (myHome.BoxDatas == null)
            {
                myHome.BoxDatas = new List <BoxData>();
            }
        }catch (Exception e) {
            //OutLog.Log ("错误:"+e.Message);
            PlayerPrefs.DeleteKey(HOME_KEY);
            value  = PlayerPrefs.GetString(HOME_KEY, defaultString);
            myHome = JsonUtility.FromJson <Home> (value);
        }
    }
예제 #16
0
        private void ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                home          = new Home(JsonConvert.DeserializeObject <List <Entity> >(Utils.ReadJson("../../resources/models/quantitiveModel.json")));
                enteredEntity = JsonConvert.DeserializeObject <Entity>(Utils.ReadJson());

                List <EntityOutput> euclid    = home.Execute(Operations.Euclid, enteredEntity);
                List <EntityOutput> minkowski = home.Execute(Operations.Minkowski, enteredEntity);
                List <EntityOutput> manhattan = home.Execute(Operations.Manhattan, enteredEntity);
                List <EntityOutput> canberra  = home.Execute(Operations.Canberra, enteredEntity);

                string euclidResult    = enteredEntity.Name + " according to Euclid refers to " + DefineClassMin(euclid).Name + Environment.NewLine;
                string minkowskiResult = enteredEntity.Name + " according to Minkowski refers to " + DefineClassMin(minkowski).Name + Environment.NewLine;
                string manhattanResult = enteredEntity.Name + " according to Manhattan refers to " + DefineClassMin(manhattan).Name + Environment.NewLine;
                string canberraResult  = enteredEntity.Name + " according to Canberra refers to " + DefineClassMin(canberra).Name + Environment.NewLine;

                rTB.Text = euclidResult + minkowskiResult + manhattanResult + canberraResult;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        //[System.Web.Http.Authorize(Roles = "admin, manager, user")]
        public HttpResponseMessage Post(Home home)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    this._unit.Homes.Add(home);
                    this._unit.SaveChanges();

                    HttpResponseMessage result = Request.CreateResponse(HttpStatusCode.Created, home);
                    result.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = home.Id }));

                    return(result);
                }
                else
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
            }
        }
예제 #18
0
        private void User_UpdateResult(object sender, User.StandardEventArgs e)
        {
            Application.Current.Dispatcher.Invoke(delegate
            {
                if (e.ResponseCode == System.Net.HttpStatusCode.OK)
                {
                    if (Destination == ControlDestination.userSettings)
                    {
                        TheSystem.Properties.Settings.Default.Token = e.Body;
                        TheSystem.Properties.Settings.Default.Save();

                        App.Restart();
                    }
                    else if (Destination == ControlDestination.editUser)
                    {
                        Home.CurrentAction = GlobalAction.users;
                    }
                }
                else
                {
                    Home.SetVidowStatus(e.Message);
                }
            });
        }
예제 #19
0
        public ActionResult inicio(int matricula, string modalidad, string password)
        {
            Home    login = new Home(matricula, password);
            Usuario user  = conn.verificar(login);

            Session["user"] = user;
            Session["modo"] = modalidad;
            if (user != null)
            {
                if (user.modalidad == "C" && modalidad == "M")
                {
                    TempData["alert"]   = "Modalidad Solo alumno, favor de editar perfil";
                    TempData["cargado"] = "S";
                    return(RedirectToAction("Index"));
                }
                return(RedirectToAction("Index", "Grupo"));
            }
            else
            {
                TempData["alert"]   = "Usuario/password incorrecto";
                TempData["cargado"] = "S";
                return(RedirectToAction("Index"));
            }
        }
예제 #20
0
        private void ToolStripMenuItem3_Click(object sender, EventArgs e)
        {
            try
            {
                home          = new Home(JsonConvert.DeserializeObject <List <Entity> >(Utils.ReadJson("../../resources/models/quantitiveModel.json")));
                enteredEntity = JsonConvert.DeserializeObject <Entity>(Utils.ReadJson());

                List <EntityOutput> acos  = home.Execute(Operations.Arccos, enteredEntity);
                List <EntityOutput> smul  = home.Execute(Operations.Smul, enteredEntity);
                List <EntityOutput> area  = home.Execute(Operations.Area, enteredEntity);
                List <EntityOutput> conus = home.Execute(Operations.Conus, enteredEntity);

                string acosResult  = enteredEntity.Name + " according to Acos refers to " + DefineClassMin(acos).Name + Environment.NewLine;
                string smulResult  = enteredEntity.Name + " according to Smul refers to " + DefineClassMax(smul).Name + Environment.NewLine;
                string areaResult  = enteredEntity.Name + " according to Area refers to " + DefineClassMax(area).Name + Environment.NewLine;
                string conusResult = enteredEntity.Name + " according to Conus refers to " + DefineClassMin(conus).Name + Environment.NewLine;

                rTB.Text = acosResult + smulResult + areaResult + conusResult;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #21
0
        // Create VA from VW
        public Archive(VirtualWorkspace vw) : base(DocumentType.VirtualArchive, null, vw.Name, vw.CreationDate)
        {
            IsReal = false;
            Roots  = new List <ArchiveNode>();
            ArchiveNode rootNode = new ArchiveNode(vw.Name, this);

            Roots.Add(rootNode);

            // Populate contents
            Home home = (App.Current as App).CurrentHome;

            for (int i = 0; i < vw.Pages.Count; i++)
            {
                ArchiveNode child = rootNode.AddNode("Page " + i);
                foreach (DocumentIcon docIcon in vw.Pages[i].Documents)
                {
                    Document doc = home.GetDocument(docIcon.DocumentID);
                    child.AddNode(doc.Name, doc);
                }
            }

            // Request saving
            bDirty = true;
        }
        protected override void Seed(DataContext context)
        {
            string[] descriptions = new string[10] {
                "Nice neighborhood with friendly neighbors.",
                "A truly beautiful home!",
                "In a cul-de-dac on a quiet street.",
                "Freeway accessible with a huge green lawn.",
                "Lots of storage and big bedrooms.",
                "Well-kept by previous owners.",
                "Includes pool, spa and basketball hoop.",
                "The back fence needs some work, but the house is in great condition.",
                "Includes a huge bonus room great for an office or playroom.",
                "Close to local magnet schools."
            };

            int count = 10;

            while ((count--) != 0)
            {
                Home home = new Home();
                home.StreetAddress = string.Format("12{0} Street St.", count);
                home.City          = "Anytown";
                home.ZipCode       = 90210;
                home.Bedrooms      = ((count % 2) == 1) ? 4 : 3;
                home.Bathrooms     = (home.Bedrooms - 2);
                home.SquareFeet    = 3700 + count;
                home.Price         = 275000 + (count * 1000);
                home.ImageName     = string.Format("home-{0}.jpg", ((count % 2) == 1) ? 2 : 1);
                home.Description   = descriptions[count];
                context.Homes.Add(home);
            }
            // */


            base.Seed(context);
        }
예제 #23
0
        public IActionResult edit(HomeeditViewModel model)
        {
            if (ModelState.IsValid)
            {
                Home homes = _employeerepository.GetHome(model.Id);
                homes.Name       = model.Name;
                homes.Email      = model.Email;
                homes.Department = model.Department;
                if (model.photos != null)
                {
                    if (model.Existingphoto != null)
                    {
                        string filepath = Path.Combine(hostingEnvironment.WebRootPath,
                                                       "images", model.Existingphoto);
                        System.IO.File.Delete(filepath);
                    }
                    homes.photopath = ProcessUploadFile(model);
                }
                _employeerepository.update(homes);

                return(RedirectToAction("index"));
            }
            return(View());
        }
예제 #24
0
        static void Main(string[] args)
        {
            User user = new User {
                Name = "Juca", Email = "*****@*****.**", Password = "******"
            };
            Home home = new Home {
                City = "SJC", Address = "SQL, 430"
            };
            Car car = new Car {
                Brand = "Fiat", Model = "Uno"
            };

            Serialization.Serialize(user);
            Serialization.Serialize(home);
            Serialization.Serialize(car);

            User u = Serialization.Deserialize <User>();
            Home h = Serialization.Deserialize <Home>();
            Car  c = Serialization.Deserialize <Car>();

            Console.WriteLine($"User => {u.Name} | Home => {h.City} | Car => {c.Brand}");

            Console.ReadKey();
        }
예제 #25
0
        /// <inheritdoc />
        public Building(Data Data, Home Home) : base(Data, Home)
        {
            this.BuildingData = (BuildingData)Data;

            if (this.BuildingData.Hitpoints[0] > 0)
            {
                this.AddComponent(new HitpointComponent(this, this.BuildingData.Hitpoints[0]));
            }

            if (this.BuildingData.GetUnitProduction(0) > 0)
            {
                this.AddComponent(new UnitProductionComponent(this));
            }

            if (this.BuildingData.GetUnitStorageCapacity(0) > 0)
            {
                int BoatIndex = 0;

                if (this.BuildingData.GetUnitProduction(0) < 1)
                {
                    BoatIndex = 0xFF;
                }
                else
                {
                    foreach (Building GameObject in this.Home.GameObjectManager.GameObjects[0])
                    {
                        if (GameObject.BuildingData.GetUnitStorageCapacity(0) > 1 && GameObject.BuildingData.GetUnitProduction(0) > 0)
                        {
                            ++BoatIndex;
                        }
                    }
                }

                this.AddComponent(new UnitStorageComponent(this, this.BuildingData.GetUnitStorageCapacity(0), BoatIndex));
            }
        }
예제 #26
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="myHome"></param>
        /// <returns></returns>
        private string FormatHomeData(Home myHome)
        {
            StringBuilder sb = new StringBuilder();

            if (myHome != null)
            {
                myHome.Rooms.ForEach(r =>
                {
                    sb.Append(r.RoomID);
                    sb.Append("^");
                    r.Devices.ForEach(d =>
                    {
                        sb.Append(d.DeviceID);
                        sb.Append("#");
                        sb.Append(IsControllerAlive(r.RoomID) == 1 ? d.DeviceState.ToString() : "D");
                        sb.Append(",");
                    });
                    sb.Remove(sb.Length - 1, 1);
                    sb.Append("@");
                });
                sb.Remove(sb.Length - 1, 1);
            }
            return(sb.ToString());
        }
예제 #27
0
        public void Scen02_CheckOutAsExistingUser_LoginBeforeCheckout()
        {
            try
            {
                Results.WriteScenarioHeading("CheckOut_02 - Buy a Product As Existing User(Logs in before adding Prodcuct in Bag).");

                home = home.NavigateToApplication().VerifyHomePage();
                home = home.ClickSignIn().LoginAs();
                ViewProduct view = home.ViewProduct().VerifyViewProductPage();
                ViewBag bag = view.SelectSizeAndClickAddToShoppingBag().ClickViewBag().VerifyShoppingBagPage();
                Shipping ship = bag.ClickCheckOutWithCreditCard().VerifyShippingTab();
                Payment pay = ship.InputShippingInfo().VerifyPaymentTab();
                ReviewYourOrder rev = pay.InputBillingInfo().VerifyReviewOrderTab();
                OrderReceipt receipt = rev.ClickPlaceYourOrderButton();
                receipt.GetOrderNumber();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #28
0
        //{
        //    var amazonProduct = new Product();
        //    amazonProduct.DescriptionData = new ProductDescriptionData
        //    {
        //        Brand = "Brand",
        //        Description = "Product description"
        //    };
        //    amazonProduct.Condition = new ConditionInfo { ConditionType = ConditionType.New };
        //    amazonProduct.ExternalProductUrl = "http://demo.virtocommerce.com";
        //    amazonProduct.SKU = "SKU987654321";
        //    amazonProduct.StandardProductID = new StandardProductID { Value = amazonProduct.SKU, Type = StandardProductIDType.ASIN };
        //    amazonProduct.ProductData = new ProductProductData { Item = new Home() };
        //    var response = SubmitFeedSender.SendAmazonFeeds(new List<Product> { amazonProduct, amazonProduct }, AmazonEnvelopeMessageType.Product, AmazonFeedType._POST_PRODUCT_DATA_, merchantId, marketplaceId, serviceUrl, accessKeyId, secretAccessKey);
        //    (response as List<string>).ForEach(line => Console.WriteLine(line));
        //    Console.ReadLine();
        //}
        private static Product GenerateProduct()
        {
            var amazonProduct = new Product();

            amazonProduct.DescriptionData =  new ProductDescriptionData
                {
                    Brand = "Brand",
                    Description = "Product description",

                };

            amazonProduct.Condition = new ConditionInfo { ConditionType = ConditionType.New };
            amazonProduct.ExternalProductUrl = "http://demo.virtocommerce.com";
            amazonProduct.SKU = "SKU987654321";
            amazonProduct.StandardProductID = new StandardProductID { Value = amazonProduct.SKU, Type = StandardProductIDType.ASIN };

            var mainCat = new Home();
            var subCat = new Kitchen();
            mainCat.ProductType = new HomeProductType { Item = subCat };

            amazonProduct.ProductData = new ProductProductData { Item = mainCat };

            return amazonProduct;
        }
예제 #29
0
        public void Scen01_CheckOutAsGuestUser()
        {
            try
            {
                Results.WriteScenarioHeading("CheckOut_01 - Buy a Product As Guest User.");

                home = home.NavigateToApplication().VerifyHomePage();
                ViewProduct view = home.ViewProduct().VerifyViewProductPage();
                ViewBag bag = view.SelectSizeAndClickAddToShoppingBag().ClickViewBag().VerifyShoppingBagPage();
                AccountSignIn acct = bag.ClickCheckOutWithCreditCard_AsGuestUser().VerifyAcctSignInPage();
                Shipping ship = acct.CheckOutAsGuestUser().VerifyShippingTab();
                Payment pay = ship.InputShippingInfo().VerifyPaymentTab();
                ReviewYourOrder rev = pay.InputBillingInfo().VerifyReviewOrderTab();
                OrderReceipt receipt = rev.ClickPlaceYourOrderButton();
                receipt.GetOrderNumber();

                Results.EndReport();
            }
            catch(Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #30
0
    protected override void OnInitComplete(EventArgs e)
    {
        id = GeneralExtensions.GetQueryStringId();
        if (id > 0)
        {
            contentData = id.GetContentById();
            homeProperties = homeUtils.GetHomeElements(contentData.Html);
            //To bind the What's New Module
            this.blogModelSource.ContentFilters.Add(new Ektron.Cms.Framework.UI.Controls.ContentFilter()
            {
                Field = Ektron.Cms.Common.ContentProperty.Id,
                Operator = Ektron.Cms.Common.CriteriaFilterOperator.InSubClause,
                Value = homeProperties.blogIds
            });

            this.clientModelSource.ContentFilters.Add(new Ektron.Cms.Framework.UI.Controls.ContentFilter()
            {
                Field = Ektron.Cms.Common.ContentProperty.Id,
                Operator = Ektron.Cms.Common.CriteriaFilterOperator.EqualTo,
                Value = homeProperties.ourClientsId.ToString()
            });
        }
        base.OnInitComplete(e);
    }
예제 #31
0
        //[Test]
        public void Scen06_AddToWishList_LoginDuringProcess()
        {
            try
            {

                Results.WriteScenarioHeading("ViewProduct_06 - Add a Product to Wish List(Exisitng User logs in during process)");

                home = home.NavigateToApplication().VerifyHomePage();
                ViewProduct view = home.ViewProduct().VerifyViewProductPage();
                view.ClickAddToWishList_WhenLoginNeeded();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #32
0
 private static int InsertTest(string connectionString)
 {
     Home pocoHome;
     var db = new PetaPoco.Database(connectionString, "System.Data.SqlClient");
     var provinces = db.Query<dynamic>(@"SELECT *
     from Province");
     foreach (var home in HomeData.Get100Homes())
     {
         pocoHome = new Home
         {
             BuildYear = home.BuildYear,
             City = home.City,
             Description = home.Description,
             ProvinceId = provinces.First(i => i.Code == home.HomeProvince.Code).Id,
             Price = home.Price,
             Surface = home.Surface,
             AddTime = DateTime.Now
         };
         db.Insert("Home", "Id", pocoHome);
     }
     return 100;
 }
예제 #33
0
	/// <summary>
	/// Add a singe available job to the global list.
	/// </summary>
	public void AnnounceFreeHome(Home home)
	{
		GameController.instance.buildingController.freeHomeList.Add (home);
	}
예제 #34
0
파일: Biclops.cs 프로젝트: rhogroup/PanTilt
 public IEnumerator<ITask> HomeHandler(Home update)
 {
     _biclops.home();
     update.ResponsePort.Post(new DefaultUpdateResponseType());
     yield break;
 }
예제 #35
0
        static void Main(string[] args)
        {
            Home home = new Home();

            home.Run();
        }
 public void initialize()
 {
     driver         = new ChromeDriver();
     gettingStarted = new GettingStarted(driver);
     home           = new Home(driver);
 }
예제 #37
0
    // Update is called once per frame
    protected override void Update()
    {
        base.Update();

        elasticL.SetPosition(1, selectedObject.transform.GetChild(0).gameObject.transform.position);
        elasticR.SetPosition(1, selectedObject.transform.GetChild(1).gameObject.transform.position);


        switch (currentStep)
        {
        // initlize the scene
        case 0:
            ObjectFollowMouse(toolObjects);
            ToolLookAtBall();


            baseObject.GetComponent <Rigidbody>().velocity = Vector3.zero;

            if (Vector3.Distance(mousePoint, ballObjects.transform.position) <= 0.05f)
            {
                IncrementStep();
            }

            if (Vector3.Distance(ctrllerPoint, ballObjects.transform.position) <= 0.05f)
            {
                IncrementStep();
            }

            break;

        // the user triggers the object
        case 1:
            BallFollowMouse(baseObject);
            ObjectFollowMouse(toolObjects);

            float time = 0f;

            // non vr and vr control of the slingshot
            if (ctrler.Session.settings.GetString("experiment_mode") == "tool")
            {
                Vector3 direc = new Vector3(Home.transform.position.x - mousePoint.x, 0, Home.transform.position.z - mousePoint.z);
                toolObjects.transform.localRotation = Quaternion.LookRotation(direc);
                // Line rendere representing the slingshot band is attached to home GameObject
                Home.GetComponent <LineRenderer>().positionCount = 2;
                Home.GetComponent <LineRenderer>().SetPosition(0, Home.transform.position);
                Home.GetComponent <LineRenderer>().SetPosition(1, mousePoint);

                if (Vector3.Distance(slingShotBall.transform.position, Home.transform.position) > 0.12f)
                {
                    time += Time.fixedDeltaTime;
                }

                if (Vector3.Distance(slingShotBall.transform.position, Home.transform.position) > 0.2f)
                {
                    Vector3 shotDir = Home.transform.position - mousePoint;
                    shotDir /= time;

                    //baseObject.GetComponent<Rigidbody>().velocity = shotDir * 0.2f;
                    pos = toolObjects.transform.position;

                    baseObject.GetComponent <Rigidbody>().velocity   = shotDir.normalized * FIRE_FORCE;
                    Home.GetComponent <LineRenderer>().positionCount = 0;
                    sound.Play();
                    IncrementStep();
                }
            }
            else
            {
                Vector3 direc = new Vector3(Home.transform.position.x - ctrllerPoint.x, 0, Home.transform.position.z - ctrllerPoint.z);
                toolObjects.transform.localRotation = Quaternion.LookRotation(direc);
                // Line rendere representing the slingshot band is attached to home GameObject
                Home.GetComponent <LineRenderer>().positionCount = 2;
                Home.GetComponent <LineRenderer>().SetPosition(0, Home.transform.position);
                Home.GetComponent <LineRenderer>().SetPosition(1, ctrllerPoint);

                if (Vector3.Distance(slingShotBall.transform.position, Home.transform.position) > 0.12f)
                {
                    time += Time.fixedDeltaTime;
                }

                foreach (var device in devices)
                {
                    UnityEngine.XR.HapticCapabilities capabilities;
                    if (device.TryGetHapticCapabilities(out capabilities))
                    {
                        if (capabilities.supportsImpulse)
                        {
                            uint  channel   = 0;
                            float amplitude = 0.4f;
                            float duration  = Time.deltaTime;
                            device.SendHapticImpulse(channel, amplitude, duration);
                        }
                    }
                }

                if (Vector3.Distance(slingShotBall.transform.position, Home.transform.position) > 0.2f)
                {
                    Vector3 shotDir = Home.transform.position - ctrllerPoint;
                    shotDir /= time;

                    //baseObject.GetComponent<Rigidbody>().velocity = shotDir * 0.2f;

                    pos = toolObjects.transform.position;

                    baseObject.GetComponent <Rigidbody>().velocity   = shotDir.normalized * FIRE_FORCE;
                    Home.GetComponent <LineRenderer>().positionCount = 0;
                    sound.Play();
                    IncrementStep();
                }
            }
            break;

        case 2:
            if (toolObjects.transform.position.z > Home.transform.position.z)
            {
                toolObjects.transform.position = ballObjects.transform.position;
            }

            else
            {
                toolObjects.transform.position = Home.transform.position;
            }


            break;

        case 3:
            toolObjects.transform.position = Home.transform.position;
            break;
        }
    }
 protected override void Dispose(bool disposing)
 {
     Assert.Equal(0, Home.GetPostbacksCount()); // this means no unhandled exception has been thrown, so no client logic has been aborted
     base.Dispose(disposing);
 }
예제 #39
0
 public void Home(Lector lector)
 {
     _home         = new Home(lector);
     _main.Content = _home;
 }
예제 #40
0
 /// <a href="http://bit.ly/2OvNqd4">Fetch an unused node and use it as the container for the provided new item</a>
 public Node Add(T t) => Home.Add(item: t).MoveTo(Owner);
예제 #41
0
 public void TestFixtureSetUp()
 {
     IWebDriver driver = StartBrowser();
     Common.currentDriver = driver;
     header = new TopHeader(driver);
     home = new Home(driver);
     Results.WriteTestSuiteHeading(typeof(TestSuite_CheckOut).Name);
 }
예제 #42
0
        public void Scen04_SendEmailToFriend()
        {
            try
            {

                Results.WriteScenarioHeading("ViewProduct_04 - Share Product Info with the friend via Email");

                home = home.NavigateToApplication().VerifyHomePage();
                ViewProduct view = home.ViewProduct().VerifyViewProductPage();
                EmailAFriend email = view.ClickEmailAFriendButton();
                view = email.EnterInfoAndSendEmail();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #43
0
 public bool Equals(Resin obj)
 {
     return(Home.Equals(obj.Home));
 }
예제 #44
0
        public FormViewRoom()
        {
            InitializeComponent();
            this.Translate();
            this.UpdateUI();
            base.DoInit();

            //Create worker
            mThread = new ExBackgroundWorker();
            mThread.WorkerReportsProgress = true;
            mThread.WorkerSupportsCancellation = true;
            mThread.ProgressChanged += new ProgressChangedEventHandler(bwAsync_WorkerChanged);
            mThread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwAsync_WorkerCompleted);
            mThread.DoWork += new DoWorkEventHandler(bwAsync_Worker);

            this.olvColumnHome.AspectGetter = delegate(object x)
            {
                Room data = (Room)x;
                if (data != null && data.RoomID > 0)
                {
                    return Home.GetDefault(data.HomeID).HomeName;
                }
                return "";
            };

            this.olvColumnUser.AspectGetter = delegate(object x)
            {
                Room data = (Room)x;
                if (data != null && data.RoomID > 0)
                {
                    return User.GetDefault(data.UserID).UserName;
                }
                return "";
            };

            //Init container tree list view
            this.mListViewData.CanExpandGetter = delegate(object x)
            {
                Room data = (Room)x;
                if (data.mListSubData != null && data.mListSubData.Count > 0)
                {
                    IList<Room> mListSubData = data.mListSubData;

                    if (mListSubData.Count > 0)
                    {
                        return true;
                    }
                }

                return false;
            };

            this.mListViewData.ChildrenGetter = delegate(object x)
            {
                Room data = (Room)x;
                IList<Room> mListSubData = data.mListSubData;

                return mListSubData;
            };

            mListViewData.PrimarySortOrder = SortOrder.Ascending;

            //Init container tree list view
            this.ListViewNhomDichVu.CanExpandGetter = delegate(object x)
            {
                ThongTinDanhSachRoom data = (ThongTinDanhSachRoom)x;
                if (data.mListSubData != null && data.mListSubData.Count > 0)
                {
                    IList<ThongTinDanhSachRoom> mListSubData = data.mListSubData;
                    return data.mListSubData.Count > 0;
                }

                return false;
            };
            this.ListViewNhomDichVu.ChildrenGetter = delegate(object x)
            {
                ThongTinDanhSachRoom data = (ThongTinDanhSachRoom)x;
                return data.mListSubData;
            };
        }
예제 #45
0
 public void Home()
 {
     _home         = new Home();
     _main.Content = _home;
 }
예제 #46
0
        //[Test]
        public void Scen07_AddToWishList_CreateNewAccountDuringProcess()
        {
            try
            {

                Results.WriteScenarioHeading("ViewProduct_07 - Add a Product to Wish List(creating new account during process");

                home = home.NavigateToApplication().VerifyHomePage();
                ViewProduct view = home.ViewProduct().VerifyViewProductPage();
                view.ClickAddToWishList_WhenNewAccountNeeded();

                Results.EndReport();
            }
            catch (Exception e)
            {
                Logging.LogStop(e);
                throw;
            }
        }
예제 #47
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (paused)
        {
            return;
        }
        if (inFiringRange)
        {
            float rotation = (rb.rotation + 90);
            if (weapon.GetComponent <Weapon>().Shoot(transform.Find("Barrel").position, new Vector2(Mathf.Cos(((rotation) * Mathf.PI) / 180), Mathf.Sin(((rotation) * Mathf.PI) / 180)), gameObject.GetComponent <Rigidbody2D>().velocity))
            {
                audioManager.Play("LazerShoot");
            }
        }

        if (inTargetingRange)
        {
            if (target == null && tag != "Friendly" && !isBomber)
            {
                target = player;
            }
            else if (target == null)
            {
                inTargetingRange = false;
                return;
            }
            Vector3 playerRelativePosition = target.transform.position - transform.position;
            float   playerDirection        = Mathf.Rad2Deg * Mathf.Atan(playerRelativePosition.y / playerRelativePosition.x);

            if (playerRelativePosition.x > 0)
            {
                playerDirection += 180f;
            }

            if (!inStoppingRange)
            {
                if (speed < maxSpeed)
                {
                    speed += thrust;
                }

                if (enhancedTargeting) // much more accurate, also more predictable
                {
                    rb.velocity = playerRelativePosition.normalized * speed;
                }
                else // less accurate, less predictable
                {
                    Vector2 direction = new Vector2(Mathf.Cos(((rb.rotation + 90) * Mathf.PI) / 180), Mathf.Sin(((rb.rotation + 90) * Mathf.PI) / 180));
                    rb.velocity = direction.normalized * speed;
                }
            }
            else
            {
                speed       = 0;
                rb.velocity = Vector2.zero;
            }

            if (enhancedTargeting)  // much more accurate, also more predictable
            {
                rb.rotation = playerDirection + 90;
            }
            else // less accurate, less predictable
            {
                if (playerDirection > (180 + rb.rotation + 90) % 360 + turnSpeed)
                {
                    if (180 > (180 + rb.rotation + 90 + turnSpeed) % 360 - playerDirection)
                    {
                        rb.angularVelocity += turnSpeed;
                        //rb.rotation += turnSpeed;
                    }
                    else
                    {
                        rb.angularVelocity -= turnSpeed;
                    }
                }
                else if (playerDirection < (180 + rb.rotation + 90) % 360 - turnSpeed)
                {
                    if (180 < (180 + rb.rotation + 90 + turnSpeed) % 360 - playerDirection)
                    {
                        rb.angularVelocity += turnSpeed;
                    }
                    else
                    {
                        rb.angularVelocity -= turnSpeed;
                    }
                }
                else
                {
                    rb.angularVelocity = 0;// rb.angularVelocity * angularDrag;
                }
            }
        }
        else if (invasionEnemy)
        {
            if (speed < maxSpeed)
            {
                speed += thrust;
            }

            if (transform.position.magnitude >= distanceAwayToStop)
            {
                transform.position = Vector2.MoveTowards(transform.position, Vector2.zero, speed * Time.deltaTime);
            }
            else
            {
                GetComponent <Rigidbody2D>().velocity = Vector2.zero;
                Home home = FindObjectOfType <Home>();

                if (home.anyPlanetsRemaining())
                {
                    int i     = 0;
                    int index = Random.Range(0, home.homePlanets.Count - 1);
                    if (home.homePlanets[index] != null)
                    {
                        target = home.homePlanets[index].gameObject;
                    }
                    while (home.homePlanets[index] == null && home.anyPlanetsRemaining() && i < 400)
                    {
                        index = Random.Range(0, home.homePlanets.Count - 1);
                        i    += 1;
                    }
                    if (home.homePlanets[index] != null)
                    {
                        target = home.homePlanets[index].gameObject;
                    }
                    else
                    {
                        FindObjectOfType <EnemyInvasionManager>().lowerCount();
                        Destroy(gameObject);
                    }
                }
                else
                {
                    FindObjectOfType <EnemyInvasionManager>().lowerCount();
                    Destroy(gameObject);
                }
                inTargetingRange = true;
            }

            Vector2 direction = Vector2.zero - (Vector2)transform.position;
            direction.Normalize();
            float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
            transform.rotation = Quaternion.Euler(Vector3.forward * (angle + 180 + 90));
        }
        else
        {
            speed              = 0;
            rb.velocity        = new Vector2(0, 0);
            rb.angularVelocity = 0;
            if (boss && health < maxHealth)
            {
                health += maxHealth * .1f;
            }
        }
    }
 public void addHome(Home home)
 {
     SimulationState.getInstance().stdout.Send("entro addHome");
     //home._name   = "home" + homes.Count;
     SimulationState.getInstance().stdout.Send("name: "+home._name);
     homes[home._name]  = home;
 }
 public ClientModeTest(DriverFixture classContext, ServerFixture assemblyContext)
     : base(classContext, assemblyContext)
 {
     Home.SetMode("client");
 }
예제 #50
0
	void Start ()
	{
		instance = this;
		tresorList = new List<Transform>();
		tresorCount = GameObject.FindObjectsOfType<Page>().Length;
	}
예제 #51
0
 public HomeViewModel(IPublishedContent content) : base(content)
 {
     StrongContent = new Home(content);
 }
예제 #52
0
 /// <summary>
 /// Create a new Home object.
 /// </summary>
 /// <param name="ID">Initial value of Id.</param>
 /// <param name="address">Initial value of Address.</param>
 public static Home CreateHome(int ID, string address)
 {
     Home home = new Home();
     home.Id = ID;
     home.Address = address;
     return home;
 }
예제 #53
0
 public void SetHome(Home value)
 {
     home = value;
 }
예제 #54
0
 /// <summary>
 /// There are no comments for Homes in the schema.
 /// </summary>
 public void AddToHomes(Home home)
 {
     base.AddObject("Homes", home);
 }
예제 #55
0
        public static List <System.Net.Mail.Attachment> GetAttachments(List <Document> attachmentList, Home currentHome)
        {
            List <System.Net.Mail.Attachment> attachments = new List <System.Net.Mail.Attachment>();

            foreach (Document cur in attachmentList)
            {
                attachments.Add(new Attachment(DocumentUtils.GetDocumentStream((bool)cur.IsPrivate, (string)cur.Url, currentHome.EncryptionPassword), (string)cur.Title));
            }
            return(attachments);
        }
예제 #56
0
 void LoadInfo()
 {
     TLYC.Children.Clear();
     TLYC.Margin = new Thickness(0, 50, 0, 0);
     TLYC.Padding = new Thickness(0, 0, 0, 0);
     Home hm = new Home();
     hm.Width = TLYC.Width;
     hm.Height = TLYC.Height-70;
     TLYC.Children.Add(hm);
 }
예제 #57
0
 public override int GetHashCode()
 {
     return(Home.GetHashCode());
 }
예제 #58
0
 protected void Page_Load(object sender, EventArgs e)
 {
     home = homeFac.GetEntityByID(1);
   	FillContent();
 }
예제 #59
0
 public ActionResult Save(Home home)
 {
     return(View());
 }
예제 #60
0
파일: City.cs 프로젝트: CurtsApp/TrafficSim
        private ITile[,] GenerateLiveMap(ITile[,] liveMap)
        {
            for (byte x = 0; x < _cityWidth; x++)
            {
                for (byte y = 0; y < _cityHeight; y++)
                {

                    switch ((int)_zoning.Map[x,y])
                    {

                        //Residential
                        case 0:
                            Home bufferHome = new Home(new Point(x,y));
                            _homes.Add(bufferHome);
                            LiveMap[x, y] = bufferHome;
                            break;
                            //Work
                        case 1:
                            Office bufferOffice = new Office(new Point(x,y));
                            _offices.Add(bufferOffice);
                            LiveMap[x, y] = bufferOffice;
                            break;
                            //Road
                        case 2:
                            LiveMap[x,y] = new TwoLaneRoad(new Point(x, y));
                            break;
                            //Intersection
                        case 3:
                            Intersection bufferIntersection = new Intersection(_traffictCycleTime + rand.Next(-30,30), true);
                            _intersections.Add(bufferIntersection);
                            LiveMap[x, y] = bufferIntersection;
                            break;
                        case 4:
                            LiveMap[x,y] = new Vacant(new Point(x,y));
                            break;
                            default:
                            throw new Exception("Zoning Map: Enum exceeds expected values");

                    }
                }
            }

            return liveMap;
        }