/// <summary> /// This method helps in the cloning process by allowing each /// class in the hierarchy to clone their own member variables. /// The class being cloned will create a new instance of itself, /// and then call the cloneHelper in its super-class to get any /// member variables of its super classes to be copied. /// </summary> /// <param name="g">the instance of the cloned object</param> protected void cloneHelper(UnionGroupNode g) { base.cloneHelper(g); // none of these objects should be defined yet System.Diagnostics.Debug.Assert(_unionState == null); // shallow copy these g._readonly = _readonly; }
/* * Member Methods */ public override object Clone() { // instantiate cloned object UnionGroupNode obj = new UnionGroupNode(); // call the cloneHelper cloneHelper(obj); // return object return(obj); }