Show / Hide Table of Contents

Class FieldCopierBuilder<ParameterType>

Used to build a copy function that will copy the fields from one object to another. Add the fields you want to copy via the AddField(FieldInfo) function, and call Finish() to create the function

Inheritance
object
FieldCopierBuilder<ParameterType>
Namespace: WeaverCore.Utilities
Assembly: WeaverCore.dll
Syntax
public sealed class FieldCopierBuilder<ParameterType>
Type Parameters
Name Description
ParameterType

Constructors

| Edit this page View Source

FieldCopierBuilder()

Declaration
public FieldCopierBuilder()
| Edit this page View Source

FieldCopierBuilder(Type)

Declaration
public FieldCopierBuilder(Type typeToCopy)
Parameters
Type Name Description
Type typeToCopy

Methods

| Edit this page View Source

AddField(FieldInfo)

Adds a field to be copied

Declaration
public void AddField(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

The field to copy

| Edit this page View Source

AddField(string, BindingFlags)

Adds a field to be copied

Declaration
public void AddField(string fieldName, BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
Parameters
Type Name Description
string fieldName

The name of the field to be added

BindingFlags flags

The binding flags to find the field

| Edit this page View Source

AddRange(IEnumerable<FieldInfo>)

Adds a range of fields to be copied

Declaration
public void AddRange(IEnumerable<FieldInfo> fields)
Parameters
Type Name Description
IEnumerable<FieldInfo> fields
| Edit this page View Source

Finish()

Creates the finished method that copies the fields from one type to another. The first parameter is the object to copy the data to, and the second parameter is the object to copy the data from

Declaration
public FieldCopierBuilder<ParameterType>.ShallowCopyDelegate Finish()
Returns
Type Description
FieldCopierBuilder<ParameterType>.ShallowCopyDelegate
| Edit this page View Source

FinishFunc()

Creates the finished method that copies the fields from one type to another. The first parameter is the object to copy the data to, and the second parameter is the object to copy the data from

Declaration
public Action<ParameterType, ParameterType> FinishFunc()
Returns
Type Description
Action<ParameterType, ParameterType>

Extension Methods

ReflectionUtilities.ReflectCallMethod(object, string, object[], BindingFlags)
ReflectionUtilities.ReflectGetField(object, string, BindingFlags)
ReflectionUtilities.ReflectGetMethod(object, string, BindingFlags)
ReflectionUtilities.ReflectGetProperty(object, string, BindingFlags)
ReflectionUtilities.ReflectSetField(object, string, object, BindingFlags)
ReflectionUtilities.ReflectSetProperty(object, string, object, BindingFlags)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