本文整理汇总了C#中PropDef类的典型用法代码示例。如果您正苦于以下问题:C# PropDef类的具体用法?C# PropDef怎么用?C# PropDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropDef类属于命名空间,在下文中一共展示了PropDef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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);
}
示例4: init
public void init()
{
mKeyDef = new KeyDef();
mKeyDef.IgnoreIfNull = true;
PropDef lPropDef = new PropDef("PropName", typeof(string), PropReadWriteRule.ReadOnly, null);
mKeyDef.Add(lPropDef);
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
示例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));
}
示例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;
}
示例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);
}