Files
data
debian
docs
eglib
external
Lucene.Net
Newtonsoft.Json
aspnetwebstack
binary-reference-assemblies
cecil
debian-snapshot
ikdasm
ikvm
referencesource
SMDiagnostics
System
System.Activities
System.Activities.DurableInstancing
System.Activities.Presentation
System.ComponentModel.DataAnnotations
DataAnnotations
Schema
AssociatedMetadataTypeTypeDescriptionProvider.cs
AssociatedMetadataTypeTypeDescriptor.cs
AssociationAttribute.cs
BindableTypeAttribute.cs
CompareAttribute.cs
ConcurrencyCheckAttribute.cs
CreditCardAttribute.cs
CustomValidationAttribute.cs
DataType.cs
DataTypeAttribute.cs
DisplayAttribute.cs
DisplayColumnAttribute.cs
DisplayFormatAttribute.cs
EditableAttribute.cs
EmailAddressAttribute.cs
EnumDataTypeAttribute.cs
FileExtensionsAttribute.cs
FilterUIHintAttribute.cs
IValidatableObject.cs
KeyAttribute.cs
LocalizableString.cs
MaxLengthAttribute.cs
MetadataPropertyDescriptorWrapper.cs
MetadataTypeAttribute.cs
MinLengthAttribute.cs
PhoneAttribute.cs
RangeAttribute.cs
RegularExpressionAttribute.cs
RequiredAttribute.cs
ScaffoldAttribute.cs
StringLengthAttribute.cs
TimestampAttribute.cs
UIHintAttribute.cs
UrlAttribute.cs
ValidationAttribute.cs
ValidationAttributeStore.cs
ValidationContext.cs
ValidationException.cs
ValidationResult.cs
Validator.cs
Properties
Resources
System.ComponentModel.DataAnnotations.txt
System.Core
System.Data
System.Data.DataSetExtensions
System.Data.Entity
System.Data.Entity.Design
System.Data.Linq
System.Data.SqlXml
System.IdentityModel
System.IdentityModel.Selectors
System.Net
System.Numerics
System.Runtime.Caching
System.Runtime.DurableInstancing
System.Runtime.Serialization
System.ServiceModel
System.ServiceModel.Activation
System.ServiceModel.Activities
System.ServiceModel.Channels
System.ServiceModel.Discovery
System.ServiceModel.Internals
System.ServiceModel.Routing
System.ServiceModel.WasHosting
System.ServiceModel.Web
System.Web
System.Web.ApplicationServices
System.Web.DynamicData
System.Web.Entity
System.Web.Entity.Design
System.Web.Extensions
System.Web.Mobile
System.Web.Routing
System.Web.Services
System.Workflow.Activities
System.Workflow.ComponentModel
System.Workflow.Runtime
System.WorkflowServices
System.Xaml.Hosting
System.Xml
System.Xml.Linq
XamlBuildTask
mscorlib
LICENSE.txt
PATENTS.TXT
README.Mono
README.md
rx
ikvm-native
libgc
m4
man
mcs
mono
msvc
po
runtime
samples
scripts
support
tools
AUTHORS
COPYING.LIB
ChangeLog.REMOVED.git-id
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
build-mingw32.sh
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-core.spec
mono-core.spec.in
mono-uninstalled.pc.in
test-driver
winconfig.h

62 lines
2.6 KiB
C#
Raw Normal View History


namespace System.ComponentModel.DataAnnotations {
/// <summary>
/// Indicates whether the consumer of a field or property, such as a client application,
/// should allow editing of the value.
/// </summary>
/// <remarks>
/// This attribute neither enforces nor guarantees editability; the underlying data
/// store might allow changing the data regardless of this attribute. The presence
/// of this attribute signals intent to the consumer of the attribute whethere or not
/// the end user should be allowed to change the value via the client application.
/// </remarks>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class EditableAttribute : Attribute {
/// <summary>
/// Indicates whether or not the field/property allows editing of the
/// value.
/// </summary>
/// <value>
/// When <c>true</c>, the field/property is editable.
/// <para>
/// When <c>false</c>, the field/property is not editable.
/// </para>
/// </value>
public bool AllowEdit { get; private set; }
/// <summary>
/// Indicates whether or not the field/property allows an initial value
/// to be specified.
/// </summary>
/// <remarks>
/// The value of this property defaults to match the <see cref="AllowEdit"/>
/// property value specified in the constructor.
/// </remarks>
/// <value>
/// When <c>true</c>, the field/property can have its value set for
/// newly constructed instances, such as during an insert operation.
/// <para>
/// When <c>false</c>, the field/property cannot have its
/// value provided for newly constructed instances, such as during
/// an insert operation. This will often indicate that the value
/// is auto-generated by the persistence store.
/// </para>
/// </value>
public bool AllowInitialValue { get; set; }
/// <summary>
/// Indicate whether or not a field/property is editable.
/// </summary>
/// <param name="allowEdit">
/// Indicates whether the field/property is editable. The value provided
/// will apply to both <see cref="AllowEdit"/> and
/// <see cref="AllowInitialValue"/> unless the <see cref="AllowInitialValue"/>
/// property is explicitly specified.
/// </param>
public EditableAttribute(bool allowEdit) {
this.AllowEdit = allowEdit;
this.AllowInitialValue = allowEdit;
}
}
}