Example #1
0
        //this is for preview
        private void CreateAllObjs(IDocument document)
        {
            Debug.WriteLine("----->Preview----->Enter Create VM AllObjs() ---");

            IPage CurrentPage = document.Pages.GetPage(_pageGID);

            if (CurrentPage == null)
            {
                return;
            }

            if (_currentItems != null)
            {
                _currentItems.Clear();
            }
            _currentItems = new List <WidgetPreViewModeBase>();
            List <IRegion> objs = GetAllObjects(CurrentPage);

            foreach (IRegion wdg in objs)
            {
                WidgetPreViewModeBase preItem = ReadOnlyWidgetFactory.CreateWidget(wdg, true);
                if (preItem == null)
                {
                    continue;
                }
                _currentItems.Add(preItem);
            }
            Debug.WriteLine("----->Preview----->Exit Create VM AllObjs() ---");
        }
Example #2
0
        private void CreateInnerImageObjs(IPage ChildPage, IDocument document)
        {
            if (ChildPage == null)
            {
                return;
            }

            //initialize  the style property with base-adaptive
            Guid      BaseViewID = document.AdaptiveViewSet.Base.Guid;
            IPageView pageView   = ChildPage.PageViews.GetPageView(BaseViewID);

            if (_currentItems != null)
            {
                _currentItems.Clear();
            }
            else
            {
                _currentItems = new List <WidgetPreViewModeBase>();
            }

            if (document.GeneratorConfigurationSet.DefaultHtmlConfiguration.ExportType == ExportType.ImageFile)
            {
                List <IRegion> objs = GetAllObjects(ChildPage);
                foreach (IRegion wdg in objs)
                {
                    if (wdg is IShape || wdg is ILine)
                    {
                        WidgetPreViewModeBase preItem = ReadOnlyWidgetFactory.CreateWidget(wdg, true);
                        if (preItem == null)
                        {
                            continue;
                        }

                        preItem.ChangeCurrentPageView(pageView);
                        preItem.IsHiddenInvalid = true;
                        _currentItems.Add(preItem);
                    }
                }
            }
            else
            {
                List <IRegion> objs = GetAllObjects(ChildPage);
                foreach (IRegion wdg in objs)
                {
                    if (wdg is ILine)
                    {
                        WidgetPreViewModeBase preItem = ReadOnlyWidgetFactory.CreateWidget(wdg, true);
                        if (preItem == null)
                        {
                            continue;
                        }

                        preItem.ChangeCurrentPageView(pageView);
                        preItem.IsHiddenInvalid = true;
                        _currentItems.Add(preItem);
                    }
                }
            }
            Debug.WriteLine("--- Exit CreateImageObjs() ---");
        }
Example #3
0
        public void LoadAllChildrenWidgets()
        {
            if (_items == null)
            {
                _items = new ObservableCollection <WidgetPreViewModeBase>();
            }
            _items.Clear();

            _master.MasterPage.Open();
            IPageView view = _master.MasterPage.PageViews.GetPageView(StyleGID);

            if (view == null)
            {
                return;
            }

            foreach (IWidget wdg in _master.MasterPage.Widgets)
            {
                WidgetPreViewModeBase preItem = ReadOnlyWidgetFactory.CreateWidget(wdg, _IsNail);
                preItem.ChangeCurrentPageView(view);
                if (preItem == null)
                {
                    continue;
                }
                _items.Add(preItem);
            }
        }
Example #4
0
        public void LoadAllChildrenWidgets(bool bIsNail)
        {
            if (items == null)
            {
                items = new ObservableCollection <WidgetPreViewModeBase>();
            }
            items.Clear();

            if (!_page.IsOpened)
            {
                _page.Open();
            }

            IPageView view = _page.PageViews.GetPageView(_styleGuid);

            if (view == null)
            {
                _page.Close();
                return;
            }
            foreach (IWidget wdg in _page.Widgets)
            {
                WidgetPreViewModeBase preItem = ReadOnlyWidgetFactory.CreateWidget(wdg, bIsNail);
                preItem.ChangeCurrentPageView(view);
                if (preItem == null)
                {
                    continue;
                }
                items.Add(preItem);
            }
            //_page.Close();
        }
        public void LoadAllChildrenWidgets()
        {
            if (_items == null)
            {
                _items = new ObservableCollection <WidgetPreViewModeBase>();
            }
            _items.Clear();

            _hamburgerVM.Widget.MenuPage.Open();

            Guid      viewID = _pageEditorViewModel.CurAdaptiveViewGID;
            IPageView view   = _hamburgerVM.Widget.MenuPage.PageViews.GetPageView(viewID);

            if (view == null)
            {
                return;
            }

            foreach (IWidget wdg in _hamburgerVM.Widget.MenuPage.Widgets)
            {
                WidgetPreViewModeBase preItem = ReadOnlyWidgetFactory.CreateWidget(wdg, false);
                if (preItem == null)
                {
                    continue;
                }
                preItem.ChangeCurrentPageView(view);
                _items.Add(preItem);
            }
        }