コード例 #1
0
        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);
        }
コード例 #2
0
 public static void Redraw(UiView caller)
 {
     if (caller != null && caller.IsViewDisplayed)
     {
         Current._shouldRedraw = true;
     }
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: amigin/my-secrets
        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);
            }
        }
コード例 #4
0
        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));
                }
            }
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: windygu/TwitchChecker
        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;
        }
コード例 #6
0
    public void InGameGUIButton_OnClick(UiView viewToActive)
    {
        viewToActive.ActiveView(() => ActiveInGameGUI(true));

        ActiveInGameGUI(false);
        GameControlller.Instance.IsPaused = true;

    }
コード例 #7
0
ファイル: UiTilesetView.cs プロジェクト: prepare/Sitana
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            DefinitionParser parser = new DefinitionParser(node);

            file["SelectionColor"] = parser.ParseColor("SelectionColor");
        }
コード例 #8
0
    private void Awake()
    {
        gerarGrid = GetComponent <GerarGrid>();
        uiView    = GetComponent <UiView>();

        prefabsList.Add(prefabArvare1);
        prefabsList.Add(prefabPedra1);
    }
コード例 #9
0
        public new static void Parse(XNode node, DefinitionFile file)
        {
            UiView.Parse(node, file);

            var parser = new DefinitionParser(node);

            file["Zoom"] = parser.ParseInt("Zoom");
        }
コード例 #10
0
ファイル: UiStack.cs プロジェクト: SunriseHirame/Athena
        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?
        }
コード例 #11
0
        private void NavigateForward()
        {
            var selectedPage = GetSelectedPage();

            if (selectedPage != null)
            {
                UiView.SetActiveWindow(PageContentWindow.MyId);
            }
        }
コード例 #12
0
 public ActionResult Return(UiView model)
 {
     if (Request.IsAjaxRequest())
     {
         return(PartialView("~/Views/base.cshtml", model));
     }
     else
     {
         return(View("~/Views/base.cshtml", model));
     }
 }
コード例 #13
0
        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);
            }
        }
コード例 #14
0
        internal void Unregister(string id, UiView view)
        {
            if (Find(id) == view)
            {
                _views.Remove(id);
            }

            if (RegisterElementsInParent && Parent != null)
            {
                Parent.Unregister(id, view);
            }
        }
コード例 #15
0
ファイル: UiService.cs プロジェクト: ahackel/Paint
    public void OpenView(UiView openView, object data = null)
    {
        foreach (var view in Views)
        {
            view.Close();
        }

        _openView = openView;
        if (_openView == null)
        {
            return;
        }
        _openView.Open(data);
    }
コード例 #16
0
ファイル: Program.cs プロジェクト: amigin/my-secrets
        private static async Task Resize()
        {
            while (true)
            {
                UiView.CheckResize();
                StateKeeper.CheckIfStateHasToBeSaved();

                if (UiNotifications.HasItemToShow())
                {
                    UiView.Render();
                }

                await Task.Delay(1000);
            }
        }
コード例 #17
0
        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);
        }
コード例 #18
0
 public void SetParentView(UiView parentView)
 {
     ParentView = parentView;
 }
コード例 #19
0
 internal void AttachView(UiView view)
 {
     View = view;
     OnViewAttached();
 }
コード例 #20
0
 private void NavigateBack()
 {
     UiView.SetActiveWindow(NoteBooksWindow.MyId);
 }
コード例 #21
0
 public void DestroyView_OnClick(UiView viewToDisable)
 {
     viewToDisable.DestroyView();
 }
コード例 #22
0
 public void ActiveView_OnClick(UiView viewToActive)
 {
     viewToActive.SetParentView(this);
     viewToActive.ActiveView();
     this.ActiveView(!CloseOnNewView);
 }
コード例 #23
0
        private void ActiveNotebookChanged()
        {
            var activeNotebook = NotebooksRepository.Get(SelectedIndex);

            UiView.FindWindow <PagesWindow>(PagesWindow.MyId)?.SetActiveNotebook(activeNotebook);
        }
コード例 #24
0
 public ActionResult Partial(UiView model) => PartialView("~/Views/base.cshtml", model);
コード例 #25
0
 public UpdateUiViewListener(UiView uiView)
 {
     _uiView = uiView;
 }
コード例 #26
0
        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;
            }
            }
        }
コード例 #27
0
        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;
        }
コード例 #28
0
        private void ActivePageChanged()
        {
            var pageContentWindow = UiView.FindWindow <PageContentWindow>(PageContentWindow.MyId);

            pageContentWindow?.SetActivePage(GetSelectedPage());
        }
コード例 #29
0
ファイル: UiViewSet.cs プロジェクト: zszqwe/anycmd
            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));
                }
            }
コード例 #30
0
 private void NavigateBack()
 {
     UiView.SetActiveWindow(PagesWindow.MyId);
 }
コード例 #31
0
 private void DisableView_OnClick(UiView viewToDisable)
 {
     viewToDisable.DisableView();
 }