C# Enum MemberwiseClone
In this chapter you will learn:
- Get to know Enum.MemberwiseClone
- Syntax for Enum.MemberwiseClone
- Returns for Enum.MemberwiseClone
- Example - Enum.MemberwiseClone
Description
Enum MemberwiseClone
creates a shallow copy of the current
Object.
Syntax
Enum.MemberwiseClone
has the following syntax.
protected Object MemberwiseClone()
Returns
Enum.MemberwiseClone
method returns A shallow copy of the current Object.
Example
/* w ww.j av a 2 s . c o m*/
using System;
[Flags] public enum Pets {
None = 0, Dog = 1, Cat = 2, Bird = 4,
Rodent = 8, Other = 16 };
public class Example
{
public static void Main()
{
Pets value = Pets.Dog | Pets.Cat;
value = value.MemberwiseClone();
}
}
Next chapter...
What you will learn in the next chapter:
- Get to know Enum.Parse(Type, String)
- Syntax for Enum.Parse(Type, String)
- Parameter for Enum.Parse(Type, String)
- Returns for Enum.Parse(Type, String)
- Example - Enum.Parse(Type, String)
C# Enum Enum
C# Enum CompareTo
C# Enum Equals
C# Enum Finalize
C# Enum Format
C# Enum GetHashCode
C# Enum GetName
C# Enum GetNames
C# Enum GetType
C# Enum GetTypeCode
C# Enum GetUnderlyingType
C# Enum GetValues
C# Enum HasFlag
C# Enum IsDefined
C# Enum Parse(Type, String, Boolean)
C# Enum ToObject(Type, Byte)
C# Enum ToObject(Type, Int16)
C# Enum ToObject(Type, Int32)
C# Enum ToObject(Type, Int64)
C# Enum ToObject(Type, Object)
C# Enum ToObject(Type, SByte)
C# Enum ToObject(Type, UInt16)
C# Enum ToObject(Type, UInt32)
C# Enum ToObject(Type, UInt64)
C# Enum ToString()
C# Enum ToString(IFormatProvider)
C# Enum ToString(String)
C# Enum ToString(String, IFormatProvider)
C# Enum TryParse(String, TEnum)
C# Enum TryParse(String, Boolean, TE...
C# Enum CompareTo
C# Enum Equals
C# Enum Finalize
C# Enum Format
C# Enum GetHashCode
C# Enum GetName
C# Enum GetNames
C# Enum GetType
C# Enum GetTypeCode
C# Enum GetUnderlyingType
C# Enum GetValues
C# Enum HasFlag
C# Enum IsDefined
C# Enum MemberwiseClone
C# Enum Parse(Type, String)C# Enum Parse(Type, String, Boolean)
C# Enum ToObject(Type, Byte)
C# Enum ToObject(Type, Int16)
C# Enum ToObject(Type, Int32)
C# Enum ToObject(Type, Int64)
C# Enum ToObject(Type, Object)
C# Enum ToObject(Type, SByte)
C# Enum ToObject(Type, UInt16)
C# Enum ToObject(Type, UInt32)
C# Enum ToObject(Type, UInt64)
C# Enum ToString()
C# Enum ToString(IFormatProvider)
C# Enum ToString(String)
C# Enum ToString(String, IFormatProvider)
C# Enum TryParse
C# Enum TryParse