Index: Core/Common/src/Core.Common.Gui/Forms/PropertyGridView/PropertyResolver.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Common/src/Core.Common.Gui/Forms/PropertyGridView/PropertyResolver.cs (.../PropertyResolver.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Core/Common/src/Core.Common.Gui/Forms/PropertyGridView/PropertyResolver.cs (.../PropertyResolver.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -60,13 +60,13 @@
}
// 1. Match property information based on ObjectType and on AdditionalDataCheck:
- var filteredPropertyInfos = propertyInfos.Where(pi => pi.ObjectType.IsInstanceOfType(sourceData) && (pi.AdditionalDataCheck == null || pi.AdditionalDataCheck(sourceData))).ToArray();
+ var filteredPropertyInfos = propertyInfos.Where(pi => pi.DataType.IsInstanceOfType(sourceData) && (pi.AdditionalDataCheck == null || pi.AdditionalDataCheck(sourceData))).ToArray();
// 2. Match property information based on object type inheritance, prioritizing most specialized object types:
- filteredPropertyInfos = FilterPropertyInfoByTypeInheritance(filteredPropertyInfos, pi => pi.ObjectType);
+ filteredPropertyInfos = FilterPropertyInfoByTypeInheritance(filteredPropertyInfos, pi => pi.DataType);
// 3. Match property information based on property type inheritance, prioritizing most specialized object property types:
- filteredPropertyInfos = FilterPropertyInfoByTypeInheritance(filteredPropertyInfos, pi => pi.PropertyType);
+ filteredPropertyInfos = FilterPropertyInfoByTypeInheritance(filteredPropertyInfos, pi => pi.PropertyObjectType);
if (filteredPropertyInfos.Length == 0)
{
Index: Core/Common/src/Core.Common.Gui/Plugin/GuiPlugin.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Common/src/Core.Common.Gui/Plugin/GuiPlugin.cs (.../GuiPlugin.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Core/Common/src/Core.Common.Gui/Plugin/GuiPlugin.cs (.../GuiPlugin.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -50,40 +50,45 @@
}
///
- /// Activates the gui plugin.
+ /// Activates the plugin.
///
public virtual void Activate() {}
///
- /// Deactivates the gui plugin.
+ /// Deactivates the plugin.
///
public virtual void Deactivate() {}
///
- /// Property info objects which can be provided by the gui plugin.
+ /// Returns all instances provided for data of this plugin.
///
public virtual IEnumerable GetPropertyInfos()
{
return Enumerable.Empty();
}
///
- /// View information objects which can be provided by the gui plugin.
+ /// Returns all instances provided for data of this plugin.
///
- public virtual IEnumerable GetViewInfoObjects()
+ public virtual IEnumerable GetViewInfos()
{
yield break;
}
///
- /// This method returns an enumeration of .
+ /// Returns all instances provided for data of this plugin.
///
- /// The enumeration of provided by the .
public virtual IEnumerable GetTreeNodeInfos()
{
yield break;
}
+ ///
+ /// Gets the child data instances that have definitions of
+ /// some parent data object.
+ ///
+ /// The parent data object.
+ /// Sequence of child data.
public virtual IEnumerable GetChildDataWithViewDefinitions(object dataObject)
{
yield break;
Index: Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs (.../PropertyInfo.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs (.../PropertyInfo.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -26,35 +26,36 @@
namespace Core.Common.Gui.Plugin
{
///
- /// Information for creating object properties
+ /// Information for creating object properties.
///
public class PropertyInfo
{
///
- /// The type of the object to create properties for
+ /// The type of the data to create properties for.
///
- public Type ObjectType { get; set; }
+ public Type DataType { get; set; }
///
- /// The type of object properties to create
+ /// The type of object properties to create.
///
- public Type PropertyType { get; set; }
+ public Type PropertyObjectType { get; set; }
///
- /// Function for determining whether or not the property information is relevant in a specfic context
+ /// Optional function, used to determine if a this instance is relevant given a data object.
///
///
/// As an example, you could implement this as follows:
/// var propertyInfo = new PropertyInfo < Folder, ModelImplementationFolderProperties} { AdditionalDataCheck = o => GetParent(o) is ModelImplementation };
///
///
- /// This property breaks the single responsibility principle; besides and an additional method is
+ /// This property breaks the single responsibility principle; besides and an additional method is
/// introduced to determine whether or not property information is relevant in a specfic context.
///
public Func AdditionalDataCheck { get; set; }
///
- /// Function for obtaining the data that should be set while creating object properties
+ /// Optional function, that allows a data object to be converted to another data
+ /// object that should be used for the property object.
///
///
/// As an example, you could implement this as follows:
@@ -63,7 +64,8 @@
public Func GetObjectPropertiesData { get; set; }
///
- /// Action that must be performed after creating object properties
+ /// Optional function, that allows for post-creation logic to be executed on the
+ /// newly create object properties.
///
///
/// As an example, you could implement this as follows:
@@ -80,9 +82,9 @@
public class PropertyInfo where TProperty : IObjectProperties
{
///
- /// The type of the object to create properties for
+ /// The type of the data to create properties for.
///
- public Type ObjectType
+ public Type DataType
{
get
{
@@ -91,9 +93,9 @@
}
///
- /// The type of object properties to create
+ /// The type of object properties to create.
///
- public Type PropertyType
+ public Type PropertyObjectType
{
get
{
@@ -102,45 +104,46 @@
}
///
- /// Function for determining whether or not the property information is relevant in a specfic context
+ /// Optional function, used to determine if a this instance is relevant given a data object.
///
///
/// As an example, you could implement this as follows:
- ///
- /// var propertyInfo = new PropertyInfo < Folder, ModelImplementationFolderProperties> { AdditionalDataCheck = o => GetParent(o) is ModelImplementation };
- ///
+ /// var propertyInfo = new PropertyInfo < Folder, ModelImplementationFolderProperties} { AdditionalDataCheck = o => GetParent(o) is ModelImplementation };
///
///
- /// This property breaks the single responsibility principle; besides and an additional method is
+ /// This property breaks the single responsibility principle; besides and an additional method is
/// introduced to determine whether or not property information is relevant in a specfic context.
///
public Func AdditionalDataCheck { get; set; }
///
- /// Function for obtaining the data that should be set while creating object properties
+ /// Optional function, that allows a data object to be converted to another data
+ /// object that should be used for the property object.
///
///
/// As an example, you could implement this as follows:
- ///
- /// var propertyInfo = new PropertyInfo <ModelImplementation, ModelImplementationProperties> { GetObjectPropertiesData = o => o.RunParameters };
- ///
+ /// var propertyInfo = new PropertyInfo <ModelImplementation, ModelImplementationProperties> { GetObjectPropertiesData = o => o.RunParameters };
+ ///
public Func GetObjectPropertiesData { get; set; }
///
- /// Action that must be performed after creating object properties
+ /// Optional function, that allows for post-creation logic to be executed.
///
///
/// As an example, you could implement this as follows:
- /// var propertyInfo = new PropertyInfo< ModelImplementation, ModelImplementationProperties> { AfterCreate = op => op.AdditionalBooleanProperty = true };
+ /// var propertyInfo = new PropertyInfo < ModelImplementation, ModelImplementationProperties > { AfterCreate = op => op.AdditionalBooleanProperty = true };
///
public Action AfterCreate { get; set; }
+ ///
+ /// Performs an implicit conversion from to .
+ ///
public static implicit operator PropertyInfo(PropertyInfo pi)
{
return new PropertyInfo
{
- ObjectType = typeof(TObject),
- PropertyType = typeof(TProperty),
+ DataType = typeof(TObject),
+ PropertyObjectType = typeof(TProperty),
AdditionalDataCheck = pi.AdditionalDataCheck != null
? o => pi.AdditionalDataCheck((TObject) o)
: (Func) null,
Index: Core/Common/src/Core.Common.Gui/Plugin/PropertyInfoExtensions.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Common/src/Core.Common.Gui/Plugin/PropertyInfoExtensions.cs (.../PropertyInfoExtensions.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Core/Common/src/Core.Common.Gui/Plugin/PropertyInfoExtensions.cs (.../PropertyInfoExtensions.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -26,18 +26,19 @@
namespace Core.Common.Gui.Plugin
{
///
- /// Extensions of
+ /// Extensions of .
///
public static class PropertyInfoExtensions
{
///
- /// Creates object properties based on the combination of and
+ /// Creates object properties based on the combination of
+ /// and .
///
- /// The property information used for creating the object properties
- /// The data that will be set to the created object properties instance
+ /// The property information used to create the object properties.
+ /// Data that will be set to the created object properties instance.
public static IObjectProperties CreateObjectProperties(this PropertyInfo propertyInfo, object sourceData)
{
- var objectProperties = (IObjectProperties) Activator.CreateInstance(propertyInfo.PropertyType);
+ var objectProperties = (IObjectProperties) Activator.CreateInstance(propertyInfo.PropertyObjectType);
objectProperties.Data = propertyInfo.GetObjectPropertiesData != null
? propertyInfo.GetObjectPropertiesData(sourceData)
Index: Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs (.../ViewInfo.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs (.../ViewInfo.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -25,87 +25,93 @@
namespace Core.Common.Gui.Plugin
{
- public class ViewInfo : ICloneable
+ ///
+ /// Information for creating a view for a particular data object.
+ ///
+ public class ViewInfo
{
///
- /// Type of the data for this viewInfo
+ /// Data type associated with this view info.
///
public Type DataType { get; set; }
///
- /// Type of the data of the view
+ /// Type of data used for the view.
///
public Type ViewDataType { get; set; }
///
- /// Type of the view
+ /// Type of the view.
///
public Type ViewType { get; set; }
///
- /// Description of the view (shown to the user when there is more then one view for an item)
+ /// Description of the view.
///
public string Description { get; set; }
///
- /// Name the view should have
+ /// Method used to determine the name for the view. Function arguments:
///
- /// - The view to get a name for
- /// - The data of the view
- /// - out - the view name
+ /// - The view to get a name for.
+ /// - The data of the view.
+ /// - out - The name of the view.
///
///
public Func GetViewName { get; set; }
///
- /// Icon of the view (shown top left)
+ /// Icon of the view.
///
public Image Image { get; set; }
///
- /// Additional data checking for matching the ViewInfo
+ /// Optional method, for checking if this view info object can be used for a given
+ /// data object. Function arguments:
///
- /// - Data as provided by the ViewProvider
- /// - out - Check succeeded
+ /// - Data for the view.
+ /// - out -
true is this view info can be used for the data, or false otherwise.
///
///
public Func AdditionalDataCheck { get; set; }
///
- /// Function that returns the data for the view (when not set it returns T in )
+ /// Optional method, used to convert data from type defined by
+ /// to type defined by . Function Arguments:
///
- /// - object - Original data for the view
- /// - out object - data for the view
+ /// - Original data.
+ /// - out - The converted data to be used in the view.
///
///
public Func GetViewData { get; set; }
///
- /// Extra actions that can be performed on the view after creation
+ /// Optional method, to perform additional actions after the view has been created.
+ /// Function arguments:
///
- /// - View to modify
- /// - Data for this viewinfo
+ /// - The created view instance.
+ /// - The data corresponding to this view info.
///
///
public Action AfterCreate { get; set; }
///
- /// Extra actions that can be performed on the view after the focus has been set on the view.
- /// (Will be called after creation and when the user tries to open a view for data while there is an existing view
- /// (and only the focus will be set to the existing view))
+ /// Optional method, to allow for extra actions to be performed after the view has
+ /// received focus. Function arguments:
///
- /// - View to modify
- /// - Data for this viewinfo
+ /// - View to modify.
+ /// - Data for this view info.
///
///
public Action OnActivateView { get; set; }
///
- /// Override the default closing of the view constructed with this info
+ /// Optional method, such that actions can be performed or checked to see if the
+ /// view should be closed. Function arguments:
///
- /// - View to close
- ///
- /// - out - Close succeeded
+ /// - View to close.
+ /// - Data of the view.
+ /// - out -
true is the closing action was successful, false otherwise.
///
///
public Func CloseForData { get; set; }
@@ -114,15 +120,19 @@
{
return DataType + " : " + ViewDataType + " : " + ViewType;
}
-
- public object Clone()
- {
- return MemberwiseClone();
- }
}
+ ///
+ /// Information for creating a view for a particular data object.
+ ///
+ /// Data type associated with this view info.
+ /// Type of data used for the view.
+ /// Type of the view.
public class ViewInfo where TView : IView
{
+ ///
+ /// Data type associated with this view info.
+ ///
public Type DataType
{
get
@@ -131,6 +141,9 @@
}
}
+ ///
+ /// Type of data used for the view.
+ ///
public Type ViewDataType
{
get
@@ -139,6 +152,9 @@
}
}
+ ///
+ /// Type of the view.
+ ///
public Type ViewType
{
get
@@ -147,22 +163,84 @@
}
}
+ ///
+ /// Description of the view.
+ ///
public string Description { get; set; }
+ ///
+ /// Method used to determine the name for the view. Function arguments:
+ ///
+ /// - The view to get a name for.
+ /// - The data of the view.
+ /// - out - The name of the view.
+ ///
+ ///
public Func GetViewName { get; set; }
+ ///
+ /// Icon of the view.
+ ///
public Image Image { get; set; }
+ ///
+ /// Optional method, for checking if this view info object can be used for a given
+ /// data object. Function arguments:
+ ///
+ /// - Data for the view.
+ /// - out -
true is this view info can be used for the data, or false otherwise.
+ ///
+ ///
public Func AdditionalDataCheck { get; set; }
+ ///
+ /// Optional method, used to convert data from type defined by
+ /// to type defined by . Function Arguments:
+ ///
+ /// - Original data.
+ /// - out - The converted data to be used in the view.
+ ///
+ ///
public Func GetViewData { get; set; }
+ ///
+ /// Optional method, to perform additional actions after the view has been created.
+ /// Function arguments:
+ ///
+ /// - The created view instance.
+ /// - The data corresponding to this view info.
+ ///
+ ///
public Action AfterCreate { get; set; }
+ ///
+ /// Optional method, to allow for extra actions to be performed after the view has
+ /// received focus. Function arguments:
+ ///
+ /// - View to modify.
+ /// - Data for this view info.
+ ///
+ ///
public Action OnActivateView { get; set; }
+ ///
+ /// Optional method, such that actions can be performed or checked to see if the
+ /// view should be closed. Function arguments:
+ ///
+ /// - View to close.
+ /// - Data of the view.
+ /// - out -
true is the closing action was successful, false otherwise.
+ ///
+ ///
public Func CloseForData { get; set; }
+ ///
+ /// Performs an implicit conversion from to .
+ ///
+ /// The view information.
+ ///
+ /// The result of the conversion.
+ ///
public static implicit operator ViewInfo(ViewInfo viewInfo)
{
return new ViewInfo
@@ -199,5 +277,10 @@
}
}
+ ///
+ /// Information for creating a view for a particular data object.
+ ///
+ /// Data type associated with this view info.
+ /// Type of the view.
public class ViewInfo : ViewInfo where TView : IView {}
}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/RingtoetsGui.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Common/src/Core.Common.Gui/RingtoetsGui.cs (.../RingtoetsGui.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Core/Common/src/Core.Common.Gui/RingtoetsGui.cs (.../RingtoetsGui.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -586,7 +586,7 @@
documentViews = documentViewManager;
- DocumentViewsResolver = new ViewResolver(documentViews, Plugins.SelectMany(p => p.GetViewInfoObjects()), mainWindow);
+ DocumentViewsResolver = new ViewResolver(documentViews, Plugins.SelectMany(p => p.GetViewInfos()), mainWindow);
PropertyResolver = new PropertyResolver(Plugins.SelectMany(p => p.GetPropertyInfos()));
applicationFeatureCommands = new ApplicationFeatureCommandHandler(PropertyResolver, MainWindow, this);
Index: Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj
===================================================================
diff -u -r652b03cb8115830641e05bffb356bcf5779bc9f0 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision 652b03cb8115830641e05bffb356bcf5779bc9f0)
+++ Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -135,6 +135,10 @@
+
+
+
+
True
True
Index: Core/Common/test/Core.Common.Gui.Test/Plugin/GuiPluginTest.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.Gui.Test/Plugin/GuiPluginTest.cs (revision 0)
+++ Core/Common/test/Core.Common.Gui.Test/Plugin/GuiPluginTest.cs (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -0,0 +1,181 @@
+using Core.Common.Gui.Plugin;
+
+using NUnit.Framework;
+
+using Rhino.Mocks;
+
+namespace Core.Common.Gui.Test.Plugin
+{
+ [TestFixture]
+ public class GuiPluginTest
+ {
+ [Test]
+ public void DefaultConstructor_ExpectedValues()
+ {
+ // Call
+ using (var plugin = new SimpleGuiPlugin())
+ {
+ // Assert
+ Assert.IsNull(plugin.Gui);
+ Assert.IsNull(plugin.RibbonCommandHandler);
+ }
+ }
+
+ [Test]
+ public void Gui_SetValue_GetNewlySetValue()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var gui = mocks.Stub();
+ mocks.ReplayAll();
+
+ using (var plugin = new SimpleGuiPlugin())
+ {
+ // Call
+ plugin.Gui = gui;
+
+ // Assert
+ Assert.AreEqual(gui, plugin.Gui);
+ }
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void Activate_DoesNotThrow()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var gui = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ using (var plugin = new SimpleGuiPlugin { Gui = gui })
+ {
+ // Call
+ TestDelegate call = () => plugin.Activate();
+
+ // Assert
+ Assert.DoesNotThrow(call);
+ }
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void Deactivate_DoesNotThrow()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var gui = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ using (var plugin = new SimpleGuiPlugin { Gui = gui })
+ {
+ // Call
+ TestDelegate call = () => plugin.Deactivate();
+
+ // Assert
+ Assert.DoesNotThrow(call);
+ }
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void GetPropertyInfos_ReturnEmpty()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var gui = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ using (var plugin = new SimpleGuiPlugin { Gui = gui })
+ {
+ // Call
+ var infos = plugin.GetPropertyInfos();
+
+ // Assert
+ CollectionAssert.IsEmpty(infos);
+ }
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void GetViewInfos_ReturnEmpty()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var gui = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ using (var plugin = new SimpleGuiPlugin { Gui = gui })
+ {
+ // Call
+ var infos = plugin.GetViewInfos();
+
+ // Assert
+ CollectionAssert.IsEmpty(infos);
+ }
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void GetTreeNodeInfos_ReturnEmpty()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var gui = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ using (var plugin = new SimpleGuiPlugin { Gui = gui })
+ {
+ // Call
+ var infos = plugin.GetTreeNodeInfos();
+
+ // Assert
+ CollectionAssert.IsEmpty(infos);
+ }
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void GetChildDataWithViewDefinitions_ReturnEmpty()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var gui = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ using (var plugin = new SimpleGuiPlugin { Gui = gui })
+ {
+ // Call
+ var infos = plugin.GetChildDataWithViewDefinitions(null);
+
+ // Assert
+ CollectionAssert.IsEmpty(infos);
+ }
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void Dispose_SetGuiToNull()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var gui = mocks.Stub();
+ mocks.ReplayAll();
+
+ using (var plugin = new SimpleGuiPlugin { Gui = gui })
+ {
+ // Call
+ plugin.Dispose();
+
+ // Assert
+ Assert.IsNull(plugin.Gui);
+ }
+ mocks.VerifyAll();
+ }
+
+ private class SimpleGuiPlugin : GuiPlugin
+ {
+
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.Gui.Test/Plugin/PropertyInfoExtensionsTest.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.Gui.Test/Plugin/PropertyInfoExtensionsTest.cs (revision 0)
+++ Core/Common/test/Core.Common.Gui.Test/Plugin/PropertyInfoExtensionsTest.cs (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -0,0 +1,73 @@
+using Core.Common.Gui.Plugin;
+using Core.Common.Gui.PropertyBag;
+
+using NUnit.Framework;
+
+namespace Core.Common.Gui.Test.Plugin
+{
+ [TestFixture]
+ public class PropertyInfoExtensionsTest
+ {
+ [Test]
+ public void CreateObjectProperties_SimplePropertyInfo_CreateObjectPropertiesObjectForData()
+ {
+ // Setup
+ PropertyInfo propertyInfo = new PropertyInfo();
+
+ const int integerValue = 22;
+
+ // Call
+ var properties = propertyInfo.CreateObjectProperties(integerValue);
+
+ // Assert
+ Assert.IsInstanceOf(properties);
+ Assert.AreEqual(integerValue, properties.Data);
+ }
+
+ [Test]
+ public void CreateObjectProperties_PropertyInfoWithGetObjectPropertiesData_CreateObjectPropertiesObjectForTransformedData()
+ {
+ // Setup
+ const int alternativeIntegerValue = 13;
+ PropertyInfo propertyInfo = new PropertyInfo
+ {
+ GetObjectPropertiesData = i => alternativeIntegerValue
+ };
+
+ const int integerValue = 22;
+
+ // Call
+ var properties = propertyInfo.CreateObjectProperties(integerValue);
+
+ // Assert
+ Assert.IsInstanceOf(properties);
+ Assert.AreEqual(alternativeIntegerValue, properties.Data);
+ }
+
+ [Test]
+ public void CreateObjectProperties_PropertyInfoWithGetObjectPropertiesDataAndAfterCreate_CreateObjectPropertiesObjectForTransformedData()
+ {
+ // Setup
+ const int alternativeIntegerValue = 13;
+ PropertyInfo propertyInfo = new PropertyInfo
+ {
+ GetObjectPropertiesData = i => alternativeIntegerValue,
+ AfterCreate = intProperties => Assert.AreEqual(alternativeIntegerValue, intProperties.Data)
+ };
+
+ const int integerValue = 22;
+
+ // Call
+ var properties = propertyInfo.CreateObjectProperties(integerValue);
+
+ // Assert
+ Assert.IsInstanceOf(properties);
+ Assert.AreEqual(alternativeIntegerValue, properties.Data);
+ }
+
+ private class TestIntProperties : IObjectProperties
+ {
+ public object Data { get; set; }
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.Gui.Test/Plugin/PropertyInfoTest.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.Gui.Test/Plugin/PropertyInfoTest.cs (revision 0)
+++ Core/Common/test/Core.Common.Gui.Test/Plugin/PropertyInfoTest.cs (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -0,0 +1,181 @@
+using System;
+
+using Core.Common.Gui.Plugin;
+using Core.Common.Gui.PropertyBag;
+
+using NUnit.Framework;
+
+namespace Core.Common.Gui.Test.Plugin
+{
+ [TestFixture]
+ public class PropertyInfoTest
+ {
+ [Test]
+ public void DefaultConstructor_ExpectedValues()
+ {
+ // Call
+ var info = new PropertyInfo();
+
+ // Assert
+ Assert.IsNull(info.DataType);
+ Assert.IsNull(info.PropertyObjectType);
+ Assert.IsNull(info.AdditionalDataCheck);
+ Assert.IsNull(info.GetObjectPropertiesData);
+ Assert.IsNull(info.AfterCreate);
+ }
+
+ [Test]
+ public void SimpleProperties_SetValues_GetNewlySetValues()
+ {
+ // Setup
+ var info = new PropertyInfo();
+
+ var newDataType = typeof(object);
+ var newPropertyObjectType = typeof(TestObjectProperties);
+ Func newAdditionalDataDelegate = o => true;
+ Func newGetObjectPropertiesDataDelegate = o => new object();
+ Action newAfterCreateDelegate = view =>
+ {
+ // Do something with the view
+ };
+
+ // Call
+ info.DataType = newDataType;
+ info.PropertyObjectType = newPropertyObjectType;
+ info.AdditionalDataCheck = newAdditionalDataDelegate;
+ info.GetObjectPropertiesData = newGetObjectPropertiesDataDelegate;
+ info.AfterCreate = newAfterCreateDelegate;
+
+ // Assert
+ Assert.AreEqual(newDataType, info.DataType);
+ Assert.AreEqual(newPropertyObjectType, info.PropertyObjectType);
+ Assert.AreEqual(newAdditionalDataDelegate, info.AdditionalDataCheck);
+ Assert.AreEqual(newGetObjectPropertiesDataDelegate, info.GetObjectPropertiesData);
+ Assert.AreEqual(newAfterCreateDelegate, info.AfterCreate);
+ }
+
+ [Test]
+ public void DefaultGenericConstructor_ExpectedValues()
+ {
+ // Call
+ var info = new PropertyInfo();
+
+ // Assert
+ Assert.AreEqual(typeof(int), info.DataType);
+ Assert.AreEqual(typeof(TestObjectProperties), info.PropertyObjectType);
+ Assert.IsNull(info.AdditionalDataCheck);
+ Assert.IsNull(info.GetObjectPropertiesData);
+ Assert.IsNull(info.AfterCreate);
+ }
+
+ [Test]
+ public void SimpleProperties_SetValuesForGenericPropertyInfo_GetNewlySetValues()
+ {
+ // Setup
+ var info = new PropertyInfo();
+
+ Func newAdditionalDataDelegate = o => true;
+ Func newGetObjectPropertiesDataDelegate = o => new object();
+ Action newAfterCreateDelegate = view =>
+ {
+ // Do something with the view
+ };
+
+ // Call
+ info.AdditionalDataCheck = newAdditionalDataDelegate;
+ info.GetObjectPropertiesData = newGetObjectPropertiesDataDelegate;
+ info.AfterCreate = newAfterCreateDelegate;
+
+ // Assert
+ Assert.AreEqual(newAdditionalDataDelegate, info.AdditionalDataCheck);
+ Assert.AreEqual(newGetObjectPropertiesDataDelegate, info.GetObjectPropertiesData);
+ Assert.AreEqual(newAfterCreateDelegate, info.AfterCreate);
+ }
+
+ [Test]
+ public void ImplicitOperator_OptionalDelegatesSet_PropertyInfoFullyConverted()
+ {
+ // Setup
+ var info = new PropertyInfo();
+
+ const int inputData = 42;
+ var properties = new TestObjectProperties();
+
+ bool additionalDataDelegateCalled = false;
+ Func newAdditionalDataDelegate = o =>
+ {
+ Assert.AreEqual(inputData, o);
+ additionalDataDelegateCalled = true;
+ return true;
+ };
+ var alternativeObject = new object();
+ bool getObjectPropertiesDataDelegateCalled = false;
+ Func newGetObjectPropertiesDataDelegate = o =>
+ {
+ Assert.AreEqual(inputData, o);
+ getObjectPropertiesDataDelegateCalled = true;
+ return alternativeObject;
+ };
+ bool afterCreateDelegateCalled = false;
+ Action newAfterCreateDelegate = view =>
+ {
+ Assert.AreSame(properties, view);
+ afterCreateDelegateCalled = true;
+ };
+
+ info.AdditionalDataCheck = newAdditionalDataDelegate;
+ info.GetObjectPropertiesData = newGetObjectPropertiesDataDelegate;
+ info.AfterCreate = newAfterCreateDelegate;
+
+ // Precondition
+ Assert.IsInstanceOf>(info);
+
+ // Call
+ PropertyInfo convertedInfo = info;
+
+ // Assert
+ Assert.IsInstanceOf(convertedInfo);
+ Assert.AreEqual(typeof(int), convertedInfo.DataType);
+ Assert.AreEqual(typeof(TestObjectProperties), convertedInfo.PropertyObjectType);
+
+ Assert.IsNotNull(convertedInfo.AdditionalDataCheck);
+ Assert.IsTrue(convertedInfo.AdditionalDataCheck(inputData));
+ Assert.IsTrue(additionalDataDelegateCalled);
+
+ Assert.IsNotNull(convertedInfo.GetObjectPropertiesData);
+ Assert.AreSame(alternativeObject, convertedInfo.GetObjectPropertiesData(inputData));
+ Assert.IsTrue(getObjectPropertiesDataDelegateCalled);
+
+ Assert.IsNotNull(convertedInfo.AfterCreate);
+ convertedInfo.AfterCreate(properties);
+ Assert.IsTrue(afterCreateDelegateCalled);
+ }
+
+ [Test]
+ public void ImplicitOperator_NoneOfTheOptionalDelegatesSet_PropertyInfoFullyConverted()
+ {
+ // Setup
+ var info = new PropertyInfo();
+
+ // Precondition
+ Assert.IsInstanceOf>(info);
+
+ // Call
+ PropertyInfo convertedInfo = info;
+
+ // Assert
+ Assert.IsInstanceOf(convertedInfo);
+ Assert.AreEqual(typeof(int), convertedInfo.DataType);
+ Assert.AreEqual(typeof(TestObjectProperties), convertedInfo.PropertyObjectType);
+
+ Assert.IsNull(convertedInfo.AdditionalDataCheck);
+ Assert.IsNull(convertedInfo.GetObjectPropertiesData);
+ Assert.IsNull(convertedInfo.AfterCreate);
+ }
+
+ private class TestObjectProperties : ObjectProperties
+ {
+
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.Gui.Test/Plugin/ViewInfoTest.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.Gui.Test/Plugin/ViewInfoTest.cs (revision 0)
+++ Core/Common/test/Core.Common.Gui.Test/Plugin/ViewInfoTest.cs (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -0,0 +1,278 @@
+using System;
+using System.Drawing;
+
+using Core.Common.Controls.Views;
+using Core.Common.Gui.Plugin;
+using Core.Common.Gui.Test.Properties;
+
+using NUnit.Framework;
+
+namespace Core.Common.Gui.Test.Plugin
+{
+ [TestFixture]
+ public class ViewInfoTest
+ {
+ [Test]
+ public void DefaultConstructor_ExpectedValues()
+ {
+ // Call
+ var viewInfo = new ViewInfo();
+
+ // Assert
+ Assert.IsNull(viewInfo.DataType);
+ Assert.IsNull(viewInfo.ViewDataType);
+ Assert.IsNull(viewInfo.ViewType);
+ Assert.IsNull(viewInfo.Description);
+ Assert.IsNull(viewInfo.GetViewName);
+ Assert.IsNull(viewInfo.Image);
+ Assert.IsNull(viewInfo.AdditionalDataCheck);
+ Assert.IsNull(viewInfo.GetViewData);
+ Assert.IsNull(viewInfo.AfterCreate);
+ Assert.IsNull(viewInfo.OnActivateView);
+ Assert.IsNull(viewInfo.CloseForData);
+ }
+
+ [Test]
+ public void SimpleProperties_SetNewValues_GetNewlySetValues()
+ {
+ // Setup
+ var viewInfo = new ViewInfo();
+
+ var newDataType = typeof(int);
+ var newViewDataType = typeof(string);
+ var viewType = typeof(StringView);
+ var newDescription = "";
+ Func getViewNameDelegate = (view, o) => "";
+ Image icon = Resources.abacus;
+ Func additionalDataDelegate = o => true;
+ Func getViewDataDelegate = o => 45;
+ Action afterCreateDelegate = (view, o) =>
+ {
+ // Do something useful
+ };
+ Action onActivateViewDelegate = (view, o) =>
+ {
+ // React to activation
+ };
+ Func closeViewForDataDelegate = (view, o) => true;
+
+ // Call
+ viewInfo.DataType = newDataType;
+ viewInfo.ViewDataType = newViewDataType;
+ viewInfo.ViewType = viewType;
+ viewInfo.Description = newDescription;
+ viewInfo.GetViewName = getViewNameDelegate;
+ viewInfo.Image = icon;
+ viewInfo.AdditionalDataCheck = additionalDataDelegate;
+ viewInfo.GetViewData = getViewDataDelegate;
+ viewInfo.AfterCreate = afterCreateDelegate;
+ viewInfo.OnActivateView = onActivateViewDelegate;
+ viewInfo.CloseForData = closeViewForDataDelegate;
+
+ // Assert
+ Assert.AreEqual(newDataType, viewInfo.DataType);
+ Assert.AreEqual(newViewDataType, viewInfo.ViewDataType);
+ Assert.AreEqual(viewType, viewInfo.ViewType);
+ Assert.AreEqual(newDescription, viewInfo.Description);
+ Assert.AreEqual(getViewNameDelegate, viewInfo.GetViewName);
+ Assert.AreEqual(icon, viewInfo.Image);
+ Assert.AreEqual(additionalDataDelegate, viewInfo.AdditionalDataCheck);
+ Assert.AreEqual(getViewDataDelegate, viewInfo.GetViewData);
+ Assert.AreEqual(afterCreateDelegate, viewInfo.AfterCreate);
+ Assert.AreEqual(onActivateViewDelegate, viewInfo.OnActivateView);
+ Assert.AreEqual(closeViewForDataDelegate, viewInfo.CloseForData);
+ }
+
+ [Test]
+ public void ToString_WithRelevantFieldsInitialized_ReturnText()
+ {
+ // Setup
+ var viewInfo = new ViewInfo
+ {
+ DataType = typeof(int),
+ ViewDataType = typeof(string),
+ ViewType = typeof(StringView)
+ };
+
+ // Call
+ var text = viewInfo.ToString();
+
+ // Assert
+ var expectedText = string.Format("{0} : {1} : {2}",
+ viewInfo.DataType, viewInfo.ViewDataType, viewInfo.ViewType);
+ Assert.AreEqual(expectedText, text);
+ }
+
+ [Test]
+ public void DefaultGenericConstructor_ExpectedValues()
+ {
+ // Call
+ var viewInfo = new ViewInfo();
+
+ // Assert
+ Assert.AreEqual(typeof(int), viewInfo.DataType);
+ Assert.AreEqual(typeof(string), viewInfo.ViewDataType);
+ Assert.AreEqual(typeof(StringView), viewInfo.ViewType);
+ Assert.IsNull(viewInfo.Description);
+ Assert.IsNull(viewInfo.GetViewName);
+ Assert.IsNull(viewInfo.Image);
+ Assert.IsNull(viewInfo.AdditionalDataCheck);
+ Assert.IsNull(viewInfo.GetViewData);
+ Assert.IsNull(viewInfo.AfterCreate);
+ Assert.IsNull(viewInfo.OnActivateView);
+ Assert.IsNull(viewInfo.CloseForData);
+ }
+
+ [Test]
+ public void SimpleProperties_GenericViewInfoSetNewValues_GetNewlySetValues()
+ {
+ // Setup
+ var viewInfo = new ViewInfo();
+
+ var newDescription = "";
+ Func getViewNameDelegate = (view, o) => "";
+ Image icon = Resources.abacus;
+ Func additionalDataDelegate = o => true;
+ Func getViewDataDelegate = o => o.ToString();
+ Action afterCreateDelegate = (view, o) =>
+ {
+ // Do something useful
+ };
+ Action onActivateViewDelegate = (view, o) =>
+ {
+ // React to activation
+ };
+ Func closeViewForDataDelegate = (view, o) => true;
+
+ // Call
+ viewInfo.Description = newDescription;
+ viewInfo.GetViewName = getViewNameDelegate;
+ viewInfo.Image = icon;
+ viewInfo.AdditionalDataCheck = additionalDataDelegate;
+ viewInfo.GetViewData = getViewDataDelegate;
+ viewInfo.AfterCreate = afterCreateDelegate;
+ viewInfo.OnActivateView = onActivateViewDelegate;
+ viewInfo.CloseForData = closeViewForDataDelegate;
+
+ // Assert
+ Assert.AreEqual(newDescription, viewInfo.Description);
+ Assert.AreEqual(getViewNameDelegate, viewInfo.GetViewName);
+ Assert.AreEqual(icon, viewInfo.Image);
+ Assert.AreEqual(additionalDataDelegate, viewInfo.AdditionalDataCheck);
+ Assert.AreEqual(getViewDataDelegate, viewInfo.GetViewData);
+ Assert.AreEqual(afterCreateDelegate, viewInfo.AfterCreate);
+ Assert.AreEqual(onActivateViewDelegate, viewInfo.OnActivateView);
+ Assert.AreEqual(closeViewForDataDelegate, viewInfo.CloseForData);
+ }
+
+ [Test]
+ public void ToString_GenericViewInfoWithRelevantFieldsInitialized_ReturnText()
+ {
+ // Setup
+ var viewInfo = new ViewInfo();
+
+ // Call
+ var text = viewInfo.ToString();
+
+ // Assert
+ var expectedText = string.Format("{0} : {1} : {2}",
+ viewInfo.DataType, viewInfo.ViewDataType, viewInfo.ViewType);
+ Assert.AreEqual(expectedText, text);
+ }
+
+ [Test]
+ public void ImplicitOperator_WithAllMethodsSet_InfoFullyConverted()
+ {
+ // Setup
+ var viewInfo = new ViewInfo();
+
+ var stringView = new StringView();
+ var dataObject = 11;
+
+ var newDescription = "";
+ const string newViewName = "";
+ Func getViewNameDelegate = (view, o) =>
+ {
+ Assert.AreSame(stringView, view);
+ Assert.AreEqual(dataObject.ToString(), o);
+ return newViewName;
+ };
+ Image icon = Resources.abacus;
+ Func additionalDataDelegate = o =>
+ {
+ Assert.AreEqual(dataObject, o);
+ return true;
+ };
+ Func getViewDataDelegate = o =>
+ {
+ Assert.AreEqual(dataObject, o);
+ return o.ToString();
+ };
+ bool afterCreateDelegateCalled = false;
+ Action afterCreateDelegate = (view, o) =>
+ {
+ Assert.AreSame(stringView, view);
+ Assert.AreEqual(dataObject, o);
+ afterCreateDelegateCalled = true;
+ };
+ bool onActivateViewDelegateCalled = false;
+ Action onActivateViewDelegate = (view, o) =>
+ {
+ Assert.AreSame(stringView, view);
+ Assert.AreEqual(dataObject, o);
+ onActivateViewDelegateCalled = true;
+ };
+ Func closeViewForDataDelegate = (view, o) =>
+ {
+ Assert.AreSame(stringView, view);
+ Assert.AreEqual(dataObject, o);
+ return true;
+ };
+
+ viewInfo.Description = newDescription;
+ viewInfo.GetViewName = getViewNameDelegate;
+ viewInfo.Image = icon;
+ viewInfo.AdditionalDataCheck = additionalDataDelegate;
+ viewInfo.GetViewData = getViewDataDelegate;
+ viewInfo.AfterCreate = afterCreateDelegate;
+ viewInfo.OnActivateView = onActivateViewDelegate;
+ viewInfo.CloseForData = closeViewForDataDelegate;
+
+ // Precondition
+ Assert.IsInstanceOf>(viewInfo);
+
+ // Call
+ ViewInfo info = viewInfo;
+
+ // Assert
+ Assert.IsInstanceOf(info);
+ Assert.AreEqual(typeof(int), info.DataType);
+ Assert.AreEqual(typeof(string), info.ViewDataType);
+ Assert.AreEqual(typeof(StringView), info.ViewType);
+ Assert.AreEqual(newDescription, info.Description);
+ Assert.AreEqual(newViewName, info.GetViewName(stringView, dataObject.ToString()));
+ Assert.AreEqual(icon, info.Image);
+ Assert.IsTrue(viewInfo.AdditionalDataCheck(dataObject));
+ Assert.AreEqual(dataObject.ToString(), viewInfo.GetViewData(dataObject));
+
+ viewInfo.AfterCreate(stringView, dataObject);
+ Assert.IsTrue(afterCreateDelegateCalled);
+
+ viewInfo.OnActivateView(stringView, dataObject);
+ Assert.IsTrue(onActivateViewDelegateCalled);
+
+ Assert.IsTrue(viewInfo.CloseForData(stringView, dataObject));
+ }
+
+ private class StringView : IView
+ {
+ public void Dispose()
+ {
+ throw new NotImplementedException();
+ }
+
+ public object Data { get; set; }
+ public string Text { get; set; }
+ }
+ }
+}
\ No newline at end of file
Index: Core/Plugins/src/Core.Plugins.CommonTools/CommonToolsGuiPlugin.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Plugins/src/Core.Plugins.CommonTools/CommonToolsGuiPlugin.cs (.../CommonToolsGuiPlugin.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Core/Plugins/src/Core.Plugins.CommonTools/CommonToolsGuiPlugin.cs (.../CommonToolsGuiPlugin.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -42,7 +42,7 @@
yield return new PropertyInfo();
}
- public override IEnumerable GetViewInfoObjects()
+ public override IEnumerable GetViewInfos()
{
yield return new ViewInfo
{
Index: Core/Plugins/src/Core.Plugins.DotSpatial/DotSpatialGuiPlugin.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Plugins/src/Core.Plugins.DotSpatial/DotSpatialGuiPlugin.cs (.../DotSpatialGuiPlugin.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Core/Plugins/src/Core.Plugins.DotSpatial/DotSpatialGuiPlugin.cs (.../DotSpatialGuiPlugin.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -68,7 +68,7 @@
base.Dispose();
}
- public override IEnumerable GetViewInfoObjects()
+ public override IEnumerable GetViewInfos()
{
yield return new ViewInfo
{
Index: Core/Plugins/src/Core.Plugins.OxyPlot/OxyPlotGuiPlugin.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Plugins/src/Core.Plugins.OxyPlot/OxyPlotGuiPlugin.cs (.../OxyPlotGuiPlugin.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Core/Plugins/src/Core.Plugins.OxyPlot/OxyPlotGuiPlugin.cs (.../OxyPlotGuiPlugin.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -61,7 +61,7 @@
activated = true;
}
- public override IEnumerable GetViewInfoObjects()
+ public override IEnumerable GetViewInfos()
{
yield return new ViewInfo
{
Index: Core/Plugins/test/Core.Plugins.CommonTools.Test/CommonToolsGuiPluginTest.cs
===================================================================
diff -u -re4ee8a21ab07f3446dc417e50574b6bc6106f460 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Plugins/test/Core.Plugins.CommonTools.Test/CommonToolsGuiPluginTest.cs (.../CommonToolsGuiPluginTest.cs) (revision e4ee8a21ab07f3446dc417e50574b6bc6106f460)
+++ Core/Plugins/test/Core.Plugins.CommonTools.Test/CommonToolsGuiPluginTest.cs (.../CommonToolsGuiPluginTest.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -25,11 +25,11 @@
// Assert
Assert.AreEqual(2, propertyInfos.Count);
- var projectPropertyInfo = propertyInfos.First(pi => pi.ObjectType == typeof(Project));
- var urlPropertyInfo = propertyInfos.First(pi => pi.ObjectType == typeof(WebLink));
+ var projectPropertyInfo = propertyInfos.First(pi => pi.DataType == typeof(Project));
+ var urlPropertyInfo = propertyInfos.First(pi => pi.DataType == typeof(WebLink));
- Assert.AreEqual(typeof(ProjectProperties), projectPropertyInfo.PropertyType);
- Assert.AreEqual(typeof(WebLinkProperties), urlPropertyInfo.PropertyType);
+ Assert.AreEqual(typeof(ProjectProperties), projectPropertyInfo.PropertyObjectType);
+ Assert.AreEqual(typeof(WebLinkProperties), urlPropertyInfo.PropertyObjectType);
}
[Test]
@@ -39,7 +39,7 @@
var guiPlugin = new CommonToolsGuiPlugin();
// Call
- var viewInfos = guiPlugin.GetViewInfoObjects().ToArray();
+ var viewInfos = guiPlugin.GetViewInfos().ToArray();
// Assert
Assert.NotNull(viewInfos);
@@ -63,7 +63,7 @@
// Setup
var guiPlugin = new CommonToolsGuiPlugin();
- var info = guiPlugin.GetViewInfoObjects().First(vi => vi.DataType == typeof(RichTextFile));
+ var info = guiPlugin.GetViewInfos().First(vi => vi.DataType == typeof(RichTextFile));
// Call
var name = info.GetViewName(null, null);
@@ -79,7 +79,7 @@
var expected = "SomeName";
var guiPlugin = new CommonToolsGuiPlugin();
- var info = guiPlugin.GetViewInfoObjects().First(vi => vi.DataType == typeof(RichTextFile));
+ var info = guiPlugin.GetViewInfos().First(vi => vi.DataType == typeof(RichTextFile));
var richTextFile = new RichTextFile
{
Name = expected
@@ -98,7 +98,7 @@
// Setup
var guiPlugin = new CommonToolsGuiPlugin();
- var info = guiPlugin.GetViewInfoObjects().First(vi => vi.DataType == typeof(WebLink));
+ var info = guiPlugin.GetViewInfos().First(vi => vi.DataType == typeof(WebLink));
// Call
var name = info.GetViewName(null, null);
@@ -114,7 +114,7 @@
var expected = "SomeName";
var guiPlugin = new CommonToolsGuiPlugin();
- var info = guiPlugin.GetViewInfoObjects().First(vi => vi.DataType == typeof(WebLink));
+ var info = guiPlugin.GetViewInfos().First(vi => vi.DataType == typeof(WebLink));
var webLink = new WebLink(expected, null);
// Call
Index: Core/Plugins/test/Core.Plugins.DotSpatial.Test/DotSpatialGuiPluginTest.cs
===================================================================
diff -u -rf2859c13f845d1cb1f654022aad4f48cdb5d908b -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Plugins/test/Core.Plugins.DotSpatial.Test/DotSpatialGuiPluginTest.cs (.../DotSpatialGuiPluginTest.cs) (revision f2859c13f845d1cb1f654022aad4f48cdb5d908b)
+++ Core/Plugins/test/Core.Plugins.DotSpatial.Test/DotSpatialGuiPluginTest.cs (.../DotSpatialGuiPluginTest.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -107,7 +107,7 @@
var view = new MapDataView();
// Call
- var views = plugin.GetViewInfoObjects().ToArray();
+ var views = plugin.GetViewInfos().ToArray();
// Assert
Assert.AreEqual(1, views.Length);
Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs
===================================================================
diff -u -readc46f479face9b66568438765d85c3a2b892cf -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs (.../OxyPlotGuiPluginTest.cs) (revision eadc46f479face9b66568438765d85c3a2b892cf)
+++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs (.../OxyPlotGuiPluginTest.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -106,7 +106,7 @@
var view = new ChartDataView();
// Call
- var views = plugin.GetViewInfoObjects().ToArray();
+ var views = plugin.GetViewInfos().ToArray();
// Assert
Assert.AreEqual(1, views.Length);
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -62,7 +62,7 @@
yield return new PropertyInfo();
}
- public override IEnumerable GetViewInfoObjects()
+ public override IEnumerable GetViewInfos()
{
yield return new ViewInfo
{
Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs
===================================================================
diff -u -r5f53f2f23d0c4145d79823c5443966ff4a5a830f -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs (.../RingtoetsGuiPluginTest.cs) (revision 5f53f2f23d0c4145d79823c5443966ff4a5a830f)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs (.../RingtoetsGuiPluginTest.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -45,8 +45,8 @@
// assert
Assert.AreEqual(1, propertyInfos.Length);
- var assessmentSectionProperties = propertyInfos.Single(pi => pi.ObjectType == typeof(AssessmentSectionBase));
- Assert.AreEqual(typeof(AssessmentSectionBaseProperties), assessmentSectionProperties.PropertyType);
+ var assessmentSectionProperties = propertyInfos.Single(pi => pi.DataType == typeof(AssessmentSectionBase));
+ Assert.AreEqual(typeof(AssessmentSectionBaseProperties), assessmentSectionProperties.PropertyObjectType);
Assert.IsNull(assessmentSectionProperties.AdditionalDataCheck);
Assert.IsNull(assessmentSectionProperties.GetObjectPropertiesData);
Assert.IsNull(assessmentSectionProperties.AfterCreate);
Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs
===================================================================
diff -u -r0c64d8a6c718c0aa67403a16c94dd0c10f862455 -r67980a5c3c5cb71c185278e849b123e7f92990eb
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs (.../PipingGuiPluginTest.cs) (revision 0c64d8a6c718c0aa67403a16c94dd0c10f862455)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs (.../PipingGuiPluginTest.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb)
@@ -44,38 +44,38 @@
// assert
Assert.AreEqual(6, propertyInfos.Length);
- var pipingCalculationContextProperties = propertyInfos.Single(pi => pi.ObjectType == typeof(PipingCalculationContext));
- Assert.AreEqual(typeof(PipingCalculationContextProperties), pipingCalculationContextProperties.PropertyType);
+ var pipingCalculationContextProperties = propertyInfos.Single(pi => pi.DataType == typeof(PipingCalculationContext));
+ Assert.AreEqual(typeof(PipingCalculationContextProperties), pipingCalculationContextProperties.PropertyObjectType);
Assert.IsNull(pipingCalculationContextProperties.AdditionalDataCheck);
Assert.IsNull(pipingCalculationContextProperties.GetObjectPropertiesData);
Assert.IsNull(pipingCalculationContextProperties.AfterCreate);
- var pipingCalculationGroupProperties = propertyInfos.Single(pi => pi.ObjectType == typeof(PipingCalculationGroupContext));
- Assert.AreEqual(typeof(PipingCalculationGroupContextProperties), pipingCalculationGroupProperties.PropertyType);
+ var pipingCalculationGroupProperties = propertyInfos.Single(pi => pi.DataType == typeof(PipingCalculationGroupContext));
+ Assert.AreEqual(typeof(PipingCalculationGroupContextProperties), pipingCalculationGroupProperties.PropertyObjectType);
Assert.IsNull(pipingCalculationGroupProperties.AdditionalDataCheck);
Assert.IsNull(pipingCalculationGroupProperties.GetObjectPropertiesData);
Assert.IsNull(pipingCalculationGroupProperties.AfterCreate);
- var pipingInputContextProperties = propertyInfos.Single(pi => pi.ObjectType == typeof(PipingInputContext));
- Assert.AreEqual(typeof(PipingInputContextProperties), pipingInputContextProperties.PropertyType);
+ var pipingInputContextProperties = propertyInfos.Single(pi => pi.DataType == typeof(PipingInputContext));
+ Assert.AreEqual(typeof(PipingInputContextProperties), pipingInputContextProperties.PropertyObjectType);
Assert.IsNull(pipingInputContextProperties.AdditionalDataCheck);
Assert.IsNull(pipingInputContextProperties.GetObjectPropertiesData);
Assert.IsNull(pipingInputContextProperties.AfterCreate);
- var pipingOutputProperties = propertyInfos.Single(pi => pi.ObjectType == typeof(PipingOutput));
- Assert.AreEqual(typeof(PipingOutputProperties), pipingOutputProperties.PropertyType);
+ var pipingOutputProperties = propertyInfos.Single(pi => pi.DataType == typeof(PipingOutput));
+ Assert.AreEqual(typeof(PipingOutputProperties), pipingOutputProperties.PropertyObjectType);
Assert.IsNull(pipingOutputProperties.AdditionalDataCheck);
Assert.IsNull(pipingOutputProperties.GetObjectPropertiesData);
Assert.IsNull(pipingOutputProperties.AfterCreate);
- var pipingSurfaceLineProperties = propertyInfos.Single(pi => pi.ObjectType == typeof(RingtoetsPipingSurfaceLine));
- Assert.AreEqual(typeof(RingtoetsPipingSurfaceLineProperties), pipingSurfaceLineProperties.PropertyType);
+ var pipingSurfaceLineProperties = propertyInfos.Single(pi => pi.DataType == typeof(RingtoetsPipingSurfaceLine));
+ Assert.AreEqual(typeof(RingtoetsPipingSurfaceLineProperties), pipingSurfaceLineProperties.PropertyObjectType);
Assert.IsNull(pipingSurfaceLineProperties.AdditionalDataCheck);
Assert.IsNull(pipingSurfaceLineProperties.GetObjectPropertiesData);
Assert.IsNull(pipingSurfaceLineProperties.AfterCreate);
- var pipingSoilProfileProperties = propertyInfos.Single(pi => pi.ObjectType == typeof(PipingSoilProfile));
- Assert.AreEqual(typeof(PipingSoilProfileProperties), pipingSoilProfileProperties.PropertyType);
+ var pipingSoilProfileProperties = propertyInfos.Single(pi => pi.DataType == typeof(PipingSoilProfile));
+ Assert.AreEqual(typeof(PipingSoilProfileProperties), pipingSoilProfileProperties.PropertyObjectType);
Assert.IsNull(pipingSoilProfileProperties.AdditionalDataCheck);
Assert.IsNull(pipingSoilProfileProperties.GetObjectPropertiesData);
Assert.IsNull(pipingSoilProfileProperties.AfterCreate);