public JsMasterStyle(IMaster master, IMasterStyle masterStyle, IPageView pageView, bool bIsSetMD5, Guid AdaptiviewID) { _master = master; _masterStyle = masterStyle; _pageView = pageView; IsSetMD5 = bIsSetMD5; _childPageView = _master.MasterPage.PageViews[AdaptiviewID]; }
public override string ToString() { //this is just for debug test, delete it later if (_master.ParentPage is IDocumentPage) { // System.Diagnostics.Debug.WriteLine("====Master md5:" + _master.MD5 + " ==========================="); } StringBuilder builder = new StringBuilder(); builder.Append("{"); builder.AppendFormat("\"id\":\"{0}\",", _master.Guid.ToString()); if (IsSetMD5 == true) { builder.AppendFormat("\"MD5\":\"{0}\",", _master.MD5); } builder.AppendFormat("\"masterPageID\":\"{0}\",", _master.MasterPageGuid.ToString()); if (_master.ParentGroup != null) { builder.AppendFormat("\"parentGroupID\":\"{0}\",", _master.ParentGroup.Guid.ToString()); } builder.Append("\"style\":"); IPageView basePageView = _master.ParentPage.PageViews[_master.ParentDocument.AdaptiveViewSet.Base.Guid]; JsMasterStyle masterStyle = new JsMasterStyle(_master, _master.MasterStyle, basePageView, IsSetMD5, _master.ParentDocument.AdaptiveViewSet.Base.Guid); builder.Append(masterStyle.ToString()); builder.Append(","); builder.Append("\"adaptiveViewStyles\":["); foreach (IAdaptiveView view in _master.ParentDocument.AdaptiveViewSet.AdaptiveViews) { IMasterStyle masterViewStyle = _master.GetMasterStyle(view.Guid); IPageView pageView = _master.ParentPage.PageViews[view.Guid]; if (masterViewStyle != null && pageView != null) { masterStyle = new JsMasterStyle(_master, masterViewStyle, pageView, IsSetMD5, view.Guid); builder.Append(masterStyle.ToString()); builder.Append(","); } } JsHelper.RemoveLastComma(builder); builder.Append("]"); builder.Append("}"); return(builder.ToString()); }
public static string GetHash(IMasterStyle style, bool bIsPlaced, bool bIsSetTarget = false) { if (style == null) { return(string.Empty); } SerialMasterStyle target = new SerialMasterStyle(style, bIsPlaced); string md5 = CreaetMD5Hash(target, bIsSetTarget); if (bIsSetTarget == true) { style.MD5 = md5; } return(md5); }
virtual public bool ChangeCurrentStyle(Guid newStyleGid) { if (newStyleGid == Guid.Empty) { _style = _master.MasterStyle; } else { _style = _master.GetMasterStyle(newStyleGid); if (_style == null) { _style = _master.MasterStyle; } } return(true); }
public void refresh(IMasterStyle style, bool bIsPlaced) { _style = style; IsPlaced = bIsPlaced; refresh(); }
public SerialMasterStyle(IMasterStyle style, bool bIsPlaced) { _style = style; IsPlaced = bIsPlaced; refresh(); }