public IList <UiView> GetAllUiViews() { var list = new List <UiView>(); foreach (DataRow row in this["UiView"].Rows) { var item = new UiView { Id = (Guid)row["Id"], Etag = (byte[])row["Etag"], Icon = row["Icon"] == DBNull.Value ? null : row["Icon"].ToString(), Tooltip = row["Tooltip"] == DBNull.Value ? null : row["Tooltip"].ToString() }; var entity = item as IEntityBase; entity.CreateBy = row["CreateBy"] == DBNull.Value ? null : row["CreateBy"].ToString(); entity.CreateOn = row["CreateOn"] == DBNull.Value ? null : (DateTime?)row["CreateOn"]; entity.CreateUserId = row["CreateUserId"] == DBNull.Value ? null : (Guid?)row["CreateUserId"]; entity.ModifiedBy = row["ModifiedBy"] == DBNull.Value ? null : row["ModifiedBy"].ToString(); entity.ModifiedOn = row["ModifiedOn"] == DBNull.Value ? null : (DateTime?)row["ModifiedOn"]; entity.ModifiedUserId = row["ModifiedUserId"] == DBNull.Value ? null : (Guid?)row["ModifiedUserId"]; list.Add(item); } return(list); }
public static void Redraw(UiView caller) { if (caller != null && caller.IsViewDisplayed) { Current._shouldRedraw = true; } }
static void Main(string[] args) { StateKeeper.LoadState(); var pageContent = new PageContentWindow(); pageContent.ShowWindow(); var pagesWindow = new PagesWindow(); pagesWindow.ShowWindow(); var noteBooksWindow = new NoteBooksWindow(); noteBooksWindow.ShowWindow(); Console.CancelKeyPress += OnExit; Task.Run(Resize); while (true) { UiView.Render(); var key = Console.ReadKey(false); UiView.KeyPressed(key); } }
public new static void Parse(XNode node, DefinitionFile file) { ButtonDrawable.Parse(node, file); var parser = new DefinitionParser(node); file["Reverse"] = parser.ParseBoolean("Reverse"); foreach (var cn in node.Nodes) { if (cn.Tag == "TransformGroup.TransitionEffect") { if (cn.Nodes.Count != 1) { string error = node.NodeError("TransformGroup.TransitionEffect must have exactly 1 child."); if (DefinitionParser.EnableCheckMode) { ConsoleEx.WriteLine(error); } else { throw new Exception(error); } } file["TransitionEffect"] = DefinitionFile.LoadFile(cn.Nodes[0]); } else if (cn.Tag == "TransformGroup.Drawables") { UiView.ParseDrawables(cn, file, typeof(ButtonDrawable)); } } }
public void SetView(UiView p_view) { if (m_currentView != p_view) { Control result; pnlMain.Controls.Clear(); switch (p_view) { case UiView.Following: result = followingCtrl; break; case UiView.Multicast: result = multicastCtrl; multicastCtrl.PopulateGrouboxTop(Controller.TwitchClient.ChannelList); break; case UiView.Settings: result = settingsCtrl; settingsCtrl.UsernameChanged = false; break; default: throw new ArgumentException(); } if (settingsCtrl.UsernameChanged) { followingCtrl.Reload(); } pnlMain.Controls.Add(result); } m_currentView = p_view; }
public void InGameGUIButton_OnClick(UiView viewToActive) { viewToActive.ActiveView(() => ActiveInGameGUI(true)); ActiveInGameGUI(false); GameControlller.Instance.IsPaused = true; }
public new static void Parse(XNode node, DefinitionFile file) { UiView.Parse(node, file); DefinitionParser parser = new DefinitionParser(node); file["SelectionColor"] = parser.ParseColor("SelectionColor"); }
private void Awake() { gerarGrid = GetComponent <GerarGrid>(); uiView = GetComponent <UiView>(); prefabsList.Add(prefabArvare1); prefabsList.Add(prefabPedra1); }
public new static void Parse(XNode node, DefinitionFile file) { UiView.Parse(node, file); var parser = new DefinitionParser(node); file["Zoom"] = parser.ParseInt("Zoom"); }
internal static void PushUi(UiView uiView) { // see if current ui has a transition animation? // Add a new ui uiStack.Add(uiView); // Play in transition animation? }
private void NavigateForward() { var selectedPage = GetSelectedPage(); if (selectedPage != null) { UiView.SetActiveWindow(PageContentWindow.MyId); } }
public ActionResult Return(UiView model) { if (Request.IsAjaxRequest()) { return(PartialView("~/Views/base.cshtml", model)); } else { return(View("~/Views/base.cshtml", model)); } }
internal void Register(string id, UiView view) { Debug.Assert(!_views.ContainsKey(id), "Cannot duplicate view ids!"); _views.Add(id, view); if (RegisterElementsInParent && Parent != null) { Parent.Register(id, view); } }
internal void Unregister(string id, UiView view) { if (Find(id) == view) { _views.Remove(id); } if (RegisterElementsInParent && Parent != null) { Parent.Unregister(id, view); } }
public void OpenView(UiView openView, object data = null) { foreach (var view in Views) { view.Close(); } _openView = openView; if (_openView == null) { return; } _openView.Open(data); }
private static async Task Resize() { while (true) { UiView.CheckResize(); StateKeeper.CheckIfStateHasToBeSaved(); if (UiNotifications.HasItemToShow()) { UiView.Render(); } await Task.Delay(1000); } }
public IList <UiView> GetAllUiViews() { var list = new List <UiView>(); foreach (DataRow row in this["UiView"].Rows) { var item = new UiView((Guid)row["Id"]) { ETag = (byte[])row["ETag"], Icon = row["Icon"] == DBNull.Value ? null : row["Icon"].ToString(), Tooltip = row["Tooltip"] == DBNull.Value ? null : row["Tooltip"].ToString() }; var entity = (IEntityBase)item; PopulateEntity(entity, row); list.Add(item); } return(list); }
public void SetParentView(UiView parentView) { ParentView = parentView; }
internal void AttachView(UiView view) { View = view; OnViewAttached(); }
private void NavigateBack() { UiView.SetActiveWindow(NoteBooksWindow.MyId); }
public void DestroyView_OnClick(UiView viewToDisable) { viewToDisable.DestroyView(); }
public void ActiveView_OnClick(UiView viewToActive) { viewToActive.SetParentView(this); viewToActive.ActiveView(); this.ActiveView(!CloseOnNewView); }
private void ActiveNotebookChanged() { var activeNotebook = NotebooksRepository.Get(SelectedIndex); UiView.FindWindow <PagesWindow>(PagesWindow.MyId)?.SetActiveNotebook(activeNotebook); }
public ActionResult Partial(UiView model) => PartialView("~/Views/base.cshtml", model);
public UpdateUiViewListener(UiView uiView) { _uiView = uiView; }
public void KeyPressed(ConsoleKeyInfo key) { if (!IsActive) { return; } switch (key.Key) { case ConsoleKey.F7: new EnterNameWindow { Header = "Enter notebook name" } .SubscribeOnEnter((ctx, value) => { NotebooksRepository.Add(value); ActiveNotebookChanged(); }) .ShowModalWindow(); return; case ConsoleKey.Enter: case ConsoleKey.Tab: var selectedNotebook = GetSelectedNotebook(); if (selectedNotebook != null) { UiView.SetActiveWindow(PagesWindow.MyId); } return; case ConsoleKey.F2: StateKeeper.StateHasToBeSynced(); return; case ConsoleKey.F4: new EnterNameWindow { Context = NotebooksRepository.Get(SelectedIndex), Header = "Edit notebook name", } .SetValue(NotebooksRepository.Get(SelectedIndex).Name) .SubscribeOnEnter((ctx, value) => { var noteBook = (Notebook)ctx; NotebooksRepository.Update(noteBook.Id, value); }) .ShowModalWindow(); return; case ConsoleKey.DownArrow: { if (SelectedIndex < NotebooksRepository.Count - 1) { SelectedIndex += 1; ActiveNotebookChanged(); } return; } case ConsoleKey.UpArrow: { if (SelectedIndex > 0) { SelectedIndex--; ActiveNotebookChanged(); } break; } } }
public IList<UiView> GetAllUiViews() { var list = new List<UiView>(); foreach (DataRow row in this["UiView"].Rows) { var item = new UiView { Id = (Guid)row["Id"], Etag = (byte[])row["Etag"], Icon = row["Icon"] == DBNull.Value ? null : row["Icon"].ToString(), Tooltip = row["Tooltip"] == DBNull.Value ? null : row["Tooltip"].ToString() }; var entity = item as IEntityBase; entity.CreateBy = row["CreateBy"] == DBNull.Value ? null : row["CreateBy"].ToString(); entity.CreateOn = row["CreateOn"] == DBNull.Value ? null : (DateTime?)row["CreateOn"]; entity.CreateUserId = row["CreateUserId"] == DBNull.Value ? null : (Guid?)row["CreateUserId"]; entity.ModifiedBy = row["ModifiedBy"] == DBNull.Value ? null : row["ModifiedBy"].ToString(); entity.ModifiedOn = row["ModifiedOn"] == DBNull.Value ? null : (DateTime?)row["ModifiedOn"]; entity.ModifiedUserId = row["ModifiedUserId"] == DBNull.Value ? null : (Guid?)row["ModifiedUserId"]; list.Add(item); } return list; }
private void ActivePageChanged() { var pageContentWindow = UiView.FindWindow <PageContentWindow>(PageContentWindow.MyId); pageContentWindow?.SetActivePage(GetSelectedPage()); }
private void Handle(IAcSession acSession, IUiViewCreateIo input, bool isCommand) { var acDomain = _set._acDomain; var viewDicByFunction = _set._viewDicByFunction; var viewDicById = _set._viewDicById; var viewRepository = acDomain.RetrieveRequiredService <IRepository <UiView> >(); if (!input.Id.HasValue) { throw new ValidationException("标识是必须的"); } UiView entity; lock (Locker) { FunctionState function; if (!acDomain.FunctionSet.TryGetFunction(input.Id.Value, out function)) { throw new ValidationException("意外的功能标识,界面视图首先是个功能。请先添加界面视图对应的功能记录。"); } UiViewState view; if (acDomain.UiViewSet.TryGetUiView(input.Id.Value, out view)) { throw new ValidationException("给定标识的界面视图已经存在"); } entity = UiView.Create(input); var state = UiViewState.Create(acDomain, entity); if (!viewDicById.ContainsKey(state.Id)) { viewDicById.Add(state.Id, state); } if (!viewDicByFunction.ContainsKey(function)) { viewDicByFunction.Add(function, state); } if (isCommand) { try { viewRepository.Add(entity); viewRepository.Context.Commit(); } catch { if (viewDicById.ContainsKey(entity.Id)) { viewDicById.Remove(entity.Id); } if (viewDicByFunction.ContainsKey(function)) { viewDicByFunction.Remove(function); } viewRepository.Context.Rollback(); throw; } } } if (isCommand) { acDomain.MessageDispatcher.DispatchMessage(new UiViewAddedEvent(acSession, entity, input, isPrivate: true)); } }
private void NavigateBack() { UiView.SetActiveWindow(PagesWindow.MyId); }
private void DisableView_OnClick(UiView viewToDisable) { viewToDisable.DisableView(); }