/// ------------------------------------------------------------------------------------ /// <summary> /// Add a column to the header/footer /// </summary> /// <param name="vwenv"></param> /// <param name="align"></param> /// <param name="flid"></param> /// ------------------------------------------------------------------------------------ private void AddColumn(IVwEnv vwenv, FwTextAlign align, PubHeader.PubHeaderTags flid) { vwenv.OpenTableCell(1, 1); if (HeaderFooterParaStyle != null && HeaderFooterParaStyle != string.Empty) { vwenv.set_StringProperty((int)FwTextPropType.ktptNamedStyle, HeaderFooterParaStyle); } vwenv.set_IntProperty((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)align); vwenv.OpenMappedPara(); vwenv.AddStringProp((int)flid, this); vwenv.CloseParagraph(); vwenv.CloseTableCell(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Copy the details from the given pub H/F set to this one. /// </summary> /// <param name="copyFrom">The set to clone</param> /// ------------------------------------------------------------------------------------ public void CloneDetails(IPubHFSet copyFrom) { Description.UnderlyingTsString = copyFrom.Description.UnderlyingTsString; Name = copyFrom.Name; // if the header and the footer were null (if they are missing in the database) // then create them if (DefaultHeaderOA == null) DefaultHeaderOA = new PubHeader(); if (DefaultFooterOA == null) DefaultFooterOA = new PubHeader(); DefaultHeaderOA.OutsideAlignedText.UnderlyingTsString = copyFrom.DefaultHeaderOA.OutsideAlignedText.UnderlyingTsString; DefaultHeaderOA.CenteredText.UnderlyingTsString = copyFrom.DefaultHeaderOA.CenteredText.UnderlyingTsString; DefaultHeaderOA.InsideAlignedText.UnderlyingTsString = copyFrom.DefaultHeaderOA.InsideAlignedText.UnderlyingTsString; DefaultFooterOA.OutsideAlignedText.UnderlyingTsString = copyFrom.DefaultFooterOA.OutsideAlignedText.UnderlyingTsString; DefaultFooterOA.CenteredText.UnderlyingTsString = copyFrom.DefaultFooterOA.CenteredText.UnderlyingTsString; DefaultFooterOA.InsideAlignedText.UnderlyingTsString = copyFrom.DefaultFooterOA.InsideAlignedText.UnderlyingTsString; PubDivision owningDiv = new PubDivision(Cache, OwnerHVO); if (owningDiv.DifferentFirstHF) { // if the header and the footer were null (if they are the same as the odd page) // then create them if (FirstHeaderOA == null) FirstHeaderOA = new PubHeader(); if (FirstFooterOA == null) FirstFooterOA = new PubHeader(); FirstHeaderOA.OutsideAlignedText.UnderlyingTsString = copyFrom.FirstHeaderOA.OutsideAlignedText.UnderlyingTsString; FirstHeaderOA.CenteredText.UnderlyingTsString = copyFrom.FirstHeaderOA.CenteredText.UnderlyingTsString; FirstHeaderOA.InsideAlignedText.UnderlyingTsString = copyFrom.FirstHeaderOA.InsideAlignedText.UnderlyingTsString; FirstFooterOA.OutsideAlignedText.UnderlyingTsString = copyFrom.FirstFooterOA.OutsideAlignedText.UnderlyingTsString; FirstFooterOA.CenteredText.UnderlyingTsString = copyFrom.FirstFooterOA.CenteredText.UnderlyingTsString; FirstFooterOA.InsideAlignedText.UnderlyingTsString = copyFrom.FirstFooterOA.InsideAlignedText.UnderlyingTsString; } else { FirstHeaderOA = null; FirstFooterOA = null; } if (owningDiv.DifferentEvenHF) { // if the header and the footer were null (if they are the same as the odd page) // then create them if (EvenHeaderOA == null) EvenHeaderOA = new PubHeader(); if (EvenFooterOA == null) EvenFooterOA = new PubHeader(); EvenHeaderOA.OutsideAlignedText.UnderlyingTsString = copyFrom.EvenHeaderOA.OutsideAlignedText.UnderlyingTsString; EvenHeaderOA.CenteredText.UnderlyingTsString = copyFrom.EvenHeaderOA.CenteredText.UnderlyingTsString; EvenHeaderOA.InsideAlignedText.UnderlyingTsString = copyFrom.EvenHeaderOA.InsideAlignedText.UnderlyingTsString; EvenFooterOA.OutsideAlignedText.UnderlyingTsString = copyFrom.EvenFooterOA.OutsideAlignedText.UnderlyingTsString; EvenFooterOA.CenteredText.UnderlyingTsString = copyFrom.EvenFooterOA.CenteredText.UnderlyingTsString; EvenFooterOA.InsideAlignedText.UnderlyingTsString = copyFrom.EvenFooterOA.InsideAlignedText.UnderlyingTsString; } else { EvenHeaderOA = null; EvenFooterOA = null; } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Copy the details from the given pub H/F set to this one. /// </summary> /// <param name="copyFrom">The set to clone</param> /// ------------------------------------------------------------------------------------ public void CloneDetails(IPubHFSet copyFrom) { Description.UnderlyingTsString = copyFrom.Description.UnderlyingTsString; Name = copyFrom.Name; // if the header and the footer were null (if they are missing in the database) // then create them if (DefaultHeaderOA == null) { DefaultHeaderOA = new PubHeader(); } if (DefaultFooterOA == null) { DefaultFooterOA = new PubHeader(); } DefaultHeaderOA.OutsideAlignedText.UnderlyingTsString = copyFrom.DefaultHeaderOA.OutsideAlignedText.UnderlyingTsString; DefaultHeaderOA.CenteredText.UnderlyingTsString = copyFrom.DefaultHeaderOA.CenteredText.UnderlyingTsString; DefaultHeaderOA.InsideAlignedText.UnderlyingTsString = copyFrom.DefaultHeaderOA.InsideAlignedText.UnderlyingTsString; DefaultFooterOA.OutsideAlignedText.UnderlyingTsString = copyFrom.DefaultFooterOA.OutsideAlignedText.UnderlyingTsString; DefaultFooterOA.CenteredText.UnderlyingTsString = copyFrom.DefaultFooterOA.CenteredText.UnderlyingTsString; DefaultFooterOA.InsideAlignedText.UnderlyingTsString = copyFrom.DefaultFooterOA.InsideAlignedText.UnderlyingTsString; PubDivision owningDiv = new PubDivision(Cache, OwnerHVO); if (owningDiv.DifferentFirstHF) { // if the header and the footer were null (if they are the same as the odd page) // then create them if (FirstHeaderOA == null) { FirstHeaderOA = new PubHeader(); } if (FirstFooterOA == null) { FirstFooterOA = new PubHeader(); } FirstHeaderOA.OutsideAlignedText.UnderlyingTsString = copyFrom.FirstHeaderOA.OutsideAlignedText.UnderlyingTsString; FirstHeaderOA.CenteredText.UnderlyingTsString = copyFrom.FirstHeaderOA.CenteredText.UnderlyingTsString; FirstHeaderOA.InsideAlignedText.UnderlyingTsString = copyFrom.FirstHeaderOA.InsideAlignedText.UnderlyingTsString; FirstFooterOA.OutsideAlignedText.UnderlyingTsString = copyFrom.FirstFooterOA.OutsideAlignedText.UnderlyingTsString; FirstFooterOA.CenteredText.UnderlyingTsString = copyFrom.FirstFooterOA.CenteredText.UnderlyingTsString; FirstFooterOA.InsideAlignedText.UnderlyingTsString = copyFrom.FirstFooterOA.InsideAlignedText.UnderlyingTsString; } else { FirstHeaderOA = null; FirstFooterOA = null; } if (owningDiv.DifferentEvenHF) { // if the header and the footer were null (if they are the same as the odd page) // then create them if (EvenHeaderOA == null) { EvenHeaderOA = new PubHeader(); } if (EvenFooterOA == null) { EvenFooterOA = new PubHeader(); } EvenHeaderOA.OutsideAlignedText.UnderlyingTsString = copyFrom.EvenHeaderOA.OutsideAlignedText.UnderlyingTsString; EvenHeaderOA.CenteredText.UnderlyingTsString = copyFrom.EvenHeaderOA.CenteredText.UnderlyingTsString; EvenHeaderOA.InsideAlignedText.UnderlyingTsString = copyFrom.EvenHeaderOA.InsideAlignedText.UnderlyingTsString; EvenFooterOA.OutsideAlignedText.UnderlyingTsString = copyFrom.EvenFooterOA.OutsideAlignedText.UnderlyingTsString; EvenFooterOA.CenteredText.UnderlyingTsString = copyFrom.EvenFooterOA.CenteredText.UnderlyingTsString; EvenFooterOA.InsideAlignedText.UnderlyingTsString = copyFrom.EvenFooterOA.InsideAlignedText.UnderlyingTsString; } else { EvenHeaderOA = null; EvenFooterOA = null; } }