Added Grids and Images

This commit is contained in:
Rich
2011-01-18 21:06:09 +00:00
parent 78dd08720a
commit cce75c2497
4 changed files with 704 additions and 2 deletions

View File

@@ -400,6 +400,62 @@ namespace VEPROMS.CSLA.Library
return _MyEntry;
}
}
private int _ContentGridCount = 0;
/// <summary>
/// Count of ContentGrids for this Content
/// </summary>
public int ContentGridCount
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty("ContentGridCount", true);
return _ContentGridCount;
}
}
private Grid _MyGrid = null;
/// <summary>
/// Related Field
/// </summary>
[TypeConverter(typeof(GridConverter))]
public Grid MyGrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty("MyGrid", true);
if (_MyGrid == null) _MyGrid = Grid.New(this);
return _MyGrid;
}
}
private int _ContentImageCount = 0;
/// <summary>
/// Count of ContentImages for this Content
/// </summary>
public int ContentImageCount
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty("ContentImageCount", true);
return _ContentImageCount;
}
}
private Image _MyImage = null;
/// <summary>
/// Related Field
/// </summary>
[TypeConverter(typeof(ImageConverter))]
public Image MyImage
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty("MyImage", true);
if (_MyImage == null) _MyImage = Image.New(this);
return _MyImage;
}
}
private int _ContentItemCount = 0;
/// <summary>
/// Count of ContentItems for this Content
@@ -590,7 +646,7 @@ namespace VEPROMS.CSLA.Library
if (base.IsDirty || list.Contains(this))
return base.IsDirty;
list.Add(this);
return base.IsDirty || (_ContentDetails == null ? false : _ContentDetails.IsDirtyList(list)) || (_MyEntry == null ? false : _MyEntry.IsDirtyList(list)) || (_ContentItems == null ? false : _ContentItems.IsDirtyList(list)) || (_ContentParts == null ? false : _ContentParts.IsDirtyList(list)) || (_ContentRoUsages == null ? false : _ContentRoUsages.IsDirtyList(list)) || (_ContentTransitions == null ? false : _ContentTransitions.IsDirtyList(list)) || (_MyZContent == null ? false : _MyZContent.IsDirtyList(list)) || (_MyFormat == null ? false : _MyFormat.IsDirtyList(list));
return base.IsDirty || (_ContentDetails == null ? false : _ContentDetails.IsDirtyList(list)) || (_MyEntry == null ? false : _MyEntry.IsDirtyList(list)) || (_MyGrid == null ? false : _MyGrid.IsDirtyList(list)) || (_MyImage == null ? false : _MyImage.IsDirtyList(list)) || (_ContentItems == null ? false : _ContentItems.IsDirtyList(list)) || (_ContentParts == null ? false : _ContentParts.IsDirtyList(list)) || (_ContentRoUsages == null ? false : _ContentRoUsages.IsDirtyList(list)) || (_ContentTransitions == null ? false : _ContentTransitions.IsDirtyList(list)) || (_MyZContent == null ? false : _MyZContent.IsDirtyList(list)) || (_MyFormat == null ? false : _MyFormat.IsDirtyList(list));
}
public override bool IsValid
{
@@ -601,7 +657,7 @@ namespace VEPROMS.CSLA.Library
if(list.Contains(this))
return (IsNew && !IsDirty) ? true : base.IsValid;
list.Add(this);
return ((IsNew && !IsDirty) ? true : base.IsValid) && (_ContentDetails == null ? true : _ContentDetails.IsValidList(list)) && (_MyEntry == null ? true : _MyEntry.IsValidList(list)) && (_ContentItems == null ? true : _ContentItems.IsValidList(list)) && (_ContentParts == null ? true : _ContentParts.IsValidList(list)) && (_ContentRoUsages == null ? true : _ContentRoUsages.IsValidList(list)) && (_ContentTransitions == null ? true : _ContentTransitions.IsValidList(list)) && (_MyZContent == null ? true : _MyZContent.IsValidList(list)) && (_MyFormat == null ? true : _MyFormat.IsValidList(list));
return ((IsNew && !IsDirty) ? true : base.IsValid) && (_ContentDetails == null ? true : _ContentDetails.IsValidList(list)) && (_MyEntry == null ? true : _MyEntry.IsValidList(list)) && (_MyGrid == null ? true : _MyGrid.IsValidList(list)) && (_MyImage == null ? true : _MyImage.IsValidList(list)) && (_ContentItems == null ? true : _ContentItems.IsValidList(list)) && (_ContentParts == null ? true : _ContentParts.IsValidList(list)) && (_ContentRoUsages == null ? true : _ContentRoUsages.IsValidList(list)) && (_ContentTransitions == null ? true : _ContentTransitions.IsValidList(list)) && (_MyZContent == null ? true : _MyZContent.IsValidList(list)) && (_MyFormat == null ? true : _MyFormat.IsValidList(list));
}
// CSLATODO: Replace base Content.ToString function as necessary
/// <summary>
@@ -638,6 +694,8 @@ namespace VEPROMS.CSLA.Library
if (_ContentItems != null && (hasBrokenRules = _ContentItems.HasBrokenRules) != null) return hasBrokenRules;
if (_ContentDetails != null && (hasBrokenRules = _ContentDetails.HasBrokenRules) != null) return hasBrokenRules;
if (_MyEntry != null && (hasBrokenRules = _MyEntry.HasBrokenRules) != null) return hasBrokenRules;
if (_MyGrid != null && (hasBrokenRules = _MyGrid.HasBrokenRules) != null) return hasBrokenRules;
if (_MyImage != null && (hasBrokenRules = _MyImage.HasBrokenRules) != null) return hasBrokenRules;
if (_ContentParts != null && (hasBrokenRules = _ContentParts.HasBrokenRules) != null) return hasBrokenRules;
if (_ContentRoUsages != null && (hasBrokenRules = _ContentRoUsages.HasBrokenRules) != null) return hasBrokenRules;
if (_ContentTransitions != null && (hasBrokenRules = _ContentTransitions.HasBrokenRules) != null) return hasBrokenRules;
@@ -754,6 +812,8 @@ namespace VEPROMS.CSLA.Library
int usedByCount = 0;
usedByCount += _ContentDetailCount;
usedByCount += _ContentEntryCount;
usedByCount += _ContentGridCount;
usedByCount += _ContentImageCount;
usedByCount += _ContentItemCount;
usedByCount += _ContentPartCount;
usedByCount += _ContentRoUsageCount;
@@ -980,6 +1040,8 @@ namespace VEPROMS.CSLA.Library
dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8);
_ContentDetailCount = dr.GetInt32("DetailCount");
_ContentEntryCount = dr.GetInt32("EntryCount");
_ContentGridCount = dr.GetInt32("GridCount");
_ContentImageCount = dr.GetInt32("ImageCount");
_ContentItemCount = dr.GetInt32("ItemCount");
_ContentPartCount = dr.GetInt32("PartCount");
_ContentRoUsageCount = dr.GetInt32("RoUsageCount");
@@ -1023,6 +1085,12 @@ namespace VEPROMS.CSLA.Library
_MyEntry = Entry.Get(dr);
// load child objects
dr.NextResult();
_MyGrid = Grid.Get(dr);
// load child objects
dr.NextResult();
_MyImage = Image.Get(dr);
// load child objects
dr.NextResult();
_ContentItems = ContentItems.Get(dr);
// load child objects
dr.NextResult();
@@ -1113,6 +1181,8 @@ namespace VEPROMS.CSLA.Library
if (_ContentItems != null) _ContentItems.Update(this);
if (_ContentDetails != null) _ContentDetails.Update(this);
if (_MyEntry != null) _MyEntry.Update(this);
if (_MyGrid != null) _MyGrid.Update(this);
if (_MyImage != null) _MyImage.Update(this);
if (_ContentParts != null) _ContentParts.Update(this);
if (_ContentRoUsages != null) _ContentRoUsages.Update(this);
if (_ContentTransitions != null) _ContentTransitions.Update(this);
@@ -1227,6 +1297,8 @@ namespace VEPROMS.CSLA.Library
if (_ContentItems != null) _ContentItems.Update(this);
if (_ContentDetails != null) _ContentDetails.Update(this);
if (_MyEntry != null) _MyEntry.Update(this);
if (_MyGrid != null) _MyGrid.Update(this);
if (_MyImage != null) _MyImage.Update(this);
if (_ContentParts != null) _ContentParts.Update(this);
if (_ContentRoUsages != null) _ContentRoUsages.Update(this);
if (_ContentTransitions != null) _ContentTransitions.Update(this);
@@ -1254,6 +1326,8 @@ namespace VEPROMS.CSLA.Library
if (_ContentItems != null) _ContentItems.Update(this);
if (_ContentDetails != null) _ContentDetails.Update(this);
if (_MyEntry != null) _MyEntry.Update(this);
if (_MyGrid != null) _MyGrid.Update(this);
if (_MyImage != null) _MyImage.Update(this);
if (_ContentParts != null) _ContentParts.Update(this);
if (_ContentRoUsages != null) _ContentRoUsages.Update(this);
if (_ContentTransitions != null) _ContentTransitions.Update(this);

