当前位置: 首页>>代码示例>>C#>>正文


C# BusinessObjectCollection类代码示例

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


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


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