-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- combat effectiveness panel with various controls - path settings panel
- Loading branch information
Showing
9 changed files
with
1,222 additions
and
117 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
This file is automatically generated by Visual Studio .Net. It is | ||
used to store generic object data source configuration information. | ||
Renaming the file extension or editing the content of this file may | ||
cause the file to be unrecognizable by the program. | ||
--> | ||
<GenericObjectDataSource DisplayName="PathSettingsData" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> | ||
<TypeInfo>cdda_item_creator.PathSettingsData, cdda-item-creator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> | ||
</GenericObjectDataSource> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace cdda_item_creator | ||
{ | ||
public class IgnoreEmptyEnumerablesResolver : DefaultContractResolver | ||
{ | ||
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) | ||
{ | ||
JsonProperty property = base.CreateProperty(member, memberSerialization); | ||
|
||
if (property.DeclaringType is IEnumerable) | ||
{ | ||
property.ShouldSerialize = instance => | ||
{ | ||
IEnumerable enumer = instance | ||
.GetType() | ||
.GetProperty(property.PropertyName) | ||
.GetValue(instance, null) as IEnumerable; | ||
|
||
if (enumer != null) | ||
{ | ||
// check to see if there is at least one item in the Enumerable | ||
return enumer.GetEnumerator().MoveNext(); | ||
} | ||
else | ||
{ | ||
// if the enumerable is null, we defer the decision to NullValueHandling | ||
return true; | ||
} | ||
}; | ||
} | ||
|
||
return property; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters