Example #1
0
        public void Callback_WhitNullRowView()
        {
            testCallBackTwoInvoked = false;

            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("TestParameter", typeof(string));
            dataTable.Rows.Add(dataTable.NewRow());

            SPSRowProvider rowProvider = new SPSRowProvider();
            IWebPartRow    provider    = rowProvider;

            provider.GetRowData(TestCallback);

            dataTable.Rows[0]["TestParameter"] = "TestModified";

            rowProvider.RowView = dataTable.DefaultView[0];

            rowProvider.SendRow();

            PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(typeof(SPSRowProvider_Tests));

            Assert.IsTrue(provider.Schema[0].Name == pdc[0].Name);
            Assert.IsTrue(provider.Schema[0].PropertyType.Equals(pdc[0].PropertyType));
            Assert.IsTrue(testCallBackTwoInvoked);
        }
 public IWebPartRow ConnectionRowProvider()
 {
     Debug.WriteLine("ConnectionRowProvider " + Title);
     // Using our special our SPSRowProvider class
     _rowProvider = new SPSRowProvider(GetRowViewForProvider());
     return(_rowProvider);
 }
Example #3
0
        public void Constructor_FromDataTable()
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("TestParameter", typeof(string));
            dataTable.Rows.Add(dataTable.NewRow());

            SPSRowProvider rowProvider = new SPSRowProvider(dataTable);
            IWebPartRow    provider    = rowProvider;

            PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(typeof(SPSRowProvider_Tests));

            Assert.IsTrue(provider.Schema[0].Name == pdc[0].Name);
            Assert.IsTrue(provider.Schema[0].PropertyType.Equals(pdc[0].PropertyType));
        }
Example #4
0
        public void Constructor_FromSPSSchemaValueBuilder()
        {
            SPSSchemaValue schema = new SPSSchemaValue();

            schema.AddParameter("TestParameter", "System.String");
            schema.AddDataValue("TestParameter", "Test");

            SPSRowProvider rowProvider = new SPSRowProvider(schema.GetDataView());
            IWebPartRow    provider    = rowProvider;

            PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(typeof(SPSRowProvider_Tests));

            Assert.IsTrue(provider.Schema[0].Name == pdc[0].Name);
            Assert.IsTrue(provider.Schema[0].PropertyType.Equals(pdc[0].PropertyType));
        }
Example #5
0
        public void Callback()
        {
            testCallBackTwoInvoked = false;

            SPSSchemaValue schema = new SPSSchemaValue();

            schema.AddParameter("TestParameter", "System.String");
            schema.AddDataValue("TestParameter", "TestModified");

            SPSRowProvider rowProvider = new SPSRowProvider(schema.GetDataView());
            IWebPartRow    provider    = rowProvider;

            provider.GetRowData(TestCallback);
            rowProvider.SendRow();

            PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(typeof(SPSRowProvider_Tests));

            Assert.IsTrue(schema.Schema[0].Name == pdc[0].Name);
            Assert.IsTrue(schema.Schema[0].PropertyType.Equals(pdc[0].PropertyType));
            Assert.IsTrue(testCallBackTwoInvoked);
        }
Example #6
0
 public IWebPartRow ConnectionRowProvider()
 {
     // Using our special SPSRowProvider class
     _rowProvider = new SPSRowProvider(GetRowViewForProvider());
     return(_rowProvider);
 }