public override void startPrimary() { Equipment.busy = true; this.startedUse = Time.realtimeSinceStartup; NetworkSounds.askSound(string.Concat("Sounds/Items/", ItemSounds.getSource(Equipment.id), "/use"), Camera.main.transform.position + (Camera.main.transform.forward * 0.5f), 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); Viewmodel.play("use"); }
public ActionResult Create(Viewmodel viewmodel) { if (ModelState.IsValid) { Student student = new Student { //StudentID=viewmodel.StudentID, StudentName = viewmodel.StudentName, }; databaseContext.Students.Add(student); databaseContext.SaveChanges(); var _Student = databaseContext.Students.Where(m => m.StudentName == viewmodel.StudentName).FirstOrDefault(); Address address = new Address { StudentID = _Student.StudentID, Addresslocation = viewmodel.Addresslocation, Pincode = viewmodel.Pincode }; databaseContext.Addresses.Add(address); databaseContext.SaveChanges(); return(RedirectToAction("Index")); } return(View(viewmodel)); }
public ActionResult Edit(int id) { Viewmodel _obj = new Viewmodel(); var _Viewmodel = from adrs in databaseContext.Addresses join stud in databaseContext.Students on adrs.StudentID equals stud.StudentID into adrsstud from stud in adrsstud.DefaultIfEmpty() where adrs.StudentID == id select new Viewmodel { StudentID = id, StudentName = stud.StudentName, Addresslocation = adrs.Addresslocation, Pincode = adrs.Pincode }; foreach (var items in _Viewmodel) { _obj.StudentID = items.StudentID; _obj.StudentName = items.StudentName; _obj.Addresslocation = items.Addresslocation; _obj.Pincode = items.Pincode; } return(View(_obj)); }
public ActionResult Order(int id) { if (Session["S_ID"] != null && Session["Role"].ToString() != "Accountant") { var Menu = db.Menus.Where(m => m.Stock > 0).ToList(); ViewBag.MenuList = new SelectList(Menu, "Food_ID", "Name"); ViewBag.OrderID = id; Viewmodel viewmodel = new Viewmodel(); viewmodel.Order_Details = new Order_DetailDAO().GetListOrder(id); viewmodel.Order_Detail = new Order_Detail(); viewmodel.Order = new OrderDAO().GetOrderByID(id); return(View("Order", viewmodel)); } else if (Session["S_ID"] != null) { TempData["ErrorMessage"] = "You are not authorized to access this page"; return(RedirectToAction("Admin_index", "Home")); } else { return(RedirectToAction("Login", "Home")); } }
public ActionResult Index() { //List<Student> studentlist = databaseContext.Students.ToList(); List <Viewmodel> viewmodellist = new List <Viewmodel>(); //List<Viewmodel> addressvmlist = studentlist.Select(x => new Viewmodel {StudentName=x.StudentName,StudentID=x.StudentID,Addresslocation=x.} var studentlist = (from adrs in databaseContext.Addresses join stud in databaseContext.Students on adrs.StudentID equals stud.StudentID select new { adrs.StudentID, stud.StudentName, adrs.Pincode, adrs.Addresslocation }).ToList(); foreach (var data in studentlist) { Viewmodel vml = new Viewmodel(); vml.StudentID = data.StudentID; vml.StudentName = data.StudentName; vml.Pincode = data.Pincode; vml.Addresslocation = data.Addresslocation; viewmodellist.Add(vml); } return(View(viewmodellist)); }
private void PrivateMessageViewPage_Loaded(object sender, RoutedEventArgs e) { if (!Viewmodel.IsDataLoaded) { Viewmodel.LoadData(); } }
/// <summary> /// Provides a deterministic way to create the Main property. /// </summary> public static void CreateMain() { if (_main == null) { _main = new Viewmodel(); } }
public override void equip() { Viewmodel.play("equip"); this.help = (GameObject)UnityEngine.Object.Instantiate(Resources.Load(string.Concat("Prefabs/Structures/", Equipment.id)), Vector3.zero, base.transform.rotation); this.help.name = "help"; UnityEngine.Object.Destroy(this.help.transform.FindChild("model").collider); this.help.transform.FindChild("model").renderer.castShadows = false; this.help.transform.FindChild("model").renderer.receiveShadows = false; this.help.tag = "Untagged"; this.help.layer = 2; this.help.transform.FindChild("model").tag = "Untagged"; this.help.transform.FindChild("model").gameObject.layer = 2; if (this.help.transform.FindChild("nav")) { UnityEngine.Object.Destroy(this.help.transform.FindChild("nav").gameObject); } if (StructureStats.isLadder(Equipment.id)) { UnityEngine.Object.Destroy(this.help.transform.FindChild("model").FindChild("ladder").gameObject); } this.rotation = StructureStats.getRotation(Equipment.id); Transform transforms = this.help.transform; transforms.rotation = transforms.rotation * Quaternion.Euler(0f, (float)this.rotation, 0f); }
public MainWindow() { InitializeComponent(); Viewmodel vm = new Viewmodel(); DataContext = vm; }
public void NotThrowExceptionWhenNoSubscribersForPropertyChanged() { var converter = Substitute.For<IUnitConverter>(); Action convert = () => Viewmodel.ConvertWith(converter, new[] { "12054" }.ToMultilineText()); convert.ShouldNotThrow(); }
public ActionResult Detail(int?id) { Viewmodel vm = new Viewmodel(); vm.product = db.Products.Find(id); vm.ie_Rate = db.Rates.ToList(); return(View(vm)); }
public ActionResult Index(int?id) { Viewmodel vm = new Viewmodel(); vm.user = db.Users.Find(id); vm.ie_shop = db.Shops.ToList(); return(View(vm)); }
public ActionResult Category(int?id) { Viewmodel vm = new Viewmodel(); vm.catagory = db.Catagories.Find(id); vm.ie_shop = db.Shops.ToList(); return(View(vm)); }
public ActionResult Like(int?id) { Viewmodel vm = new Viewmodel(); vm.user = db.Users.Find(id); vm.ie_like = db.Likes.ToList(); return(View(vm)); }
public ActionResult Bestselling() { Viewmodel vm = new Viewmodel(); vm.ie_product = db.Products.ToList(); vm.ie_Rate = db.Rates.ToList(); return(View(vm)); }
private async void Continue_Click(object sender, RoutedEventArgs e) { if (await Viewmodel.VerifyNetCode()) { ValidResult = true; Result.TrySetResult(true); } }
public ActionResult Shop(int?id) { Viewmodel vm = new Viewmodel(); vm.ie_photo = db.PhotoGallereys.ToList(); vm.shop = db.Shops.Find(id); vm.ie_product = db.Products.ToList(); return(View(vm)); }
public override void startPrimary() { if (this.safe) { Equipment.busy = true; this.startedUse = Time.realtimeSinceStartup; Viewmodel.play("use"); } }
public override void equip() { Viewmodel.play("equip"); this.marker = Equipment.model.transform.FindChild("model").FindChild("player").gameObject; if (PlayerSettings.arm) { this.marker.transform.parent.localScale = new Vector3(1f, -1f, 1f); } }
public void RaisePropertyChangedForResult() { var converter = Substitute.For<IUnitConverter>(); Viewmodel.MonitorEvents(); Viewmodel.ConvertWith(converter, new[] { "23.5", "1.2" }.ToMultilineText()); Viewmodel.ShouldRaisePropertyChangeFor(viewmodel => viewmodel.Result); }
public ActionResult Index() { Viewmodel vm = new Viewmodel { FAQs = db.FAQs.ToList(), FAQcategories = db.FaqCategories.ToList() }; return(View(vm)); }
public ActionResult Index() { Viewmodel vm = new Viewmodel { Projects = db.Projects.ToList(), Categories = db.Categories.ToList(), ProjectCategory = db.ProjectCategories.ToList() }; return(View(vm)); }
/** * The Start method is called automatically by Monobehaviors, * essentially becoming the constructor of the class. * <p> * See <a href="http://docs.unity3d.com/ScriptReference/MonoBehaviour.Start.html">docs.unity3d.com</a> for more information. */ private void Start() { bobTimer = 0.0f; player = GetComponent<Player> (); Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; equipment = GameObject.Find("Equipment").GetComponent<Equipment>(); viewmodel = null; guiController = GameObject.Find("Graphical User Interface").GetComponent<GUIController>(); audioSource = GetComponent<AudioSource>(); }
// GET: About public ActionResult Index() { Viewmodel vm = new Viewmodel { Abouts = db.Abouts.ToList(), Partners = db.Partners.ToList(), Facts = db.Facts.ToList() }; return(View(vm)); }
public override void startPrimary() { Physics.Raycast(Camera.main.transform.position + (Camera.main.transform.forward * -0.5f), Camera.main.transform.forward, out Jack.hit, 5f, -29365511); if (Jack.hit.collider != null && Jack.hit.collider.tag == "Vehicle" && Jack.hit.collider.GetComponent <Vehicle>().lastSpeed == 0) { this.target = Jack.hit.collider.gameObject; NetworkSounds.askSound(string.Concat("Sounds/Items/", ItemSounds.getSource(Equipment.id), "/use"), Camera.main.transform.position + (Camera.main.transform.forward * 0.5f), 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); Equipment.busy = true; this.startedUse = Time.realtimeSinceStartup; Viewmodel.play("use"); } }
public override void startPrimary() { Physics.Raycast(Camera.main.transform.position + (Camera.main.transform.forward * -0.5f), Camera.main.transform.forward, out Fertilizer.hit, 5f, -29365511); if (Fertilizer.hit.collider != null && Fertilizer.hit.collider.tag == "Barricade" && ItemType.getType(int.Parse(Fertilizer.hit.collider.transform.parent.name)) == 22) { this.target = Fertilizer.hit.collider.gameObject; NetworkSounds.askSound(string.Concat("Sounds/Items/", ItemSounds.getSource(Equipment.id), "/use"), Camera.main.transform.position + (Camera.main.transform.forward * 0.5f), 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); Equipment.busy = true; this.startedUse = Time.realtimeSinceStartup; Viewmodel.play("use"); } }
public override void startPrimary() { Physics.Raycast(Camera.main.transform.position + (Camera.main.transform.forward * -0.5f), Camera.main.transform.forward, out Gas.hit, 5f, -29365511); if (Gas.hit.collider != null && (Player.inventory.items[Equipment.equipped.x, Equipment.equipped.y].state == "f" && Gas.hit.collider.tag == "Vehicle" && Gas.hit.collider.GetComponent <Vehicle>().fuel < Gas.hit.collider.GetComponent <Vehicle>().maxFuel || Player.inventory.items[Equipment.equipped.x, Equipment.equipped.y].state == "e" && Gas.hit.collider.tag == "Vehicle" && Gas.hit.collider.GetComponent <Vehicle>().fuel >= 50 || Player.inventory.items[Equipment.equipped.x, Equipment.equipped.y].state == "e" && (Gas.hit.collider.name == "gasTank" || Gas.hit.collider.name == "gasPump"))) { this.target = Gas.hit.collider.gameObject; NetworkSounds.askSound(string.Concat("Sounds/Items/", ItemSounds.getSource(Equipment.id), "/use"), Camera.main.transform.position + (Camera.main.transform.forward * 0.5f), 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f); Equipment.busy = true; this.startedUse = Time.realtimeSinceStartup; Viewmodel.play("use"); } }
public void Setup() { if (CaptureHandler != null) { // Start the Capture Session. if (!CaptureHandler.GetSessionActive()) { CaptureHandler.StartSession(); } } Viewmodel.StartCaptureSequence(); }
public void UpdateResultWithExpectedValue(string[] inputValues, double[] result) { var rawInput = inputValues.ToMultilineText(); var expectedValue = result.Select(value => value.ToString()).ToMultilineText(); FakeFormatter.ToCollection(rawInput).Returns(inputValues); FakeFormatter.ToText(null).ReturnsForAnyArgs(expectedValue); var converter = ConfigureConverterFor(inputValues, result); Viewmodel.ConvertWith(converter, rawInput); Viewmodel.Result.Should().Be(expectedValue); }
public void PassConvertedValuesToFormatterAsCollectionOfInvariantCultureString(string[] inputValues, double[] result) { var expectedOutputValues = result.Select(value => value.ToString(CultureInfo.InvariantCulture)); IEnumerable<string> actualOutputValues = null; var inputValue = inputValues.ToMultilineText(); FakeFormatter.ToCollection(inputValue).ReturnsForAnyArgs(inputValues); FakeFormatter.ToText(Arg.Do<IEnumerable<string>>(values => actualOutputValues = values)).ReturnsForAnyArgs(string.Empty); var converter = ConfigureConverterFor(inputValues, result); Viewmodel.ConvertWith(converter, inputValue); actualOutputValues.ShouldBeEquivalentTo(expectedOutputValues); }
// =============== ProductDetails ========== public ActionResult ViewProductDetails(int?id) { Viewmodel v = new Viewmodel(); Product p = db.Product.Where(x => x.id == id).SingleOrDefault(); v.id_p = p.id; v.name_p = p.name; v.image = p.image; v.price = p.price; v.description = p.description; Category cat = db.Category.Where(x => x.id == p.category_id).SingleOrDefault(); v.name_c = cat.name; return(View(v)); }
/** * Sets the viewmodel of the player. * * @param model the model to render * @param itemID the item ID of the viewmodel */ private void setViewmodel(GameObject model, int itemID) { if (viewmodel != null) { Destroy(viewmodel.gameObject); viewmodel = null; } if (model != null) { GameObject newViewmodel = Instantiate(model); newViewmodel.transform.SetParent(player._Camera.transform); viewmodel = newViewmodel.GetComponent<Viewmodel>(); newViewmodel.transform.localPosition = viewmodel.DefaultPosition; viewmodel.ItemID = itemID; viewmodelAnimation = viewmodel.GetComponent<Animation>(); } }