Пример #1
0
        /// <summary>
        /// Returns a clone of the current object
        /// </summary>
        /// <returns></returns>
//		public override object Clone()
//		{
//			XmlConfigurationOption clone = null;
//			XmlConfigurationElement element = (XmlConfigurationElement)base.Clone();
//			if (element != null)
//			{
//				clone = new XmlConfigurationOption(element);
//				clone.ResetBeforeEdit();
//				clone.ResetChanged();
//				clone.ResetAfterEdit();
//				clone.ResetEditCancelled();
//				clone.Value = this.Value;
//				clone.ValueAssemblyQualifiedName = this.ValueAssemblyQualifiedName;
////				clone.ReferencedAssemblyName = this.ReferencedAssemblyName;
//				clone.EditorAssemblyQualifiedName = this.EditorAssemblyQualifiedName;
//			}
//			return clone;
//		}

        public override object Clone()
        {
            object clone = CloningEngine.Clone(this, CloningEngine.DefaultBindingFlags);

            if (clone != null)
            {
                ((XmlConfigurationOption)clone).ResetBeforeEdit();
                ((XmlConfigurationOption)clone).ResetChanged();
                ((XmlConfigurationOption)clone).ResetAfterEdit();
                ((XmlConfigurationOption)clone).ResetEditCancelled();
                return(clone);
            }
            return(null);
        }
Пример #2
0
//		public virtual object Clone()
//		{
//			XmlConfigurationElement clone = new XmlConfigurationElement();
//
//			clone.ElementName = _elementName;
//			clone.Description = _description;
//			clone.Category = _category;
//			clone.DisplayName = _displayName;
//			clone.Hidden = _hidden;
//			clone.Readonly = _readonly;
//			clone.Persistent = _persistent;
////			clone.Fullpath = _fullpath;
//			clone.AcceptChanges();
//
//			return clone;
//		}

        public virtual object Clone()
        {
            object clone = CloningEngine.Clone(this, CloningEngine.DefaultBindingFlags);

            return(clone);
        }