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

C# BusinessObjectCollection类代码示例

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

本文整理汇总了C#中BusinessObjectCollection的典型用法代码示例。如果您正苦于以下问题:C# BusinessObjectCollection类的具体用法?C# BusinessObjectCollection怎么用?C# BusinessObjectCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BusinessObjectCollection类属于命名空间,在下文中一共展示了BusinessObjectCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetAggregateRelationship

 private static MultipleRelationship<ContactPersonTestBO> GetAggregateRelationship(OrganisationTestBO organisationTestBO, out BusinessObjectCollection<ContactPersonTestBO> cpCol) {
     MultipleRelationship<ContactPersonTestBO> aggregateRelationship = organisationTestBO.Relationships.GetMultiple<ContactPersonTestBO>("ContactPeople");
     RelationshipDef relationshipDef = (RelationshipDef) aggregateRelationship.RelationshipDef;
     relationshipDef.RelationshipType = RelationshipType.Aggregation;
     cpCol = aggregateRelationship.BusinessObjectCollection;
     return aggregateRelationship;
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:7,代码来源:TestRelatedBOCol_Aggregation.cs


示例2: Test_BusinessObjectEdited_ShouldRefreshTheValueInTheList

        public void Test_BusinessObjectEdited_ShouldRefreshTheValueInTheList()
        {
            //---------------Set up test pack-------------------
            ClassDef.ClassDefs.Clear();
            MyBO.LoadDefaultClassDef();
            var listBox = GetControlFactory().CreateListBox();
            var manager = CreateListBoxCollectionManager(listBox);
            var boToBeUpdated = new MyBO();
            var myBoCol = new BusinessObjectCollection<MyBO> {new MyBO(), boToBeUpdated };
            manager.BusinessObjectCollection = myBoCol;

            manager.Control.SelectedItem = boToBeUpdated;
            var initialListBoxDisplayText = manager.Control.Text;
            var initialBOToString = boToBeUpdated.ToString();
            //---------------Assert Precondition----------------
            Assert.AreEqual(2, manager.Control.Items.Count);

            Assert.AreSame(boToBeUpdated, manager.Control.Items[1]);
            Assert.AreEqual(initialBOToString, initialListBoxDisplayText);
            //---------------Execute Test ----------------------
            boToBeUpdated.TestProp = GetRandomString();
            boToBeUpdated.Save();
            //---------------Test Result -----------------------
            var updatedListBoxDisplayText = manager.Control.Text;
            var updatedBOToString = boToBeUpdated.ToString();
            Assert.AreNotEqual(initialListBoxDisplayText, updatedListBoxDisplayText);
            Assert.AreNotEqual(initialBOToString, updatedBOToString);

            Assert.AreEqual(updatedBOToString, updatedListBoxDisplayText);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:30,代码来源:TestListBoxCollectionManagerWin.cs


示例3: TestBusinessObjectControlHasDifferentBOWhenTabChanges

        public void TestBusinessObjectControlHasDifferentBOWhenTabChanges()
        {
            //---------------Set up test pack-------------------
            IBOColTabControl boColTabControl = GetControlFactory().CreateBOColTabControl();

            IBusinessObjectControl busControl = GetBusinessObjectControlStub();
            boColTabControl.BusinessObjectControl = busControl;

            BusinessObjectCollection<MyBO> myBoCol = new BusinessObjectCollection<MyBO>();
            MyBO firstBo = new MyBO();
            myBoCol.Add(firstBo);
            myBoCol.Add(new MyBO());
            MyBO thirdBO = new MyBO();
            myBoCol.Add(thirdBO);
            boColTabControl.BusinessObjectCollection = myBoCol;

            //---------------Assert Precondition----------------
            Assert.AreEqual(firstBo, boColTabControl.BusinessObjectControl.BusinessObject);

            //---------------Execute Test ----------------------
            boColTabControl.TabControl.SelectedIndex = 2;

            //---------------Test Result -----------------------
            Assert.AreNotSame(firstBo, boColTabControl.BusinessObjectControl.BusinessObject);
            Assert.AreEqual(thirdBO, boColTabControl.BusinessObjectControl.BusinessObject);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:26,代码来源:TestBOColTabControlVWG.cs


示例4: TearDown

        public void TearDown()
        {
            BusinessObjectCollection<Shape> shapes = new BusinessObjectCollection<Shape>();
            shapes.LoadAll();
            Shape[] shapesClone = shapes.ToArray();
            foreach (Shape shape in shapesClone)
            {
                shape.MarkForDelete();
            }
            shapes.SaveAll();
            //Shape shape = BOLoader.Instance.GetBusinessObject<Shape>(
            //    "ShapeName = 'MyShape' OR ShapeName = 'MyShapeChanged'");
            //if (shape != null)
            //{
            //    shape.MarkForDelete();
            //    shape.Save();
            //}

            //CircleNoPrimaryKey circle = BOLoader.Instance.GetBusinessObject<CircleNoPrimaryKey>(
            //    "ShapeName = 'Circle' OR ShapeName = 'CircleChanged'");
            //if (circle != null)
            //{
            //    circle.MarkForDelete();
            //    circle.Save();
            //}

            //FilledCircleInheritsCircleNoPK filledCircle = BOLoader.Instance.GetBusinessObject<FilledCircleInheritsCircleNoPK>(
            //    "ShapeName = 'FilledCircle' OR ShapeName = 'FilledCircleChanged'");
            //if (filledCircle != null)
            //{
            //    filledCircle.MarkForDelete();
            //    filledCircle.Save();
            //}
        }
开发者ID:Chillisoft,项目名称:habanero,代码行数:34,代码来源:TestInheritanceHierarchySingleClass.cs


示例5: GetRelationship

 protected MultipleRelationship<ContactPersonTestBO> GetRelationship(
     out OrganisationTestBO organisationTestBO, 
     out BusinessObjectCollection<ContactPersonTestBO> cpCol)
 {
     RelationshipCol relationships;
     return GetRelationship(out organisationTestBO, out relationships, out cpCol);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:7,代码来源:TestMultipleRelationshipCancelEdits_Base.cs


示例6: SetupSelectorWithTestPackCollection

 private static void SetupSelectorWithTestPackCollection(ComboBoxCollectionSelector selectorManager, bool includeBlankItems)
 {
     MyBO.LoadDefaultClassDef();
     selectorManager.IncludeBlankItem = includeBlankItems;
     BusinessObjectCollection<MyBO> myBOs = new BusinessObjectCollection<MyBO> { { new MyBO(), new MyBO() } };
     selectorManager.SetCollection(myBOs);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:7,代码来源:TestComboBoxCollectionSelector.cs


示例7: InitialiseCollection

 public void InitialiseCollection()
 {
     _boCol = new BusinessObjectCollection<MultiPropBO>();
     _boCol.Add((MultiPropBO)_classDef.CreateNewBusinessObject());
     _boCol.Add((MultiPropBO)_classDef.CreateNewBusinessObject());
     //_boCol.Add((MultiPropBO)_classDef.CreateNewBusinessObject());
     //_boCol.Add((MultiPropBO)_classDef.CreateNewBusinessObject());
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:8,代码来源:TestReflectedPropertyComparer.cs


示例8: GetData

        public static BusinessObjectCollection GetData(int categoryId)
        {
            List<BusinessObject> result = GetData().FindAll(obj => obj.CategoryID == categoryId);
            BusinessObjectCollection ret = new BusinessObjectCollection();
            ret.Clear();
            ret.AddRange(result);

            return ret;
        }
开发者ID:Letractively,项目名称:henoch,代码行数:9,代码来源:BusinessDataStorage.cs


示例9: AssertAllCollectionsHaveNoItems

 public static void AssertAllCollectionsHaveNoItems(BusinessObjectCollection<ContactPersonTestBO> cpCol)
 {
     Assert.AreEqual(0, cpCol.Count);
     Assert.AreEqual(0, cpCol.AddedBusinessObjects.Count);
     Assert.AreEqual(0, cpCol.RemovedBusinessObjects.Count);
     Assert.AreEqual(0, cpCol.PersistedBusinessObjects.Count);
     Assert.AreEqual(0, cpCol.MarkedForDeleteBusinessObjects.Count);
     Assert.AreEqual(0, cpCol.CreatedBusinessObjects.Count);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:9,代码来源:BusinessObjectCollectionTestHelper.cs


示例10: GetCompositionRelationship

 private static MultipleRelationship<ContactPersonTestBO> GetCompositionRelationship(out BusinessObjectCollection<ContactPersonTestBO> cpCol, OrganisationTestBO organisationTestBO)
 {
     MultipleRelationship<ContactPersonTestBO> compositionRelationship =
         organisationTestBO.Relationships.GetMultiple<ContactPersonTestBO>("ContactPeople");
     RelationshipDef relationshipDef = (RelationshipDef)compositionRelationship.RelationshipDef;
     relationshipDef.RelationshipType = RelationshipType.Composition;
     cpCol = compositionRelationship.BusinessObjectCollection;
     return compositionRelationship;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:9,代码来源:TestTreeViewControllerWin.cs


示例11: GetHierarchicalData

        public static BusinessObjectCollection GetHierarchicalData(int? parentId)
        {
            List<BusinessObject> result = GetData().FindAll(obj => obj.ParentID == parentId);
            BusinessObjectCollection ret = new BusinessObjectCollection();
            ret.Clear();
            ret.AddRange(result);

            return ret;
        }
开发者ID:Letractively,项目名称:henoch,代码行数:9,代码来源:BusinessDataStorage.cs


示例12:

 public static void AssertOneObjectInCurrentPersistedCollectionOnly
     (BusinessObjectCollection<ContactPersonTestBO> cpCol)
 {
     Assert.AreEqual(1, cpCol.Count);
     Assert.AreEqual(0, cpCol.AddedBusinessObjects.Count);
     Assert.AreEqual(0, cpCol.RemovedBusinessObjects.Count);
     Assert.AreEqual(1, cpCol.PersistedBusinessObjects.Count);
     Assert.AreEqual(0, cpCol.MarkedForDeleteBusinessObjects.Count);
     Assert.AreEqual(0, cpCol.CreatedBusinessObjects.Count);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:10,代码来源:BusinessObjectCollectionTestHelper.cs


示例13: CreateDirtyChildren

 protected void CreateDirtyChildren(BusinessObjectCollection<ContactPersonTestBO> cpCol,
                         out ContactPersonTestBO existingChild,
                         out ContactPersonTestBO editedChild,
                         out ContactPersonTestBO deletedChild,
                         out ContactPersonTestBO createdChildWithEdits,
                         out ContactPersonTestBO createdChild)
 {
     createdChild = CreateCreatedChild(cpCol);
     createdChildWithEdits = CreateCreatedChildWithEdits(cpCol);
     existingChild = CreateExistingChild(cpCol);
     editedChild = CreateEditedChild(cpCol);
     deletedChild = CreateDeletedChild(cpCol);
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:13,代码来源:TestMultipleRelationshipCancelEdits_Composition.cs


示例14: Test_BindBusinessObjectCollection_ToListBox_ShouldAddToControlList

 public void Test_BindBusinessObjectCollection_ToListBox_ShouldAddToControlList()
 {
     //---------------Set up test pack-------------------
     var lstBox = new ListBox();
     var selectorBinder = new HabaneroSelectorControlBinder<FakeBo, ListBox>(lstBox);
     var businessObjectCollection = new BusinessObjectCollection<FakeBo>();
     businessObjectCollection.CreateBusinessObject();
     //---------------Assert Precondition----------------
     Assert.AreEqual(0, lstBox.Items.Count);
     //---------------Execute Test ----------------------
     selectorBinder.SetBusinessObjectCollection(businessObjectCollection);
     //---------------Test Result -----------------------
     Assert.AreEqual(1, lstBox.Items.Count, "The business object collection's items should be in list");
 }
开发者ID:Chillisoft,项目名称:habanero.binding,代码行数:14,代码来源:TestHabaneroSelectorControlBinder.cs


示例15: 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.
            ClassDef.ClassDefs.Clear();
            BOWithIntID.LoadClassDefWithIntID();
            _propDef_int = new PropDef("PropName", typeof (int), PropReadWriteRule.ReadWrite, null);
            _validBusinessObject = new BOWithIntID {TestField = _validLookupValue};
            _validIntID = 3;
            _validBusinessObject.IntID = _validIntID;
            _collection_IntId = new BusinessObjectCollection<BOWithIntID> {_validBusinessObject};

            _propDef_int.LookupList = new BusinessObjectLookupListStub(typeof (BOWithIntID), _collection_IntId);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:14,代码来源:TestBOPropLookupList_BusinessObjectLookupList_IntID.cs


示例16: TestSetCollection_EmptyCollection

        public void TestSetCollection_EmptyCollection()
        {
            //---------------Set up test pack-------------------
            ListViewCollectionManager cntrl = CreateDefaultListVievController();
            BusinessObjectCollection<MyBO> col = new BusinessObjectCollection<MyBO>();

            //---------------Execute Test ----------------------
            cntrl.SetCollection(col);
            //---------------Test Result -----------------------
            Assert.AreEqual(0, cntrl.ListView.Items.Count);
            //UIDef uiDef = GetDefaultUIDef(cntrl);
            //Assert.AreEqual(uiDef.GetUIGridProperties().Count, cntrl.ListView.Columns.Count);//There are 8 columns in the collection BO
            //Assert.IsNull(gridBase.SelectedBusinessObject);
            //---------------Tear Down -------------------------          
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:15,代码来源:TestListViewCollectionSelectorWin.cs


示例17: Test_SelectedBusinessObject_ReturnsNullIfNoItemSelected

 public override void Test_SelectedBusinessObject_ReturnsNullIfNoItemSelected()
 {
     //---------------Set up test pack-------------------
     IBOColSelectorControl colSelector = CreateSelector();
     MyBO myBO = new MyBO();
     BusinessObjectCollection<MyBO> collection = new BusinessObjectCollection<MyBO> { myBO };
     colSelector.BusinessObjectCollection = collection;
     colSelector.SelectedBusinessObject = null;
     //---------------Assert Precondition----------------
     Assert.AreEqual(collection.Count + NumberOfLeadingBlankRows(), colSelector.NoOfItems, "The blank item and one other");
     //---------------Execute Test ----------------------
     IBusinessObject selectedBusinessObject = colSelector.SelectedBusinessObject;
     //---------------Test Result -----------------------
     Assert.IsNull(selectedBusinessObject);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:15,代码来源:TestBOSelectorBOTabVWG.cs


示例18: TestCreateTestTabControlCollectionController

 public void TestCreateTestTabControlCollectionController()
 {
     //---------------Set up test pack-------------------
     BusinessObjectCollection<MyBO> myBOs = new BusinessObjectCollection<MyBO> {{new MyBO(), new MyBO()}};
     ITabControl tabControl = CreateTabControl();
     BOColTabControlManager selectorManager = new BOColTabControlManager(tabControl, GetControlFactory());
     selectorManager.BusinessObjectControl = GetBusinessObjectControl();
     //---------------Verify test pack-------------------
     //---------------Execute Test ----------------------
     selectorManager.BusinessObjectCollection = myBOs;
     //---------------Verify Result -----------------------
     Assert.AreEqual(myBOs, selectorManager.BusinessObjectCollection);
     Assert.AreSame(tabControl, selectorManager.TabControl);
     //---------------Tear Down -------------------------   
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:15,代码来源:TestBOColTabControlManager.cs


示例19: TestSetCollectionOnGrid_EmptyCollection

        public void TestSetCollectionOnGrid_EmptyCollection()
        {
            //---------------Set up test pack-------------------
            MyBO.LoadDefaultClassDef();
            var col = new BusinessObjectCollection<MyBO>();
            var gridBase = CreateGridBaseStub();
            SetupGridColumnsForMyBo(gridBase);
            //---------------Execute Test ----------------------
#pragma warning disable 618,612
            gridBase.SetBusinessObjectCollection(col);
#pragma warning restore 618,612
            //---------------Test Result -----------------------
            Assert.AreEqual(0, gridBase.Rows.Count);
            //Assert.AreEqual(classDef.PropDefcol.Count, myGridBase.Columns.Count);//There are 8 columns in the collection BO
            Assert.IsNull(gridBase.SelectedBusinessObject);
            //---------------Tear Down -------------------------          
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:17,代码来源:TestGridBase.cs


示例20: Test_CreateTestComboBoxCollectionController

 public void Test_CreateTestComboBoxCollectionController()
 {
     //---------------Set up test pack-------------------
     MyBO.LoadClassDefWithBoolean();
     BusinessObjectCollection<MyBO> myBOs = new BusinessObjectCollection<MyBO> {{new MyBO(), new MyBO()}};
     IComboBox cmb = GetControlFactory().CreateComboBox();
     DisposeOnTearDown(cmb);
     ComboBoxCollectionSelector selector = new ComboBoxCollectionSelector(cmb, GetControlFactory());
     DisposeOnTearDown(selector);
     //---------------Verify test pack-------------------
     //---------------Execute Test ----------------------
     selector.SetCollection(myBOs);
     //---------------Verify Result -----------------------
     Assert.AreEqual(myBOs, selector.BusinessObjectCollection);
     Assert.AreSame(cmb,selector.Control);
     //---------------Tear Down -------------------------   
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:17,代码来源:TestComboBoxCollectionSelector.cs



注:本文中的BusinessObjectCollection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# BusinessObjectParameters类代码示例发布时间:2022-05-24
下一篇:
C# BusinessLogic类代码示例发布时间: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