本文整理汇总了C#中PropDef类的典型用法代码示例。如果您正苦于以下问题:C# PropDef类的具体用法?C# PropDef怎么用?C# PropDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropDef类属于命名空间,在下文中一共展示了PropDef类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ConstructMessage
private static string ConstructMessage(PropDef propDef)
{
if (propDef == null) return "";
string displayName = String.IsNullOrEmpty(propDef.DisplayName) ? propDef.PropertyName : propDef.DisplayName;
return String.Format("Error writing to property '{0}' because it is configured as a '{1}' property.",
displayName, propDef.ReadWriteRule);
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:7,代码来源:BOPropWriteException.cs
示例2: CreateClassDef
private new static ClassDef CreateClassDef()
{
PropDefCol lPropDefCol = new PropDefCol();
PropDef propDef =
new PropDef("Radius", typeof(int), PropReadWriteRule.ReadWrite, null);
lPropDefCol.Add(propDef);
//propDef = new PropDef("ContactPersonID", typeof(Guid), PropReadWriteRule.WriteOnce, "ContactPersonID", null);
//lPropDefCol.Add(propDef);
KeyDefCol keysCol = new KeyDefCol();
RelationshipDefCol relDefCol = new RelationshipDefCol();
//RelKeyDef relKeyDef = new RelKeyDef();
//IPropDef relPropDef = lPropDefCol["ContactPersonID"];
//RelPropDef lRelPropDef = new RelPropDef(relPropDef, "ContactPersonID");
//relKeyDef.Add(lRelPropDef);
//RelationshipDef relDef = new SingleRelationshipDef("ContactPerson", typeof(ContactPerson), relKeyDef, false, DeleteParentAction.DoNothing);
//relDefCol.Add(relDef);
ClassDef lClassDef = new ClassDef(typeof(CircleNoPrimaryKey), null, "circle_table", lPropDefCol, keysCol, relDefCol, null);
//ClassDef lClassDef = new ClassDef(typeof(CircleNoPrimaryKey), null, lPropDefCol, keysCol, relDefCol);
lClassDef.SuperClassDef = new SuperClassDef(Shape.GetClassDef(), ORMapping.ClassTableInheritance);
ClassDef.ClassDefs.Add(lClassDef);
return lClassDef;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:26,代码来源:CircleNoPrimaryKey.cs
示例3: Setup
public void Setup()
{
ClassDef.ClassDefs.Clear();
_boPropCol1 = new BOPropCol();
_keyDef1 = new KeyDef();
_boPropCol2 = new BOPropCol();
_keyDef2 = new KeyDef();
//Props for KeyDef 1
PropDef lPropDef = new PropDef("PropName", typeof(string), PropReadWriteRule.ReadWrite, null);
_boPropCol1.Add(lPropDef.CreateBOProp(false));
_keyDef1.Add(lPropDef);
lPropDef = new PropDef("PropName1", typeof(string), PropReadWriteRule.ReadWrite, null);
_boPropCol1.Add(lPropDef.CreateBOProp(false));
_keyDef1.Add(lPropDef);
//Props for KeyDef 2
lPropDef = new PropDef("PropName1", typeof(string), PropReadWriteRule.ReadWrite, null);
_boPropCol2.Add(lPropDef.CreateBOProp(false));
_keyDef2.Add(lPropDef);
lPropDef = new PropDef("PropName", typeof(string), PropReadWriteRule.ReadWrite, null);
_boPropCol2.Add(lPropDef.CreateBOProp(false));
_keyDef2.Add(lPropDef);
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:26,代码来源:TestBoKey.cs
示例4: init
public void init()
{
mKeyDef = new KeyDef();
mKeyDef.IgnoreIfNull = true;
PropDef lPropDef = new PropDef("PropName", typeof(string), PropReadWriteRule.ReadOnly, null);
mKeyDef.Add(lPropDef);
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:7,代码来源:TestKeyDef.cs
示例5: init
public void init()
{
PropDef propDef = new PropDef("Prop", typeof(string), PropReadWriteRule.ReadWrite, null);
_relPropDef = new RelPropDef(propDef, "PropName");
_propDefCol = new PropDefCol();
_propDefCol.Add(propDef);
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:7,代码来源:TestRelPropDef.cs
示例6: TestFixtureSetup
public void TestFixtureSetup()
{
//Code that is executed before any test is run in this class. If multiple tests
// are executed then it will still only be called once.
_propDef = new PropDef("PropName", typeof (string), PropReadWriteRule.ReadWrite, null);
_dataMapper = new StringDataMapper();
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:7,代码来源:TestStringDataMapper.cs
示例7: CreateTestMapperClassDef
public static ClassDef CreateTestMapperClassDef()
{
PropDefCol lPropDefCol = new PropDefCol();
PropDef propDef =
new PropDef("ShapeName", typeof(String), PropReadWriteRule.ReadWrite, "ShapeName", null);
lPropDefCol.Add(propDef);
propDef = new PropDef("ShapeID", typeof(Guid), PropReadWriteRule.WriteOnce, "ShapeID_field", null);
lPropDefCol.Add(propDef);
propDef = new PropDef("ShapeValue", typeof(Int32), PropReadWriteRule.ReadWrite, null);
lPropDefCol.Add(propDef);
// propDef = new PropDef("MyID", typeof(Guid), PropReadWriteRule.WriteOnce, null);
// lPropDefCol.Add(propDef);
PrimaryKeyDef primaryKey = new PrimaryKeyDef();
primaryKey.IsGuidObjectID = true;
primaryKey.Add(lPropDefCol["ShapeID"]);
KeyDefCol keysCol = new KeyDefCol();
KeyDef lKeyDef = new KeyDef();
lKeyDef.Add(lPropDefCol["ShapeName"]);
keysCol.Add(lKeyDef);
// RelKeyDef relKeyDef = new RelKeyDef();
//RelPropDef lRelPropDef = new RelPropDef(propDef, "OwnerID");
//relKeyDef.Add(lRelPropDef);
//RelationshipDef relDef = new MultipleRelationshipDef("Owner", typeof (Shape),
// relKeyDef, false, "", DeleteParentAction.DereferenceRelated);
RelationshipDefCol relDefCol = new RelationshipDefCol();
//relDefCol.Add(relDef);
ClassDef lClassDef = new ClassDef(typeof(Shape), primaryKey, "Shape_table", lPropDefCol, keysCol, relDefCol);
ClassDef.ClassDefs.Add(lClassDef);
return lClassDef;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:32,代码来源:Shape.cs
示例8: CreateMockBOWithExtraReadOnlyProp
internal static MockBO CreateMockBOWithExtraReadOnlyProp(string newPropName)
{
ClassDef newClassDef = new MockBO().ClassDef.Clone();
PropDef def = new PropDef(newPropName, typeof (string), PropReadWriteRule.ReadOnly, "");
newClassDef.PropDefcol.Add(def);
return new MockBO(newClassDef);
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:7,代码来源:StatementGeneratorTestHelper.cs
示例9: TestFixtureSetup
public void TestFixtureSetup()
{
ClassDef.ClassDefs.Clear();
MyBO.LoadClassDefsNoUIDef();
//Code that is executed before any test is run in this class. If multiple tests
// are executed then it will still only be called once.
_propDef = new PropDef("PropName", typeof (Guid), PropReadWriteRule.ReadWrite, null);
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:8,代码来源:TestBOPropGuid.cs
示例10: SetUp
public void SetUp()
{
PropDef propDef = new PropDef("Prop", typeof(string), PropReadWriteRule.ReadWrite, null);
mRelPropDef = new RelPropDef(propDef, "PropName");
mPropDefCol = new PropDefCol();
mPropDefCol.Add(propDef);
BORegistry.DataAccessor = new DataAccessorInMemory();
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:8,代码来源:TestRelProp.cs
示例11: CreateMockBOWithExtraNonPersistableProp
internal static MockBO CreateMockBOWithExtraNonPersistableProp(string newPropName)
{
ClassDef newClassDef = new MockBO().ClassDef.Clone();
PropDef def = new PropDef(newPropName, typeof (string), PropReadWriteRule.ReadWrite, "")
{Persistable = false};
newClassDef.PropDefcol.Add(def);
return new MockBO(newClassDef);
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:8,代码来源:StatementGeneratorTestHelper.cs
示例12: CreateBOPropDef
protected static PropDefCol CreateBOPropDef()
{
var lPropDefCol = new PropDefCol();
var propDef = new PropDef(PK1_PROP1_NAME, typeof(string), PropReadWriteRule.ReadWrite, "PK1_Prop1", null);
lPropDefCol.Add(propDef);
return lPropDefCol;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:9,代码来源:BOWithStringPKProp.cs
示例13: TestContainsPropDef
public void TestContainsPropDef()
{
PropDef propDef = new PropDef("prop", typeof(string), PropReadWriteRule.ReadWrite, null);
PropDefColInheritor col = new PropDefColInheritor();
Assert.IsFalse(col.GetContains(propDef));
col.Add(propDef);
Assert.IsTrue(col.GetContains(propDef));
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:9,代码来源:TestPropDefCol.cs
示例14: GetClassDefWithSingleInheritanceHierarchy_NonPersistableProp
public static IClassDef GetClassDefWithSingleInheritanceHierarchy_NonPersistableProp(string nonPersistablePropertyName)
{
var filledCircleClassDef = GetClassDefWithSingleInheritanceHierarchy();
var nonPersistablePropDef = new PropDef(nonPersistablePropertyName, typeof(string), PropReadWriteRule.ReadWrite,
"");
nonPersistablePropDef.Persistable = false;
filledCircleClassDef.SuperClassClassDef.PropDefcol.Add(nonPersistablePropDef);
return filledCircleClassDef;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:9,代码来源:FilledCircleNoPrimaryKey.cs
示例15: TestRemove
public void TestRemove()
{
PropDef propDef = new PropDef("prop", typeof(string), PropReadWriteRule.ReadWrite, null);
PropDefColInheritor col = new PropDefColInheritor();
col.CallRemove(propDef);
col.Add(propDef);
Assert.AreEqual(1, col.Count);
col.CallRemove(propDef);
Assert.AreEqual(0, col.Count);
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:11,代码来源:TestPropDefCol.cs
示例16: CreateClassDef
private static ClassDef CreateClassDef()
{
PropDefCol lPropDefCol = new PropDefCol();
PropDef propDef =
new PropDef("SomeNewProp", typeof(int), PropReadWriteRule.ReadWrite, null);
lPropDefCol.Add(propDef);
KeyDefCol keysCol = new KeyDefCol();
RelationshipDefCol relDefCol = new RelationshipDefCol();
ClassDef lClassDef = new ClassDef(typeof(BOWithIntID_Child), null, "bowithintid", lPropDefCol, keysCol, relDefCol, null);
return lClassDef;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:11,代码来源:BOWithIntID_Child.cs
示例17: SetupTest
public void SetupTest()
{
ClassDef.ClassDefs.Clear();
this.SetupDBConnection();
BORegistry.DataAccessor = new DataAccessorDB();
_propDef_int = new PropDef("PropName", typeof(int), PropReadWriteRule.ReadWrite, null);
DatabaseLookupList databaseLookupList = new DatabaseLookupList(_sql, 10000, "", "", true);
_propDef_int.LookupList = databaseLookupList;
databaseLookupList.GetLookupList();
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:12,代码来源:TestBOPropLookupList_DatabaseLookupList_Int.cs
示例18: Test_SetPropDefUnitOfMeasure
public void Test_SetPropDefUnitOfMeasure()
{
//---------------Set up test pack-------------------
PropDef propDef = new PropDef("PropName", typeof (string), PropReadWriteRule.ReadOnly, null);
//---------------Assert Precondition----------------
Assert.AreEqual("", propDef.UnitOfMeasure);
//---------------Execute Test ----------------------
const string newUOM = "New UOM";
propDef.UnitOfMeasure = newUOM;
//---------------Test Result -----------------------
Assert.AreEqual(newUOM, propDef.UnitOfMeasure);
}
开发者ID:Chillisoft,项目名称:habanero,代码行数:12,代码来源:TestPropDef.cs
示例19: SetupTestFixture
public void SetupTestFixture()
{
//Code that is executed before any test is run in this class. If multiple tests
// are executed then it will still only be called once.
ClassDef.ClassDefs.Clear();
this.SetupDBConnection();
BORegistry.DataAccessor = new DataAccessorDB();
_propDef_guid = new PropDef("PropName", typeof (Guid), PropReadWriteRule.ReadWrite, null);
DatabaseLookupList databaseLookupList = new DatabaseLookupList(_sql) {PropDef = _propDef_guid};
databaseLookupList.GetLookupList();
_propDef_guid.LookupList = databaseLookupList;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:13,代码来源:TestBOPropLookupList_DatabaseLookupList_GuidID.cs
示例20: Test_SetLookupListForPropDef
public void Test_SetLookupListForPropDef()
{
//---------------Set up test pack-------------------
PropDef propDef = new PropDef("PropName", typeof (int), PropReadWriteRule.ReadWrite, null);
DatabaseLookupList databaseLookupList = new DatabaseLookupList(_sql);
//---------------Assert Precondition----------------
Assert.IsInstanceOf(typeof (NullLookupList), propDef.LookupList);
//---------------Execute Test ----------------------
propDef.LookupList = databaseLookupList;
//---------------Test Result -----------------------
Assert.IsNotNull(propDef.LookupList);
Assert.AreSame(propDef, databaseLookupList.PropDef);
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:14,代码来源:TestBOPropLookupList_DatabaseLookupList_Int.cs
注:本文中的PropDef类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论