View File

@@ -265,6 +265,64 @@ namespace VEPROMS.CSLA.Library
return _MyEntry;
}
}
private int _ContentGridCount = 0;
/// <summary>
/// Count of ContentGrids for this Content
/// </summary>
public int ContentGridCount
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty("ContentGridCount", true);
return _ContentGridCount;
}
}
private GridInfo _MyGrid = null;
[TypeConverter(typeof(GridInfoConverter))]
public GridInfo MyGrid
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty("MyGrid", true);
if (_ContentGridCount != 0 && _MyGrid == null)
{
_MyGrid = GridInfo.Get(_ContentID);
_ContentGridCount = _MyGrid == null ? 0 : 1;
}
return _MyGrid;
}
}
private int _ContentImageCount = 0;
/// <summary>
/// Count of ContentImages for this Content
/// </summary>
public int ContentImageCount
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty("ContentImageCount", true);
return _ContentImageCount;
}
}
private ImageInfo _MyImage = null;
[TypeConverter(typeof(ImageInfoConverter))]
public ImageInfo MyImage
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty("MyImage", true);
if (_ContentImageCount != 0 && _MyImage == null)
{
_MyImage = ImageInfo.Get(_ContentID);
_ContentImageCount = _MyImage == null ? 0 : 1;
}
return _MyImage;
}
}
private int _ContentItemCount = 0;
/// <summary>
/// Count of ContentItems for this Content
@@ -538,6 +596,24 @@ namespace VEPROMS.CSLA.Library
//RHM Removed 20090724 - Duplicates function of code above.
// - Dispose caused error when a new step was added.
// - Resequence of transitions did not work properly.
// if(_MyGrid != null)
// {
// _MyGrid.Dispose();// Dispose related value
// _MyGrid = null;// Reset related value
// }
_ContentGridCount = -1;// Reset Count
//RHM Removed 20090724 - Duplicates function of code above.
// - Dispose caused error when a new step was added.
// - Resequence of transitions did not work properly.
// if(_MyImage != null)
// {
// _MyImage.Dispose();// Dispose related value
// _MyImage = null;// Reset related value
// }
_ContentImageCount = -1;// Reset Count
//RHM Removed 20090724 - Duplicates function of code above.
// - Dispose caused error when a new step was added.
// - Resequence of transitions did not work properly.
// if(_MyZContent != null)
// {
// _MyZContent.Dispose();// Dispose related value
@@ -583,6 +659,24 @@ namespace VEPROMS.CSLA.Library
//RHM Removed 20090724 - Duplicates function of code above.
// - Dispose caused error when a new step was added.
// - Resequence of transitions did not work properly.
// if(_MyGrid != null)
// {
// _MyGrid.Dispose();// Dispose related value
// _MyGrid = null;// Reset related value
// }
_ContentGridCount = -1;// Reset Count
//RHM Removed 20090724 - Duplicates function of code above.
// - Dispose caused error when a new step was added.
// - Resequence of transitions did not work properly.
// if(_MyImage != null)
// {
// _MyImage.Dispose();// Dispose related value
// _MyImage = null;// Reset related value
// }
_ContentImageCount = -1;// Reset Count
//RHM Removed 20090724 - Duplicates function of code above.
// - Dispose caused error when a new step was added.
// - Resequence of transitions did not work properly.
// if(_MyZContent != null)
// {
// _MyZContent.Dispose();// Dispose related value
@@ -656,6 +750,8 @@ namespace VEPROMS.CSLA.Library
_UserID = dr.GetString("UserID");
_ContentDetailCount = dr.GetInt32("DetailCount");
_ContentEntryCount = dr.GetInt32("EntryCount");
_ContentGridCount = dr.GetInt32("GridCount");
_ContentImageCount = dr.GetInt32("ImageCount");
_ContentItemCount = dr.GetInt32("ItemCount");
_ContentPartCount = dr.GetInt32("PartCount");
_ContentRoUsageCount = dr.GetInt32("RoUsageCount");

View File

@@ -141,6 +141,10 @@ namespace VEPROMS.CSLA.Library
// { public override string ToString() { return string.Format("{0}", _Name); } }
// public partial class FormatInfo
// { public override string ToString() { return string.Format("{0}", _Name); } }
// public partial class Grid
// { public override string ToString() { return string.Format("{0}", _Name); } }
// public partial class GridInfo
// { public override string ToString() { return string.Format("{0}", _Name); } }
// public partial class Group
// { public override string ToString() { return string.Format("{0}", _Name); } }
// public partial class GroupAssignment
@@ -149,6 +153,10 @@ namespace VEPROMS.CSLA.Library
// { public override string ToString() { return string.Format("{0}", _Name); } }
// public partial class GroupInfo
// { public override string ToString() { return string.Format("{0}", _Name); } }
// public partial class Image
// { public override string ToString() { return string.Format("{0}", _Name); } }
// public partial class ImageInfo
// { public override string ToString() { return string.Format("{0}", _Name); } }
// public partial class Item
// { public override string ToString() { return string.Format("{0}", _Name); } }
// public partial class ItemAnnotation