Index: Core/Common/src/Core.Common.Base/IO/IFileExporter.cs
===================================================================
diff -u -ra29fec51f51cad7d19ea534636d15c84bf52ccec -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Base/IO/IFileExporter.cs (.../IFileExporter.cs) (revision a29fec51f51cad7d19ea534636d15c84bf52ccec)
+++ Core/Common/src/Core.Common.Base/IO/IFileExporter.cs (.../IFileExporter.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -33,7 +33,8 @@
/// Gets the file filter of the .
///
///
- /// "My file format1 (*.ext1)|*.ext1|My file format2 (*.ext2)|*.ext2".
+ /// An example string would be:
+ /// "My file format1 (*.ext1)|*.ext1|My file format2 (*.ext2)|*.ext2"
///
string FileFilter { get; }
Index: Core/Common/src/Core.Common.Base/IO/IFileImporter.cs
===================================================================
diff -u -rf7d7a919dec1b7d79672af043f268cde57aab0ba -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Base/IO/IFileImporter.cs (.../IFileImporter.cs) (revision f7d7a919dec1b7d79672af043f268cde57aab0ba)
+++ Core/Common/src/Core.Common.Base/IO/IFileImporter.cs (.../IFileImporter.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -33,7 +33,8 @@
/// Gets the file filter of the .
///
///
- /// "My file format1 (*.ext1)|*.ext1|My file format2 (*.ext2)|*.ext2".
+ /// An example string would be:
+ /// "My file format1 (*.ext1)|*.ext1|My file format2 (*.ext2)|*.ext2"
///
string FileFilter { get; }
Index: Core/Common/src/Core.Common.Controls/Views/HtmlPageView.cs
===================================================================
diff -u -ra3388f7316f4e953275d33d799cf62dd5fd7594d -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Controls/Views/HtmlPageView.cs (.../HtmlPageView.cs) (revision a3388f7316f4e953275d33d799cf62dd5fd7594d)
+++ Core/Common/src/Core.Common.Controls/Views/HtmlPageView.cs (.../HtmlPageView.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -4,11 +4,11 @@
namespace Core.Common.Controls.Views
{
///
- /// Class for showing a html page based on an .
+ /// Class for showing a html page based on an .
///
public partial class HtmlPageView : UserControl, IView
{
- private Url url;
+ private WebLink url;
///
/// Constructs a new .
@@ -26,7 +26,7 @@
}
set
{
- url = value as Url;
+ url = value as WebLink;
if (url != null && url.Path != null)
{
Index: Core/Common/src/Core.Common.Gui/Attributes/DynamicReadOnlyAttribute.cs
===================================================================
diff -u -rb92517dbc9956b930a6cfc7f96a1f762dfa41cf6 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Gui/Attributes/DynamicReadOnlyAttribute.cs (.../DynamicReadOnlyAttribute.cs) (revision b92517dbc9956b930a6cfc7f96a1f762dfa41cf6)
+++ Core/Common/src/Core.Common.Gui/Attributes/DynamicReadOnlyAttribute.cs (.../DynamicReadOnlyAttribute.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -1,13 +1,13 @@
using System;
using System.ComponentModel;
+using System.Reflection;
+using Core.Common.Gui.Properties;
-using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources;
-
namespace Core.Common.Gui.Attributes
{
///
/// Marks property as a conditional read-only property. When this attribute is declared
- /// on a property, the declaring a class should have a public method marked with
+ /// on a property, the declaring class should have a public method marked with
/// to be used to evaluate if
/// that property should be read-only or not.
///
@@ -35,23 +35,21 @@
return ReadOnlyAttribute.Default.IsReadOnly;
}
- var isDynamicReadOnlyProperty = PropertyIsDynamicallyReadOnly(obj, propertyName);
- if (!isDynamicReadOnlyProperty)
+ if (!IsPropertyDynamicallyReadOnly(obj, propertyName))
{
return ReadOnlyAttribute.Default.IsReadOnly;
}
var isPropertyReadOnlyDelegate = DynamicReadOnlyValidationMethodAttribute.CreateIsReadOnlyMethod(obj);
-
return isPropertyReadOnlyDelegate(propertyName);
}
- private static bool PropertyIsDynamicallyReadOnly(object obj, string propertyName)
+ private static bool IsPropertyDynamicallyReadOnly(object obj, string propertyName)
{
- var propertyInfo = obj.GetType().GetProperty(propertyName);
+ MemberInfo propertyInfo = obj.GetType().GetProperty(propertyName);
if (propertyInfo == null)
{
- throw new MissingMemberException(string.Format(CoreCommonGuiResources.Could_not_find_property_0_on_type_1_, propertyName,
+ throw new MissingMemberException(string.Format(Resources.Could_not_find_property_0_on_type_1_, propertyName,
obj.GetType()));
}
Index: Core/Common/src/Core.Common.Gui/Attributes/DynamicVisibleAttribute.cs
===================================================================
diff -u -rb92517dbc9956b930a6cfc7f96a1f762dfa41cf6 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Gui/Attributes/DynamicVisibleAttribute.cs (.../DynamicVisibleAttribute.cs) (revision b92517dbc9956b930a6cfc7f96a1f762dfa41cf6)
+++ Core/Common/src/Core.Common.Gui/Attributes/DynamicVisibleAttribute.cs (.../DynamicVisibleAttribute.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -1,13 +1,14 @@
using System;
using System.ComponentModel;
+using System.Reflection;
-using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources;
+using Core.Common.Gui.Properties;
namespace Core.Common.Gui.Attributes
{
///
/// Marks property as a conditional visible property. When this attribute is declared
- /// on a property, the declaring a class should have a public method marked with
+ /// on a property, the declaring class should have a public method marked with
/// to be used to evaluate if
/// that property should be visible or not.
///
@@ -35,8 +36,7 @@
return BrowsableAttribute.Default.Browsable;
}
- var isPropertyWithDynamicVisibility = PropertyIsDynamicallyVisible(obj, propertyName);
- if (!isPropertyWithDynamicVisibility)
+ if (!IsPropertyDynamicallyVisible(obj, propertyName))
{
return BrowsableAttribute.Default.Browsable;
}
@@ -46,12 +46,12 @@
return isPropertyVisibleDelegate(propertyName);
}
- private static bool PropertyIsDynamicallyVisible(object obj, string propertyName)
+ private static bool IsPropertyDynamicallyVisible(object obj, string propertyName)
{
- var propertyInfo = obj.GetType().GetProperty(propertyName);
+ MemberInfo propertyInfo = obj.GetType().GetProperty(propertyName);
if (propertyInfo == null)
{
- throw new MissingMemberException(string.Format(CoreCommonGuiResources.Could_not_find_property_0_on_type_1_, propertyName,
+ throw new MissingMemberException(string.Format(Resources.Could_not_find_property_0_on_type_1_, propertyName,
obj.GetType()));
}
Index: Core/Common/src/Core.Common.Gui/Attributes/PropertyOrderAttribute.cs
===================================================================
diff -u -rcd9655d356bdff388c7058eeff1cdbed076c407b -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Gui/Attributes/PropertyOrderAttribute.cs (.../PropertyOrderAttribute.cs) (revision cd9655d356bdff388c7058eeff1cdbed076c407b)
+++ Core/Common/src/Core.Common.Gui/Attributes/PropertyOrderAttribute.cs (.../PropertyOrderAttribute.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -3,9 +3,8 @@
namespace Core.Common.Gui.Attributes
{
///
- /// Attribute that allows for controlling the order that properties appear in .
- /// Ordering should occur on ascending order. Not having this attribute defined means
- /// an order value of .
+ /// Attribute that allows for controlling the order that properties appear in a property grid.
+ /// Ordering should occur on ascending order.
///
[AttributeUsage(AttributeTargets.Property)]
public sealed class PropertyOrderAttribute : Attribute
Index: Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj
===================================================================
diff -u -re96306bc32984aa50c6d1162167214024ddcf59a -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision e96306bc32984aa50c6d1162167214024ddcf59a)
+++ Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -138,6 +138,7 @@
+
Index: Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs
===================================================================
diff -u -re96306bc32984aa50c6d1162167214024ddcf59a -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision e96306bc32984aa50c6d1162167214024ddcf59a)
+++ Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -1055,8 +1055,12 @@
{
var welcomePageName = (string) Gui.UserSettings["startPageName"];
var welcomePageUrl = Gui.FixedSettings.StartPageUrl;
+ if (string.IsNullOrEmpty(welcomePageUrl))
+ {
+ welcomePageUrl = "about:blank";
+ }
- var url = new Url(welcomePageName, welcomePageUrl);
+ var url = new WebLink(welcomePageName, new Uri(welcomePageUrl));
Gui.ViewCommands.OpenView(url);
}
Index: Core/Common/src/Core.Common.Gui/IViewResolver.cs
===================================================================
diff -u -r42ca97fdb85a553c6aac3bfdfe57c7be4af90821 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Gui/IViewResolver.cs (.../IViewResolver.cs) (revision 42ca97fdb85a553c6aac3bfdfe57c7be4af90821)
+++ Core/Common/src/Core.Common.Gui/IViewResolver.cs (.../IViewResolver.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -10,9 +10,9 @@
{
///
/// Default view types registered for data object types.
- ///
- /// DefaultViewTypes[objectType] = viewType;
///
+ /// The keys in this dictionary are the object types and the values the
+ /// corresponding view object types.
IDictionary DefaultViewTypes { get; }
///
Index: Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpec.cs
===================================================================
diff -u -rd7ef66291b1a64881d4e26b8fc30c5f66f16d67a -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpec.cs (.../PropertySpec.cs) (revision d7ef66291b1a64881d4e26b8fc30c5f66f16d67a)
+++ Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpec.cs (.../PropertySpec.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -1,15 +1,19 @@
using System;
using System.ComponentModel;
+using System.IO;
using System.Linq;
using System.Reflection;
+using log4net;
+
namespace Core.Common.Gui.PropertyBag
{
///
/// This class represents a single property.
///
public class PropertySpec
{
+ private static readonly ILog log = LogManager.GetLogger(typeof(PropertySpec));
private readonly System.Reflection.PropertyInfo propertyInfo;
///
@@ -30,7 +34,7 @@
Name = propertyInfo.Name;
TypeName = propertyInfo.PropertyType.AssemblyQualifiedName;
- var attributeList = propertyInfo.GetCustomAttributes(true).OfType().Select(attrib => attrib).ToList();
+ var attributeList = propertyInfo.GetCustomAttributes(true).OfType().ToList();
if (propertyInfo.GetSetMethod() == null)
{
attributeList.Add(new ReadOnlyAttribute(true));
@@ -107,6 +111,7 @@
/// Gets the property value represented by this instance of some object instance.
///
/// The instance that holds the property to be retrieved.
+ /// The property value on .
/// When
///
/// - Represented property is an index-property.
@@ -144,7 +149,7 @@
}
///
- /// Determines whether the captured property is decorated with [is non custom expandable object property].
+ /// Determines whether the captured property is decorated with
/// that is configured to use .
///
/// Returns true if a is declared using
@@ -164,17 +169,22 @@
try
{
var type = Type.GetType(typeName);
- if (type != null)
+ if (type != null && typeof(ExpandableObjectConverter) == type)
{
- if (typeof(ExpandableObjectConverter) == type)
- {
- return true;
- }
+ return true;
}
}
- catch (Exception)
+ catch (Exception e)
{
- // gulp
+ if (e is TargetInvocationException || e is ArgumentException ||
+ e is TypeLoadException || e is FileLoadException || e is BadImageFormatException)
+ {
+ log.DebugFormat("Unable to find TypeConverter of type '{0}", typeConverterClassName);
+ }
+ else
+ {
+ throw; // Not expected exception -> Fail fast
+ }
}
}
return false;
Index: Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpecDescriptor.cs
===================================================================
diff -u -r8de8647e95dd220a1a4d78980e88af32ee9d2d3f -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpecDescriptor.cs (.../PropertySpecDescriptor.cs) (revision 8de8647e95dd220a1a4d78980e88af32ee9d2d3f)
+++ Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpecDescriptor.cs (.../PropertySpecDescriptor.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -81,7 +81,7 @@
public override void ResetValue(object component)
{
-
+ throw new InvalidOperationException("Do not call 'ResetValue' if 'CanResetValue(object)' returns false.");
}
public override object GetValue(object component)
Index: Core/Common/src/Core.Common.Gui/PropertyInfo.cs
===================================================================
diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Gui/PropertyInfo.cs (.../PropertyInfo.cs) (revision a950714ad9510756331d862aa35695fa0b2ed03b)
+++ Core/Common/src/Core.Common.Gui/PropertyInfo.cs (.../PropertyInfo.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -21,9 +21,8 @@
/// Function for determining whether or not the property information is relevant in a specfic context
///
///
- ///
- /// var propertyInfo = new PropertyInfo < Folder, ModelImplementationFolderProperties} { AdditionalDataCheck = o => GetParent(o) is ModelImplementation };
- ///
+ /// 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
@@ -34,17 +33,20 @@
///
/// Function for obtaining the data that should be set while creating object properties
///
- ///
- /// var propertyInfo = new PropertyInfo <ModelImplementation, ModelImplementationProperties> { GetObjectPropertiesData = o => o.RunParameters };
- ///
+ /// As an example, you could implement this as follows:
+ ///
+ /// As an example, you could implement this as follows:
+ /// var propertyInfo = new PropertyInfo <ModelImplementation, ModelImplementationProperties> { GetObjectPropertiesData = o => o.RunParameters };
+ ///
public Func
///
+ /// As an example, you could implement this as follows:
///
/// var propertyInfo = new PropertyInfo < Folder, ModelImplementationFolderProperties> { AdditionalDataCheck = o => GetParent(o) is ModelImplementation };
///
@@ -94,17 +97,20 @@
///
/// Function for obtaining the data that should be set while creating object properties
///
- ///
+ ///
+ /// As an example, you could implement this as follows:
+ ///
/// var propertyInfo = new PropertyInfo <ModelImplementation, ModelImplementationProperties> { GetObjectPropertiesData = o => o.RunParameters };
///
public Func GetObjectPropertiesData { get; set; }
///
/// Action that must be performed after creating object properties
///
- ///
- /// var propertyInfo = new PropertyInfo< ModelImplementation, ModelImplementationProperties> { AfterCreate = op => op.AdditionalBooleanProperty = true };
- ///
+ ///
+ /// As an example, you could implement this as follows:
+ /// var propertyInfo = new PropertyInfo< ModelImplementation, ModelImplementationProperties> { AfterCreate = op => op.AdditionalBooleanProperty = true };
+ ///
public Action AfterCreate { get; set; }
public static implicit operator PropertyInfo(PropertyInfo pi)
Index: Core/Common/src/Core.Common.Gui/SettingsHelper.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/SettingsHelper.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/SettingsHelper.cs (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -0,0 +1,43 @@
+using System;
+using System.IO;
+using System.Reflection;
+
+using Core.Common.Utils.Reflection;
+
+namespace Core.Common.Gui
+{
+ public static class SettingsHelper
+ {
+ static SettingsHelper()
+ {
+ //set defaults based on executing assembly
+ var info = AssemblyUtils.GetExecutingAssemblyInfo();
+ ApplicationName = info.Product;
+ ApplicationVersion = info.Version;
+ ApplicationCompany = info.Company;
+ }
+
+ public static string ApplicationName { get; private set; }
+
+ public static string ApplicationVersion { get; private set; }
+
+ public static string ApplicationCompany { get; private set; }
+
+ public static string GetApplicationLocalUserSettingsDirectory()
+ {
+ var localSettingsDirectoryPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
+ var executingAssembly = Assembly.GetExecutingAssembly();
+ var assemblyInfo = AssemblyUtils.GetAssemblyInfo(executingAssembly);
+ var companySettingsDirectoryPath = Path.Combine(localSettingsDirectoryPath, assemblyInfo.Company);
+
+ var appSettingsDirectoryPath = Path.Combine(companySettingsDirectoryPath, ApplicationName + " " + ApplicationVersion);
+
+ if (!Directory.Exists(appSettingsDirectoryPath))
+ {
+ Directory.CreateDirectory(appSettingsDirectoryPath);
+ }
+
+ return appSettingsDirectoryPath;
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Utils/Attributes/ResourceHelper.cs
===================================================================
diff -u -r29cfa36a80794e6c3264d29ec8e72d204f3302d3 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Utils/Attributes/ResourceHelper.cs (.../ResourceHelper.cs) (revision 29cfa36a80794e6c3264d29ec8e72d204f3302d3)
+++ Core/Common/src/Core.Common.Utils/Attributes/ResourceHelper.cs (.../ResourceHelper.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -15,7 +15,7 @@
/// Name of the resource property to be retrieved.
/// String resource in the resources file.
/// Resource cannot be found or does
- /// not have the given resource name.
+ /// not have the given resource name or isn't of type string.
internal static string GetResourceLookup(Type resourceType, string resourceName)
{
var property = resourceType.GetProperty(resourceName, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
Index: Core/Common/src/Core.Common.Utils/Builders/FileReaderErrorMessageBuilder.cs
===================================================================
diff -u -r654d3a712eedbdeea718dc0448c5544f09e053cd -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Utils/Builders/FileReaderErrorMessageBuilder.cs (.../FileReaderErrorMessageBuilder.cs) (revision 654d3a712eedbdeea718dc0448c5544f09e053cd)
+++ Core/Common/src/Core.Common.Utils/Builders/FileReaderErrorMessageBuilder.cs (.../FileReaderErrorMessageBuilder.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -37,7 +37,7 @@
///
/// The location description.
/// The builder being configured.
- /// line 7
+ /// Call this method with a location description such as "line 7".
public FileReaderErrorMessageBuilder WithLocation(string locationDescription)
{
location = " " + locationDescription;
@@ -49,7 +49,7 @@
///
/// The subject description.
/// The builder being configured.
- /// soil profile 'blabla'
+ /// Call this method with a subject description such as "soil profile 'blabla'".
public FileReaderErrorMessageBuilder WithSubject(string subjectDescription)
{
subject = string.Format(" ({0})", subjectDescription);
Index: Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj
===================================================================
diff -u -r39db35bed5aea7238bcb03d842598ee87a002390 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj (.../Core.Common.Utils.csproj) (revision 39db35bed5aea7238bcb03d842598ee87a002390)
+++ Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj (.../Core.Common.Utils.csproj) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -107,10 +107,9 @@
Resources.resx
-
-
+
Index: Core/Common/src/Core.Common.Utils/Drawing/GraphicsExtensions.cs
===================================================================
diff -u -r632b9c8cd36e7663a17e53320d3bfedb873889e0 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Utils/Drawing/GraphicsExtensions.cs (.../GraphicsExtensions.cs) (revision 632b9c8cd36e7663a17e53320d3bfedb873889e0)
+++ Core/Common/src/Core.Common.Utils/Drawing/GraphicsExtensions.cs (.../GraphicsExtensions.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -31,7 +31,7 @@
private static ImageAttributes CalculateOpacityImageAttributes(float opacity)
{
- var colorMatrix = CreateColorMatrixForOpacityChange(opacity);
+ ColorMatrix colorMatrix = CreateColorMatrixForOpacityChange(opacity);
var imgAttributes = new ImageAttributes();
imgAttributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
Index: Core/Common/src/Core.Common.Utils/Extensions/ComparableExtensions.cs
===================================================================
diff -u -r1a6f65407809a58d25b871af1fc77d6323c6c83a -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Utils/Extensions/ComparableExtensions.cs (.../ComparableExtensions.cs) (revision 1a6f65407809a58d25b871af1fc77d6323c6c83a)
+++ Core/Common/src/Core.Common.Utils/Extensions/ComparableExtensions.cs (.../ComparableExtensions.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -8,12 +8,13 @@
public static class ComparableExtensions
{
///
- /// Determines whether one object is greater then another.
+ /// Determines whether one object is greater than another.
///
/// The first object.
/// The second object.
/// True if is considered greater then ,
/// false otherwise.
+ /// null is considered smaller than any other not-null value.
/// Object type of
/// is not the same as that of .
public static bool IsBigger(this IComparable object1, IComparable object2)
@@ -31,12 +32,13 @@
}
///
- /// Determines whether one object is smaller then another.
+ /// Determines whether one object is smaller than another.
///
/// The first object.
/// The second object.
/// True if is considered smaller then ,
/// false otherwise.
+ /// null is considered smaller then any not-null value.
/// Object type of
/// is not the same as that of .
public static bool IsSmaller(this IComparable object1, IComparable object2)
Index: Core/Common/src/Core.Common.Utils/Extensions/EnumerableExtensions.cs
===================================================================
diff -u -r2a1dc72ed9a202b720c26828e5d53cecc5a0e6c8 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/src/Core.Common.Utils/Extensions/EnumerableExtensions.cs (.../EnumerableExtensions.cs) (revision 2a1dc72ed9a202b720c26828e5d53cecc5a0e6c8)
+++ Core/Common/src/Core.Common.Utils/Extensions/EnumerableExtensions.cs (.../EnumerableExtensions.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -24,18 +24,5 @@
action(item);
}
}
-
- ///
- /// Returns the number of elements in a sequence.
- ///
- /// A sequence that contains elements to be counted.
- /// The number of elements in the input sequence.
- /// source is null.
- /// The number of elements in source is larger than
- ///
- public static int Count(this IEnumerable source)
- {
- return Enumerable.Count(source.Cast());
- }
}
}
\ No newline at end of file
Fisheye: Tag 770547be3030f73473282742f9a63ca6805ff74b refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Utils/SettingsHelper.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 770547be3030f73473282742f9a63ca6805ff74b refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Utils/Url.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Common/src/Core.Common.Utils/WebLink.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Utils/WebLink.cs (revision 0)
+++ Core/Common/src/Core.Common.Utils/WebLink.cs (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -0,0 +1,31 @@
+using System;
+
+namespace Core.Common.Utils
+{
+ ///
+ /// This class represents a link to a website.
+ ///
+ public class WebLink
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The name of the .
+ /// The path of the .
+ public WebLink(string name, Uri path)
+ {
+ Name = name;
+ Path = path;
+ }
+
+ ///
+ /// Gets or sets the path of the .
+ ///
+ public Uri Path { get; set; }
+
+ ///
+ /// Gets or sets the name of the .
+ ///
+ public string Name { get; set; }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.Controls.Test/Views/HtmlPageViewTest.cs
===================================================================
diff -u -rb81978adc73edcf368115b58fd37f34dc7fb6ab5 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/test/Core.Common.Controls.Test/Views/HtmlPageViewTest.cs (.../HtmlPageViewTest.cs) (revision b81978adc73edcf368115b58fd37f34dc7fb6ab5)
+++ Core/Common/test/Core.Common.Controls.Test/Views/HtmlPageViewTest.cs (.../HtmlPageViewTest.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -31,7 +31,7 @@
public void Data_SetValidUrl_ShouldReturnSetValueAndNavigateToCorrespondingPage()
{
// Setup
- var url = new Url("", "http://www.google.nl");
+ var url = new WebLink("", new Uri("http://www.google.nl"));
// Call
var htmlPageView = new HtmlPageView
@@ -76,7 +76,7 @@
public void Data_SetInvalidUrl_ShouldReturnValueAndAndNavigateToBlankPage()
{
// Setup
- var url = new Url("", null);
+ var url = new WebLink("", null);
// Call
var htmlPageView = new HtmlPageView
Index: Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj
===================================================================
diff -u -r06d3d49bf8eaceb367dad29a6f2379b0f781f119 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision 06d3d49bf8eaceb367dad29a6f2379b0f781f119)
+++ Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -65,6 +65,7 @@
+
Index: Core/Common/test/Core.Common.Gui.Test/PropertyBag/PropertySpecDescriptorTest.cs
===================================================================
diff -u -r8de8647e95dd220a1a4d78980e88af32ee9d2d3f -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/test/Core.Common.Gui.Test/PropertyBag/PropertySpecDescriptorTest.cs (.../PropertySpecDescriptorTest.cs) (revision 8de8647e95dd220a1a4d78980e88af32ee9d2d3f)
+++ Core/Common/test/Core.Common.Gui.Test/PropertyBag/PropertySpecDescriptorTest.cs (.../PropertySpecDescriptorTest.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -154,6 +154,24 @@
}
[Test]
+ public void ResetValue_CanNotReset_ThrowsInvalidOperationException()
+ {
+ // Setup
+ var instance = new ClassWithProperties();
+ var spec = new PropertySpec(instance.GetType().GetProperty("PropertyWithOnlyGetter"));
+ var propertyDescriptor = new PropertySpecDescriptor(spec, instance);
+
+ // Precondition
+ Assert.IsFalse(propertyDescriptor.CanResetValue(instance));
+
+ // Call
+ TestDelegate call = () => propertyDescriptor.ResetValue(instance);
+
+ // Assert
+ Assert.Throws(call);
+ }
+
+ [Test]
public void ShouldSerializeValue_ReturnFalse()
{
// Setup
Index: Core/Common/test/Core.Common.Gui.Test/SettingsHelperTest.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.Gui.Test/SettingsHelperTest.cs (revision 0)
+++ Core/Common/test/Core.Common.Gui.Test/SettingsHelperTest.cs (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -0,0 +1,40 @@
+using Core.Common.Utils.Reflection;
+
+using NUnit.Framework;
+
+namespace Core.Common.Gui.Test
+{
+ [TestFixture]
+ public class SettingsHelperTest
+ {
+ [Test]
+ public void ApplicationName_ReturnProductNameOfExecutingAssebly()
+ {
+ // Call
+ var settings = SettingsHelper.ApplicationName;
+
+ // Assert
+ Assert.AreEqual(AssemblyUtils.GetExecutingAssemblyInfo().Product, settings);
+ }
+
+ [Test]
+ public void ApplicationVersion_ReturnVersionOfExecutingAssebly()
+ {
+ // Call
+ var settings = SettingsHelper.ApplicationVersion;
+
+ // Assert
+ Assert.AreEqual(AssemblyUtils.GetExecutingAssemblyInfo().Version, settings);
+ }
+
+ [Test]
+ public void ApplicationCompany_ReturnCompanyOfExecutingAssebly()
+ {
+ // Call
+ var settings = SettingsHelper.ApplicationCompany;
+
+ // Assert
+ Assert.AreEqual(AssemblyUtils.GetExecutingAssemblyInfo().Company, settings);
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.Test/Gui/ViewListTest.cs
===================================================================
diff -u -rd53a27a49d8db860ff0894554dab040a1b6204a5 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/test/Core.Common.Test/Gui/ViewListTest.cs (.../ViewListTest.cs) (revision d53a27a49d8db860ff0894554dab040a1b6204a5)
+++ Core/Common/test/Core.Common.Test/Gui/ViewListTest.cs (.../ViewListTest.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.Linq;
using Core.Common.Controls.Views;
@@ -138,12 +139,12 @@
[RequiresSTA]
public void OpeningViewForDataTwiceShouldOnlySetActiveView()
{
- var url = new Url("Deltares", "www.deltares.nl");
+ var url = new WebLink("Deltares", new Uri("http://www.deltares.nl"));
var viewList = new ViewList(new TestDockingManager(), ViewLocation.Document);
var viewResolver = new ViewResolver(viewList, new ViewInfo[]
{
- new ViewInfo()
+ new ViewInfo()
}, null);
viewResolver.OpenViewForData(url);
Index: Core/Common/test/Core.Common.Utils.Test/Core.Common.Utils.Test.csproj
===================================================================
diff -u -r39db35bed5aea7238bcb03d842598ee87a002390 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/test/Core.Common.Utils.Test/Core.Common.Utils.Test.csproj (.../Core.Common.Utils.Test.csproj) (revision 39db35bed5aea7238bcb03d842598ee87a002390)
+++ Core/Common/test/Core.Common.Utils.Test/Core.Common.Utils.Test.csproj (.../Core.Common.Utils.Test.csproj) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -92,7 +92,7 @@
-
+
Index: Core/Common/test/Core.Common.Utils.Test/Drawing/GraphicsExtensionsTest.cs
===================================================================
diff -u -r632b9c8cd36e7663a17e53320d3bfedb873889e0 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/test/Core.Common.Utils.Test/Drawing/GraphicsExtensionsTest.cs (.../GraphicsExtensionsTest.cs) (revision 632b9c8cd36e7663a17e53320d3bfedb873889e0)
+++ Core/Common/test/Core.Common.Utils.Test/Drawing/GraphicsExtensionsTest.cs (.../GraphicsExtensionsTest.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -13,7 +13,9 @@
public class GraphicsExtensionsTest
{
[Test]
- public void DrawImageTransparent_DrawWithOpacity1_TargetShouldBeIdenticalToSource()
+ [TestCase(1.0f)]
+ [TestCase(3.0f)]
+ public void DrawImageTransparent_DrawWithOpacity1OrGreater_TargetShouldBeIdenticalToSource(float opacity)
{
// Setup
var rect2x2 = new RectangleF(0f, 0f, 2f, 2f);
@@ -23,15 +25,17 @@
using (var target = Resources.Black2x2.Clone(rect2x2, imageFormat))
{
// Call
- Graphics.FromImage(target).DrawImageTransparent(image, 0, 0, 1f);
+ Graphics.FromImage(target).DrawImageTransparent(image, 0, 0, opacity);
// Assert
TestHelper.AssertImagesAreEqual(image, target);
}
}
[Test]
- public void DrawImageTransparent_DrawWithOpacity0_TargetShouldBeUnaffected()
+ [TestCase(0f)]
+ [TestCase(-3f)]
+ public void DrawImageTransparent_DrawWithOpacity0OrLess_TargetShouldBeUnaffected(float opacity)
{
// Setup
var rect2x2 = new RectangleF(0f, 0f, 2f, 2f);
@@ -42,7 +46,7 @@
using (var expectedtarget = Resources.Black2x2.Clone(rect2x2, imageFormat))
{
// Call
- Graphics.FromImage(target).DrawImageTransparent(image, 0, 0, 0f);
+ Graphics.FromImage(target).DrawImageTransparent(image, 0, 0, opacity);
// Assert
TestHelper.AssertImagesAreEqual(expectedtarget, target);
Index: Core/Common/test/Core.Common.Utils.Test/Extensions/EnumerableExtensionsTest.cs
===================================================================
diff -u -r2a1dc72ed9a202b720c26828e5d53cecc5a0e6c8 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Common/test/Core.Common.Utils.Test/Extensions/EnumerableExtensionsTest.cs (.../EnumerableExtensionsTest.cs) (revision 2a1dc72ed9a202b720c26828e5d53cecc5a0e6c8)
+++ Core/Common/test/Core.Common.Utils.Test/Extensions/EnumerableExtensionsTest.cs (.../EnumerableExtensionsTest.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -1,7 +1,5 @@
using System;
-using System.Collections;
using System.Collections.Generic;
-using System.Linq;
using Core.Common.Utils.Extensions;
@@ -32,31 +30,5 @@
// Assert
CollectionAssert.AreEqual(items, results, "elements should be equal");
}
-
- [Test]
- public void Count_ForRandomRange_ReturnsElementCount([Random(0, 100, 1)] int expectedCount)
- {
- // Setup
- IEnumerable enumerable = Enumerable.Range(1, expectedCount);
-
- // Call
- var count = enumerable.Count();
-
- // Assert
- Assert.AreEqual(expectedCount, count);
- }
-
- [Test]
- public void Count_SequenceIsNull_ThrowArgumentNullException()
- {
- // Setup
- IEnumerable sequence = null;
-
- // Call
- TestDelegate call = () => sequence.Count();
-
- // Assert
- Assert.Throws(call);
- }
}
}
\ No newline at end of file
Fisheye: Tag 770547be3030f73473282742f9a63ca6805ff74b refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Utils.Test/UrlTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Common/test/Core.Common.Utils.Test/WebLinkTest.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.Utils.Test/WebLinkTest.cs (revision 0)
+++ Core/Common/test/Core.Common.Utils.Test/WebLinkTest.cs (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -0,0 +1,43 @@
+using System;
+
+using NUnit.Framework;
+
+namespace Core.Common.Utils.Test
+{
+ [TestFixture]
+ public class WebLinkTest
+ {
+ [Test]
+ public void Initialization()
+ {
+ // Setup
+ const string name = "Deltares";
+ var path = new Uri("http://www.deltares.com");
+
+ // Call
+ var url = new WebLink(name, path);
+
+ // Assert
+ Assert.AreEqual(name, url.Name);
+ Assert.AreEqual(path, url.Path);
+ }
+
+ [Test]
+ public void SipleProperties_SetAndGetValue_ReturnNewlySetValue()
+ {
+ // Setup
+ var url = new WebLink("Deltares", new Uri("http://www.deltares.com"));
+
+ const string newName = "Google";
+ var newPath = new Uri("http://www.google.com");
+
+ // Call
+ url.Name = newName;
+ url.Path = newPath;
+
+ // Assert
+ Assert.AreEqual(newName, url.Name);
+ Assert.AreEqual(newPath, url.Path);
+ }
+ }
+}
\ No newline at end of file
Index: Core/GIS/src/Core.GIS.SharpMap.Extensions/Layers/BingLayer.cs
===================================================================
diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/GIS/src/Core.GIS.SharpMap.Extensions/Layers/BingLayer.cs (.../BingLayer.cs) (revision a950714ad9510756331d862aa35695fa0b2ed03b)
+++ Core/GIS/src/Core.GIS.SharpMap.Extensions/Layers/BingLayer.cs (.../BingLayer.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -18,15 +18,6 @@
private BingMapType? mapType;
- public virtual string CacheLocation
- {
- get
- {
- var path = SettingsHelper.GetApplicationLocalUserSettingsDirectory();
- return Path.Combine(path, "cache_bing_" + MapType.ToLower());
- }
- }
-
public virtual string MapType { get; set; }
public override object Clone()
@@ -47,15 +38,7 @@
if (!bingCache.ContainsKey(MapType))
{
- //no cache so mem
- if (CacheLocation == null)
- {
- bingCache[MapType] = new MemoryCache(1000, 100000);
- }
- else
- {
- bingCache[MapType] = new FileCache(CacheLocation, "jpg");
- }
+ bingCache[MapType] = new MemoryCache(1000, 100000);
}
cache = bingCache[MapType];
Index: Core/GIS/src/Core.GIS.SharpMap.Extensions/Layers/OpenStreetMapLayer.cs
===================================================================
diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/GIS/src/Core.GIS.SharpMap.Extensions/Layers/OpenStreetMapLayer.cs (.../OpenStreetMapLayer.cs) (revision a950714ad9510756331d862aa35695fa0b2ed03b)
+++ Core/GIS/src/Core.GIS.SharpMap.Extensions/Layers/OpenStreetMapLayer.cs (.../OpenStreetMapLayer.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -38,28 +38,11 @@
0.597164283
};
- public static string CacheLocation
- {
- get
- {
- var path = SettingsHelper.GetApplicationLocalUserSettingsDirectory();
- return Path.Combine(path, "cache_open_street_map");
- }
- }
-
protected override ITileCache GetOrCreateCache()
{
if (omsCache == null)
{
- if (CacheLocation == null)
- {
- omsCache = new MemoryCache(1000, 100000);
- }
- else
- {
- var cacheDirectoryPath = CacheLocation;
- omsCache = new FileCache(cacheDirectoryPath, "png");
- }
+ omsCache = new MemoryCache(1000, 100000);
}
return omsCache;
}
Index: Core/GIS/src/Core.GIS.SharpMap.Extensions/Layers/WmscLayer.cs
===================================================================
diff -u -r9f01c4daf5b7af6549045ed6ac404d18419c2555 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/GIS/src/Core.GIS.SharpMap.Extensions/Layers/WmscLayer.cs (.../WmscLayer.cs) (revision 9f01c4daf5b7af6549045ed6ac404d18419c2555)
+++ Core/GIS/src/Core.GIS.SharpMap.Extensions/Layers/WmscLayer.cs (.../WmscLayer.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -40,16 +40,6 @@
public virtual string Url { get; set; }
- public virtual string CacheLocation
- {
- get
- {
- var path = SettingsHelper.GetApplicationLocalUserSettingsDirectory();
- return Path.Combine(path,
- "cache_wms_" + Url.Replace(':', '_').Replace('/', '_').Replace('&', '_').Replace('?', '_') + WmsLayer);
- }
- }
-
public virtual string WmsLayer { get; set; }
public static ILayer CreateWmsLayersFromUrl(string url)
@@ -94,15 +84,7 @@
{
if (cache == null)
{
- //no cache so mem
- if (CacheLocation == null)
- {
- cache = new MemoryCache(1000, 100000);
- }
- else
- {
- cache = new FileCache(CacheLocation, "jpg");
- }
+ cache = new MemoryCache(1000, 100000);
}
return cache;
}
Index: Core/GIS/test/Core.GIS.SharpMap.Extensions.Test/Core.GIS.SharpMap.Extensions.Test.csproj
===================================================================
diff -u -r379bee599d1329561cbaccdb112609492ac80203 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/GIS/test/Core.GIS.SharpMap.Extensions.Test/Core.GIS.SharpMap.Extensions.Test.csproj (.../Core.GIS.SharpMap.Extensions.Test.csproj) (revision 379bee599d1329561cbaccdb112609492ac80203)
+++ Core/GIS/test/Core.GIS.SharpMap.Extensions.Test/Core.GIS.SharpMap.Extensions.Test.csproj (.../Core.GIS.SharpMap.Extensions.Test.csproj) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -82,7 +82,6 @@
-
Index: Core/GIS/test/Core.GIS.SharpMap.Extensions.Test/Layers/BingLayerTest.cs
===================================================================
diff -u -r41c77f9f36ae74a406fd382187426cc06d2b0200 -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/GIS/test/Core.GIS.SharpMap.Extensions.Test/Layers/BingLayerTest.cs (.../BingLayerTest.cs) (revision 41c77f9f36ae74a406fd382187426cc06d2b0200)
+++ Core/GIS/test/Core.GIS.SharpMap.Extensions.Test/Layers/BingLayerTest.cs (.../BingLayerTest.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -20,14 +20,5 @@
var clone = (BingLayer) layer.Clone();
Assert.IsNull(clone.Map);
}
-
- [Test]
- public void CacheDirectoryIsDefined()
- {
- StringAssert.EndsWith(@"cache_bing_aerial", new BingLayer
- {
- MapType = "Aerial"
- }.CacheLocation, "Cache directory is defined");
- }
}
}
\ No newline at end of file
Fisheye: Tag 770547be3030f73473282742f9a63ca6805ff74b refers to a dead (removed) revision in file `Core/GIS/test/Core.GIS.SharpMap.Extensions.Test/Layers/OpenStreetMapLayerTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Plugins/src/Core.Plugins.CommonTools/CommonToolsGuiPlugin.cs
===================================================================
diff -u -rdf19cc498388d9252090817c0dbfc1c334caa0ef -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Plugins/src/Core.Plugins.CommonTools/CommonToolsGuiPlugin.cs (.../CommonToolsGuiPlugin.cs) (revision df19cc498388d9252090817c0dbfc1c334caa0ef)
+++ Core/Plugins/src/Core.Plugins.CommonTools/CommonToolsGuiPlugin.cs (.../CommonToolsGuiPlugin.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -15,7 +15,7 @@
{
public override IEnumerable GetPropertyInfos()
{
- yield return new PropertyInfo();
+ yield return new PropertyInfo();
yield return new PropertyInfo();
}
@@ -26,7 +26,7 @@
Image = Common.Gui.Properties.Resources.key,
GetViewName = (v, o) => o != null ? o.Name : ""
};
- yield return new ViewInfo
+ yield return new ViewInfo
{
Image = Resources.home,
Description = Resources.CommonToolsGuiPlugin_GetViewInfoObjects_Browser,
Index: Core/Plugins/src/Core.Plugins.CommonTools/Property/UrlProperties.cs
===================================================================
diff -u -r5fc49ff1f8950ee4e33887edb6c543fac700b5dd -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Plugins/src/Core.Plugins.CommonTools/Property/UrlProperties.cs (.../UrlProperties.cs) (revision 5fc49ff1f8950ee4e33887edb6c543fac700b5dd)
+++ Core/Plugins/src/Core.Plugins.CommonTools/Property/UrlProperties.cs (.../UrlProperties.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -1,3 +1,5 @@
+using System;
+
using Core.Common.Gui;
using Core.Common.Utils;
using Core.Common.Utils.Attributes;
@@ -6,7 +8,7 @@
namespace Core.Plugins.CommonTools.Property
{
[ResourcesDisplayName(typeof(Resources), "UrlProperties_DisplayName")]
- public class UrlProperties : ObjectProperties
+ public class UrlProperties : ObjectProperties
{
[ResourcesCategory(typeof(Resources), "Categories_General")]
[ResourcesDisplayName(typeof(Resources), "Common_Name_DisplayName")]
@@ -30,11 +32,11 @@
{
get
{
- return data.Path;
+ return data.Path.ToString();
}
set
{
- data.Path = value;
+ data.Path = new Uri(value);
}
}
}
Index: Core/Plugins/test/Core.Plugins.CommonTools.Test/CommonToolsGuiPluginTest.cs
===================================================================
diff -u -rdf19cc498388d9252090817c0dbfc1c334caa0ef -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Plugins/test/Core.Plugins.CommonTools.Test/CommonToolsGuiPluginTest.cs (.../CommonToolsGuiPluginTest.cs) (revision df19cc498388d9252090817c0dbfc1c334caa0ef)
+++ Core/Plugins/test/Core.Plugins.CommonTools.Test/CommonToolsGuiPluginTest.cs (.../CommonToolsGuiPluginTest.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -20,7 +20,7 @@
Assert.AreEqual(2, propertyInfos.Count);
var projectPropertyInfo = propertyInfos.First(pi => pi.ObjectType == typeof(Project));
- var urlPropertyInfo = propertyInfos.First(pi => pi.ObjectType == typeof(Url));
+ var urlPropertyInfo = propertyInfos.First(pi => pi.ObjectType == typeof(WebLink));
Assert.AreEqual(typeof(ProjectProperties), projectPropertyInfo.PropertyType);
Assert.AreEqual(typeof(UrlProperties), urlPropertyInfo.PropertyType);
@@ -35,7 +35,7 @@
Assert.NotNull(viewInfos);
Assert.AreEqual(2, viewInfos.Count);
Assert.IsTrue(viewInfos.Any(vi => vi.DataType == typeof(RichTextFile) && vi.ViewType == typeof(RichTextView)));
- Assert.IsTrue(viewInfos.Any(vi => vi.DataType == typeof(Url) && vi.ViewType == typeof(HtmlPageView)));
+ Assert.IsTrue(viewInfos.Any(vi => vi.DataType == typeof(WebLink) && vi.ViewType == typeof(HtmlPageView)));
}
}
}
\ No newline at end of file
Index: Core/Plugins/test/Core.Plugins.CommonTools.Test/Property/UrlPropertiesTest.cs
===================================================================
diff -u -rcd9655d356bdff388c7058eeff1cdbed076c407b -r770547be3030f73473282742f9a63ca6805ff74b
--- Core/Plugins/test/Core.Plugins.CommonTools.Test/Property/UrlPropertiesTest.cs (.../UrlPropertiesTest.cs) (revision cd9655d356bdff388c7058eeff1cdbed076c407b)
+++ Core/Plugins/test/Core.Plugins.CommonTools.Test/Property/UrlPropertiesTest.cs (.../UrlPropertiesTest.cs) (revision 770547be3030f73473282742f9a63ca6805ff74b)
@@ -18,7 +18,7 @@
var urlProperties = new UrlProperties();
// Assert
- Assert.IsInstanceOf>(urlProperties);
+ Assert.IsInstanceOf>(urlProperties);
}
@@ -29,7 +29,7 @@
var someName = "some name";
var otherName = "some other name";
- var url = new Url(someName, string.Empty);
+ var url = new WebLink(someName, new Uri("https://www.google.nl"));
var properties = new UrlProperties
{
Data = url
@@ -49,32 +49,32 @@
public void Path_WithData_ReturnsPath()
{
// Setup
- var somePath = "some path";
- var otherPath = "some path";
+ var somePath = "http://www.deltares.nl";
+ var otherPath = "http://www.google.nl";
- var url = new Url(string.Empty, somePath);
+ var url = new WebLink(string.Empty, new Uri(somePath));
var properties = new UrlProperties
{
Data = url
};
// Call & Assert
- Assert.AreEqual(otherPath, properties.Path);
+ Assert.AreEqual(new Uri(somePath), properties.Path);
// Call
properties.Path = otherPath;
// Assert
- Assert.AreEqual(otherPath, url.Path);
+ Assert.AreEqual(new Uri(otherPath), url.Path);
}
[Test]
public void GetProperties_Always_ReturnsTwoProperty()
{
// Setup
var someName = "some name";
- var somePath = "some path";
- var url = new Url(someName, somePath);
+ var somePath = "http://www.google.nl";
+ var url = new WebLink(someName, new Uri(somePath));
var bag = new DynamicPropertyBag(new UrlProperties
{