object.MemberwiseClone()

Here are the examples of the csharp api object.MemberwiseClone() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1154 Examples 7

19 View Source File : IOEntry.cs
License : Apache License 2.0
Project Creator : aloneguid

public object Clone()
      {
         var clone = (IOEntry)MemberwiseClone();
         clone.Metadata = new Dictionary<string, string>(Metadata, StringComparer.OrdinalIgnoreCase);
         clone.Properties = new Dictionary<string, object>(Properties, StringComparer.OrdinalIgnoreCase);
         return clone;
      }

19 View Source File : TimelineImageNoticeModel.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : anoyetta

public TimelineImageNoticeModel Clone()
        {
            var clone = this.MemberwiseClone() as TimelineImageNoticeModel;

            clone.ClearToHide();

            return clone;
        }

19 View Source File : Client.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public Client Clone()
        {
            return MemberwiseClone() as Client;
        }

19 View Source File : Style.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

public Style Clone()
		{
			Style newStyle = (Style) this.MemberwiseClone();

			newStyle.nameFont = (Font) NameFont.Clone();
			newStyle.abstractNameFont = (Font) AbstractNameFont.Clone();
			newStyle.identifierFont = (Font) IdentifierFont.Clone();
			newStyle.memberFont = (Font) MemberFont.Clone();
			newStyle.staticMemberFont = (Font) StaticMemberFont.Clone();
			newStyle.abstractMemberFont = (Font) AbstractMemberFont.Clone();
			newStyle.commentFont = (Font) CommentFont.Clone();
			newStyle.relationshipTextFont = (Font) RelationshipTextFont.Clone();

			return newStyle;
		}

19 View Source File : BuildObject.cs
License : MIT License
Project Creator : alee12131415

public BuildObject Get() {
            return (BuildObject)MemberwiseClone();
        }

19 View Source File : IdentityResource.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public IdenreplacedyResource Clone()
        {
            return MemberwiseClone() as IdenreplacedyResource;
        }

19 View Source File : SpatialUnderstandingDllObjectPlacement.cs
License : MIT License
Project Creator : anderm

public object Clone()
            {
                return this.MemberwiseClone();
            }

19 View Source File : FsBufferedReaderWriter.cs
License : MIT License
Project Creator : Adoxio

public override object Clone()
		{
			// Lucene does input reader clone. So we need to handle it properly

			var copy = (FsBufferedReaderWriter)MemberwiseClone();
			copy.IsClone = true;

			copy.pageBuffer = new byte[this.PageSize];
			Array.Copy(this.pageBuffer, copy.pageBuffer, this.PageSize);

			return copy;
		}

19 View Source File : Ticker.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : anoyetta

public Ticker Clone() => (Ticker)this.MemberwiseClone();

19 View Source File : Context.cs
License : MIT License
Project Creator : AdrianWilczynski

public Context Clone() => (Context)MemberwiseClone();

19 View Source File : CloserSettings.cs
License : MIT License
Project Creator : AlexanderPro

public object Clone()
        {
            return this.MemberwiseClone();
        }

19 View Source File : EndNode.cs
License : MIT License
Project Creator : alee12131415

public EndNode Clone() {
            return (EndNode)MemberwiseClone();
        }

19 View Source File : RelyingParty.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public RelyingParty Clone()
        {
            return MemberwiseClone() as RelyingParty;
        }

19 View Source File : DnsRecordBase.cs
License : Apache License 2.0
Project Creator : alexreinert

internal T Clone<T>()
			where T : DnsRecordBase
		{
			return (T) MemberwiseClone();
		}

19 View Source File : ProfileAttributeBase.cs
License : MIT License
Project Creator : actions

public object Clone()
        {
            ProfileAttributeBase<T> newProfileAttribute = (ProfileAttributeBase<T>)MemberwiseClone();
            newProfileAttribute.Descriptor = Descriptor != null ? (AttributeDescriptor)Descriptor.Clone() : null;
            newProfileAttribute.Value = Value is ICloneable ? (T)((ICloneable)Value).Clone() : Value;
            return newProfileAttribute;
        }

