public void Show() { indexDataBot = 0; indexDataTop = indexDataBot; indexCellBot = 0; indexCellTop = 0; foreach (var cell in lstCell) { ViewLevel viewLevel = lstCell[indexCellTop].GetComponent <ViewLevel>(); viewLevel.Init(indexDataTop); viewLevel.Show(); indexCellTop++; indexDataTop = LogicIndexData(indexDataTop, true); } indexCellTop--; indexDataTop = LogicIndexData(indexDataTop, false); ; //MoveToLevel(); //if(scrollauto != null) { // scrollauto.Kill(); //} //scrollauto = DOVirtual.DelayedCall(0.2f, () => { scrollauto = scrollRect.DOVerticalNormalizedPos(normalizedPosition + 0.0001f, 0.01f); }); }
public ActionResult Days(int SiteCode = -1, int YYYY = -1, int MM = -1, int DD = -1) { DateTime currDate; try { currDate = new DateTime(YYYY, MM, DD); } catch { currDate = DateTime.Now; } ViewBag.currDate = currDate; Hydro.HydroServiceClient theHydro = new Hydro.HydroServiceClient(); ViewLevel theView = new ViewLevel(); const int TYPE_AGK = 6; theView.theSiteList = ViewSite.GetAll(TYPE_AGK); theView.SelectedSiteCode = SiteCode; if (theView.SelectedSiteCode == -1) { theView.SelectedSiteCode = theView.theSiteList[0].Code; } return(View(theView)); }
public virtual void Attach(ViewLevel viewLevel, UView beAttchedView) { UIMgr = beAttchedView?.UIMgr; ParentView?.SubViews.Remove(this); if (viewLevel == ViewLevel.Root) { ParentView = beAttchedView; RootView = beAttchedView; ViewLevel = ViewLevel.Main; RectTrans.SetParent(RootView?.CanvasTrans); UIMgr.AddToMainViews(this); UIMgr.AddToGroupViews(this); } else if (viewLevel == ViewLevel.Main) { ParentView = beAttchedView; RootView = beAttchedView.RootView; ViewLevel = ViewLevel.Sub; RectTrans.SetParent(RootView?.CanvasTrans); UIMgr.AddToGroupViews(this); //移动到父节点下面 Trans.SetSiblingIndex(ParentView.Trans.GetSiblingIndex() + ParentView.SubViews.Count + 1); } else { CLog.Error("无法挂载到:" + viewLevel); } ParentView.SubViews.Add(this); }
public ActionResult DeleteConfirmed(int id) { ViewLevel viewlevel = db.ViewLevels.Include(x => x.Groups).SingleOrDefault(x => x.ID == id); if (viewlevel == null) { return(HttpNotFound()); } db.Contents.Include(x => x.Access) .Where(x => x.Access != null && x.Access.ID == id).ToList() .ForEach(x => x.Access = null); db.Categories.Include(x => x.Access) .Where(x => x.Access != null && x.Access.ID == id).ToList() .ForEach(x => x.Access = null); db.Menus.Include(x => x.Access) .Where(x => x.Access != null && x.Access.ID == id).ToList() .ForEach(x => x.Access = null); db.ViewLevels.Remove(viewlevel); db.SaveChanges(); return(RedirectToAction("Index")); }
public sealed override void Attach(ViewLevel viewLevel, UView beAttchedView) { base.Attach(viewLevel, beAttchedView); if (ParentView != null) { Trans.SetParent(ParentView.Trans); } Trans.localPosition = sourceLocalPos; }
public void SetViewLevel(ViewLevel level) { if (currentLevel != level) { currentLevel = level; uiElements.ForEach(x => x.Display(currentLevel)); } }
public ViewLevel PostLevel([FromBody] Level level) { if (!ModelState.IsValid) { throw new Exception("No valido"); } db.Level.Add(level); db.SaveChanges(); ViewLevel viewLevel = level; return(viewLevel); }
//testing #region TestData private static HtmlRole GetSampleRole(string htmlName, ViewLevel vl = ViewLevel.Edit) { HtmlRole role1 = new HtmlRole { RoleId = ModuleConstant.roleAdmin, ModuleId = ModuleConstant.MaklumatKakiTangan, HtmlName = htmlName, IsView = true, IsAdd = false, IsEdit = false, IsDelete = false }; switch (vl) { case (ViewLevel.NoAccess): role1.IsView = false; role1.IsAdd = false; role1.IsEdit = false; role1.IsDelete = false; break; case (ViewLevel.View): role1.IsView = true; role1.IsAdd = false; role1.IsEdit = false; role1.IsDelete = false; break; case (ViewLevel.Add): role1.IsView = true; role1.IsAdd = true; role1.IsEdit = false; role1.IsDelete = false; break; case (ViewLevel.Edit): role1.IsView = true; role1.IsAdd = false; role1.IsEdit = true; role1.IsDelete = false; break; case (ViewLevel.Delete): role1.IsView = true; role1.IsAdd = false; role1.IsEdit = false; role1.IsDelete = true; break; } return(role1); }
public static List<Connector> GetStructureConnectors(DBVersion version, String connectionString, ViewLevel viewLevel, List<Process> processes) { switch (viewLevel) { case ViewLevel.Activity: return GetActivityConnectors(connectionString, processes, version); case ViewLevel.SubProcess: return GetSubProcessConnectors(connectionString, processes, version); } return null; }
public IActionResult Getlevel(int id = 0) { var model = new ViewLevel(); if (id > 0) { model = _viewLevel.FindById(id); } return(Json(model)); }
public static List<Node> GetStructureNodes(DBVersion version, String connectionString, ViewLevel viewLevel, List<Process> processes, bool getInstances = false) { switch (viewLevel) { case ViewLevel.Activity: return GetActivityNodes(connectionString, processes, version, getInstances); case ViewLevel.SubProcess: return GetTaskNodes(connectionString, processes, version, getInstances); } return null; }
public ActionResult Details(int?id) { if (id == null) { return(BadRequest()); } ViewLevel viewlevel = db.ViewLevels.Find(id); if (viewlevel == null) { return(HttpNotFound()); } viewlevel.Groups = db.Groups.Where(x => x.Access.FirstOrDefault(y => y.ID == viewlevel.ID) != null).ToList(); return(View(viewlevel)); }
public ActionResult Edit(int?id) { if (id == null) { return(BadRequest()); } ViewLevel viewlevel = db.ViewLevels.Find(id); if (viewlevel == null) { return(HttpNotFound()); } viewlevel.Groups = db.Groups.Include(x => x.Access).Where(x => x.Access.FirstOrDefault(y => y.ID == viewlevel.ID) != null).ToList(); return(View(new ViewLevelViewModel().Initialize(FillWithChildren(db.Groups.Where(x => x.Parent == null).ToList()), viewlevel))); }
public ViewLevel AssignTheSelectedGroupsToTheViewLevelAndReturnIt(ViewLevel vl, List <SelectableGroup> sg) { foreach (var g in sg) { if (g.Selected) { if (vl.Groups.SingleOrDefault(x => x.ID == g.ID) == null) { vl.Groups.Add(db.Groups.SingleOrDefault(y => y.ID == g.ID)); } } else { if (vl.Groups.SingleOrDefault(x => x.ID == g.ID) != null) { vl.Groups.Remove(db.Groups.SingleOrDefault(y => y.ID == g.ID)); } } } return(vl); }
public async Task <IActionResult> AddAsync(ViewLevelwithImage ViewLevelwithImage) { int Subjectid = 0; if (ModelState.IsValid) { ViewLevel model = new ViewLevel { Contentid = ViewLevelwithImage.Contentid, LevelContent = ViewLevelwithImage.LevelContent, Levelid = ViewLevelwithImage.Levelid }; if (ViewLevelwithImage.LevelidName != null) { model.LevelidName = ViewLevelwithImage.LevelidName; } if (string.IsNullOrEmpty(ViewLevelwithImage.LevelContent)) { model.LevelContent = "Empty"; } if (ViewLevelwithImage.LevelImage != null) { using (var memoryStream = new MemoryStream()) { await ViewLevelwithImage.LevelImage.CopyToAsync(memoryStream); model.LevelImage = memoryStream.ToArray(); } } _viewLevel.Add(model); _viewLevel.Save(); Subjectid = _content.FindById((int)model.Contentid).Subjectid; } return(RedirectToAction("contentlist", "content", new { id = Subjectid })); }
public void EnqueueMessage(string message, LogLevel level, OpType operationType, Exception ex = null, ViewLevel viewLevel = ViewLevel.Admin, string toObjct = "", string fromMethod = "") { if ((level == LogLevel.Debug && _log.IsDebugEnabled) || (level == LogLevel.Error && _log.IsErrorEnabled) || (level == LogLevel.Fatal && _log.IsFatalEnabled) || (level == LogLevel.Info && _log.IsInfoEnabled) || (level == LogLevel.Warn && _log.IsWarnEnabled)) //|| (level == LogLevel.Printer && _printerLog.IsErrorEnabled) //|| (level == LogLevel.Pay && _PayLog.IsInfoEnabled)) { var ip = Net.Net.Ip; //var ip = "112.253.8.147"; _que.Enqueue(new LogMessage { //Message = GetContent(message, ex).ToString(), Message = message, Level = level, Exception = ex, UserIP = ip, UserName = OperatorProvider.Provider.GetCurrent().UserCode, CurrentUrl = HttpContext.Current?.Request.Url.ToString(), PrevUrl = (HttpContext.Current?.Request.UrlReferrer != null ? HttpContext.Current?.Request.UrlReferrer.AbsoluteUri : string.Empty), IPCity = Tool.GetIpLocation(ip), OperationType = (int)operationType, ToObjct = toObjct, ViewLevel = (int)viewLevel, FromMethod = fromMethod }); // 通知线程往磁盘中写日志 _mre.Set(); } }
/// <summary>Returns a standard view associated with the current action and passes a view model</summary> /// <param name="standardView">Standard view supported by all themes</param> /// <param name="model">The model that is to be passed to the view</param> /// <param name="level">The level the view desires to be</param> /// <param name="forceNewShell">Indicates whether it is desired to launch this view in a new shell (may or may not be respected by each theme)</param> /// <returns>A view result</returns> /// <example> /// public ActionResult ShowDetails() /// { /// var model = new MyModel(); /// return Document(StandardViews.Block, model, ViewLevel.Popup); /// } /// </example> protected virtual ViewResult View(StandardViews standardView, object model = null, ViewLevel level = ViewLevel.Normal, bool forceNewShell = false) { var viewName = "CODEFrameworkStandardView" + standardView; return View(viewName, model, level, forceNewShell); }
// Update is called once per frame void Update() { if (m_ViewLevel == ViewLevel.Far) { if (Input.GetAxis("Mouse ScrollWheel") > 0 || ToucheUpdate() == 1) { CloseTweener(); var finalPos = sum_position / 2; #if UNITY_EDITOR finalPos = Input.mousePosition; #endif Vector3 mousePos = Camera.main.ScreenToWorldPoint(new Vector3(finalPos.x, finalPos.y, Camera.main.WorldToScreenPoint(m_BigMapMeshRender.transform.position).z)); Vector3 mouseNor = (mousePos - transform.position).normalized; //float angle = Vector3.Angle(transform.forward, mouseNor); //angle = angle > 90 ? 180 - angle : angle; //float dis = m_Dis / Mathf.Cos((angle * Mathf.Deg2Rad)); //Vector3 target = transform.position + mouseNor * dis; Vector3 target = GetIntersectWithLineAndPlane(transform.position, mouseNor, Vector3.up, new Vector3(0, (transform.position + transform.forward * m_Dis).y, 0)); if (target.x > m_SmallMaX) { target = new Vector3(m_SmallMaX, target.y, target.z); } if (target.x < m_SmallMinX) { target = new Vector3(m_SmallMinX, target.y, target.z); } if (target.z > m_SmallMaxZ) { target = new Vector3(target.x, target.y, m_SmallMaxZ); } if (target.z < m_SmallMinZ) { target = new Vector3(target.x, target.y, m_SmallMinZ); } m_CameraTween = Camera.main.transform.DOMove(target, 0.5f); m_ValueTween = DOTween.To(() => m_ChangeValue, x => m_ChangeValue = x, 1, 0.5f); DoNearFarTween(false); m_ViewLevel = ViewLevel.Near; } } else if (m_ViewLevel == ViewLevel.Near) { if (Input.GetAxis("Mouse ScrollWheel") < 0 || ToucheUpdate() == -1) { CloseTweener(); Vector3 targetPos = transform.position - transform.forward * m_Dis; if (targetPos.x > m_BigMaxX) { targetPos = new Vector3(m_BigMaxX, targetPos.y, targetPos.z); } if (targetPos.x < m_BigMinX) { targetPos = new Vector3(m_BigMinX, targetPos.y, targetPos.z); } if (targetPos.z > m_BigMaxZ) { targetPos = new Vector3(targetPos.x, targetPos.y, m_BigMaxZ); } if (targetPos.z < m_BigMinZ) { targetPos = new Vector3(targetPos.x, targetPos.y, m_BigMinZ); } m_CameraTween = Camera.main.transform.DOMove(targetPos, 0.5f); m_ValueTween = DOTween.To(() => m_ChangeValue, x => m_ChangeValue = x, 0, 0.5f); DoNearFarTween(true); m_ViewLevel = ViewLevel.Far; } } m_BigMapMeshRender.material.SetFloat("_ThreValue", m_ChangeValue); }
/// <summary> /// Returns a modal default view associated with the current action and passes a view model /// </summary> /// <param name="model">The model that is to be passed to the view</param> /// <param name="level">The level the view desires to be</param> /// <param name="scope">The scope of the view (global or local/child).</param> /// <returns>A view result</returns> /// <example> /// public ActionResult ShowDetails() /// { /// var model = new MyModel(); /// return ViewModal(model, ViewLevel.Popup); /// } /// </example> protected virtual ViewResult ViewModal(object model = null, ViewLevel level = ViewLevel.Normal, ViewScope scope = ViewScope.Global) { var result = View(model, level); result.IsModal = true; result.ViewScope = scope; return result; }
public abstract void Display(ViewLevel level);
public override void Display(ViewLevel level) { GetComponent <Renderer>().enabled = level == ViewLevel.SystemCenter; }
// 将界面挂到其他界面下 public sealed override void Attach(ViewLevel viewLevel, UView beAttchedView) { base.Attach(viewLevel, beAttchedView); ResetSourcePosData(); }
/// <summary> /// Returns a named view associated with the current action and passes a view model /// </summary> /// <param name="viewName">The name of the view that is to be returned</param> /// <param name="model">The model that is to be passed to the view</param> /// <param name="level">The level the view desires to be</param> /// <param name="forceNewShell">Indicates whether it is desired to launch this view in a new shell (may or may not be respected by each theme)</param> /// <returns>A view result</returns> /// <exception cref="CODE.Framework.Wpf.Mvvm.ViewNotFoundException"></exception> /// <example> /// public ActionResult ShowDetails() /// { /// var model = new MyModel(); /// return Document("SomeView", model, ViewLevel.Popup); /// } /// </example> protected virtual ViewResult View(string viewName, object model = null, ViewLevel level = ViewLevel.Normal, bool forceNewShell = false) { var result = new ViewResult {Model = model, ForceNewShell = forceNewShell}; var locationsSearchedUnsuccessfully = new List<string>(); if (!FindView(viewName, level, result, locationsSearchedUnsuccessfully)) { var sb = new StringBuilder(); foreach (var location in locationsSearchedUnsuccessfully) sb.AppendLine(location); throw new ViewNotFoundException(sb.ToString()); } return result; }
public ActionResult Months(int SiteCode = -1, int YYYY = -1, int MM = -1, int DD = 1) { DateTime currDate; try { currDate = new DateTime(YYYY, MM, DD); } catch { currDate = DateTime.Now; } ViewBag.currDate = currDate; Hydro.HydroServiceClient theHydro = new Hydro.HydroServiceClient(); ViewLevel theView = new ViewLevel(); const int TYPE_AGK = 6; theView.theSiteList = ViewSite.GetAll(TYPE_AGK); theView.SelectedSiteCode = SiteCode; if (theView.SelectedSiteCode == -1) { theView.SelectedSiteCode = theView.theSiteList[0].Code; } int SiteID = theView.theSiteList.Where(x => x.Code == theView.SelectedSiteCode).Single().ID; DateTime dateBgn = new DateTime(currDate.Year, currDate.Month, 1); DateTime dateEnd = new DateTime(currDate.Year, currDate.Month, DateTime.DaysInMonth(currDate.Year, currDate.Month)); const int LEVEL_CODE = 2; var ValueCollection = theHydro.GetDataValues(SiteID, dateBgn, dateEnd, LEVEL_CODE, null, null, null); if (ValueCollection == null) { return(View(theView)); } foreach (var item in ValueCollection) { if (item.Value > -9000) { ViewLevel.Level theLevel = new ViewLevel.Level(); theLevel.Value = item.Value; theLevel.YYYY = item.Date.Year; theLevel.MM = item.Date.Month; theLevel.DD = item.Date.Day; theLevel.HH = item.Date.Hour; theLevel.MI = 0; theLevel.SS = 0; theLevel.ID = item.Id; theView.theLevelList.Add(theLevel); } } const int HydroPostType = 2; var HydroPost = theHydro.GetSite(theView.SelectedSiteCode.ToString(), HydroPostType); var HydroPostValueCollection = theHydro.GetDataValues(HydroPost.SiteId, dateBgn, dateEnd, LEVEL_CODE, null, null, null); if (HydroPostValueCollection == null) { return(View(theView)); } foreach (var item in HydroPostValueCollection) { if (item.Value > -9000) { ViewLevel.Level theLevel = new ViewLevel.Level(); theLevel.Value = item.Value; theLevel.YYYY = item.Date.Year; theLevel.MM = item.Date.Month; theLevel.DD = item.Date.Day; theLevel.HH = item.Date.Hour; theLevel.MI = 0; theLevel.SS = 0; theLevel.ID = item.Id; theView.theHydroPostLevelList.Add(theLevel); } } return(View(theView)); }
public override void Display(ViewLevel level) { GetComponent <Renderer>().enabled = level == ViewLevel.Planetary; }
public override void Display(ViewLevel level) { GetComponent <Renderer>().enabled = level == ViewLevel.Orbiting; }
/// <summary>Attempts to find the view using all currently registered view engines.</summary> /// <param name="viewName">Name of the view to be found</param> /// <param name="level">Display level of the view (such as top-level)</param> /// <param name="result">The view result object.</param> /// <param name="locationsSearchedUnsuccessfully">A list of locations the engines searched unsuccessfully (can be used by callers to display error messages and the like)</param> /// <returns>Success indicator (false if no view was found)</returns> private bool FindView(string viewName, ViewLevel level, ViewResult result, List<string> locationsSearchedUnsuccessfully = null) { var foundView = false; var controllerName = GetType().Name.ToLower(); if (controllerName.ToLower().EndsWith("controller")) controllerName = controllerName.Substring(0, controllerName.Length - 10); foreach (var engine in RegisteredViewEngines) { var viewResult = engine.GetView(viewName, controllerName); if (viewResult.FoundView) { result.View = viewResult.View; result.ViewSource = viewResult.ViewSource; result.ViewTitle = SimpleView.GetTitle(viewResult.View); result.ViewIconResourceKey = SimpleView.GetIconResourceKey(viewResult.View); result.View.DataContext = result.Model; var haveViewInformation = result.Model as IHaveViewInformation; if (haveViewInformation != null) haveViewInformation.AssociatedView = result.View; result.ViewLevel = level; foundView = true; break; } if (locationsSearchedUnsuccessfully != null) locationsSearchedUnsuccessfully.AddRange(viewResult.LocationsSearched); } return foundView; }
/// <summary> /// Returns the default view associated with the current action and passes a view model /// </summary> /// <param name="model">The model that is to be passed to the view</param> /// <param name="level">The level the view desires to be</param> /// <param name="forceNewShell">Indicates whether it is desired to launch this view in a new shell (may or may not be respected by each theme)</param> /// <returns>A view result</returns> /// <example> /// public ActionResult ShowDetails() /// { /// var model = new MyModel(); /// return Document(model, ViewLevel.StandAlone); /// } /// </example> protected virtual ViewResult View(object model, ViewLevel level, bool forceNewShell = false) { var viewName = "Index"; if (RequestContext.RouteData.Data.ContainsKey("action")) viewName = RequestContext.RouteData.Data["action"].ToString(); return View(viewName, model, level, forceNewShell); }
public override void Display(ViewLevel level) { lr.enabled = level == ViewLevel.Orbiting; }
/// <summary> /// Warn级别 /// </summary> /// <param name="msg">记录信息</param> /// <param name="ex">异常信息</param> /// <param name="opType">操作类型</param> /// <param name="fromMethod">来自哪个方法</param> /// <param name="toObjct">发送给谁</param> /// <param name="viewLevel">查看等级</param> public static void Warn(string msg, OpType opType, Exception ex = null , string fromMethod = "", string toObjct = "", ViewLevel viewLevel = ViewLevel.Admin) { Instance().EnqueueMessage(msg, LogLevel.Warn, opType, ex, viewLevel, toObjct, fromMethod); }
public WorkStatus GetLastStatus(string customerShortName, string projectShortName, Guid workId, ViewLevel viewLevel = ViewLevel.All, int maxMessages = 10) { var method = $"getWorkStatus?customerShortName={customerShortName}&projectShortName={projectShortName}&workId={workId}&viewLevel={viewLevel}&max_messages={maxMessages}"; var response = _analyticsEngineClient.Client.GetAsync(method).Result; _validation.ValidateResponse(response); return(JsonConvert.DeserializeObject <WorkStatus>(response.Content.ReadAsStringAsync().Result)); }