예제 #1
0
        public Item(Item src)
        {
            this.Id             = src.Id;
            this.Name           = src.Name;
            this.NormalizedName = src.NormalizedName;
            this.Description    = src.Description;

            this.OkCmd     = CommandFactory.AcceptLinkCmd(this);
            this.CancelCmd = new Command((arg) =>
            {
                this.Parent.Navi.PopModalAsync();
            });

            this.LinkOpCmd   = StoreFactory.HalProxy.NewLinkCmd(this, StoreFactory.CurrentVM);
            this.DeleteMeCmd = CommandFactory.GetDelInputLineCmd(StoreFactory.CurrentVM, this);
        }
예제 #2
0
        public Item() : base()
        {
            this.Id        = StoreFactory.NewId();
            this.OkCmd     = CommandFactory.AcceptLinkCmd(this);
            this.CancelCmd = new Command((arg) =>
            {
                this.Parent.Navi.PopModalAsync();
            });

            this.DeleteCmd = new Command(() =>
            {
                (this.Parent as CommonBaseVM).DisableLine(this);
            });

            this.LinkOpCmd   = StoreFactory.HalProxy.NewLinkCmd(this, StoreFactory.CurrentVM);
            this.DeleteMeCmd = CommandFactory.GetDelInputLineCmd(StoreFactory.CurrentVM, this);
            this.IsAutoOk    = StoreFactory.Settings.IsAutoOk;
        }
예제 #3
0
        public Item GetItem(string expr, bool initLink = false)
        {
            var ret = this.Items.FirstOrDefault(x => Search(expr, x));

            if (ret == null)
            {
                if (initLink)
                {
                    ret = new Item()
                    {
                        Name           = expr,
                        NormalizedName = expr,
                        LinkId         = StoreFactory.GetSectionIndexForName(expr, string.Empty),
                        Parent         = StoreFactory.CurrentVM
                    };
                }
                else
                {
                    ret = new Item()
                    {
                        Name           = expr,
                        NormalizedName = expr,
                        Parent         = StoreFactory.CurrentVM
                    };
                }

                ret.LinkOpCmd   = StoreFactory.HalProxy.NewLinkCmd(ret, StoreFactory.CurrentVM);
                ret.DeleteMeCmd = CommandFactory.GetDelInputLineCmd(StoreFactory.CurrentVM, ret);
                ret.OkCmd       = CommandFactory.AcceptLinkCmd(ret);

                this.Items.Add(ret);
            }
            else if (initLink)
            {
                ret.LinkId = StoreFactory.GetSectionIndexForName(expr, ret.Link != null ? ret.Link.Name : string.Empty);
            }

            return(ret);
        }