CSLA - Generated - C Items
This commit is contained in:
@@ -13,8 +13,6 @@ using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using Csla;
|
||||
using Csla.Data;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
namespace VEPROMS.CSLA.Library
|
||||
@@ -28,16 +26,13 @@ namespace VEPROMS.CSLA.Library
|
||||
public partial class ContentInfo : ReadOnlyBase<ContentInfo>, IDisposable
|
||||
{
|
||||
public static event ContentInfoEvent InfoChanged;
|
||||
private void OnInfoChanged(ContentInfo contentInfo)
|
||||
{
|
||||
if (InfoChanged != null)
|
||||
InfoChanged(this);
|
||||
}
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping until replace CSLA")]
|
||||
private void OnInfoChanged(ContentInfo contentInfo) => InfoChanged?.Invoke(this);
|
||||
public event ContentInfoEvent Changed;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping until replace CSLA")]
|
||||
private void OnChange(ContentInfo contentInfo)
|
||||
{
|
||||
if (Changed != null)
|
||||
Changed(this);
|
||||
Changed?.Invoke(this);
|
||||
OnInfoChanged(this);
|
||||
}
|
||||
private void OnChange()
|
||||
@@ -53,6 +48,7 @@ namespace VEPROMS.CSLA.Library
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
#region Collection
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private static List<ContentInfo> _CacheList = new List<ContentInfo>();
|
||||
protected static void AddToCache(ContentInfo contentInfo)
|
||||
{
|
||||
@@ -62,6 +58,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
while (_CacheList.Contains(contentInfo)) _CacheList.Remove(contentInfo); // In RemoveFromCache
|
||||
}
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private static Dictionary<string, List<ContentInfo>> _CacheByPrimaryKey = new Dictionary<string, List<ContentInfo>>();
|
||||
private static void ConvertListToDictionary()
|
||||
{
|
||||
@@ -104,21 +101,8 @@ namespace VEPROMS.CSLA.Library
|
||||
#endregion
|
||||
#region Business Methods
|
||||
private string _ErrorMessage = string.Empty;
|
||||
public string ErrorMessage
|
||||
{
|
||||
get { return _ErrorMessage; }
|
||||
}
|
||||
public string ErrorMessage => _ErrorMessage;
|
||||
protected Content _Editable;
|
||||
private IVEHasBrokenRules HasBrokenRules
|
||||
{
|
||||
get
|
||||
{
|
||||
IVEHasBrokenRules hasBrokenRules = null;
|
||||
if (_Editable != null)
|
||||
hasBrokenRules = _Editable.HasBrokenRules;
|
||||
return hasBrokenRules;
|
||||
}
|
||||
}
|
||||
private int _ContentID;
|
||||
[System.ComponentModel.DataObjectField(true, true)]
|
||||
public int ContentID
|
||||
@@ -518,24 +502,12 @@ namespace VEPROMS.CSLA.Library
|
||||
return _MyZContent;
|
||||
}
|
||||
}
|
||||
// CSLATODO: Replace base ContentInfo.ToString function as necessary
|
||||
/// <summary>
|
||||
/// Overrides Base ToString
|
||||
/// </summary>
|
||||
/// <returns>A string representation of current ContentInfo</returns>
|
||||
//public override string ToString()
|
||||
//{
|
||||
// return base.ToString();
|
||||
//}
|
||||
// CSLATODO: Check ContentInfo.GetIdValue to assure that the ID returned is unique
|
||||
/// <summary>
|
||||
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
|
||||
/// </summary>
|
||||
/// <returns>A Unique ID for the current ContentInfo</returns>
|
||||
protected override object GetIdValue()
|
||||
{
|
||||
return MyContentInfoUnique; // Absolutely Unique ID
|
||||
}
|
||||
protected override object GetIdValue() => MyContentInfoUnique; // Absolutely Unique ID
|
||||
#endregion
|
||||
#region Factory Methods
|
||||
private static int _ContentInfoUnique = 0;
|
||||
@@ -549,9 +521,9 @@ namespace VEPROMS.CSLA.Library
|
||||
return ui;
|
||||
}
|
||||
}
|
||||
private int _MyContentInfoUnique = ContentInfoUnique;
|
||||
public int MyContentInfoUnique // Absolutely Unique ID - Info
|
||||
{ get { return _MyContentInfoUnique; } }
|
||||
private readonly int _MyContentInfoUnique = ContentInfoUnique;
|
||||
// Absolutely Unique ID - Info
|
||||
public int MyContentInfoUnique => _MyContentInfoUnique;
|
||||
protected ContentInfo()
|
||||
{/* require use of factory methods */
|
||||
AddToCache(this);
|
||||
@@ -560,15 +532,11 @@ namespace VEPROMS.CSLA.Library
|
||||
private static int _CountCreated = 0;
|
||||
private static int _CountDisposed = 0;
|
||||
private static int _CountFinalized = 0;
|
||||
private static int IncrementCountCreated
|
||||
{ get { return ++_CountCreated; } }
|
||||
private int _CountWhenCreated = IncrementCountCreated;
|
||||
public static int CountCreated
|
||||
{ get { return _CountCreated; } }
|
||||
public static int CountNotDisposed
|
||||
{ get { return _CountCreated - _CountDisposed; } }
|
||||
public static int CountNotFinalized
|
||||
{ get { return _CountCreated - _CountFinalized; } }
|
||||
private static int IncrementCountCreated => ++_CountCreated;
|
||||
private readonly int _CountWhenCreated = IncrementCountCreated;
|
||||
public static int CountCreated => _CountCreated;
|
||||
public static int CountNotDisposed => _CountCreated - _CountDisposed;
|
||||
public static int CountNotFinalized => _CountCreated - _CountFinalized;
|
||||
~ContentInfo()
|
||||
{
|
||||
_CountFinalized++;
|
||||
@@ -606,25 +574,8 @@ namespace VEPROMS.CSLA.Library
|
||||
if (_ContentItems != null)
|
||||
_ContentItems = null;
|
||||
_Text = null;
|
||||
//if (_ContentParts != null)
|
||||
// _ContentParts = null;
|
||||
//if (_ContentRoUsages != null)
|
||||
// _ContentRoUsages = null;
|
||||
//if (_ContentTransitions != null)
|
||||
// _ContentTransitions = null;
|
||||
//if (_MyEntry != null)
|
||||
// _MyEntry = null;
|
||||
//if (_MyGrid != null)
|
||||
// _MyGrid = null;
|
||||
//if (_MyImage != null)
|
||||
// _MyImage = null;
|
||||
//if (_MyZContent != null)
|
||||
// _MyZContent = null;
|
||||
}
|
||||
public virtual Content Get()
|
||||
{
|
||||
return _Editable = Content.Get(_ContentID);
|
||||
}
|
||||
public virtual Content Get() => _Editable = Content.Get(_ContentID);
|
||||
public static void Refresh(Content tmp)
|
||||
{
|
||||
string key = tmp.ContentID.ToString();
|
||||
@@ -675,11 +626,11 @@ namespace VEPROMS.CSLA.Library
|
||||
_Type = tmp.Type;
|
||||
if (_FormatID != tmp.FormatID)
|
||||
{
|
||||
if (MyFormat != null) MyFormat.RefreshFormatContents(); // Update List for old value
|
||||
MyFormat?.RefreshFormatContents(); // Update List for old value
|
||||
_FormatID = tmp.FormatID; // Update the value
|
||||
}
|
||||
_MyFormat = null; // Reset list so that the next line gets a new list
|
||||
if (MyFormat != null) MyFormat.RefreshFormatContents(); // Update List for new value
|
||||
MyFormat?.RefreshFormatContents(); // Update List for new value
|
||||
_Config = tmp.Config;
|
||||
_DTS = tmp.DTS;
|
||||
_UserID = tmp.UserID;
|
||||
@@ -716,8 +667,6 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public static ContentInfo Get(int contentID)
|
||||
{
|
||||
//if (!CanGetObject())
|
||||
// throw new System.Security.SecurityException("User not authorized to view a Content");
|
||||
try
|
||||
{
|
||||
ContentInfo tmp = GetCachedByPrimaryKey(contentID);
|
||||
@@ -756,13 +705,9 @@ namespace VEPROMS.CSLA.Library
|
||||
[Serializable()]
|
||||
protected class PKCriteria
|
||||
{
|
||||
private int _ContentID;
|
||||
public int ContentID
|
||||
{ get { return _ContentID; } }
|
||||
public PKCriteria(int contentID)
|
||||
{
|
||||
_ContentID = contentID;
|
||||
}
|
||||
private readonly int _ContentID;
|
||||
public int ContentID => _ContentID;
|
||||
public PKCriteria(int contentID) => _ContentID = contentID;
|
||||
}
|
||||
private void ReadData(SafeDataReader dr)
|
||||
{
|
||||
@@ -834,7 +779,7 @@ namespace VEPROMS.CSLA.Library
|
||||
#endregion
|
||||
// Standard Refresh
|
||||
#region extension
|
||||
ContentInfoExtension _ContentInfoExtension = new ContentInfoExtension();
|
||||
readonly ContentInfoExtension _ContentInfoExtension = new ContentInfoExtension();
|
||||
[Serializable()]
|
||||
partial class ContentInfoExtension : extensionBase { }
|
||||
[Serializable()]
|
||||
@@ -850,10 +795,10 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
|
||||
{
|
||||
if (destType == typeof(string) && value is ContentInfo)
|
||||
if (destType == typeof(string) && value is ContentInfo info)
|
||||
{
|
||||
// Return the ToString value
|
||||
return ((ContentInfo)value).ToString();
|
||||
return info.ToString();
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user