コード例 #1
0
        public static ScreenItemModel Factory(ShowItemType ItemType, IScreenItem source)
        {
            var item  = ScreenItem.Factory(ItemType, source);
            var model = ScreenItemModel.Factory(item);

            return(model);
        }
コード例 #2
0
        public void ApplyItems(IScreenSection source)
        {
            this.Items = new ObservableCollection <IScreenItem>();
            var jj = from a in source.Items
                     select ScreenItemModel.Factory(a) as IScreenItem;

            this.LoadItems(jj);
        }
コード例 #3
0
        public ScreenDefnModel(
            string ScreenName, string NamespaceName, string ScreenGuid,
            IScreenDim ScreenDim, IEnumerable <IScreenItem> Items)
        {
            this.ScreenName    = ScreenName;
            this.NamespaceName = NamespaceName;
            this.ScreenGuid    = ScreenGuid;
            this.ScreenDim     = new ScreenDimModel(ScreenDim);

            // create the ObservableCollection of item models from the list of items of
            // the ScreenDefn.
            this.Items = new ObservableCollection <IScreenItem>();
            var jj = from a in Items
                     select ScreenItemModel.Factory(a) as IScreenItem;

            this.LoadItems(jj);
        }
コード例 #4
0
        public static ScreenItemModel Factory(IScreenItem source)
        {
            ScreenItemModel model = null;

            if (source is IScreenField)
            {
                model = new ScreenFieldModel(source);
            }
            else if (source is IScreenLiteral)
            {
                model = new ScreenLiteralModel(source);
            }
            else if (source is IScreenSection)
            {
                model = new ScreenSectionModel(source as IScreenSection);
            }
            return(model);
        }