19 View Source File : PresentationParameters.cs
License : MIT License
Project Creator : Aminator

public PresentationParameters Clone() => (PresentationParameters)MemberwiseClone();

19 View Source File : Role.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public new Role Clone()
        {
            return MemberwiseClone() as Role;
        }

19 View Source File : Settings.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : anoyetta

public Settings Clone() => (Settings)this.MemberwiseClone();

19 View Source File : EntityBase.cs
License : Apache License 2.0
Project Creator : aadreja

public virtual EnreplacedyBase ShallowCopy()
        {
            return (EnreplacedyBase)MemberwiseClone();
        }

19 View Source File : AdvancedNoticeConfig.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : anoyetta

public object Clone() => this.MemberwiseClone();

19 View Source File : Culture.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public Culture Clone()
        {
            return MemberwiseClone() as Culture;
        }

19 View Source File : User.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public User Clone()
        {
            return MemberwiseClone() as User;
        }

19 View Source File : HighlightingColor.cs
License : MIT License
Project Creator : Abdesol

public virtual HighlightingColor Clone()
		{
			HighlightingColor c = (HighlightingColor)MemberwiseClone();
			c.frozen = false;
			return c;
		}

19 View Source File : DialogNode.cs
License : MIT License
Project Creator : alee12131415

public DialogNode Clone() {
            return (DialogNode)MemberwiseClone();
        }

19 View Source File : ILASTExpression.cs
License : GNU General Public License v3.0
Project Creator : Aekras1a

public ILASTExpression Clone()
        {
            return (ILASTExpression) MemberwiseClone();
        }

19 View Source File : MenuItem.cs
License : MIT License
Project Creator : AlexanderPro

public object Clone()
        {
            var menuItemClone = (MenuItem)MemberwiseClone();
            menuItemClone.Items = new List<MenuItem>();
            foreach (var item in Items)
            {
                menuItemClone.Items.Add((MenuItem)item.Clone());
            }
            return menuItemClone;
        }

19 View Source File : StartNode.cs
License : MIT License
Project Creator : alee12131415

public StartNode Clone() {
            return (StartNode)MemberwiseClone();
        }

19 View Source File : ApiScope.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public ApiScope Clone()
        {
            return MemberwiseClone() as ApiScope;
        }

19 View Source File : BendPoint.cs
License : GNU General Public License v3.0
Project Creator : alexgracianoarj

public object Clone()
		{
			return this.MemberwiseClone();
		}

19 View Source File : Profile.cs
License : MIT License
Project Creator : actions

public object Clone()
        {
            Profile newProfile = MemberwiseClone() as Profile;

            // Since core attributes are cloned on read, we can get away with a shallow copy
            newProfile.CoreAttributes = CoreAttributes != null ? CoreAttributes.ToDictionary(x => x.Key, x => (CoreProfileAttribute) x.Value.Clone()) : null;
            newProfile.ApplicationContainer = ApplicationContainer != null ? (AttributesContainer)ApplicationContainer.Clone() : null;

            return newProfile;
        }

19 View Source File : Brush.cs
License : MIT License
Project Creator : alexismorin

public object Clone()
		{
			return MemberwiseClone();
		}

19 View Source File : Api.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public ProtectResource Clone()
        {
            var clone = MemberwiseClone() as ProtectResource;
            return clone;
        }

19 View Source File : BuildingPrototype.cs
License : MIT License
Project Creator : AliakseiFutryn

protected object DeepClone()
		{
			object itemClone = MemberwiseClone();
			if (itemClone != null)
			{
				using (MemoryStream stream = new MemoryStream())
				{
					BinaryFormatter formatter = new BinaryFormatter();
					formatter.Serialize(stream, itemClone);
					stream.Position = 0;
					return formatter.Deserialize(stream);
				}

			}
			return null;
		}

19 View Source File : MessageHeader.cs
License : MIT License
Project Creator : a1q123456

public object Clone()
        {
            return MemberwiseClone();
        }

19 View Source File : Setting.cs
License : MIT License
Project Creator : AmazingDM

