• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PropDef类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PropVariant类代码示例发布时间:2022-05-24
下一篇:
C# Prop类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap