Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public String set_Mtype(String t)
        {
            if (t == "none")
            {
                mtype = Mtype.none; return("true");
            }
            if (t == "m_b1")
            {
                mtype = Mtype.滑鼠側鍵; return("true");
            }
            if (t == "m_l")
            {
                mtype = Mtype.滑鼠左鍵; return("true");
            }
            if (t == "m_mm")
            {
                mtype = Mtype.滑鼠中鍵; return("true");
            }
            if (t == "m_r")
            {
                mtype = Mtype.滑鼠右鍵; return("true");
            }
            if (t == "m_r_2")
            {
                mtype = Mtype.滑鼠右鍵_2; return("true");
            }

            return("false");
        }
Example #2
0
 /// <summary>
 /// Create a circularize manuever at time t around centerBody.
 /// </summary>
 /// <param name="nbody"></param>
 /// <param name="time"></param>
 /// <param name="centerBody"></param>
 public Maneuver(NBody nbody, float time, NBody centerBody)
 {
     this.nbody      = nbody;
     this.centerBody = centerBody;
     mtype           = Mtype.circularize;
     worldTime       = time;
 }
Example #3
0
        public APIReturn _Add([FromForm] int?Parent_id, [FromForm] string Name)
        {
            MtypeInfo item = new MtypeInfo();

            item.Parent_id = Parent_id;
            item.Name      = Name;
            item           = Mtype.Insert(item);
            return(APIReturn.成功.SetData("item", item.ToBson()));
        }
Example #4
0
        /// <summary>
        /// 模擬點擊滑鼠右鍵。開啟右鍵選單
        /// </summary>
        private void RightClick()
        {
            var mt = mtype;

            mtype = Mtype.none;
            NativeMethods.RightDown();
            NativeMethods.RightUp();
            Thread.Sleep(1);
            mtype = mt;
        }
Example #5
0
        public ActionResult Edit([FromQuery] int Id)
        {
            MtypeInfo item = Mtype.GetItem(Id);

            if (item == null)
            {
                return(APIReturn.记录不存在_或者没有权限);
            }
            ViewBag.item = item;
            return(View());
        }
Example #6
0
        public APIReturn _Del([FromForm] int[] ids)
        {
            int affrows = 0;

            foreach (int id in ids)
            {
                affrows += Mtype.Delete(id);
            }
            if (affrows > 0)
            {
                return(APIReturn.成功.SetMessage($"删除成功,影响行数:{affrows}"));
            }
            return(APIReturn.失败);
        }
Example #7
0
        public APIReturn _Edit([FromQuery] int Id, [FromForm] int?Parent_id, [FromForm] string Name)
        {
            MtypeInfo item = Mtype.GetItem(Id);

            if (item == null)
            {
                return(APIReturn.记录不存在_或者没有权限);
            }
            item.Parent_id = Parent_id;
            item.Name      = Name;
            int affrows = Mtype.Update(item);

            if (affrows > 0)
            {
                return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}"));
            }
            return(APIReturn.失败);
        }