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
19
Source : IteratorStateMachine.cs
with MIT License
from 71
with MIT License
from 71
public IEnumerator<T> GetEnumerator()
{
IteratorStateMachine<T> ism = (IteratorStateMachine<T>)this.MemberwiseClone();
ism.Reset();
return ism;
}
19
Source : QueryClause.cs
with MIT License
from 71
with MIT License
from 71
internal QueryClause Clone(QueryExpression query, int index)
{
QueryClause clone = this.MemberwiseClone() as QueryClause;
clone.query = query;
clone.index = index;
return clone;
}
19
Source : Instruction.cs
with GNU Lesser General Public License v3.0
from 9and3
with GNU Lesser General Public License v3.0
from 9and3
public override Grreplacedhopper.Kernel.Types.IGH_Goo Duplicate() {
return (Grreplacedhopper.Kernel.Types.IGH_Goo)base.MemberwiseClone();
}
19
Source : MessageHeader.cs
with MIT License
from a1q123456
with MIT License
from a1q123456
public object Clone()
{
return MemberwiseClone();
}
19
Source : EntityBase.cs
with Apache License 2.0
from aadreja
with Apache License 2.0
from aadreja
public virtual EnreplacedyBase ShallowCopy()
{
return (EnreplacedyBase)MemberwiseClone();
}
19
Source : HighlightingColor.cs
with MIT License
from Abdesol
with MIT License
from Abdesol
public virtual HighlightingColor Clone()
{
HighlightingColor c = (HighlightingColor)MemberwiseClone();
c.frozen = false;
return c;
}
19
Source : Carro.cs
with MIT License
from abrandaol-youtube
with MIT License
from abrandaol-youtube
public Carro ShallowCopy()
{
return (Carro) this.MemberwiseClone();
}
19
Source : Profile.cs
with MIT License
from actions
with MIT License
from 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
Source : ProfileAttributeBase.cs
with MIT License
from actions
with MIT License
from 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
Source : AttributesContainer.cs
with MIT License
from actions
with MIT License
from 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
Source : FsBufferedReaderWriter.cs
with MIT License
from Adoxio
with MIT License
from 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
Source : SettingsModel.cs
with MIT License
from AdrianWilczynski
with MIT License
from AdrianWilczynski
public SettingsModel Clone()
=> (SettingsModel)MemberwiseClone();
19
Source : Context.cs
with MIT License
from AdrianWilczynski
with MIT License
from AdrianWilczynski
public Context Clone() => (Context)MemberwiseClone();
19
Source : ILASTExpression.cs
with GNU General Public License v3.0
from Aekras1a
with GNU General Public License v3.0
from Aekras1a
public ILASTExpression Clone()
{
return (ILASTExpression) MemberwiseClone();
}
19
Source : guider.cs
with MIT License
from agalasso
with MIT License
from agalasso
public GuideStats Clone() { return (GuideStats) MemberwiseClone(); }
19
Source : ApiScope.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public ApiScope Clone()
{
return MemberwiseClone() as ApiScope;
}
19
Source : RelyingParty.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public RelyingParty Clone()
{
return MemberwiseClone() as RelyingParty;
}
19
Source : Api.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public ProtectResource Clone()
{
var clone = MemberwiseClone() as ProtectResource;
return clone;
}
19
Source : IdentityResource.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public IdenreplacedyResource Clone()
{
return MemberwiseClone() as IdenreplacedyResource;
}
19
Source : ExternalProvider.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public ExternalProvider Clone()
{
return MemberwiseClone() as ExternalProvider;
}
19
Source : Role.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public new Role Clone()
{
return MemberwiseClone() as Role;
}
19
Source : User.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public new User Clone()
{
return MemberwiseClone() as User;
}
19
Source : Client.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public Client Clone()
{
return MemberwiseClone() as Client;
}
19
Source : Role.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public Role Clone()
{
return MemberwiseClone() as Role;
}
19
Source : Culture.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public Culture Clone()
{
return MemberwiseClone() as Culture;
}
19
Source : User.cs
with Apache License 2.0
from Aguafrommars
with Apache License 2.0
from Aguafrommars
public User Clone()
{
return MemberwiseClone() as User;
}
19
Source : BuildObject.cs
with MIT License
from alee12131415
with MIT License
from alee12131415
public BuildObject Get() {
return (BuildObject)MemberwiseClone();
}
19
Source : DialogNode.cs
with MIT License
from alee12131415
with MIT License
from alee12131415
public DialogNode Clone() {
return (DialogNode)MemberwiseClone();
}
19
Source : EndNode.cs
with MIT License
from alee12131415
with MIT License
from alee12131415
public EndNode Clone() {
return (EndNode)MemberwiseClone();
}
19
Source : StartNode.cs
with MIT License
from alee12131415
with MIT License
from alee12131415
public StartNode Clone() {
return (StartNode)MemberwiseClone();
}
19
Source : ValueObject.cs
with MIT License
from AleksandreJavakhishvili
with MIT License
from AleksandreJavakhishvili
public ValueObject GetCopy()
{
return MemberwiseClone() as ValueObject;
}
19
Source : MenuItem.cs
with MIT License
from AlexanderPro
with MIT License
from 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
Source : CloserSettings.cs
with MIT License
from AlexanderPro
with MIT License
from AlexanderPro
public object Clone()
{
return this.MemberwiseClone();
}
19
Source : BendPoint.cs
with GNU General Public License v3.0
from alexgracianoarj
with GNU General Public License v3.0
from alexgracianoarj
public object Clone()
{
return this.MemberwiseClone();
}
19
Source : Style.cs
with GNU General Public License v3.0
from alexgracianoarj
with GNU General Public License v3.0
from 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
Source : Brush.cs
with MIT License
from alexismorin
with MIT License
from alexismorin
public object Clone()
{
return MemberwiseClone();
}
19
Source : DnsRecordBase.cs
with Apache License 2.0
from alexreinert
with Apache License 2.0
from alexreinert
internal T Clone<T>()
where T : DnsRecordBase
{
return (T) MemberwiseClone();
}
19
Source : BuildingPrototype.cs
with MIT License
from AliakseiFutryn
with MIT License
from 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
Source : IOEntry.cs
with Apache License 2.0
from aloneguid
with Apache License 2.0
from 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
Source : Setting.cs
with MIT License
from AmazingDM
with MIT License
from AmazingDM
public Setting Clone()
{
return (Setting) MemberwiseClone();
}
19
Source : PresentationParameters.cs
with MIT License
from Aminator
with MIT License
from Aminator
public PresentationParameters Clone() => (PresentationParameters)MemberwiseClone();
19
Source : ValueObject.cs
with MIT License
from amolines
with MIT License
from amolines
public ValueObject GetCopy()
{
return this.MemberwiseClone() as ValueObject;
}
19
Source : SpatialUnderstandingDllObjectPlacement.cs
with MIT License
from anderm
with MIT License
from anderm
public object Clone()
{
return this.MemberwiseClone();
}
19
Source : ValueObject.cs
with MIT License
from anjoy8
with MIT License
from anjoy8
public virtual T Clone()
{
return (T)MemberwiseClone();
}
19
Source : Settings.cs
with BSD 3-Clause "New" or "Revised" License
from anoyetta
with BSD 3-Clause "New" or "Revised" License
from anoyetta
public Settings Clone() => (Settings)this.MemberwiseClone();
19
Source : TimelineStyle.cs
with BSD 3-Clause "New" or "Revised" License
from anoyetta
with BSD 3-Clause "New" or "Revised" License
from anoyetta
public TimelineStyle Clone()
{
var clone = this.MemberwiseClone() as TimelineStyle;
clone.Font = this.Font.Clone() as FontInfo;
return clone;
}
19
Source : TimelineImageNoticeModel.cs
with BSD 3-Clause "New" or "Revised" License
from anoyetta
with BSD 3-Clause "New" or "Revised" License
from anoyetta
public TimelineImageNoticeModel Clone()
{
var clone = this.MemberwiseClone() as TimelineImageNoticeModel;
clone.ClearToHide();
return clone;
}
19
Source : TimelineTriggerModel.cs
with BSD 3-Clause "New" or "Revised" License
from anoyetta
with BSD 3-Clause "New" or "Revised" License
from 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
Source : AdvancedNoticeConfig.cs
with BSD 3-Clause "New" or "Revised" License
from anoyetta
with BSD 3-Clause "New" or "Revised" License
from anoyetta
public object Clone() => this.MemberwiseClone();
19
Source : Ticker.cs
with BSD 3-Clause "New" or "Revised" License
from anoyetta
with BSD 3-Clause "New" or "Revised" License
from anoyetta
public Ticker Clone() => (Ticker)this.MemberwiseClone();
See More Examples