public Setting Clone()
        {
            return (Setting) MemberwiseClone();
        }

19 View Source File : ExternalProvider.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public ExternalProvider Clone()
        {
            return MemberwiseClone() as ExternalProvider;
        }

19 View Source File : ValueObject.cs
License : MIT License
Project Creator : amolines

public ValueObject GetCopy()
        {
            return this.MemberwiseClone() as ValueObject;
        }

19 View Source File : AttributesContainer.cs
License : MIT License
Project Creator : actions

public object Clone()
        {
            AttributesContainer newContainer = (AttributesContainer)MemberwiseClone();

            // Deep copy of attributes dictionary
            newContainer.Attributes = Attributes != null ? Attributes.ToDictionary(x => x.Key, x => (ProfileAttribute)x.Value.Clone()) : null;

            return newContainer;
        }

19 View Source File : ValueObject.cs
License : MIT License
Project Creator : anjoy8

public virtual T Clone()
        {
            return (T)MemberwiseClone();
        }

19 View Source File : User.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public new User Clone()
        {
            return MemberwiseClone() as User;
        }

19 View Source File : TimelineStyle.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : anoyetta

public TimelineStyle Clone()
        {
            var clone = this.MemberwiseClone() as TimelineStyle;
            clone.Font = this.Font.Clone() as FontInfo;
            return clone;
        }

19 View Source File : QueryClause.cs
License : MIT License
Project Creator : 71

internal QueryClause Clone(QueryExpression query, int index)
        {
            QueryClause clone = this.MemberwiseClone() as QueryClause;

            clone.query = query;
            clone.index = index;

            return clone;
        }

19 View Source File : TimelineTriggerModel.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : anoyetta

public TimelineTriggerModel Clone()
        {
            var clone = this.MemberwiseClone() as TimelineTriggerModel;

            if (this.SyncMatch != null)
            {
                var b = new BinaryFormatter();

                using (var ms = new WrappingStream(new MemoryStream()))
                {
                    b.Serialize(ms, this.SyncMatch);
                    ms.Position = 0;
                    clone.SyncMatch = b.Deserialize(ms) as Match;
                }
            }

            clone.statements = new List<TimelineBase>();

            var statements = new List<TimelineBase>();
            foreach (var stat in this.statements)
            {
                var child = stat;

                switch (stat)
                {
                    case TimelineVisualNoticeModel v:
                        child = v.Clone();
                        break;

                    case TimelineImageNoticeModel i:
                        child = i.Clone();
                        break;
                }

                statements.Add(child);
            }

            clone.AddRange(statements);

            return clone;
        }

19 View Source File : Role.cs
License : Apache License 2.0
Project Creator : Aguafrommars

public Role Clone()
        {
            return MemberwiseClone() as Role;
        }

19 View Source File : SettingsModel.cs
License : MIT License
Project Creator : AdrianWilczynski

public SettingsModel Clone()
            => (SettingsModel)MemberwiseClone();

19 View Source File : IteratorStateMachine.cs
License : MIT License
Project Creator : 71

public IEnumerator<T> GetEnumerator()
        {
            IteratorStateMachine<T> ism = (IteratorStateMachine<T>)this.MemberwiseClone();
            ism.Reset();

            return ism;
        }

19 View Source File : Instruction.cs
License : GNU Lesser General Public License v3.0
Project Creator : 9and3

public override Grreplacedhopper.Kernel.Types.IGH_Goo Duplicate() {
            return (Grreplacedhopper.Kernel.Types.IGH_Goo)base.MemberwiseClone();
        }

19 View Source File : Carro.cs
License : MIT License
Project Creator : abrandaol-youtube

public Carro ShallowCopy()
        {
            return (Carro) this.MemberwiseClone();
        }

19 View Source File : guider.cs
License : MIT License
Project Creator : agalasso

public GuideStats Clone() { return (GuideStats) MemberwiseClone(); }

19 View Source File : ValueObject.cs
License : MIT License
Project Creator : AleksandreJavakhishvili

public ValueObject GetCopy()
        {
            return MemberwiseClone() as ValueObject;
        }

See More Examples