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.
ContextBOVerifier.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="ContextBOVerifier.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>no summary</summary>
7//-----------------------------------------------------------------------
8using System;
9using System.Runtime.Serialization;
10
11
13{
15 public abstract class ContextBOVerifier<T> : BusinessBase<T> where T : ContextBOVerifier<T>
16 {
17 static int _dummy = 0;
18 public ContextBOVerifier() :this(true){}
19 public ContextBOVerifier(bool isNew)
20 {
21
22 if (isNew)
23 MarkNew();
24 else
25 MarkOld();
26
27 _dummy = _dummy + 0;
28 }
29
30 protected override void OnDeserialized(StreamingContext context)
31 {
32 _dummy = _dummy + 0;
33 base.OnDeserialized(context);
34 }
35
36 private static PropertyInfo<string> NameProperty =
37 RegisterProperty(new PropertyInfo<string>("Name", "Name"));
38 public string Name
39 {
40 get { return GetProperty(NameProperty); }
41 set { SetProperty(NameProperty, value); }
42 }
43
45 RegisterProperty(new PropertyInfo<string>("ReceivedContextValue", "ReceivedContextValue"));
47 {
50 }
51
52 #region Data Access
53
54 //Defined in inherited classes - .server for .Net and .client for Silverlight implementations
55 protected void SetReceivedContextValuePropertyFrom(Contexts selectedContext)
56 {
57 if(selectedContext == Contexts.Client)
59 else
60#pragma warning disable CS0618 // Type or member is obsolete
62#pragma warning restore CS0618 // Type or member is obsolete
63
64 }
65
66 protected void SetContextValueModified(Contexts selectedContext)
67 {
68 if (selectedContext == Contexts.Client)
70 else
71#pragma warning disable CS0618 // Type or member is obsolete
73#pragma warning restore CS0618 // Type or member is obsolete
74 }
75 #endregion
76 }
77
79 {
80 public const string INITIAL_VALUE = "Hello World!";
81 public const string MODIFIED_VALUE = "Changed";
82 }
83
84 public enum Contexts
85 {
86 Client,
87 Global
88 }
89}
Provides consistent context information between the client and server DataPortal objects.
ContextDictionary ClientContext
Returns the application-specific context data provided by the client.
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
object GetProperty(IPropertyInfo propertyInfo)
Gets a property's value as a specified type.
virtual void LoadProperty(IPropertyInfo propertyInfo, object newValue)
Loads a property's managed field with the supplied value.
virtual void MarkOld()
Marks the object as being an old (not new) object.
void SetProperty(IPropertyInfo propertyInfo, object newValue)
Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the val...
virtual void MarkNew()
Marks the object as being a new object.
Maintains metadata about a property.
void SetReceivedContextValuePropertyFrom(Contexts selectedContext)
override void OnDeserialized(StreamingContext context)
@ Serializable
Prevents updating or inserting until the transaction is complete.