CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
BrokenRule.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="BrokenRule.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Stores details about a specific broken business rule.</summary>
7//-----------------------------------------------------------------------
8using System;
9using Csla.Core;
11
12namespace Csla.Rules
13{
18 public partial class BrokenRule : MobileObject
19 {
23 public BrokenRule()
24 { }
25
26 private string _ruleName;
27 private string _description;
28 private string _property;
29 private RuleSeverity _severity;
30 private string _originProperty;
31
35 public override string ToString()
36 {
37 return Description;
38 }
39
44 public string RuleName
45 {
46 get { return _ruleName; }
47 internal set { _ruleName = value; }
48 }
49
54 public string Description
55 {
56 get { return _description; }
57 internal set { _description = value; }
58 }
59
64 public string Property
65 {
66 get { return _property; }
67 internal set { _property = value; }
68 }
69
77 {
78 get { return _severity; }
79 internal set { _severity = value; }
80 }
81
86 public string OriginProperty
87 {
88 get { return _originProperty; }
89 internal set { _originProperty = value; }
90 }
91
92 #region MobileObject overrides
93
104 protected override void OnGetState(SerializationInfo info, StateMode mode)
105 {
106 info.AddValue("_ruleName", _ruleName);
107 info.AddValue("_description", _description);
108 info.AddValue("_property", _property);
109 info.AddValue("_severity", (int)_severity);
110 info.AddValue("_originProperty", _originProperty);
111
112 base.OnGetState(info, mode);
113 }
114
125 protected override void OnSetState(SerializationInfo info, StateMode mode)
126 {
127 _ruleName = info.GetValue<string>("_ruleName");
128 _description = info.GetValue<string>("_description");
129 _property = info.GetValue<string>("_property");
130 _severity = info.GetValue<RuleSeverity>("_severity");
131 _originProperty = info.GetValue<string>("_originProperty");
132
133 base.OnSetState(info, mode);
134 }
135
136 #endregion
137 }
138}
Inherit from this base class to easily create a serializable class.
Definition: MobileObject.cs:20
Stores details about a specific broken business rule.
Definition: BrokenRule.cs:19
override void OnGetState(SerializationInfo info, StateMode mode)
Override this method to insert your field values into the MobileFormatter serialzation stream.
Definition: BrokenRule.cs:104
string Property
Provides access to the property affected by the broken rule.
Definition: BrokenRule.cs:65
override string ToString()
Gets a string representation for this object.
Definition: BrokenRule.cs:35
override void OnSetState(SerializationInfo info, StateMode mode)
Override this method to retrieve your field values from the MobileFormatter serialzation stream.
Definition: BrokenRule.cs:125
string Description
Provides access to the description of the broken rule.
Definition: BrokenRule.cs:55
RuleSeverity Severity
Gets the severity of the broken rule.
Definition: BrokenRule.cs:77
string RuleName
Provides access to the name of the broken rule.
Definition: BrokenRule.cs:45
BrokenRule()
Creates an instance of this type.
Definition: BrokenRule.cs:23
string OriginProperty
Gets or sets the origin property.
Definition: BrokenRule.cs:87
Object containing the serialization data for a specific object.
void AddValue(string name, object value)
Adds a value to the serialization stream.
StateMode
Indicates the reason the MobileFormatter functionality has been invoked.
Definition: StateMode.cs:20
RuleSeverity
Values for validation rule severities.
Definition: RuleSeverity.cs:16
@ Serializable
Prevents updating or inserting until the transaction is complete.