////////////////////////// public void clone(ClassBorders obds) { this.AlwaysInFront = obds.AlwaysInFront; this.Count = obds.Count; this.Creator = obds.Creator; this.DistanceFrom = obds.DistanceFrom; this.DistanceFromBottom = obds.DistanceFromBottom; this.DistanceFromLeft = obds.DistanceFromLeft; this.DistanceFromRight = obds.DistanceFromRight; this.DistanceFromTop = obds.DistanceFromTop; this.Enable = obds.Enable; this.EnableFirstPageInSection = obds.EnableFirstPageInSection; this.EnableOtherPagesInSection = obds.EnableOtherPagesInSection; this.HasHorizontal = obds.HasHorizontal; this.HasVertical = obds.HasVertical; this.InsideColor = obds.InsideColor; this.InsideColorIndex = obds.InsideColorIndex; this.InsideLineStyle = obds.InsideLineStyle; this.InsideLineWidth = obds.InsideLineWidth; this.JoinBorders = obds.JoinBorders; this.OutsideColor = obds.OutsideColor; this.OutsideColorIndex = obds.OutsideColorIndex; this.OutsideLineStyle = obds.OutsideLineStyle; this.OutsideLineWidth = obds.OutsideLineWidth; this.Shadow = obds.Shadow; this.SurroundFooter = obds.SurroundFooter; this.SurroundHeader = obds.SurroundHeader; this.m_hashBorder.Clear(); ClassBorder bd = null; for (int i = (int)WdBorderType.wdBorderVertical; i <= (int)WdBorderType.wdBorderTop; i++) { bd = (ClassBorder)obds[(WdBorderType)i]; if (bd != null) { ClassBorder classBd = new ClassBorder(); classBd.clone(bd); m_hashBorder[i] = classBd; } } return; }
// 复制Word.Borders的对象到本类 public void clone(Word.Borders obds) { this.AlwaysInFront = obds.AlwaysInFront; // 进行赋值 this.Count = obds.Count; // 进行赋值 this.Creator = obds.Creator; // 进行赋值 try { this.DistanceFrom = obds.DistanceFrom; // 进行赋值 this.DistanceFromBottom = obds.DistanceFromBottom; // 进行赋值 this.DistanceFromLeft = obds.DistanceFromLeft; // 进行赋值 this.DistanceFromRight = obds.DistanceFromRight; // 进行赋值 this.DistanceFromTop = obds.DistanceFromTop; // 进行赋值 } catch (System.Exception ex) { } finally { } this.Enable = obds.Enable; // 进行赋值 this.EnableFirstPageInSection = obds.EnableFirstPageInSection; // 进行赋值 this.EnableOtherPagesInSection = obds.EnableOtherPagesInSection; // 进行赋值 this.HasHorizontal = obds.HasHorizontal; // 进行赋值 this.HasVertical = obds.HasVertical; // 进行赋值 this.InsideColor = obds.InsideColor; // 进行赋值 this.InsideColorIndex = obds.InsideColorIndex; // 进行赋值 this.InsideLineStyle = obds.InsideLineStyle; // 进行赋值 this.InsideLineWidth = obds.InsideLineWidth; // 进行赋值 this.JoinBorders = obds.JoinBorders; // 进行赋值 this.OutsideColor = obds.OutsideColor; // 进行赋值 this.OutsideColorIndex = obds.OutsideColorIndex; // 进行赋值 this.OutsideLineStyle = obds.OutsideLineStyle; // 进行赋值 this.OutsideLineWidth = obds.OutsideLineWidth; // 进行赋值 this.Shadow = obds.Shadow; // 进行赋值 this.SurroundFooter = obds.SurroundFooter; // 进行赋值 this.SurroundHeader = obds.SurroundHeader; // 进行赋值 this.m_hashBorder.Clear(); Border bd = null; // 将Border的各成员进行赋值 for (int i = (int)WdBorderType.wdBorderVertical; i <= (int)WdBorderType.wdBorderTop; i++) { try { bd = (Border)obds[(WdBorderType)i]; } catch (System.Exception ex) { continue; } if (bd != null) { ClassBorder classBd = new ClassBorder(); classBd.clone(bd); m_hashBorder[i] = classBd; } } return; }