Exemple #1
0
        public PartialViewResult Delete(int id)
        {
            ViewArea entity = GetById(id);

            HttpContext.Session.SetString("AreaBoolSearch", "true");
            return(PartialView(entity));
        }
Exemple #2
0
        public ActionResult Index([Bind("AreaId,Name,TypeName,TypeId,Code")] ViewAreaFilter entity)
        {
            if (entity.TypeId == 0)
            {
                entity.TypeId = null;
            }
            try
            {
                ViewArea viewArea = new ViewArea();

                viewArea.TypeId = entity.TypeId;
                viewArea.Name   = entity.Name;
                viewArea.Code   = entity.Code;
                CheckForAlerts();

                List <ViewAreaFilter> entities = JsonConvert.DeserializeObject <List <ViewAreaFilter> >(GenericRequest(true, "Area", "Search", entity));
                HttpContext.Session.SetString("AreaSearch", JsonConvert.SerializeObject(entities));
                HttpContext.Session.SetString("AreaBoolSearch", "true");
                ViewBag.AreaType = GetAllAreaType().Select(x => new SelectListItem {
                    Text = x.Name, Value = x.AreaTypeId.ToString()
                }).ToArray();
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                HttpContext.Session.SetString("errorMessage", ex.Message);
                return(RedirectToAction("Index"));
            }
        }
Exemple #3
0
        public ActionResult Edit([Bind("AreaId,Name,TypeId,Code")] ViewAreaFilter entity)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    ViewArea entityArea = new ViewArea();
                    entityArea.Deleted        = false;
                    entityArea.UserAccountId  = GetCurrentUser();
                    entityArea.DateLastUpdate = DateTime.Now;
                    entityArea.Code           = entity.Code;
                    entityArea.Name           = entity.Name;
                    entityArea.TypeId         = entity.TypeId;
                    entityArea.AreaId         = entity.AreaId;


                    bool result = JsonConvert.DeserializeObject <bool>(GenericRequest(true, "Area", "Save", entityArea));
                    return(RedirectToAction("Index"));
                }

                ViewBag.AreaType = GetAllAreaType().Select(x => new SelectListItem {
                    Text = x.Name, Value = x.AreaTypeId.ToString()
                }).ToArray();
                return(View(entity));
            }
            catch (Exception ex)
            {
                HttpContext.Session.SetString("errorMessage", ex.Message);
                return(RedirectToAction("Index"));
            }
        }
Exemple #4
0
 public Player(ServerHandle handle, int id, Router router)
 {
     this.handle = handle;
     this.id     = id;
     this.router = router;
     exists      = true;
     viewArea    = new ViewArea(0, 0, 1920 / 2 * handle.Settings.playerViewScaleMult, 1080 / 2 * handle.Settings.playerViewScaleMult, 1);
 }
Exemple #5
0
        public PartialViewResult Edit(int id)
        {
            HttpContext.Session.SetString("AreaBoolSearch", "true");
            ViewArea entity = GetById(id);

            ViewBag.AreaType = GetAllAreaType().Select(x => new SelectListItem {
                Text = x.Name, Value = x.AreaTypeId.ToString()
            }).ToArray();
            return(PartialView(entity));
        }
Exemple #6
0
        public void PostionIsInViewArea(int SourceX, int SourceY, int TargetX, int TargetY, bool EspectedResult)
        {
            ViewArea      TargetArea        = new ViewArea(SourceX, SourceY);
            FurrePosition TargetCoordinates = new FurrePosition(TargetX, TargetY);

            Assert.Multiple(() =>
            {
                Assert.That(TargetArea.InRange(TargetCoordinates),
                            Is.EqualTo(EspectedResult), $"TargetArea {TargetArea}");
            });
        }
    void Start()
    {
        rBody = GetComponent <Rigidbody> ();

        view = GetComponent <ViewArea>();
        view.Init();

        fieldOfView = GetComponent <FieldOfView>();

        shake = GetComponent <ShakeChild>();
    }
 /// <summary>
 /// ViewArea変更
 /// </summary>
 /// <param name="viewArea">表示するViewArea</param>
 private void ChangeVisibleViewArea(ViewArea viewArea)
 {
     foreach (var value in this.areaTable)
     {
         if (value.Key == viewArea)
         {
             continue;
         }
         value.Value.Visibility = Visibility.Collapsed;
     }
     this.areaTable[viewArea].Visibility = Visibility.Visible;
 }
Exemple #9
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         ViewArea entity = new ViewArea();
         entity.AreaId = id;
         bool result = JsonConvert.DeserializeObject <bool>(GenericRequest(true, "Area", "Remove", entity));
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         HttpContext.Session.SetString("errorMessage", ex.Message);
         return(RedirectToAction("Index"));
     }
 }
Exemple #10
0
 void Update()
 {
     view = GetComponent <ViewArea>();
     if (view.target != null)
     {
         agent.destination = view.target.transform.position;
         agent.speed       = 0.7f;
         gameObject.GetComponent <MeshRenderer>().materials[0].color = Color.red;
         if (waiting != null)
         {
             StopCoroutine(waiting);
             waiting = null;
         }
     }
     else if (agent.remainingDistance < 0.1f)
     {
         GotoNextPoint();
     }
 }
Exemple #11
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            if (!this.Capture)
            {
                StopDragging(false);
            }

            if (viewModel == null)
            {
                this.Cursor = Cursors.Default;
                return;
            }

            Metrics m = GetMetrics();

            if (dragPoint.HasValue)
            {
                var mousePt = this.PointToScreen(new System.Drawing.Point(dragPoint.Value.X, e.Y));

                if (dragForm == null)
                {
                    dragForm = new TimeLineDragForm(this);
                }

                ViewArea area = m.TopDrag.Contains(dragPoint.Value) ? ViewArea.TopDrag : ViewArea.BottomDrag;
                dragForm.Area = area;

                var rslt = viewModel.OnDragging(
                    area,
                    e.Y - dragPoint.Value.Y +
                    (area == ViewArea.TopDrag ? m.TimeLine.Top : m.TimeLine.Bottom)
                    );
                DateTime d = rslt.D;
                dragForm.Date = d;

                var pt1        = this.PointToScreen(new System.Drawing.Point());
                var pt2        = this.PointToScreen(new System.Drawing.Point(ClientSize.Width, 0));
                int formHeight = datesSize.Value + StaticMetrics.DragAreaHeight;
                dragForm.SetBounds(
                    pt1.X,
                    pt1.Y + rslt.Y +
                    (area == ViewArea.TopDrag ? -formHeight : 0),
                    pt2.X - pt1.X,
                    formHeight
                    );

                if (!dragForm.Visible)
                {
                    dragForm.Visible = true;
                    this.Focus();
                }
            }
            else
            {
                var cursor = viewModel.OnMouseMove(e.X, e.Y);

                if (cursor == CursorShape.SizeNS)
                {
                    this.Cursor = Cursors.SizeNS;
                }
                else if (cursor == CursorShape.Wait)
                {
                    this.Cursor = Cursors.WaitCursor;
                }
                else
                {
                    this.Cursor = Cursors.Arrow;
                }
            }
        }
Exemple #12
0
 private bool IsObjectInArea(Rectangle objectRectangle)
 {
     return(ViewArea.Intersects(objectRectangle));
 }
Exemple #13
0
 void Start()
 {
     viewArea = GetComponent <ViewArea>();
     viewArea.Init();
 }
Exemple #14
0
        public ViewArea GetById(int id)
        {
            ViewArea view = JsonConvert.DeserializeObject <ViewArea>(GenericRequest(true, "Area", "GetById", id));

            return(view);
        }