internal MasterStyle AddMasterStyle(AdaptiveView view) { MasterStyle style = new MasterStyle(this, view.Guid); _masterStyles.Add(style.ViewGuid, style); return(style); }
public void ChangeParent(IAdaptiveView view, IAdaptiveView newParent) { if (view == _base) { throw new ArgumentException("Cannot change parent of Base adaptive view!"); } AdaptiveView viewToChange = view as AdaptiveView; AdaptiveView newParentView = newParent as AdaptiveView; if (viewToChange == null) { throw new ArgumentNullException("view"); } if (newParentView == null) { throw new ArgumentNullException("newParent"); } // Remove view from old parent AdaptiveView oldParentView = viewToChange.ParentView as AdaptiveView; if (oldParentView != null && oldParentView != newParentView) { oldParentView.RemoveChildView(viewToChange); } newParentView.AddChildView(viewToChange); _document.OnChangeAdaptiveViewParent(viewToChange, oldParentView); }
public void DeleteAdaptiveView(IAdaptiveView view) { if (view == _base) { throw new ArgumentException("Cannot delete Base adaptive view!"); } AdaptiveView viewToDelete = view as AdaptiveView; if (viewToDelete != null) { AdaptiveView parent = viewToDelete.ParentView as AdaptiveView; if (parent != null) { // Remove this view from parent parent.RemoveChildView(viewToDelete); // Add child view to new parent foreach (AdaptiveView childView in viewToDelete.ChildViews) { if (childView != null) { parent.AddChildView(childView); } } } // Remove this view from views _views.Remove(viewToDelete); _document.OnDeleteAdaptiveView(viewToDelete); } }
internal void DeleteWidgetStyle(AdaptiveView view) { if (view != null) { DeleteWidgetStyle(view.Guid); } }
internal WidgetStyle AddWidgetStyle(AdaptiveView view) { WidgetStyle style = new WidgetStyle(this, view.Guid); _widgetStyles.Add(style.ViewGuid, style); return(style); }
internal AdaptiveViewSet(Document document) : base("AdaptiveViewSet") { _document = document; _affectAllViews = false; _base = new AdaptiveView(this, "Base"); _views = new AdaptiveViews(this); }
internal void OnChangeAdaptiveViewParent(AdaptiveView view, AdaptiveView oldParentView) { foreach (Page page in _allPages.Values) { if (page != null && page.IsOpened) { page.OnChangeAdaptiveViewParent(view, oldParentView); } } }
internal void OnDeleteAdaptiveView(AdaptiveView view) { foreach (Page page in _allPages.Values) { if (page != null && page.IsOpened) { page.OnDeleteAdaptiveView(view); } } }
internal void RemoveChildView(AdaptiveView view) { if (view != null) { _childViewGuidList.Remove(view.Guid); if (_childViews != null) { _childViews.Remove(view); } } }
internal override void OnAddAdaptiveView(AdaptiveView view) { base.OnAddAdaptiveView(view); foreach (EmbeddedPage page in EmbeddedPages) { if (page != null && page.IsOpened) { page.OnAddAdaptiveView(view); } } }
public IAdaptiveView CreateAdaptiveView(string name, IAdaptiveView parent) { AdaptiveView parentView = parent as AdaptiveView; if (parentView == null) { throw new ArgumentNullException("parent"); } AdaptiveView view = new AdaptiveView(this, name); parentView.AddChildView(view); _views.Add(view); _document.OnAddAdaptiveView(view); return(view); }
internal void AddChildView(AdaptiveView view) { if (view != null) { /* * AdpativeView object only can be created via IApdativeViewSet and * the new created object is already in AdaptiveViewSet, so we don't need * keeping the input object, we just keep the guid and can get the object * from set with this guid when we need the object. * */ _childViewGuidList.Add(view.Guid); view.ParentView = this; if (_childViews != null) { _childViews.Add(view); } } }
public bool MoveAdaptiveViewTo(IAdaptiveView view, int index) { if (view == _base) { throw new ArgumentException("Cannot move base adaptive view!"); } AdaptiveView viewToMove = view as AdaptiveView; AdaptiveView parentView = viewToMove.ParentView as AdaptiveView; if (parentView != null) { AdaptiveViews views = parentView.ChildViews as AdaptiveViews; if (views != null) { return(views.MoveItemTo(viewToMove, index)); } } return(false); }
internal override void OnAddAdaptiveView(AdaptiveView view) { base.OnAddAdaptiveView(view); _button.OnAddAdaptiveView(view); }
internal void OnAddAdaptiveView(AdaptiveView view) { AddMasterStyle(view); }
internal virtual void OnAddAdaptiveView(AdaptiveView view) { AddWidgetStyle(view); }