Skip to content

Commit

Permalink
Merge pull request #74 from isogeo/dev
Browse files Browse the repository at this point in the history
Version 1.0.2
  • Loading branch information
jgrosmaire authored Jun 24, 2021
2 parents 94215de + 81fe0dc commit 578fc9c
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/nouvelle-fonctionnalit-.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Nouvelle fonctionnalité
about: Créer une issue pour suggérer les évolutions du plugin Isogeo ArcGis Pro
title: "[Feature] "
labels: enhancement
assignees: ''
assignees: 'jgrosmaire'

---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/rapport-de-bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Rapport de bug
about: Créer un rapport de bug pour aider l'amélioration du plugin Isogeo ArcGis Pro
title: "[BUG]"
labels: bug
assignees: VianneyDoleans
assignees: jgrosmaire

---

Expand Down
6 changes: 3 additions & 3 deletions AddIn/Isogeo.AddIn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
<ArcGISFolder Condition="'$(ArcGISFolder)' == ''">$(registry:HKEY_CURRENT_USER\SOFTWARE\ESRI\ArcGISPro@InstallDir)</ArcGISFolder>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
Expand Down
2 changes: 0 additions & 2 deletions AddIn/Views/Metadata/ContactItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = ContactOwner.Phone, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = ContactOwner.AddressLine1, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = ContactOwner.City, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = ContactOwner.ZipCode, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = ContactOwner.Country, Mode = OneWay}"/>
</StackPanel>
</UserControl>
4 changes: 1 addition & 3 deletions AddIn/Views/Metadata/MetadataContacts.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
<DataTemplate x:Key="ContactItem">
<StackPanel>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = Name, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = Organization, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = Email, Mode = OneWay}"/>
<!--MouseDoubleClick="LblEmail_OnMouseDoubleClick"/>-->
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = Phone, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = AddressLine1, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = AddressLine2, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = AddressLine3, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = City, Mode = OneWay}"/>
<TextBox Style="{StaticResource HideBoxTxt}" Text="{Binding Path = Country, Mode = OneWay}"/>
</StackPanel>
</DataTemplate>
</ResourceDictionary>
Expand Down
30 changes: 22 additions & 8 deletions AddIn/ViewsModels/Metadata/MetadataViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using MVVMPattern;
using MVVMPattern.MediatorPattern;
using System.Text.RegularExpressions;
using System.Globalization;
using System;

namespace Isogeo.AddIn.ViewsModels.Metadata
Expand Down Expand Up @@ -84,15 +85,15 @@ public Contact ContactOwner
AddressLine2 = Isogeo.Language.Resources.NotReported,
AddressLine3 = Isogeo.Language.Resources.NotReported,
City = Isogeo.Language.Resources.NotReported,
Country = Isogeo.Language.Resources.NotReported,
CountryCode = Isogeo.Language.Resources.NotReported,
Email = Isogeo.Language.Resources.NotReported,
Name = Isogeo.Language.Resources.NotReported,
Organization = Isogeo.Language.Resources.NotReported,
Phone = Isogeo.Language.Resources.NotReported,
ZipCode = Isogeo.Language.Resources.NotReported
};
return _currentResult._creator.contact;

return _currentResult?._creator?.contact;
}
}

Expand All @@ -108,8 +109,8 @@ private static void FillContactWithEmpty(Contact contact)
contact.AddressLine2 = "";
if (string.IsNullOrWhiteSpace(contact.AddressLine3))
contact.AddressLine3 = "";
if (string.IsNullOrWhiteSpace(contact.Country))
contact.Country = "";
if (string.IsNullOrWhiteSpace(contact.CountryCode))
contact.CountryCode = "";
if (string.IsNullOrWhiteSpace(contact.Email))
contact.Email = Isogeo.Language.Resources.NotReported;
if (string.IsNullOrWhiteSpace(contact.Organization))
Expand All @@ -122,9 +123,20 @@ private static void FillContactWithEmpty(Contact contact)

private static void FillCity(Contact contact)
{
contact.City = contact.ZipCode + " " + contact.City + " " + contact.Country;
if (string.IsNullOrWhiteSpace(contact.City))
contact.City = Isogeo.Language.Resources.NotReported;
try
{
contact.City = contact.ZipCode + " " + contact.City + ", " + (new RegionInfo(contact.CountryCode).DisplayName);
if (string.IsNullOrWhiteSpace(contact.City))
contact.City = Isogeo.Language.Resources.NotReported;
}
catch (ArgumentException argEx)
{
// The code was not a valid country code
contact.City = contact.ZipCode + " " + contact.City;
if (string.IsNullOrWhiteSpace(contact.City))
contact.City = Isogeo.Language.Resources.NotReported;
}

}

public ObservableCollection<Contact> ContactItemsList { get; set; }
Expand All @@ -144,7 +156,9 @@ private void LoadContactsLists()
FillContactWithEmpty(contact.contact);

if (contact.contact.AddressLine2 != "")
contact.contact.AddressLine1 += " " + contact.contact.AddressLine2;
contact.contact.AddressLine1 += ", " + contact.contact.AddressLine2;
if (contact.contact.AddressLine3 != "")
contact.contact.AddressLine1 += ", " + contact.contact.AddressLine3;

FillCity(contact.contact);

Expand Down
2 changes: 1 addition & 1 deletion AddIn/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.8" targetFramework="net48" />
<package id="log4net" version="2.0.12" targetFramework="net48" />
</packages>
6 changes: 4 additions & 2 deletions Map/Isogeo.Map.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Mapping\ArcGIS.Desktop.Mapping.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
Expand Down
2 changes: 1 addition & 1 deletion Map/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.8" targetFramework="net48" />
<package id="log4net" version="2.0.12" targetFramework="net48" />
</packages>
2 changes: 1 addition & 1 deletion Models/API/Contact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public string City
get;
set;
}
public string Country
public string CountryCode
{
get;
set;
Expand Down
5 changes: 3 additions & 2 deletions Models/Isogeo.Models.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
Expand All @@ -53,6 +53,7 @@
<HintPath>..\packages\RestSharp.106.11.4\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
Expand Down
2 changes: 1 addition & 1 deletion Models/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.8" targetFramework="net48" />
<package id="log4net" version="2.0.12" targetFramework="net48" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" />
<package id="RestSharp" version="106.11.4" targetFramework="net48" />
</packages>
7 changes: 4 additions & 3 deletions Utils/Isogeo.Utils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
Expand All @@ -50,6 +52,5 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
2 changes: 1 addition & 1 deletion Utils/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.8" targetFramework="net472" />
<package id="log4net" version="2.0.12" targetFramework="net48" />
</packages>

0 comments on commit 578fc9c

Please sign in to comment.