316 Commits
0.1 ... 1.0.0

Author SHA1 Message Date
Ben Wallis
04cbf218f3 Bumped version to 1.0.0 2018-09-30 11:43:22 +01:00
Ben Wallis
6007306346 Added 1.0.0 release notes 2018-09-28 20:44:25 +01:00
Ben Wallis
992bd21570 Fixed UpdateService which was erroneously using the local update manager instead of the GitHub update manager for several parts of the update process 2018-09-28 20:24:09 +01:00
Ben Wallis
7d8b32b2e7 Fixup after merging missed commit from master 2018-09-28 17:58:16 +01:00
Ben Wallis
ac904c31ff * Added default colours for TextColor, BorderColor and BackgroundColor block items (previously the default color was completely transparent)
* Bumped version to 1.0.0-beta3
2018-09-28 17:47:23 +01:00
Ben Wallis
f51fe315ad Updated Filtration.nuspec for 1.0.0-beta2 2018-09-28 17:27:07 +01:00
Ben Wallis
3ce2e12f56 Disabled setting themes for MinimapIcon, PlayEffect and SetFontSize blocks (temporary fix for issue #68) 2018-09-28 17:20:42 +01:00
Ben Wallis
43e5b30080 Merge pull request #88 from GlenCFL/validate-lists
Audit and Validate the Data Files
2018-09-27 12:38:58 +01:00
GlenCFL
bc99339390 Audit the static data files. 2018-09-27 07:21:32 -04:00
Ben Wallis
781faae85d Merge pull request #87 from GlenCFL/mod-completions
Provide autocompletions for item mods.
2018-09-27 07:08:47 +01:00
GlenCFL
c926808878 Remove the now irrelevant static data test. 2018-09-26 23:40:34 -04:00
GlenCFL
24d9f97717 Provide autocompletions for item mods. 2018-09-26 23:35:39 -04:00
Ben Wallis
7e4e6fe42e Refactored StaticDataService to use local resources for ItemBaseTypes.txt and ItemClasses.txt instead of the old files in APPDATA that aren't used anymore.
Bumped develop version to 1.0.0-beta2
2018-09-26 19:12:31 +01:00
Ben Wallis
c6d75cfff6 Implemented auto-update using Squirrel
Reworked SettingsPageView to not need a Save Button and added a folder browser control
2018-09-26 18:40:54 +01:00
Ben Wallis
2f30eade7c Merge pull request #84 from azakhi/bugfix/fix-child-firing-block-selection-event
Fix block items firing blocklist selectionchanged
2018-09-21 17:43:07 +01:00
azakhi
e719f0bce0 Fix block items firing blocklist selectionchanged 2018-09-21 19:28:37 +03:00
Ben Wallis
dffbbf3591 Merge pull request #82 from azakhi/bugfix/81-increase-maximum-explicit-mod-rule
Increase HasExplicitMod limit to 8
2018-09-17 12:13:26 +01:00
azakhi
07a7e8d05c Increase HasExplicitMod limit to 8 2018-09-17 10:37:25 +03:00
Ben Wallis
1ba224906c Merge pull request #80 from azakhi/feature/improve-section-wide-actions
Improve commands & add multiple selection feature
2018-09-16 19:19:24 +01:00
azakhi
32523787d2 Improve commands & add multiple selection feature 2018-09-13 17:34:16 +03:00
Ben Wallis
ac6943d73b Replaced AlertSound .wav files with .mp3 files (reduces installer size by 50%~) 2018-09-08 22:34:41 +01:00
Ben Wallis
36c0aaea17 Bumped version to 0.21 2018-09-08 10:26:45 +01:00
Ben Wallis
4b38a6a4e0 Bumped version to 0.20 2018-09-08 10:14:56 +01:00
Ben Wallis
9c44dd7e7d Merge pull request #79 from azakhi/feature/12-13-preserve-user-ui-choices
Preserve UI states and last active document
2018-09-08 10:13:36 +01:00
Ben Wallis
18c878e350 Merge pull request #75 from azakhi/feature/40-add-enable-disable-to-group-browser
Feature/40 add enable disable to group browser
2018-09-08 10:12:04 +01:00
Ben Wallis
5d30888597 Merge pull request #72 from azakhi/feature/improve-pasting-multiple-blocks
Improve pasting to support different copy sources
2018-09-08 09:56:14 +01:00
azakhi
bfd722d362 Add add/delete block group support to blocks 2018-09-07 20:36:27 +03:00
azakhi
d23741555a Fix tests 2018-09-07 20:36:27 +03:00
azakhi
820aa5499e Fix block group creation 2018-09-07 20:36:27 +03:00
azakhi
1ee38b4c0e Fix block group output & expand/collapse all 2018-09-07 20:36:27 +03:00
azakhi
4bed777427 Improve parent group status logic 2018-09-07 20:36:27 +03:00
azakhi
1f6cbeec86 Add enable/disable checkbox to group browser 2018-09-07 20:36:27 +03:00
azakhi
550a2d8f25 Preserve UI states and last active document 2018-09-07 19:57:32 +03:00
Ben Wallis
ae38197052 Merge pull request #77 from GlenCFL/save-state
Set the state to dirty on using editing commands.
2018-09-07 15:05:43 +01:00
GlenCFL
4fd4ffc520 Set the state to dirty on using editing commands. 2018-09-07 04:59:57 -04:00
Ben Wallis
e15efe4e15 Merge pull request #76 from GlenCFL/transparency_rework
Make the minimap icons transparent. Take 2.
2018-09-07 08:13:27 +01:00
GlenCFL
196db4c730 Use Enum.IsDefined as suggested. 2018-09-07 03:01:45 -04:00
GlenCFL
910b2b8c7f Make the minimap icons transparent. 2018-09-06 20:01:16 -04:00
Ben Wallis
b31ce1d843 Merge pull request #74 from azakhi/feature/19-add-buttons-to-group-browser
Add clear all button & missing functions
2018-09-05 16:01:46 +01:00
azakhi
99a011c78c Add clear all button & missing functions 2018-09-05 17:55:16 +03:00
azakhi
69ce542c1a Improve pasting to support different copy sources 2018-09-04 14:18:11 +03:00
Ben Wallis
2ff9ebf242 Merge pull request #71 from azakhi/bugfix/70-fix-max-quality
Increase maximum quality to 30
2018-09-04 06:45:18 +01:00
azakhi
0eff63d706 Increase maximum quality to 30 2018-09-04 08:34:26 +03:00
Ben Wallis
1b8f37ca3a Merge pull request #65 from azakhi/bugfix/64-fix-group-browser-filter
Fix block group browser not filtering
2018-09-03 18:55:19 +01:00
Ben Wallis
b4f02f872e Merge pull request #67 from azakhi/bugfix/10-fix-default-opacity
Change default alpha value to 240
2018-09-03 18:53:09 +01:00
azakhi
cfef82e53a Change default alpha value to 240 2018-09-03 15:37:10 +03:00
azakhi
bdd121f48c Fix block group browser not filtering 2018-09-03 11:26:13 +03:00
Ben Wallis
0209de3817 Update README.md 2018-09-01 10:15:38 +01:00
Ben Wallis
1e26a2ae3e Merge pull request #62 from GlenCFL/fix-reopen
Fix the reading of CustomAlertSounds containing path separators.
2018-09-01 09:57:54 +01:00
GlenCFL
54b72e44b0 Reposition the new custom sound tests. 2018-08-31 21:06:51 -04:00
GlenCFL
24df1d7687 Fix the reading of CustomAlertSounds containing path separators. 2018-08-31 20:01:21 -04:00
Ben Wallis
7162e16b49 Merge pull request #59 from azakhi/improvements
Improvements
2018-08-31 15:28:18 +01:00
azakhi
324ce4d0b3 Fix binding problem 2018-08-31 17:05:21 +03:00
azakhi
de489e8b2c Fix folder bug 2018-08-31 16:54:24 +03:00
azakhi
341b1d1eb2 Make section header parsing more generic 2018-08-31 16:13:57 +03:00
azakhi
6be29dbd28 Add tests and fix theme bug 2018-08-31 16:02:17 +03:00
azakhi
3851ad51e1 Add support for comments between rules 2018-08-31 14:22:26 +03:00
azakhi
65d3e07156 Add comment support for all rule types 2018-08-31 11:21:43 +03:00
azakhi
a86ab3ec8d Use available sounds as combobox source 2018-08-31 09:40:48 +03:00
azakhi
41722e8a57 Update icons 2018-08-31 09:00:31 +03:00
Ben Wallis
3cb0a041d7 Update README.md 2018-08-30 19:31:45 +01:00
Ben Wallis
c8778bb1eb bumped version to 0.19 2018-08-30 19:28:32 +01:00
Ben Wallis
8e849d6a8f Merge pull request #57 from azakhi/master
Fix play effect parsing bug
2018-08-30 19:26:37 +01:00
azakhi
0d3f01a856 Update item classes 2018-08-30 21:23:34 +03:00
azakhi
178ff579c6 Fix PlayEffect parsing 2018-08-30 21:22:20 +03:00
Ben Wallis
30aa52e788 updated Delve Socketable Currency in ItemClasses 2018-08-30 19:20:44 +01:00
Ben Wallis
c1aee2f8f7 Merge branch 'master' of https://github.com/ben-wallis/Filtration 2018-08-30 18:31:53 +01:00
Ben Wallis
937426e9a3 added tests 2018-08-30 18:31:34 +01:00
Ben Wallis
7e0932830d Update README.md 2018-08-30 18:14:24 +01:00
Ben Wallis
15c63fa222 Merge pull request #55 from azakhi/master
Copy paste sound bug fix
2018-08-30 18:00:09 +01:00
Ben Wallis
cc986eea21 updated version to 0.18 and 2016 dates to 2018 2018-08-30 17:59:20 +01:00
azakhi
c260014a16 Add requested changes 2018-08-30 19:56:47 +03:00
azakhi
8f0f73f185 Copy paste sound bug fix 2018-08-30 19:33:46 +03:00
Ben Wallis
15143f738f Fixed crash when scrolling with open blocks 2018-08-29 22:45:47 +01:00
Ben Wallis
dc6ed934b2 Merge pull request #54 from azakhi/master
3.4 Update and Improvements
2018-08-29 22:39:36 +01:00
azakhi
78b4ddc862 Add new filter fuatures 2018-08-29 20:12:02 +03:00
azakhi
a09f0a5090 Add custom sound theme support 2018-08-29 13:11:41 +03:00
azakhi
2958d93b33 Add Custom Sound block 2018-08-27 22:43:01 +03:00
azakhi
1e9b1158bd Merge branch 'improvements' 2018-08-26 20:27:23 +03:00
azakhi
d92d34af05 Add alert sound theme support 2018-08-26 20:24:13 +03:00
azakhi
bc5a005ee7 Add font size theme support & improve theme system 2018-08-25 15:52:16 +03:00
azakhi
8ba3433dcf Refactor theme code to support different types 2018-08-24 22:07:24 +03:00
azakhi
d0bc0b6864 Add section search feature 2018-08-24 18:03:38 +03:00
azakhi
1eaf0b6fe5 Improve UI performance 2018-08-24 01:09:44 +03:00
azakhi
4c76dc9bab Improve test block for beam feature 2018-08-22 20:20:12 +03:00
azakhi
2a7df9a1ca Add a temporary block type for new beam feature 2018-08-22 13:15:50 +03:00
azakhi
add7514ce7 Fix temporary block type control 2018-08-22 11:47:32 +03:00
azakhi
0974579684 Add requested changes & minor bug fixes 2018-08-22 11:41:02 +03:00
azakhi
c0e9c534de Add temporary block type for new type 2018-08-21 17:03:42 +03:00
azakhi
780081263c Replace 'Maelström' to prevent encoding problems 2018-08-20 21:34:16 +03:00
azakhi
387f08db85 Improve parsing 2018-08-20 21:25:30 +03:00
azakhi
7fb9378304 Improve parsing & bug fixes 2018-08-20 21:25:30 +03:00
azakhi
e5209fb459 Improve UI 2018-08-20 21:25:30 +03:00
azakhi
961805272d Make comment blocks expandable & improve parsing 2018-08-20 21:25:30 +03:00
azakhi
281c7d85e1 Fix adding comment block to collapsed section 2018-08-20 21:25:30 +03:00
azakhi
57775a9e22 Start sections collapsed & restyle buttons 2018-08-20 21:25:30 +03:00
azakhi
5817295f7c Fix adding block to a collapsed section 2018-08-20 21:25:30 +03:00
azakhi
216168533f Fix pasting sections 2018-08-20 21:25:29 +03:00
azakhi
f6969a0204 Fix performance issue 2018-08-20 21:25:29 +03:00
azakhi
38053666a0 Fix collapsed section height 2018-08-20 21:25:29 +03:00
azakhi
bd730dd518 Add section features 2018-08-20 21:25:29 +03:00
azakhi
2c4096ff2c Add DisableDropSound block type 2018-08-20 21:19:18 +03:00
azakhi
738415f10a Add ElderMap block type 2018-08-12 11:15:45 +03:00
azakhi
f03e37602d Fix script desc bug in a better way 2018-08-11 12:28:13 +03:00
azakhi
2230b81257 Fix test 2018-08-10 17:27:43 +03:00
azakhi
3aa2bf488c Fix tests 2018-08-10 17:22:55 +03:00
azakhi
71b7a45f84 Add tests and small bugfixes 2018-08-10 17:08:17 +03:00
azakhi
0fd2db7076 Add new base types and classes 2018-08-09 17:12:03 +03:00
azakhi
400688573c Add new block types added in 3.3 2018-08-09 16:48:11 +03:00
Ben Wallis
52fc1f6bbc Merge branch 'master' of https://github.com/ben-wallis/Filtration 2017-12-09 16:16:29 +00:00
Ben Wallis
3f437c0109 FIL-18: Fixed first comment block being merged into the script description 2017-12-09 16:16:20 +00:00
Ben Wallis
f838b35b4c Added Murderous Eye Jewel to ItemBaseTypes.txt 2017-12-09 15:12:39 +00:00
Ben Wallis
ac706486cb Update README.md 2017-12-08 18:09:04 +00:00
Ben Wallis
3607ad362e Update README.md 2017-12-08 18:08:48 +00:00
Ben Wallis
1ecec4e9dc Bumped version to 0.17 2017-12-08 17:58:53 +00:00
Ben Wallis
404a04c210 Merge pull request #51 from GlenCFL/fixes
0.16 Regression Fixing
2017-12-08 17:57:13 +00:00
GlenCFL
f1b2be7d74 Add in Ben's fix for Comments not setting dirty state. 2017-12-08 12:54:53 -05:00
GlenCFL
6393a53bf5 Remove code duplication. 2017-12-08 12:12:17 -05:00
GlenCFL
a0a72b5fe8 Mark comments as two way, fixing updating issues. 2017-12-08 10:44:22 -05:00
GlenCFL
d96234f099 Fix the contextual Delete Section command. 2017-12-08 09:15:01 -05:00
GlenCFL
07fdc2eb49 Fix the Add Section crash. 2017-12-08 07:41:16 -05:00
GlenCFL
86ff670fb0 Fix for the ShChaos sound not playing. 2017-12-08 01:42:00 -05:00
Ben Wallis
c9caed7e6b Fixed failing test 2017-12-07 22:35:06 +00:00
Ben Wallis
9cf4d86cb0 Fixed multiline comment saving 2017-12-07 22:22:26 +00:00
Ben Wallis
523a9553d9 Fixed section browser 2017-12-07 21:36:42 +00:00
Ben Wallis
b88730fb3a Merge pull request #49 from GlenCFL/master
Provide an update to fully support Path of Exile 3.1.
2017-12-07 20:19:14 +00:00
GlenCFL
06b88e85f2 Fix failing tests. 2017-12-07 14:27:03 -05:00
GlenCFL
b98988f0b5 Merge remote-tracking branch 'upstream/master' 2017-12-07 14:16:47 -05:00
Ben Wallis
d14e4e9320 Merge pull request #50 from ben-wallis/develop
Various changes from local repo
2017-12-07 18:24:46 +00:00
Ben Wallis
d91f7e1ac3 Fixed compile warnings 2017-12-07 18:18:05 +00:00
Ben Wallis
d84b17ced3 Implemented script-level undo/redo (currently hidden in UI) 2017-12-07 18:14:47 +00:00
GlenCFL
fef20ff36a Fix the halting issue on window close. 2017-12-07 12:53:44 -05:00
GlenCFL
23fa82655b Add tests for the new keywords. 2017-12-07 12:14:42 -05:00
GlenCFL
e5bd994164 Fix the existing tests. 2017-12-07 11:57:36 -05:00
GlenCFL
342487f800 Update the ordering of the BlockItems. 2017-12-07 09:26:33 -05:00
GlenCFL
8bf3527b69 Add support for PlayAlertSoundPositional. 2017-12-07 08:21:32 -05:00
GlenCFL
010e0dda31 Add support for the new alert sounds. 2017-12-07 06:49:25 -05:00
GlenCFL
2cf6a5953b Update both the item class and item base lists. 2017-12-06 23:24:30 -05:00
GlenCFL
1ebbe5b5a8 Add support for the new block types. 2017-12-06 23:03:46 -05:00
Ben Wallis
fee2a4dd99 Initial refactoring to support CommandManager 2017-06-17 13:50:44 +01:00
Ben Wallis
b65fad0679 FIL-4 Completed refactoring of Sections to ItemFilterCommentBlocks 2017-06-17 12:19:54 +01:00
Ben Wallis
43c6149832 Fixed failing tests 2017-05-20 18:34:45 +01:00
Ben Wallis
4def27c49d FIL-4 Refactored script parsing to retain isolated comments as a new ItemFilterBlockComment type - UI still needs reworking with new templates and such. 2017-05-20 18:14:28 +01:00
Ben Wallis
7b8ff1e3cb Update README.md 2017-05-14 14:15:11 +01:00
Ben Wallis
797c911bb5 FIL-13 Comments on the Show/Hide line are now preserved if block groups are not enabled for the script 2017-05-14 14:10:54 +01:00
Ben Wallis
8e54cc3b4b Fixed failing tests 2017-05-14 13:06:07 +01:00
Ben Wallis
ab7aefa8a6 FIL-11 Added BlockGroupsEnabled flag to ItemFilterScript (encapsulated in new ItemFilterScriptSettings object) 2017-05-14 13:02:30 +01:00
Ben Wallis
bb77138854 FIL-1 Changed Block Group Parsing to use " - " as delimiter instead of "-" 2017-05-14 12:12:42 +01:00
Ben Wallis
2d98f7de36 Updated appveyor.yml 2017-05-09 22:03:24 +01:00
Ben Wallis
6277917ae6 Updated Filtration.sln Visual Studio version from 14 to 15 2017-05-09 21:58:34 +01:00
Ben Wallis
3fe021949a Replaced AutoMapper usage for ItemFilterBlockGroup viewmodel mapping with constructor overload
Updated NuGet packages
2017-05-09 21:41:51 +01:00
Ben Wallis
733c7d1757 Added [Ignore] to integration unit tests 2017-05-08 20:12:24 +01:00
Ben Wallis
702c118783 Added appveyor.yml 2017-05-08 20:09:29 +01:00
Ben Wallis
11d85fdd1b Update README.md 2016-12-03 12:22:15 +00:00
Ben Wallis
8dc5864d2e Bumped version to 0.15 2016-12-03 12:14:23 +00:00
Ben Wallis
884651bce9 Added support for Identified (Issue #34) and Corrupted (Issue #42) block items
Changed block item output order (Issue #41)
2016-12-03 11:58:18 +00:00
Ben Wallis
e7a40c8c6d Updated FluentAssertions nuget package 2016-09-01 21:27:39 +01:00
Ben Wallis
dde9f65ea6 Bumped version number to 0.14, added icon to Update Available window 2016-09-01 21:19:22 +01:00
Ben Wallis
ae6e8c5211 Fixed #31 - Added context menu to sections 2016-09-01 21:11:15 +01:00
Ben Wallis
67685d9eac Fixed #30 - Updating a section title does not update the Section Browser 2016-09-01 21:02:38 +01:00
Ben Wallis
af08cdfed6 Fixed #32 - PlayAlertSound ignored on Paste Block Style 2016-09-01 20:56:58 +01:00
Ben Wallis
0b791f5747 Fixed #33 - Update check window buttons erroneously shut down application 2016-09-01 20:26:55 +01:00
Ben Wallis
43bc1410ae Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2016-08-31 00:10:40 +01:00
Ben Wallis
b3520246b9 Fixed bug causing removing a block item to not refresh the item preview 2016-08-31 00:10:36 +01:00
Ben Wallis
6d1c51361b Bumped to 0.13 2016-08-30 22:57:49 +01:00
Ben Wallis
360b1c8144 Bumped version to 0.13 2016-08-30 22:54:31 +01:00
Ben Wallis
80b8318574 Fixed #28 - Add appearance block item links firing wrong command 2016-08-30 22:53:17 +01:00
Ben Wallis
85f47ce654 Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2016-08-30 19:16:47 +01:00
Ben Wallis
c88c401ca8 Fixed crash when Item Base Types or Item Classes static data files aren't present 2016-08-30 19:16:44 +01:00
Ben Wallis
45ab1a57e3 Updated current release to 0.12 2016-08-30 19:03:58 +01:00
Ben Wallis
f77e9575fc Moved Update Data Url to Settings 2016-08-30 18:42:40 +01:00
Ben Wallis
6eb17555c0 Fixed 2 bugs relating to duplicate ItemRarity block items and spaces at the end of ItemRarity block items 2016-08-30 18:39:08 +01:00
Ben Wallis
ce4366d3fd Replaced ItemBaseTypes.txt and ItemClasses.txt 2016-08-29 13:17:40 +01:00
Ben Wallis
03a291a309 Switched back to Office 2013 theme now that it's fixed on Windows 10. Slightly increased with of Block Item user controls. 2016-08-29 13:13:27 +01:00
Ben Wallis
0eecd5d1ff Added auto updating of ItemBaseTypes.txt and ItemClasses.txt static data files 2016-08-21 13:33:14 +01:00
Ben Wallis
f947cd02da Improved dirty script detection to include modifications to blocks rather than just block additions/removals 2016-08-20 21:17:12 +01:00
Ben Wallis
f75095ba72 Tidy up, updated ItemBaseTypes and ItemClasses files to Path of Exile 2.3.4 2016-08-20 15:42:59 +01:00
Ben Wallis
76dd9fb22c Groundwork for loot preview view implemented 2016-01-31 14:11:30 +00:00
Ben Wallis
8bfbe7cc66 Refactored parsing services into separate project 2016-01-31 11:56:55 +00:00
Ben Wallis
86dc03f4ff Various refactorings to support ItemFilterPreview 2016-01-31 10:51:53 +00:00
Ben Wallis
d159f0b262 Finished initial implementation of filter processing core 2015-12-29 22:03:07 +00:00
Ben Wallis
1bdc8bf6fd More work on item filter processing 2015-12-28 17:30:34 +00:00
Ben Wallis
89e98fc8c6 Block matching basics complete 2015-12-20 15:17:26 +00:00
Ben Wallis
014107c76b Started work on Item Filter Preview module 2015-12-19 23:02:32 +00:00
Ben Wallis
2f2a57e77a Changed to Office 2013 FluentRibbon theme as the Windows 8 theme is broken on Windows 10. 2015-12-19 13:19:07 +00:00
Ben Wallis
d014a93b70 More work on Issue #22 - added remove item button to items in the EditableListBoxControl on mouseover. 2015-12-19 11:51:03 +00:00
Ben Wallis
7d2e20e9e1 Partially fixed Issue #22 - the EditableListBoxControl now accepts enter to add an item and retains focus in the text box after doing so. 2015-12-19 10:47:55 +00:00
Ben Wallis
bb45832d7a Fixed Bug #20 2015-12-19 10:32:22 +00:00
Ben Wallis
2dc56799fd Implemented C# 6.0 features, fixed most of resharper's code quality suggestions. 2015-12-13 20:17:15 +00:00
Ben Wallis
9a117d118f Retargeted projects to .NET Framework 4.6.1 2015-12-13 19:45:01 +00:00
Ben Wallis
94836f9673 Updated NuGet packages and fixed broken tests 2015-12-13 19:41:33 +00:00
Ben
c5eb27d08d Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-07-31 22:14:02 +01:00
Ben
4185c3dbde Removed async update check due to threading issue 2015-07-31 22:13:58 +01:00
Ben Wallis
fc12c2dced Updated release to 0.11 2015-07-31 21:49:42 +01:00
Ben
94146467a3 Removed async from a test that didn't need it 2015-07-31 21:43:33 +01:00
Ben
da9fad05a6 Changed maximum PlayAlertSound volume from 100 to 300 as per latest patch.
Updated version to 0.11
2015-07-31 19:52:19 +01:00
Ben
eb73767560 Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-07-31 19:45:57 +01:00
Ben
2954cfe259 Fixed async tests 2015-07-31 19:45:51 +01:00
Ben Wallis
3694e6fa0c Updated release to 0.10 2015-07-26 17:19:53 +01:00
Ben
37258e563a Added Divination Cards to base types 2015-07-26 17:12:51 +01:00
Ben
71e1f2bf78 Revert "Removed Stackable Currency from ItemClasses"
This reverts commit f3ed386845.
2015-07-26 17:03:12 +01:00
Ben
b2b412a73c Revert "Removed Thrusting One Hand Swords from Base Types"
This reverts commit e80295cb69.
2015-07-26 17:03:06 +01:00
Ben
ae948c83a5 Updated version number to 0.10 2015-07-26 17:02:54 +01:00
Ben
3727166a44 Added drag and drop to open script/theme functionality 2015-07-26 11:48:54 +01:00
Ben
32b0a0199f Implemented async saving and loading 2015-07-25 19:02:42 +01:00
Ben
e54730d693 Added Tooltips for keyboard shortcuts and added Ctrl+N shortcut 2015-07-25 15:46:38 +01:00
Ben
d11eefaeab Fixed crash when pasting blocks with block groups assigned 2015-07-24 18:41:13 +01:00
Ben
da5b2c73a0 Moved clipboard operations to ClipboardService 2015-07-24 16:52:31 +01:00
Ben
2ff1373c6b Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-07-24 14:47:52 +01:00
Ben
1882687601 Fixed BlockGroupBrowser indeterminate checkbox state bug 2015-07-24 14:47:47 +01:00
Ben Wallis
3ba25b8f07 Updated release to 0.9 2015-07-15 19:55:52 +01:00
Ben
e80295cb69 Removed Thrusting One Hand Swords from Base Types 2015-07-15 19:48:51 +01:00
Ben
f3ed386845 Removed Stackable Currency from ItemClasses 2015-07-15 19:48:33 +01:00
Ben
89e0c717e8 Bumped version to 0.9 2015-07-15 19:45:49 +01:00
Ben
8924637b98 Added hint text when no audio visual block items are added. 2015-07-15 19:41:31 +01:00
Ben
b0b912c676 Added save check on close 2015-07-15 19:36:42 +01:00
Ben
92ebc51e7b Switched file save encoding to UTF-8 2015-07-15 19:17:19 +01:00
Ben
95e7581a5b Fixed Delete Theme Component button being enabled for non-master themes 2015-07-15 19:12:19 +01:00
Ben
9cb854b584 Fixed Usages: 0 being visible when editing a non-master theme 2015-07-15 19:10:51 +01:00
Ben
61c2902f0c Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-07-15 19:02:34 +01:00
Ben
dc157713f3 Fixed Issue #8 - Crash when Filtration cannot perform the update check on startup 2015-07-15 19:02:29 +01:00
Ben Wallis
16fe837544 updated to 0.8 2015-07-13 15:17:53 +01:00
Ben
58de6f06b9 Added Jewel to ItemClasses.txt 2015-07-10 18:13:12 +01:00
Ben
af2dace29a Fixed crash when opening a script after Filtration is invoked via file association (Issue #7) 2015-07-10 18:11:03 +01:00
Ben
59cf604430 Revert "Increased the size of the Item Preview control to cater for FontSize 45"
This reverts commit 93a51e7829.
2015-07-10 17:54:42 +01:00
Ben
93a51e7829 Increased the size of the Item Preview control to cater for FontSize 45 2015-07-10 17:52:10 +01:00
Ben
9d928a374a Fixed crash when clicking Close menu option with no script/theme open
Fixed memory leak when documents are closed.
2015-07-10 17:48:34 +01:00
Ben
b5788504cb Fixed Disabled Block Block Group Bug (Issue #6) 2015-07-10 17:29:37 +01:00
Ben
6e71005e93 Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-07-09 18:58:27 +01:00
Ben
56e163e3e0 Fix for line description being lost when reading disabled blocks 2015-07-09 18:58:22 +01:00
Ben Wallis
c856bbcee7 updated screenshots 2015-07-06 19:14:28 +01:00
Ben Wallis
490496f2f7 Updated release to 0.7 2015-07-06 18:41:14 +01:00
Ben
9fcb609a51 Implemented disabled block support 2015-07-06 18:19:05 +01:00
Ben
1b63f68eee Fixed theme serialization/deserialization and added them toolbar icons 2015-07-06 15:33:25 +01:00
Ben
a496ab9b42 Resharper Code Issues Cleanup 2015-07-06 13:45:19 +01:00
Ben
cbbc7c25fa More theme changes 2015-07-06 13:41:46 +01:00
Ben
d6bd1678b4 Fixed contextual tabs 2015-07-06 12:01:48 +01:00
Ben
bfa2341ab8 Implemented editable themes / master themes 2015-07-05 22:43:17 +01:00
Ben
511f503e88 Refactored ThemeComponentBuilder into ThemeComponentCollection 2015-07-05 16:54:09 +01:00
Ben
3ea0530c01 Added Divination Cards to Classes and Base Types lookup lists 2015-07-05 16:19:45 +01:00
Ben
aad34b1407 Changed UpdateDataUrl back to correct url 2015-07-05 11:14:44 +01:00
Ben
544b931477 Added theme component tag selection control 2015-07-05 11:09:59 +01:00
Ben
f5dcdf0af9 Removed item block display settings popup 2015-07-04 22:38:13 +01:00
Ben
da3759cd76 Refactored ItemFilterBlockView to use new usercontrol instead of datatemplate spam 2015-07-04 21:12:47 +01:00
Ben
d586492de8 Added theme component tooltip in theme editor 2015-07-04 20:24:00 +01:00
Ben
3337531161 Fixed another copy paste bug, changed speaker icon to button 2015-07-04 17:28:34 +01:00
Ben
0c470b3c97 Fixed copy paste crashes 2015-07-04 16:47:28 +01:00
Ben
3a60a5005b Changed versioning format, added grouping to theme browser, fixed styles 2015-07-04 14:29:07 +01:00
Ben
8b6207e334 Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-07-04 12:24:56 +01:00
Ben
fea6bf6da2 Fixed bug causing clicks between documents and toolpanes not to register. 2015-07-04 12:24:50 +01:00
Ben Wallis
b6d1befd23 Delete Filtration.exe.config 2015-07-03 22:56:26 +01:00
Ben Wallis
2475d90bac Delete LootFilterScriptViewModel - Copy.cs 2015-07-03 22:55:51 +01:00
Ben
aae014b6e0 Added NLog logging 2015-07-03 22:16:17 +01:00
Ben
aadd56c473 Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-07-03 21:19:30 +01:00
Ben
8f533e8fd7 Fixed localised decimal bug and tidied up About Window 2015-07-03 21:19:25 +01:00
Ben Wallis
272b7e8360 Update README.md 2015-07-02 22:48:57 +01:00
Ben
2d448ed850 Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-07-02 22:02:55 +01:00
Ben
bf4781dbde Added application-level unhandled exception handler 2015-07-02 22:02:51 +01:00
Ben Wallis
b889f1ef9a Update README.md 2015-07-02 20:47:00 +01:00
Ben
45b9d87ddb Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-07-02 20:19:41 +01:00
Ben
eb054a5068 Added auto updater 2015-07-02 20:19:32 +01:00
Ben Wallis
30498f08eb Update README.md 2015-07-02 20:17:33 +01:00
Ben
121681906d Fixed WPF Toolkit nuget package references 2015-07-02 18:06:16 +01:00
Ben
526350e389 Moved AvalonDock to libs directory and updated references 2015-07-02 18:03:05 +01:00
Ben
0bc3cac585 Added untracked files 2015-07-02 17:57:43 +01:00
Ben
c3d11da155 Further AutoMapper changes 2015-07-01 22:28:29 +01:00
Ben
440254f3f8 More styling work, fixed automapper issue 2015-07-01 22:26:00 +01:00
Ben
3a628df744 Fixed single line script description bug
Style tweaks inc. block selection style
2015-06-28 22:46:29 +01:00
Ben
c3a40b3412 Various bug fixes and sorted app icon 2015-06-28 21:44:36 +01:00
Ben
965627d587 Moved Settings to BackStage 2015-06-27 23:19:16 +01:00
Ben
4e77075182 Fixed memory leaks 2015-06-27 22:24:35 +01:00
Ben
dce21d84b3 Major UI overhaul, implemented FluentRibbon 2015-06-27 18:08:06 +01:00
Ben
5b4c622345 Completed initial implementation of Theme Editor 2015-06-26 21:54:20 +01:00
Ben
71ad5f2d05 Implemented opening/saving themes 2015-06-26 17:42:20 +01:00
Ben
aa5cedcbba Added Theme Editor window and added to Tools menu 2015-06-26 10:17:32 +01:00
Ben
cc05945108 Implemented ThemeComponent reading/saving in translation layer 2015-06-25 23:05:24 +01:00
Ben
e53e24100f Fixed block group advanced status being lost during save 2015-06-24 23:04:54 +01:00
Ben
4faa12474a Added settings window 2015-06-24 22:34:19 +01:00
Ben
1ba3b3f850 Added Default Path of Exile directory to saved settings 2015-06-24 21:24:38 +01:00
Ben
c6f5dcda39 Moved Object Model to separate project 2015-06-24 19:57:16 +01:00
Ben
1be6fe9e7b Refactored script to text translation 2015-06-23 22:21:10 +01:00
Ben
29ed02e172 Fixed bug where closing a non-active document blanked the tool windows for the current document 2015-06-23 21:59:26 +01:00
Ben
e3505b3575 Fixed AvalonDock close tools crash, added Block Output Preview pane 2015-06-23 21:41:57 +01:00
Ben
0eafd59e79 Set BlockGroupBrowser pane to not be closeable 2015-06-22 21:00:13 +01:00
Ben
692269ddb3 Fixed ColorBlock parsing to respect comments, preventing overflow errors when numbers are present in comments on these lines. 2015-06-22 19:00:22 +01:00
Ben
72e9caec29 Added ItemFilterScriptRepository 2015-06-18 22:12:15 +01:00
Ben
e25fbe67eb Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-06-18 21:08:50 +01:00
Ben
c80d4825df Added AutoMapper for BlockGroup to BlockGroupViewModel translation 2015-06-18 21:08:44 +01:00
Ben Wallis
e07e7eeb3e Updated screenshots and release links for 0.3 2015-06-14 21:17:15 +01:00
Ben
8119018f33 Changed About Window to 2015-06-14 21:11:25 +01:00
Ben
e0a660fec6 Added Advanced Block Group block colouring 2015-06-14 20:56:05 +01:00
Ben
08d9cf277b Added partial support for Advanced BlockGroups 2015-06-14 19:17:39 +01:00
Ben
08a193dc6b Various bug fixes, added standard POE colours to ColorPickers 2015-06-14 16:50:08 +01:00
Ben
aa433ad685 Added Show/Hide functionality to the checkboxes in the Block Group Browser 2015-06-11 22:01:52 +01:00
Ben
3ee7e1cc2a Added ThreeState IsChecked logic to ItemFilterBlockGroup 2015-06-11 21:01:33 +01:00
Ben
6d9edbda98 Refactored AvalonDock workspace into separate ViewModel 2015-06-11 20:33:45 +01:00
Ben
f4eaba016f Implemented AvalonDock, added BlockGroupBrowser 2015-06-10 22:42:31 +01:00
Ben
92eb8cec01 Basic AvalonDock functionality implemented 2015-06-09 23:55:25 +01:00
Ben
41ecdf325c Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-06-08 22:31:24 +01:00
Ben
7b0e83b9ae Implemented BlockGroups and related translation 2015-06-08 22:29:39 +01:00
Ben
d48f7a58ec Replaced all instances of "LootFilter" with "ItemFilter" 2015-06-08 20:17:34 +01:00
Ben Wallis
4db27cdfbd Update README.md 2015-06-07 20:07:19 +01:00
Ben Wallis
f7512f9f8b Updated download links for 0.2 2015-06-07 20:07:01 +01:00
Ben
5bd5ce8b0f Updated versioning information. Need to automate this. 2015-06-07 19:58:39 +01:00
Ben
a693d68494 Changed "Script edited with" tagline to point to GitHub site 2015-06-07 19:18:56 +01:00
Ben
dffe301c87 Refactored the Item Preview boxes in the block list and the replace colors dialog to use a common UserControl 2015-06-07 18:56:55 +01:00
Ben
0bab1e7c9a Cleaned up BlockItem classes, added BlockItemBase and pulled up ILootFilterBlockItem abstract members into it.
Added click toggle for Show/Hide as per suggestion from Antnee
2015-06-07 15:13:09 +01:00
Ben
270645623a Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-06-07 11:37:09 +01:00
Ben
f5be647d52 Tweaked item preview to show bright borders more clearly. 2015-06-07 11:37:04 +01:00
Ben Wallis
329fc24ed6 Update README.md 2015-06-07 00:54:00 +01:00
Ben Wallis
5152c05aa9 Update README.md 2015-06-06 23:33:04 +01:00
Ben Wallis
3fa6a346b0 Update README.md 2015-06-06 23:24:55 +01:00
Ben
770f98c7f5 Fixed bug allowing paste with no target block selected 2015-06-06 23:17:51 +01:00
Ben
595ed61f16 Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2015-06-06 22:24:54 +01:00
Ben
ba83770d21 Fixed position of Preview text in Replace Colors Window 2015-06-06 22:24:48 +01:00
Ben Wallis
f4b035a155 Create README.md 2015-06-06 22:24:00 +01:00
492 changed files with 58596 additions and 7536 deletions

183
.gitignore vendored
View File

@@ -1,23 +1,37 @@
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files # User-specific files
/.vs/
*.suo *.suo
*.user *.user
*.userosscache
*.sln.docstates *.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results # Build results
[Dd]ebug/ [Dd]ebug/
[Dd]ebugPublic/ [Dd]ebugPublic/
[Rr]elease/ [Rr]elease/
[Rr]eleases/
x64/ x64/
build/ x86/
bld/ bld/
[Bb]in/ [Bb]in/
[Oo]bj/ [Oo]bj/
[Ll]og/
# Roslyn cache directories # Visual Studio 2015/2017 cache/options directory
*.ide/ .vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results # MSTest test Results
[Tt]est[Rr]esult*/ [Tt]est[Rr]esult*/
@@ -32,6 +46,19 @@ TestResult.xml
[Rr]eleasePS/ [Rr]eleasePS/
dlldata.c dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c *_i.c
*_p.c *_p.c
*_i.h *_i.h
@@ -64,14 +91,21 @@ _Chutzpah*
ipch/ ipch/
*.aps *.aps
*.ncb *.ncb
*.opendb
*.opensdf *.opensdf
*.sdf *.sdf
*.cachefile *.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler # Visual Studio profiler
*.psess *.psess
*.vsp *.vsp
*.vspx *.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace # TFS 2012 Local Workspace
$tf/ $tf/
@@ -84,7 +118,7 @@ _ReSharper*/
*.[Rr]e[Ss]harper *.[Rr]e[Ss]harper
*.DotSettings.user *.DotSettings.user
# JustCode is a .NET coding addin-in # JustCode is a .NET coding add-in
.JustCode .JustCode
# TeamCity is a build add-in # TeamCity is a build add-in
@@ -93,9 +127,18 @@ _TeamCity*
# DotCover is a Code Coverage Tool # DotCover is a Code Coverage Tool
*.dotCover *.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch # NCrunch
_NCrunch_* _NCrunch_*
.*crunch*.local.xml .*crunch*.local.xml
nCrunchTemp_*
# MightyMoose # MightyMoose
*.mm.* *.mm.*
@@ -123,42 +166,63 @@ publish/
# Publish Web Output # Publish Web Output
*.[Pp]ublish.xml *.[Pp]ublish.xml
*.azurePubxml *.azurePubxml
## TODO: Comment the next line if you want to checkin your # Note: Comment the next line if you want to checkin your web deploy settings,
## web deploy settings but do note that will include unencrypted # but database connection strings (with potential passwords) will be unencrypted
## passwords *.pubxml
#*.pubxml *.publishproj
# NuGet Packages Directory # Microsoft Azure Web App publish settings. Comment the next line if you want to
packages/* # checkin your Azure Web App publish settings, but sensitive information contained
## TODO: If the tool you use requires repositories.config # in these scripts will be unencrypted
## uncomment the next line PublishScripts/
#!packages/repositories.config
# Enable "build/" folder in the NuGet Packages folder since # NuGet Packages
# NuGet packages use it for MSBuild targets. *.nupkg
# This line needs to be after the ignore of the build folder # The packages folder can be ignored because of Package Restore
# (and the packages folder if the line above has been uncommented) **/[Pp]ackages/*
!packages/build/ # except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Windows Azure Build Output # Microsoft Azure Build Output
csx/ csx/
*.build.csdef *.build.csdef
# Windows Store app package directory # Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/ AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others # Others
sql/
*.Cache
ClientBin/ ClientBin/
[Ss]tyle[Cc]op.*
~$* ~$*
*~ *~
*.dbmdl *.dbmdl
*.dbproj.schemaview *.dbproj.schemaview
*.jfm
*.pfx *.pfx
*.publishsettings *.publishsettings
node_modules/ orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects # RIA/Silverlight projects
Generated_Code/ Generated_Code/
@@ -174,6 +238,7 @@ UpgradeLog*.htm
# SQL Server files # SQL Server files
*.mdf *.mdf
*.ldf *.ldf
*.ndf
# Business Intelligence projects # Business Intelligence projects
*.rdl.data *.rdl.data
@@ -183,7 +248,69 @@ UpgradeLog*.htm
# Microsoft Fakes # Microsoft Fakes
FakesAssemblies/ FakesAssemblies/
# LightSwitch generated files # GhostDoc plugin setting file
GeneratedArtifacts/ *.GhostDoc.xml
_Pvt_Extensions/
ModelManifest.xml # Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# TypeScript v1 declaration files
typings/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1E42A658-45C4-4DD9-83C5-2A10728DBDFA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Filtration.Common.Tests</RootNamespace>
<AssemblyName>Filtration.Common.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Moq, Version=4.5.30.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.5.30\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Filtration.Common.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Filtration.Common.Tests")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("23ba4e1b-1cb6-47fc-9a8b-6ce61fc3eb32")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
<package id="Moq" version="4.5.30" targetFramework="net461" />
<package id="NUnit" version="3.6.1" targetFramework="net461" />
</packages>

View File

@@ -2,9 +2,9 @@
using System.Globalization; using System.Globalization;
using System.Windows.Data; using System.Windows.Data;
namespace Filtration.Converters namespace Filtration.Common.Converters
{ {
internal class BoolInverterConverter : IValueConverter public class BooleanInverterConverter : IValueConverter
{ {
public object Convert(object value, Type targetType, object parameter, public object Convert(object value, Type targetType, object parameter,
CultureInfo culture) CultureInfo culture)

View File

@@ -0,0 +1,43 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Filtration.Common.Converters
{
public class BooleanVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool && targetType == typeof (Visibility))
{
var val = (bool) value;
if (val)
{
return Visibility.Visible;
}
if (parameter is Visibility)
{
return parameter;
}
return Visibility.Collapsed;
}
if (value != null)
{
return Visibility.Visible;
}
if (parameter is Visibility)
{
return parameter;
}
return Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -2,7 +2,7 @@
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Media; using System.Windows.Media;
namespace Filtration.Converters namespace Filtration.Common.Converters
{ {
public class ColorToSolidColorBrushConverter : IValueConverter public class ColorToSolidColorBrushConverter : IValueConverter
{ {
@@ -13,10 +13,7 @@ namespace Filtration.Converters
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{ {
if (value != null) return ((SolidColorBrush) value)?.Color;
return ((SolidColorBrush)value).Color;
return null;
} }
} }
} }

View File

@@ -0,0 +1,42 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Filtration.Common.Converters
{
internal class InverseBooleanVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool && targetType == typeof (Visibility))
{
var val = (bool) value;
if (val)
{
return Visibility.Collapsed;
}
if (parameter is Visibility)
{
return parameter;
}
return Visibility.Visible;
}
if (value != null)
{
return Visibility.Collapsed;
}
if (parameter is Visibility)
{
return parameter;
}
return Visibility.Visible;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -3,7 +3,7 @@ using System.Globalization;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
namespace Filtration.Converters namespace Filtration.Common.Converters
{ {
internal class StringToVisibilityConverter : IValueConverter internal class StringToVisibilityConverter : IValueConverter
{ {

View File

@@ -3,16 +3,16 @@ using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Windows.Markup; using System.Windows.Markup;
namespace Filtration.Extensions namespace Filtration.Common.Extensions
{ {
internal class EnumerationExtension : MarkupExtension public class EnumerationExtension : MarkupExtension
{ {
private Type _enumType; private Type _enumType;
public EnumerationExtension(Type enumType) public EnumerationExtension(Type enumType)
{ {
if (enumType == null) throw new ArgumentNullException("enumType"); if (enumType == null) throw new ArgumentNullException(nameof(enumType));
EnumType = enumType; EnumType = enumType;
} }

View File

@@ -4,7 +4,7 @@ using System.Windows;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Navigation; using System.Windows.Navigation;
namespace Filtration.Extensions namespace Filtration.Common.Extensions
{ {
public static class HyperlinkExtensions public static class HyperlinkExtensions
{ {
@@ -25,9 +25,10 @@ namespace Filtration.Extensions
var hyperlink = sender as Hyperlink; var hyperlink = sender as Hyperlink;
if ((bool)args.NewValue) if ((bool)args.NewValue)
hyperlink.RequestNavigate += Hyperlink_RequestNavigate; {
else if (hyperlink != null) hyperlink.RequestNavigate += Hyperlink_RequestNavigate;
hyperlink.RequestNavigate -= Hyperlink_RequestNavigate; }
else if (hyperlink != null) hyperlink.RequestNavigate -= Hyperlink_RequestNavigate;
} }
private static void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) private static void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)

View File

@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8CB44F28-2956-4C2A-9314-72727262EDD4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Filtration.Common</RootNamespace>
<AssemblyName>Filtration.Common</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Castle.Windsor, Version=3.4.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Practices.ServiceLocation">
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Converters\BooleanInverterConverter.cs" />
<Compile Include="Converters\BooleanVisibilityConverter.cs" />
<Compile Include="Converters\ColorToSolidColorBrushConverter.cs" />
<Compile Include="Converters\InverseBooleanVisibilityConverter.cs" />
<Compile Include="Converters\StringToVisibilityConverter.cs" />
<Compile Include="Extensions\EnumerationExtension.cs" />
<Compile Include="Extensions\HyperlinkExtensions.cs" />
<Compile Include="Messages\ThemeClosedMessage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\FileSystemService.cs" />
<Compile Include="Services\MessageBoxService.cs" />
<Compile Include="Utilities\LineReader.cs" />
<Compile Include="ViewModels\PaneViewModel.cs" />
<Compile Include="WindsorInstallers\ServicesInstaller.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
<Project>{4AAC3BEB-1DC1-483E-9D11-0E9334E80227}</Project>
<Name>Filtration.ObjectModel</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Styles\SharedResourcesDictionary.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,6 @@
namespace Filtration.Common.Messages
{
class ThemeClosedMessage
{
}
}

View File

@@ -0,0 +1,40 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Filtration.Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Filtration.Common")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("36a40512-35b4-489c-8e20-f431b9e92dc1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: InternalsVisibleTo("Filtration.Tests")]
[assembly: InternalsVisibleTo("Filtration.Common.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]

View File

@@ -1,9 +1,10 @@
using System; using System;
using System.IO; using System.IO;
using System.Text;
namespace Filtration.Services namespace Filtration.Common.Services
{ {
internal interface IFileSystemService public interface IFileSystemService
{ {
string ReadFileAsString(string filePath); string ReadFileAsString(string filePath);
void WriteFileFromString(string filePath, string inputString); void WriteFileFromString(string filePath, string inputString);
@@ -20,7 +21,7 @@ namespace Filtration.Services
public void WriteFileFromString(string filePath, string inputString) public void WriteFileFromString(string filePath, string inputString)
{ {
File.WriteAllText(filePath, inputString); File.WriteAllText(filePath, inputString, Encoding.UTF8);
} }
public bool DirectoryExists(string directoryPath) public bool DirectoryExists(string directoryPath)

View File

@@ -0,0 +1,17 @@
using System.Windows;
namespace Filtration.Common.Services
{
public interface IMessageBoxService
{
MessageBoxResult Show(string caption, string message, MessageBoxButton buttons, MessageBoxImage image);
}
public class MessageBoxService : IMessageBoxService
{
public MessageBoxResult Show(string caption, string message, MessageBoxButton buttons, MessageBoxImage image)
{
return MessageBox.Show(message, caption, buttons, image);
}
}
}

View File

@@ -1,14 +1,13 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Filtration.Converters"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:converters="clr-namespace:Filtration.Common.Converters"
mc:Ignorable="d" > mc:Ignorable="d" >
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary> <ResourceDictionary>
<Style x:Key="PathOfExileFont"> <Style x:Key="PathOfExileFont">
<Setter Property="TextElement.FontFamily" Value="pack://application:,,,/resources/#Fontin SmallCaps" /> <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/resources/#Fontin SmallCaps" />
<Setter Property="TextElement.FontSize" Value="14" />
</Style> </Style>
<Style x:Key="ChromelessToggleButton" TargetType="{x:Type ToggleButton}"> <Style x:Key="ChromelessToggleButton" TargetType="{x:Type ToggleButton}">
<Setter Property="Template"> <Setter Property="Template">
@@ -21,15 +20,30 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<converters:IntToItemRarityConverter x:Key="IntToItemRarityConverter" /> <Style x:Key="ChromelessButton" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border BorderThickness="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Border}" x:Key="BlockItemBorder">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Black" />
<Setter Property="CornerRadius" Value="3" />
<Setter Property="Margin" Value="0,0,5,5" />
</Style>
<converters:StringToVisibilityConverter x:Key="StringToVisibilityConverter" /> <converters:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
<converters:BoolInverterConverter x:Key="BoolInverterConverter" /> <converters:BooleanInverterConverter x:Key="BoolInverterConverter" />
<converters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" /> <converters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
<converters:BooleanToBlockActionConverter x:Key="BooleanToBlockActionConverter" />
<converters:BooleanToBlockActionInverseConverter x:Key="BooleanToBlockActionInverseConverter" />
<converters:BlockItemTypeToStringConverter x:Key="BlockItemTypeToStringConverter" />
<converters:BooleanVisibilityConverter x:Key="BooleanVisibilityConverter" /> <converters:BooleanVisibilityConverter x:Key="BooleanVisibilityConverter" />
<converters:InverseBooleanVisibilityConverter x:Key="InverseBooleanVisibilityConverter" />
</ResourceDictionary> </ResourceDictionary>
<ResourceDictionary Source="ExpanderStyle.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -2,10 +2,11 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Text; using System.Text;
namespace Filtration.Utilities namespace Filtration.Common.Utilities
{ {
public sealed class LineReader : IEnumerable<string> public sealed class LineReader : IEnumerable<string>
@@ -21,6 +22,7 @@ namespace Filtration.Utilities
/// the stream into text. /// the stream into text.
/// </summary> /// </summary>
/// <param name="streamSource">Data source</param> /// <param name="streamSource">Data source</param>
[DebuggerStepThrough]
public LineReader(Func<Stream> streamSource) public LineReader(Func<Stream> streamSource)
: this(streamSource, Encoding.UTF8) : this(streamSource, Encoding.UTF8)
{ {
@@ -33,6 +35,7 @@ namespace Filtration.Utilities
/// <param name="streamSource">Data source</param> /// <param name="streamSource">Data source</param>
/// <param name="encoding">Encoding to use to decode the stream /// <param name="encoding">Encoding to use to decode the stream
/// into text</param> /// into text</param>
[DebuggerStepThrough]
public LineReader(Func<Stream> streamSource, Encoding encoding) public LineReader(Func<Stream> streamSource, Encoding encoding)
: this(() => new StreamReader(streamSource(), encoding)) : this(() => new StreamReader(streamSource(), encoding))
{ {
@@ -44,6 +47,7 @@ namespace Filtration.Utilities
/// UTF8 is used to decode the file into text. /// UTF8 is used to decode the file into text.
/// </summary> /// </summary>
/// <param name="filename">File to read from</param> /// <param name="filename">File to read from</param>
[DebuggerStepThrough]
public LineReader(string filename) public LineReader(string filename)
: this(filename, Encoding.UTF8) : this(filename, Encoding.UTF8)
{ {
@@ -56,6 +60,7 @@ namespace Filtration.Utilities
/// <param name="filename">File to read from</param> /// <param name="filename">File to read from</param>
/// <param name="encoding">Encoding to use to decode the file /// <param name="encoding">Encoding to use to decode the file
/// into text</param> /// into text</param>
[DebuggerStepThrough]
public LineReader(string filename, Encoding encoding) public LineReader(string filename, Encoding encoding)
: this(() => new StreamReader(filename, encoding)) : this(() => new StreamReader(filename, encoding))
{ {
@@ -66,6 +71,7 @@ namespace Filtration.Utilities
/// is only called when the enumerator is fetched /// is only called when the enumerator is fetched
/// </summary> /// </summary>
/// <param name="dataSource">Data source</param> /// <param name="dataSource">Data source</param>
[DebuggerStepThrough]
public LineReader(Func<TextReader> dataSource) public LineReader(Func<TextReader> dataSource)
{ {
_dataSource = dataSource; _dataSource = dataSource;
@@ -74,6 +80,7 @@ namespace Filtration.Utilities
/// <summary> /// <summary>
/// Enumerates the data source line by line. /// Enumerates the data source line by line.
/// </summary> /// </summary>
[DebuggerStepThrough]
public IEnumerator<string> GetEnumerator() public IEnumerator<string> GetEnumerator()
{ {
using (TextReader reader = _dataSource()) using (TextReader reader = _dataSource())
@@ -89,6 +96,7 @@ namespace Filtration.Utilities
/// <summary> /// <summary>
/// Enumerates the data source line by line. /// Enumerates the data source line by line.
/// </summary> /// </summary>
[DebuggerStepThrough]
IEnumerator IEnumerable.GetEnumerator() IEnumerator IEnumerable.GetEnumerator()
{ {
return GetEnumerator(); return GetEnumerator();

View File

@@ -0,0 +1,66 @@
using System.Windows.Media;
using GalaSoft.MvvmLight;
namespace Filtration.Common.ViewModels
{
public class PaneViewModel : ViewModelBase
{
private string _title;
public string Title
{
get { return _title; }
set
{
if (_title != value)
{
_title = value;
RaisePropertyChanged();
}
}
}
public ImageSource IconSource { get; protected set; }
private string _contentId;
public string ContentId
{
get { return _contentId; }
set
{
if (_contentId != value)
{
_contentId = value;
RaisePropertyChanged();
}
}
}
private bool _isSelected;
public bool IsSelected
{
get { return _isSelected; }
set
{
if (_isSelected != value)
{
_isSelected = value;
RaisePropertyChanged();
}
}
}
private bool _isActive;
public bool IsActive
{
get { return _isActive; }
set
{
if (_isActive != value)
{
_isActive = value;
RaisePropertyChanged();
}
}
}
}
}

View File

@@ -1,22 +1,22 @@
using Castle.MicroKernel.Registration; using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration; using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor; using Castle.Windsor;
using Filtration.Translators; using Filtration.Common.Services;
namespace Filtration.WindsorInstallers namespace Filtration.Common.WindsorInstallers
{ {
public class TranslatorsInstaller : IWindsorInstaller public class ServicesInstaller :IWindsorInstaller
{ {
public void Install(IWindsorContainer container, IConfigurationStore store) public void Install(IWindsorContainer container, IConfigurationStore store)
{ {
container.Register( container.Register(
Component.For<ILootFilterScriptTranslator>() Component.For<IFileSystemService>()
.ImplementedBy<LootFilterScriptTranslator>() .ImplementedBy<FileSystemService>()
.LifeStyle.Singleton); .LifeStyle.Singleton);
container.Register( container.Register(
Component.For<ILootFilterBlockTranslator>() Component.For<IMessageBoxService>()
.ImplementedBy<LootFilterBlockTranslator>() .ImplementedBy<MessageBoxService>()
.LifeStyle.Singleton); .LifeStyle.Singleton);
} }
} }

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net451" />
<package id="Castle.Windsor" version="3.4.0" targetFramework="net461" />
<package id="CommonServiceLocator" version="1.3" targetFramework="net451" />
<package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net461" />
</packages>

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0F333344-7695-47B2-B0E6-172E4DE74819}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Filtration.Interface</RootNamespace>
<AssemblyName>Filtration.Interface</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="IDocument.cs" />
<Compile Include="IEditableDocument.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,14 @@
using System.Threading.Tasks;
using System.Windows.Input;
using GalaSoft.MvvmLight.CommandWpf;
namespace Filtration.Interface
{
public interface IDocument
{
bool IsScript { get; }
bool IsTheme { get; }
Task Close();
RelayCommand CloseCommand { get; }
}
}

View File

@@ -0,0 +1,11 @@
using System.Threading.Tasks;
namespace Filtration.Interface
{
public interface IEditableDocument : IDocument
{
bool IsDirty { get; }
Task SaveAsync();
Task SaveAsAsync();
}
}

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Filtration.Interface")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Filtration.Interface")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f21659a3-839a-41ca-97b9-78cc6f6af353")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="1.3" targetFramework="net461" />
<package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net461" />
</packages>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<connectionStrings>
<add name="FiltrationDbContext" connectionString="data source=&quot;D:\C# Projects\Filtration\Filtration.db&quot;" providerName="System.Data.SQLite.EF6" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
</system.data></configuration>

View File

@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7A5720DE-A41B-47EA-AAAB-7C5608FF0C1F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Filtration.ItemFilterPreview.Data.Tests</RootNamespace>
<AssemblyName>Filtration.ItemFilterPreview.Data.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data.SQLite, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.102.0\lib\net46\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.SQLite.EF6, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.102.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.SQLite.Linq, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.102.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Repositories\TestItemSetRepository.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Filtration.ItemFilterPreview.Data\Filtration.ItemFilterPreview.Data.csproj">
<Project>{855b38cc-eef2-471d-bbbc-eb3e2ff3d387}</Project>
<Name>Filtration.ItemFilterPreview.Data</Name>
</ProjectReference>
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
<Name>Filtration.ObjectModel</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Filtration.ItemFilterPreview.Data.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Filtration.ItemFilterPreview.Data.Tests")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7a5720de-a41b-47ea-aaab-7c5608ff0c1f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,55 @@
using System.Linq;
using Filtration.ItemFilterPreview.Data.Repositories;
using Filtration.ObjectModel;
using Filtration.ObjectModel.Enums;
using NUnit.Framework;
namespace Filtration.ItemFilterPreview.Data.Tests.Repositories
{
[Ignore("integration test")]
[TestFixture]
public class TestItemSetRepository
{
[Test]
public void All_ReturnsAllItemSets()
{
using (var repository = new ItemSetRepository())
{
var result = repository.All.ToList();
}
}
[Test]
public void AddItemToItemSet()
{
ItemSet fetchedItemSet;
using (var repository = new ItemSetRepository())
{
fetchedItemSet = repository.Find(1);
}
var newItem = new Item
{
BaseType = "Test Base",
Description = "Test Item Supreme",
DropLevel = 75,
Height = 3,
Width = 2,
ItemClass = "Super Class",
ItemRarity = ItemRarity.Rare,
ItemLevel = 50,
ItemSet = fetchedItemSet,
ItemSetId = fetchedItemSet.Id
};
fetchedItemSet.Items.Add(newItem);
using (var repository = new ItemSetRepository())
{
repository.InsertOrUpdate(fetchedItemSet);
repository.Save();
}
}
}
}

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.3" targetFramework="net461" />
<package id="NUnit" version="3.6.1" targetFramework="net461" />
<package id="System.Data.SQLite" version="1.0.102.0" targetFramework="net461" />
<package id="System.Data.SQLite.Core" version="1.0.102.0" targetFramework="net461" />
<package id="System.Data.SQLite.EF6" version="1.0.102.0" targetFramework="net461" />
<package id="System.Data.SQLite.Linq" version="1.0.102.0" targetFramework="net461" />
</packages>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<connectionStrings>
<add name="FiltrationDbContext" connectionString="data source=&quot;D:\C# Projects\Filtration\Filtration.db&quot;" providerName="System.Data.SQLite.EF6" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
</system.data></configuration>

View File

@@ -0,0 +1,47 @@
using System;
using System.Data.Entity;
using Filtration.ObjectModel;
namespace Filtration.ItemFilterPreview.Data.DataContexts
{
public class FiltrationDbContext : DbContext
{
public FiltrationDbContext() : base("name=FiltrationDbContext")
{
// Disable database initializer
Database.SetInitializer<FiltrationDbContext>(null);
Database.Log = Console.WriteLine;
}
public virtual DbSet<Item> Items { get; set; }
public virtual DbSet<ItemSet> ItemSets { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Item>()
.Property(e => e.Description)
.IsUnicode(false);
modelBuilder.Entity<Item>()
.Property(e => e.BaseType)
.IsUnicode(false);
modelBuilder.Entity<Item>()
.Property(e => e.ItemClass)
.IsUnicode(false);
modelBuilder.Entity<Item>()
.Property(e => e.Sockets)
.IsUnicode(false);
modelBuilder.Entity<ItemSet>()
.Property(e => e.Name)
.IsUnicode(false);
modelBuilder.Entity<ItemSet>()
.HasMany(e => e.Items)
.WithRequired(e => e.ItemSet)
.WillCascadeOnDelete(false);
}
}
}

View File

@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{855B38CC-EEF2-471D-BBBC-EB3E2FF3D387}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Filtration.ItemFilterPreview.Data</RootNamespace>
<AssemblyName>Filtration.ItemFilterPreview.Data</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.102.0\lib\net46\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.SQLite.EF6, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.102.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.SQLite.Linq, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.102.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataContexts\FiltrationDbContext.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Repositories\IEntityRepository.cs" />
<Compile Include="Repositories\ItemSetRepository.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
<Name>Filtration.ObjectModel</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Filtration.ItemFilterPreview.Data")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Filtration.ItemFilterPreview.Data")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("855b38cc-eef2-471d-bbbc-eb3e2ff3d387")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,16 @@
using System;
using System.Linq;
using System.Linq.Expressions;
namespace Filtration.ItemFilterPreview.Data.Repositories
{
public interface IEntityRepository<T> : IDisposable
{
IQueryable<T> All { get; }
IQueryable<T> AllIncluding(params Expression<Func<T, object>>[] includeProperties);
T Find(int id);
void InsertOrUpdate(T itemSet);
void Delete(int id);
void Save();
}
}

View File

@@ -0,0 +1,63 @@
using System;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using Filtration.ItemFilterPreview.Data.DataContexts;
using Filtration.ObjectModel;
namespace Filtration.ItemFilterPreview.Data.Repositories
{
public class ItemSetRepository : IEntityRepository<ItemSet>
{
FiltrationDbContext _context = new FiltrationDbContext();
public IQueryable<ItemSet> All => _context.ItemSets;
public IQueryable<ItemSet> AllIncluding(params Expression<Func<ItemSet, object>>[] includeProperties)
{
IQueryable<ItemSet> query = _context.ItemSets;
foreach (var includeProperty in includeProperties)
{
query = query.Include(includeProperty);
}
return query;
}
public ItemSet Find(int id)
{
return _context.ItemSets.Find(id);
}
public void InsertOrUpdate(ItemSet itemSet)
{
if (itemSet.Id == default(long))
{
// New entity
_context.ItemSets.Add(itemSet);
}
else
{
// Existing entity
_context.Entry(itemSet).State = EntityState.Modified;
}
}
public void Delete(int id)
{
var itemSet = _context.ItemSets.Find(id);
_context.ItemSets.Remove(itemSet);
}
public void Save()
{
_context.SaveChanges();
}
public void Dispose()
{
_context.Dispose();
}
}
}

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.3" targetFramework="net46" />
<package id="System.Data.SQLite" version="1.0.102.0" targetFramework="net461" />
<package id="System.Data.SQLite.Core" version="1.0.102.0" targetFramework="net461" />
<package id="System.Data.SQLite.EF6" version="1.0.102.0" targetFramework="net461" />
<package id="System.Data.SQLite.Linq" version="1.0.102.0" targetFramework="net461" />
</packages>

View File

@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{58CD3B9C-EBBA-4527-A81C-78B7EA9CA298}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Filtration.ItemFilterPreview.Tests</RootNamespace>
<AssemblyName>Filtration.ItemFilterPreview.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>True</IsCodedUITest>
<TestProjectType>CodedUITest</TestProjectType>
<IsWindowsStoreCodedUITest>True</IsWindowsStoreCodedUITest>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions, Version=4.19.2.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.19.2.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.5.30.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.5.30\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="YamlDotNet, Version=3.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\YamlDotNet.3.9.0\lib\net35\YamlDotNet.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
<Visible>False</Visible>
</CodeAnalysisDependentAssemblyPaths>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Services\serializationtest.cs" />
<Compile Include="Services\TestItemBlockItemMatcher.cs" />
<Compile Include="Services\TestItemFilterProcessor.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Filtration.ItemFilterPreview\Filtration.ItemFilterPreview.csproj">
<Project>{3ab98b6e-05db-44fa-9dad-584aa88f0739}</Project>
<Name>Filtration.ItemFilterPreview</Name>
</ProjectReference>
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
<Name>Filtration.ObjectModel</Name>
</ProjectReference>
<ProjectReference Include="..\Filtration.Parser.Interface\Filtration.Parser.Interface.csproj">
<Project>{46383F20-02DF-48B4-B092-9088FA4ACD5A}</Project>
<Name>Filtration.Parser.Interface</Name>
</ProjectReference>
<ProjectReference Include="..\Filtration.Parser\Filtration.Parser.csproj">
<Project>{10a7c2bc-ec6f-4a38-bdda-e35935004c02}</Project>
<Name>Filtration.Parser</Name>
</ProjectReference>
<ProjectReference Include="..\Filtration\Filtration.csproj">
<Project>{55e0a34c-e039-43d7-a024-a4045401cdda}</Project>
<Name>Filtration</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="Resources\MuldiniFilterScript.txt" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Filtration.ItemFilterPreview.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Filtration.ItemFilterPreview.Tests")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("58cd3b9c-ebba-4527-a81c-78b7ea9ca298")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,82 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Filtration.ItemFilterPreview.Tests.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Filtration.ItemFilterPreview.Tests.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to ###############################################################################
///################ Path of Exile Item Filter - Script by Muldini ################
///###############################################################################
///############ http://www.pathofexile.com/forum/view-thread/1259059 #############
///
///
///
///
///###############################################################################
///### Overview ##################################################################
///################## [rest of string was truncated]&quot;;.
/// </summary>
internal static string MuldiniFilterScript {
get {
return ResourceManager.GetString("MuldiniFilterScript", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="MuldiniFilterScript" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MuldiniFilterScript.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,522 @@
using System.Collections.Generic;
using Filtration.ItemFilterPreview.Services;
using Filtration.ObjectModel;
using Filtration.ObjectModel.BlockItemTypes;
using Filtration.ObjectModel.Enums;
using Moq;
using NUnit.Framework;
namespace Filtration.ItemFilterPreview.Tests.Services
{
[TestFixture]
public class TestItemBlockItemMatcher
{
private ItemBlockItemMatcherTestUtility _testUtility;
[SetUp]
public void ItemBlockItemMatcherTestSetUp()
{
_testUtility = new ItemBlockItemMatcherTestUtility();
}
[Test]
public void ItemBlockMatch_EmptyShowBlock_ReturnsTrue()
{
//Arrange
var testInputItem = Mock.Of<IItem>();
var testInputBlock = new ItemFilterBlock();
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockMatch(testInputBlock, testInputItem);
//Assert
Assert.IsTrue(result);
}
[Test]
public void ItemBlockMatch_SingleBlockItem_Matches_ReturnsTrue()
{
//Arrange
var testBaseType = "Test Base Type";
var testInputItem = Mock.Of<IItem>(i => i.BaseType == testBaseType);
var testInputBlock = new ItemFilterBlock();
var baseTypeBlockItem = new BaseTypeBlockItem();
baseTypeBlockItem.Items.Add(testBaseType);
testInputBlock.BlockItems.Add(baseTypeBlockItem);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockMatch(testInputBlock, testInputItem);
//Assert
Assert.IsTrue(result);
}
[Test]
public void ItemBlockMatch_SingleBlockItem_DoesNotMatche_ReturnsFalse()
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.BaseType == "Base Type 1");
var testInputBlock = new ItemFilterBlock();
var baseTypeBlockItem = new BaseTypeBlockItem();
baseTypeBlockItem.Items.Add("Base Type 2");
testInputBlock.BlockItems.Add(baseTypeBlockItem);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockMatch(testInputBlock, testInputItem);
//Assert
Assert.IsFalse(result);
}
[Test]
public void ItemBlockMatch_MultipleBlockItems_Matches_ReturnsTrue()
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.BaseType == "Base Type 1" && i.Height == 4 && i.Width == 2);
var testInputBlock = new ItemFilterBlock();
var baseTypeBlockItem = new BaseTypeBlockItem();
baseTypeBlockItem.Items.Add("Base Type 1");
var heightBlockItem = new HeightBlockItem(FilterPredicateOperator.Equal, 4);
var widthBlockItem = new WidthBlockItem(FilterPredicateOperator.Equal, 2);
testInputBlock.BlockItems.Add(baseTypeBlockItem);
testInputBlock.BlockItems.Add(heightBlockItem);
testInputBlock.BlockItems.Add(widthBlockItem);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockMatch(testInputBlock, testInputItem);
//Assert
Assert.IsTrue(result);
}
[Test]
public void ItemBlockMatch_MultipleBlockItems_DoesNotMatch_ReturnsFalse()
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.BaseType == "Base Type 1" && i.Height == 4 && i.Width == 2);
var testInputBlock = new ItemFilterBlock();
var baseTypeBlockItem = new BaseTypeBlockItem();
baseTypeBlockItem.Items.Add("Base Type d");
var heightBlockItem = new HeightBlockItem(FilterPredicateOperator.Equal, 3);
var widthBlockItem = new WidthBlockItem(FilterPredicateOperator.Equal, 2);
testInputBlock.BlockItems.Add(baseTypeBlockItem);
testInputBlock.BlockItems.Add(heightBlockItem);
testInputBlock.BlockItems.Add(widthBlockItem);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockMatch(testInputBlock, testInputItem);
//Assert
Assert.IsFalse(result);
}
[TestCase("Test Base Type", true)]
[TestCase("Test Bas", true)]
[TestCase("T", true)]
[TestCase("Base Type", false)]
public void ItemBlockItemMatch_BaseTypeBlockItem_SingleBlockItemValue_ReturnsTrue(string testInputBaseType, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.BaseType == "Test Base Type");
var testInputBaseTypeBlockItem = new BaseTypeBlockItem();
testInputBaseTypeBlockItem.Items.Add(testInputBaseType);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBaseTypeBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[TestCase("Test Base Type", true)]
[TestCase("Test Bas", true)]
[TestCase("T", true)]
[TestCase("Base Type", false)]
public void ItemBlockItemMatch_BaseTypeBlockItem_MultipleBlockItemValues_ReturnsCorrectResult(string testInputBaseType, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.BaseType == "Test Base Type");
var testInputBlockItem = new BaseTypeBlockItem();
testInputBlockItem.Items.Add("Something else");
testInputBlockItem.Items.Add(testInputBaseType);
testInputBlockItem.Items.Add("Blah");
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[TestCase("Test Item Class", true)]
[TestCase("Test It", true)]
[TestCase("T", true)]
[TestCase("Carrots", false)]
[TestCase("Item Class", true)]
public void ItemBlockItemMatch_ClassBlockItem_SingleBlockItemValue_ReturnsCorrectResult(string testInputBlockItemItemClass, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.ItemClass == "Test Item Class");
var testInputBlockItem = new ClassBlockItem();
testInputBlockItem.Items.Add(testInputBlockItemItemClass);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[TestCase(FilterPredicateOperator.Equal, 49, false)]
[TestCase(FilterPredicateOperator.Equal, 50, true)]
[TestCase(FilterPredicateOperator.Equal, 51, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 49, true)]
[TestCase(FilterPredicateOperator.GreaterThan, 50, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 51, false)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 49, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 50, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 51, false)]
[TestCase(FilterPredicateOperator.LessThan, 49, false)]
[TestCase(FilterPredicateOperator.LessThan, 50, false)]
[TestCase(FilterPredicateOperator.LessThan, 51, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 49, false)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 50, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 51, true)]
[TestCase(-1, 51, false)]
public void ItemBlockItemMatch_DropLevelBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemDropLevel, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.DropLevel == 50);
var testInputBlockItem = new DropLevelBlockItem(testInputFilterPredicateOperator, testInputBlockItemDropLevel);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[TestCase(FilterPredicateOperator.Equal, 1, false)]
[TestCase(FilterPredicateOperator.Equal, 2, true)]
[TestCase(FilterPredicateOperator.Equal, 3, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 1, true)]
[TestCase(FilterPredicateOperator.GreaterThan, 2, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 3, false)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 1, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 2, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 3, false)]
[TestCase(FilterPredicateOperator.LessThan, 1, false)]
[TestCase(FilterPredicateOperator.LessThan, 2, false)]
[TestCase(FilterPredicateOperator.LessThan, 3, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 1, false)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 2, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 3, true)]
[TestCase(-1, 3, false)]
public void ItemBlockItemMatch_HeightBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemHeight, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.Height == 2);
var testInputBlockItem = new HeightBlockItem(testInputFilterPredicateOperator, testInputBlockItemHeight);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[TestCase(FilterPredicateOperator.Equal, 49, false)]
[TestCase(FilterPredicateOperator.Equal, 50, true)]
[TestCase(FilterPredicateOperator.Equal, 51, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 49, true)]
[TestCase(FilterPredicateOperator.GreaterThan, 50, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 51, false)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 49, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 50, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 51, false)]
[TestCase(FilterPredicateOperator.LessThan, 49, false)]
[TestCase(FilterPredicateOperator.LessThan, 50, false)]
[TestCase(FilterPredicateOperator.LessThan, 51, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 49, false)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 50, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 51, true)]
[TestCase(-1, 51, false)]
public void ItemBlockItemMatch_ItemLevelBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemItemLevel, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.ItemLevel == 50);
var testInputBlockItem = new ItemLevelBlockItem(testInputFilterPredicateOperator, testInputBlockItemItemLevel);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[TestCase(FilterPredicateOperator.Equal, 2, false)]
[TestCase(FilterPredicateOperator.Equal, 3, true)]
[TestCase(FilterPredicateOperator.Equal, 4, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 2, true)]
[TestCase(FilterPredicateOperator.GreaterThan, 3, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 4, false)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 2, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 3, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 4, false)]
[TestCase(FilterPredicateOperator.LessThan, 2, false)]
[TestCase(FilterPredicateOperator.LessThan, 3, false)]
[TestCase(FilterPredicateOperator.LessThan, 4, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 2, false)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 3, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 4, true)]
[TestCase(-1, 3, false)]
public void ItemBlockItemMatch_LinkedSocketsBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemLinkedSockets, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.LinkedSockets == 3);
var testInputBlockItem = new LinkedSocketsBlockItem(testInputFilterPredicateOperator, testInputBlockItemLinkedSockets);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[TestCase(FilterPredicateOperator.Equal, 11, false)]
[TestCase(FilterPredicateOperator.Equal, 12, true)]
[TestCase(FilterPredicateOperator.Equal, 13, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 11, true)]
[TestCase(FilterPredicateOperator.GreaterThan, 12, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 13, false)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 11, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 12, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 13, false)]
[TestCase(FilterPredicateOperator.LessThan, 11, false)]
[TestCase(FilterPredicateOperator.LessThan, 12, false)]
[TestCase(FilterPredicateOperator.LessThan, 13, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 11, false)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 12, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 13, true)]
[TestCase(-1, 13, false)]
public void ItemBlockItemMatch_QualityBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemQuality, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.Quality == 12);
var testInputBlockItem = new QualityBlockItem(testInputFilterPredicateOperator, testInputBlockItemQuality);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[TestCase(FilterPredicateOperator.Equal, ItemRarity.Normal, false)]
[TestCase(FilterPredicateOperator.Equal, ItemRarity.Magic , true)]
[TestCase(FilterPredicateOperator.Equal, ItemRarity.Rare, false)]
[TestCase(FilterPredicateOperator.GreaterThan, ItemRarity.Normal, true)]
[TestCase(FilterPredicateOperator.GreaterThan, ItemRarity.Magic, false)]
[TestCase(FilterPredicateOperator.GreaterThan, ItemRarity.Rare, false)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, ItemRarity.Normal, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, ItemRarity.Magic, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, ItemRarity.Rare, false)]
[TestCase(FilterPredicateOperator.LessThan, ItemRarity.Normal, false)]
[TestCase(FilterPredicateOperator.LessThan, ItemRarity.Magic, false)]
[TestCase(FilterPredicateOperator.LessThan, ItemRarity.Rare, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, ItemRarity.Normal, false)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, ItemRarity.Magic, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, ItemRarity.Rare, true)]
[TestCase(-1, 13, false)]
public void ItemBlockItemMatch_RarityBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemRarity, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.ItemRarity == ItemRarity.Magic);
var testInputBlockItem = new RarityBlockItem(testInputFilterPredicateOperator, testInputBlockItemRarity);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[TestCase(FilterPredicateOperator.Equal, 2, false)]
[TestCase(FilterPredicateOperator.Equal, 3, true)]
[TestCase(FilterPredicateOperator.Equal, 4, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 2, true)]
[TestCase(FilterPredicateOperator.GreaterThan, 3, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 4, false)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 2, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 3, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 4, false)]
[TestCase(FilterPredicateOperator.LessThan, 2, false)]
[TestCase(FilterPredicateOperator.LessThan, 3, false)]
[TestCase(FilterPredicateOperator.LessThan, 4, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 2, false)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 3, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 4, true)]
[TestCase(-1, 3, false)]
public void ItemBlockItemMatch_SocketsBlockItem_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemSockets, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.SocketCount == 3);
var testInputBlockItem = new SocketsBlockItem(testInputFilterPredicateOperator, testInputBlockItemSockets);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[TestCase(FilterPredicateOperator.Equal, 1, false)]
[TestCase(FilterPredicateOperator.Equal, 2, true)]
[TestCase(FilterPredicateOperator.Equal, 3, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 1, true)]
[TestCase(FilterPredicateOperator.GreaterThan, 2, false)]
[TestCase(FilterPredicateOperator.GreaterThan, 3, false)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 1, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 2, true)]
[TestCase(FilterPredicateOperator.GreaterThanOrEqual, 3, false)]
[TestCase(FilterPredicateOperator.LessThan, 1, false)]
[TestCase(FilterPredicateOperator.LessThan, 2, false)]
[TestCase(FilterPredicateOperator.LessThan, 3, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 1, false)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 2, true)]
[TestCase(FilterPredicateOperator.LessThanOrEqual, 3, true)]
[TestCase(-1, 3, false)]
public void ItemBlockItemMatch_ReturnsCorrectResult(FilterPredicateOperator testInputFilterPredicateOperator, int testInputBlockItemWidth, bool expectedResult)
{
//Arrange
var testInputItem = Mock.Of<IItem>(i => i.Width == 2);
var testInputBlockItem = new WidthBlockItem(testInputFilterPredicateOperator, testInputBlockItemWidth);
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.AreEqual(expectedResult, result);
}
[Test]
public void ItemBlockItemMatch_SocketGroupBlockItem_SingleItemSocketGroup_SingleBlockItemSocketGroup_Match_ReturnsCorrectResult()
{
//Arrange
var testInputBlockItem = new SocketGroupBlockItem();
testInputBlockItem.Items.Add("RGB");
var testInputItem = Mock.Of<IItem>(i => i.LinkedSocketGroups == new List<SocketGroup>
{
new SocketGroup(new List<Socket>
{
new Socket(SocketColor.Red),
new Socket(SocketColor.Green),
new Socket(SocketColor.Blue),
}, true)
});
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.IsTrue(result);
}
[Test]
public void ItemBlockItemMatch_SocketGroupBlockItem_SingleItemSocketGroup_SingleBlockItemSocketGroup_NoMatch_ReturnsCorrectResult()
{
//Arrange
var testInputBlockItem = new SocketGroupBlockItem();
testInputBlockItem.Items.Add("RGB");
var testInputItem = Mock.Of<IItem>(i => i.LinkedSocketGroups == new List<SocketGroup>
{
new SocketGroup(new List<Socket>
{
new Socket(SocketColor.Red),
new Socket(SocketColor.Green)
}, true)
});
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.IsFalse(result);
}
[Test]
public void ItemBlockItemMatch_SocketGroupBlockItem_MultipleItemSocketGroup_SingleBlockItemSocketGroup_NoMatch_ReturnsCorrectResult()
{
//Arrange
var testInputBlockItem = new SocketGroupBlockItem();
testInputBlockItem.Items.Add("RGB");
testInputBlockItem.Items.Add("RGWW");
testInputBlockItem.Items.Add("RRGG");
testInputBlockItem.Items.Add("WWWW");
var testInputItem = Mock.Of<IItem>(i => i.LinkedSocketGroups == new List<SocketGroup>
{
new SocketGroup(new List<Socket>
{
new Socket(SocketColor.Red),
new Socket(SocketColor.Green),
new Socket(SocketColor.White),
new Socket(SocketColor.Green)
}, true)
});
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.IsFalse(result);
}
[Test]
public void ItemBlockItemMatch_SocketGroupBlockItem_MultipleItemSocketGroup_SingleBlockItemSocketGroup_Match_ReturnsCorrectResult()
{
//Arrange
var testInputBlockItem = new SocketGroupBlockItem();
testInputBlockItem.Items.Add("RGB");
testInputBlockItem.Items.Add("RGWW");
testInputBlockItem.Items.Add("RGWG");
testInputBlockItem.Items.Add("WWWW");
var testInputItem = Mock.Of<IItem>(i => i.LinkedSocketGroups == new List<SocketGroup>
{
new SocketGroup(new List<Socket>
{
new Socket(SocketColor.Red),
new Socket(SocketColor.Green),
new Socket(SocketColor.White),
new Socket(SocketColor.Green)
}, true)
});
//Act
var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);
//Assert
Assert.IsTrue(result);
}
private class ItemBlockItemMatcherTestUtility
{
public ItemBlockItemMatcherTestUtility()
{
// Mock setups
// Class under-test instantiation
BlockItemMatcher = new BlockItemMatcher();
}
public BlockItemMatcher BlockItemMatcher { get; }
}
}
}

View File

@@ -0,0 +1,258 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Filtration.ItemFilterPreview.Services;
using Filtration.ItemFilterPreview.Tests.Properties;
using Filtration.ObjectModel;
using Filtration.ObjectModel.BlockItemTypes;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.Factories;
using Filtration.Parser.Services;
using Moq;
using NUnit.Framework;
namespace Filtration.ItemFilterPreview.Tests.Services
{
[TestFixture]
public class TestItemFilterProcessor
{
private ItemFilterProcessorTestUtility _testUtility;
[SetUp]
public void ItemFilterProcessorTestSetUp()
{
_testUtility = new ItemFilterProcessorTestUtility();
}
[Test]
public void ProcessItemsAgainstItemFilterScript_Matches_ReturnsTrue()
{
//Arrange
var testInputItem = Mock.Of<IItem>();
var testInputBlock = Mock.Of<IItemFilterBlock>();
var testInputScript = Mock.Of<IItemFilterScript>(s => s.ItemFilterBlocks == new ObservableCollection<IItemFilterBlockBase> {testInputBlock});
_testUtility.MockBlockItemMatcher
.Setup(b => b.ItemBlockMatch(testInputBlock, testInputItem))
.Returns(true)
.Verifiable();
//Act
var result = _testUtility.ItemFilterProcessor.ProcessItemsAgainstItemFilterScript(testInputScript, new List<IItem> { testInputItem });
//Assert
_testUtility.MockBlockItemMatcher.Verify();
Assert.AreEqual(testInputBlock, result.First(r => r.ItemFilterBlock == testInputBlock).ItemFilterBlock);
}
[Test]
public void ProcessItemsAgainstItemFilterScript_DoesNotMatch_ResultHasNullItemFilterBlock()
{
//Arrange
var testInputItem = Mock.Of<IItem>();
var testInputBlock = Mock.Of<IItemFilterBlock>();
var testInputScript = Mock.Of<IItemFilterScript>(s => s.ItemFilterBlocks == new ObservableCollection<IItemFilterBlockBase> { testInputBlock });
_testUtility.MockBlockItemMatcher
.Setup(b => b.ItemBlockMatch(testInputBlock, testInputItem))
.Returns(false)
.Verifiable();
//Act
var result = _testUtility.ItemFilterProcessor.ProcessItemsAgainstItemFilterScript(testInputScript, new List<IItem> { testInputItem });
//Assert
_testUtility.MockBlockItemMatcher.Verify();
Assert.AreEqual(null, result.First(r => r.Item == testInputItem).ItemFilterBlock);
}
[Test]
[Ignore("Outdated item filter")]
public void ProcessItemsAgainstItemFilterScript_IntegrationTest()
{
//Arrange
var testInputScriptFile = Resources.MuldiniFilterScript;
var blockGroupHierarchyBuilder = new BlockGroupHierarchyBuilder();
var mockItemFilterScriptFactory = new Mock<IItemFilterScriptFactory>();
mockItemFilterScriptFactory
.Setup(i => i.Create())
.Returns(new ItemFilterScript());
var scriptTranslator = new ItemFilterScriptTranslator(blockGroupHierarchyBuilder, new ItemFilterBlockTranslator(blockGroupHierarchyBuilder), mockItemFilterScriptFactory.Object);
var script = scriptTranslator.TranslateStringToItemFilterScript(testInputScriptFile);
var testInputItem = new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
};
var itemFilterProcessor = new ItemFilterProcessor(new BlockItemMatcher());
//Act
var result = itemFilterProcessor.ProcessItemsAgainstItemFilterScript(script, new List<IItem> { testInputItem });
//Assert
Assert.AreEqual("Wands", result.First().ItemFilterBlock.BlockItems.OfType<ClassBlockItem>().First().Items.First());
}
[Test]
[Ignore("Outdated item filter")]
public void ProcessItemsAgainstItemFilterScript_IntegrationTest_10Items()
{
//Arrange
var testInputScriptFile = Resources.MuldiniFilterScript;
var blockGroupHierarchyBuilder = new BlockGroupHierarchyBuilder();
var mockItemFilterScriptFactory = new Mock<IItemFilterScriptFactory>();
mockItemFilterScriptFactory
.Setup(i => i.Create())
.Returns(new ItemFilterScript());
var scriptTranslator = new ItemFilterScriptTranslator(blockGroupHierarchyBuilder, new ItemFilterBlockTranslator(blockGroupHierarchyBuilder), mockItemFilterScriptFactory.Object);
var script = scriptTranslator.TranslateStringToItemFilterScript(testInputScriptFile);
var testInputItems = new List<IItem>
{
new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
},
new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
},
new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
},
new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
},
new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
},
new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
},
new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
},
new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
},
new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
},
new Item
{
BaseType = "BlahdeBlah",
ItemClass = "Wands",
ItemRarity = ItemRarity.Magic,
ItemLevel = 9,
DropLevel = 9,
Height = 3,
Width = 1,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red)}, false)}
}
};
var itemFilterProcessor = new ItemFilterProcessor(new BlockItemMatcher());
//Act
var result = itemFilterProcessor.ProcessItemsAgainstItemFilterScript(script, testInputItems);
//Assert
Assert.AreEqual("Wands", result.First().ItemFilterBlock.BlockItems.OfType<ClassBlockItem>().First().Items.First());
}
private class ItemFilterProcessorTestUtility
{
public ItemFilterProcessorTestUtility()
{
// Mock setups
MockBlockItemMatcher = new Mock<IBlockItemMatcher>();
// Class under-test instantiation
ItemFilterProcessor = new ItemFilterProcessor(MockBlockItemMatcher.Object);
}
public ItemFilterProcessor ItemFilterProcessor { get; private set; }
public Mock<IBlockItemMatcher> MockBlockItemMatcher { get; }
}
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using Filtration.ObjectModel;
using Filtration.ObjectModel.Enums;
using NUnit.Framework;
namespace Filtration.ItemFilterPreview.Tests.Services
{
class serializationtest
{
[Ignore("")]
[Test]
public void test_serialization()
{
//Arrange
var item = new Item
{
ItemClass = "Test Class",
BaseType = "Test Base Type",
DropLevel = 54,
Height = 2,
Width = 2,
ItemLevel = 50,
ItemRarity = ItemRarity.Rare,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> {new Socket(SocketColor.Red), new Socket(SocketColor.Blue), new Socket(SocketColor.White)}, true)},
Quality = 12
};
//Act
var serializer = new XmlSerializer(item.GetType());
var output = string.Empty;
using (var textWriter = new StringWriter())
{
serializer.Serialize(textWriter, item);
output = textWriter.ToString();
}
//Assert
}
}
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Xceed.Wpf.AvalonDock" publicKeyToken="3e4669d2f30244f4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.9.0.0" newVersion="2.9.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ControlzEx" publicKeyToken="f08b075e934b7045" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.4" newVersion="2.2.0.4" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
<package id="FluentAssertions" version="4.19.2" targetFramework="net461" />
<package id="Moq" version="4.5.30" targetFramework="net461" />
<package id="NUnit" version="3.6.1" targetFramework="net461" />
<package id="YamlDotNet" version="3.9.0" targetFramework="net461" />
</packages>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
</configuration>

View File

@@ -0,0 +1,8 @@
<Application x:Class="Filtration.ItemFilterPreview.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Startup="Application_Startup">
<Application.Resources>
</Application.Resources>
</Application>

View File

@@ -0,0 +1,25 @@
using System.Windows;
using Castle.Facilities.TypedFactory;
using Castle.Windsor;
using Castle.Windsor.Installer;
using Filtration.ItemFilterPreview.Views;
namespace Filtration.ItemFilterPreview
{
public partial class App : Application
{
private IWindsorContainer _container;
private void Application_Startup(object sender, StartupEventArgs e)
{
_container = new WindsorContainer();
_container.AddFacility<TypedFactoryFacility>();
_container.Install(FromAssembly.InThisApplication());
_container.Install(FromAssembly.Named("Filtration.Parser"));
var mainWindow = _container.Resolve<IMainWindow>();
mainWindow.Show();
}
}
}

View File

@@ -0,0 +1,202 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3AB98B6E-05DB-44FA-9DAD-584AA88F0739}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Filtration.ItemFilterPreview</RootNamespace>
<AssemblyName>Filtration.ItemFilterPreview</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Castle.Windsor, Version=3.4.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Moq, Version=4.5.30.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.5.30\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Services\BlockItemMatcher.cs" />
<Compile Include="Services\ItemFilterProcessor.cs" />
<Compile Include="UserControls\DesignTime\DesignTimeItemControl.cs" />
<Compile Include="UserControls\ItemControl.xaml.cs">
<DependentUpon>ItemControl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControls\ItemSocketsControl.xaml.cs">
<DependentUpon>ItemSocketsControl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControls\LootExplosionSceneUserControl.xaml.cs">
<DependentUpon>LootExplosionSceneUserControl.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\LootExplosionViewModel.cs" />
<Compile Include="ViewModels\MainWindowViewModel.cs" />
<Compile Include="Views\LootExplosionView.xaml.cs">
<DependentUpon>LootExplosionView.xaml</DependentUpon>
</Compile>
<Compile Include="WindsorInstallers\ViewModelsInstaller.cs" />
<Compile Include="WindsorInstallers\ViewsInstaller.cs" />
<Compile Include="WindsorInstallers\ServicesInstaller.cs" />
<Page Include="UserControls\ItemControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControls\LootExplosionSceneUserControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\LootExplosionView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Views\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="UserControls\ItemSocketsControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
<Resource Include="Resources\Fontin-SmallCaps.ttf" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Filtration.Common\Filtration.Common.csproj">
<Project>{8cb44f28-2956-4c2a-9314-72727262edd4}</Project>
<Name>Filtration.Common</Name>
</ProjectReference>
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
<Name>Filtration.ObjectModel</Name>
</ProjectReference>
<ProjectReference Include="..\Filtration.Parser.Interface\Filtration.Parser.Interface.csproj">
<Project>{46383f20-02df-48b4-b092-9088fa4acd5a}</Project>
<Name>Filtration.Parser.Interface</Name>
</ProjectReference>
<ProjectReference Include="..\Filtration.Parser\Filtration.Parser.csproj">
<Project>{10a7c2bc-ec6f-4a38-bdda-e35935004c02}</Project>
<Name>Filtration.Parser</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\neversink.filter.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\muldini.txt" />
</ItemGroup>
<ItemGroup>
<Folder Include="Model\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,59 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Filtration.ItemFilterPreview")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Filtration.ItemFilterPreview")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]

View File

@@ -0,0 +1,100 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Filtration.ItemFilterPreview.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Filtration.ItemFilterPreview.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to ###############################################################################
///################ Path of Exile Item Filter - Script by Muldini ################
///###############################################################################
///############ http://www.pathofexile.com/forum/view-thread/1259059 #############
///
///
///
///
///###############################################################################
///### Overview ##################################################################
///################## [rest of string was truncated]&quot;;.
/// </summary>
internal static string muldini {
get {
return ResourceManager.GetString("muldini", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to #---------------------------------------------------------------------------------------------------------------
///# NeverSink&apos;s Indepth Loot Filter
///# VERSION 3.0 - Full
///#---------------------------------------------------------------------------------------------------------------
///#
///# You can always find the latest version here:
///# http://pastebin.com/Af00CbhA
///# Forum discussion thread. You can post question and feedback here:
///# http://www.pathofexile.com/forum/view-thread/1246208/page/1
///# Please use [rest of string was truncated]&quot;;.
/// </summary>
internal static string neversinkfilter {
get {
return ResourceManager.GetString("neversinkfilter", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="muldini" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\muldini.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="neversinkfilter" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\neversink.filter.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Filtration.ItemFilterPreview.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,155 @@
using System.Linq;
using Filtration.ObjectModel;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.BlockItemTypes;
namespace Filtration.ItemFilterPreview.Services
{
internal interface IBlockItemMatcher
{
bool ItemBlockMatch(IItemFilterBlock block, IItem item);
bool ItemBlockItemMatch(IItemFilterBlockItem blockItem, IItem item);
}
internal class BlockItemMatcher : IBlockItemMatcher
{
public bool ItemBlockMatch(IItemFilterBlock block, IItem item)
{
var match = block.BlockItems
.Where(blockItem => !(blockItem is IAudioVisualBlockItem) && !(blockItem is ActionBlockItem))
.All(blockItem => ItemBlockItemMatch(blockItem, item));
return match;
}
public bool ItemBlockItemMatch(IItemFilterBlockItem blockItem, IItem item)
{
var blockItemType = blockItem.GetType();
if (blockItemType == typeof (BaseTypeBlockItem))
return BaseTypeBlockItemMatch((BaseTypeBlockItem)blockItem, item);
if (blockItemType == typeof (ClassBlockItem))
return ClassBlockItemMatch((ClassBlockItem) blockItem, item);
if (blockItemType == typeof(DropLevelBlockItem))
return DropLevelBlockItemMatch((DropLevelBlockItem)blockItem, item);
if (blockItemType == typeof(HeightBlockItem))
return HeightBlockItemMatch((HeightBlockItem)blockItem, item);
if (blockItemType == typeof(ItemLevelBlockItem))
return ItemLevelBlockItemMatch((ItemLevelBlockItem)blockItem, item);
if (blockItemType == typeof(LinkedSocketsBlockItem))
return LinkedSocketsBlockItemMatch((LinkedSocketsBlockItem)blockItem, item);
if (blockItemType == typeof(QualityBlockItem))
return QualityBlockItemMatch((QualityBlockItem)blockItem, item);
if (blockItemType == typeof(RarityBlockItem))
return RarityBlockItemMatch((RarityBlockItem)blockItem, item);
if (blockItemType == typeof(SocketsBlockItem))
return SocketsBlockItemMatch((SocketsBlockItem)blockItem, item);
if (blockItemType == typeof(WidthBlockItem))
return WidthBlockItemMatch((WidthBlockItem)blockItem, item);
if (blockItemType == typeof(SocketGroupBlockItem))
return SocketGroupBlockItemMatch((SocketGroupBlockItem)blockItem, item);
return false;
}
private static bool BaseTypeBlockItemMatch(BaseTypeBlockItem baseTypeBlockItem, IItem item)
{
return baseTypeBlockItem.Items.Any(b => item.BaseType.StartsWith(b));
}
private static bool ClassBlockItemMatch(ClassBlockItem classBlockItem, IItem item)
{
return classBlockItem.Items.Any(c => item.ItemClass.Contains(c));
}
private static bool DropLevelBlockItemMatch(DropLevelBlockItem dropLevelBlockItem, IItem item)
{
return NumericFilterPredicateBlockItemMatch(dropLevelBlockItem, item.DropLevel);
}
private static bool HeightBlockItemMatch(HeightBlockItem heightBlockItem, IItem item)
{
return NumericFilterPredicateBlockItemMatch(heightBlockItem, item.Height);
}
private static bool ItemLevelBlockItemMatch(ItemLevelBlockItem itemLevelBlockItem, IItem item)
{
return NumericFilterPredicateBlockItemMatch(itemLevelBlockItem, item.ItemLevel);
}
private static bool LinkedSocketsBlockItemMatch(LinkedSocketsBlockItem linkedSocketsBlockItem, IItem item)
{
return NumericFilterPredicateBlockItemMatch(linkedSocketsBlockItem, item.LinkedSockets);
}
private static bool QualityBlockItemMatch(QualityBlockItem qualityBlockItem, IItem item)
{
return NumericFilterPredicateBlockItemMatch(qualityBlockItem, item.Quality);
}
private static bool RarityBlockItemMatch(RarityBlockItem qualityBlockItem, IItem item)
{
return NumericFilterPredicateBlockItemMatch(qualityBlockItem, (int)item.ItemRarity);
}
private static bool SocketsBlockItemMatch(SocketsBlockItem socketsBlockItem, IItem item)
{
return NumericFilterPredicateBlockItemMatch(socketsBlockItem, item.SocketCount);
}
private static bool WidthBlockItemMatch(WidthBlockItem widthBlockItem, IItem item)
{
return NumericFilterPredicateBlockItemMatch(widthBlockItem, item.Width);
}
private static bool SocketGroupBlockItemMatch(SocketGroupBlockItem socketGroupBlockItem, IItem item)
{
foreach (var blockItemSocketGroup in socketGroupBlockItem.SocketGroups) // for each group of sockets in the block item
{
foreach (var itemLinkedSocketGroup in item.LinkedSocketGroups) // for each linked socket group in the item
{
if (SocketGroupHasRequiredSocketColors(itemLinkedSocketGroup, blockItemSocketGroup))
{
return true;
}
}
}
return false;
}
private static bool SocketGroupHasRequiredSocketColors(SocketGroup itemLinkedSocketGroup, SocketGroup blockItemSocketGroup)
{
var blockSocketGroupColorCounts = blockItemSocketGroup.GroupBy(i => i.Color, (key, values) => new { SocketColor = key, Count = values.Count() }).ToList();
var itemSocketGroupColorCounts = itemLinkedSocketGroup.GroupBy(i => i.Color, (key, values) => new {SocketColor = key, Count = values.Count()}).ToList();
foreach (var blockItemSocketColorCount in blockSocketGroupColorCounts)
{
var match = itemSocketGroupColorCounts.FirstOrDefault(i => i.SocketColor == blockItemSocketColorCount.SocketColor && i.Count >= blockItemSocketColorCount.Count);
if (match == null)
{
return false;
}
}
return true;
}
private static bool NumericFilterPredicateBlockItemMatch<T>(T numericFilterPredicateBlockItem, int matchValue) where T : NumericFilterPredicateBlockItem
{
return numericFilterPredicateBlockItem.FilterPredicate.CompareUsing(matchValue);
}
}
}

View File

@@ -0,0 +1,48 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Filtration.ObjectModel;
namespace Filtration.ItemFilterPreview.Services
{
internal interface IItemFilterProcessor
{
List<IFilteredItem> ProcessItemsAgainstItemFilterScript(IItemFilterScript itemFilterScript, IEnumerable<IItem> items);
}
internal class ItemFilterProcessor : IItemFilterProcessor
{
private readonly IBlockItemMatcher _blockItemMatcher;
public ItemFilterProcessor(IBlockItemMatcher blockItemMatcher)
{
_blockItemMatcher = blockItemMatcher;
}
public List<IFilteredItem> ProcessItemsAgainstItemFilterScript(IItemFilterScript itemFilterScript, IEnumerable<IItem> items)
{
var overallsw = Stopwatch.StartNew();
var filteredItems = new List<IFilteredItem>();
var sw = Stopwatch.StartNew();
foreach (var item in items)
{
sw.Restart();
var matchedBlock = itemFilterScript.ItemFilterBlocks
.OfType<IItemFilterBlock>()
.FirstOrDefault(block => _blockItemMatcher.ItemBlockMatch(block, item));
filteredItems.Add(new FilteredItem(item, matchedBlock));
Debug.WriteLine("Processed Item in {0}ms", sw.ElapsedMilliseconds);
}
sw.Stop();
overallsw.Stop();
Debug.WriteLine("Total processing time: {0}ms", overallsw.ElapsedMilliseconds);
return filteredItems;
}
}
}

View File

@@ -0,0 +1,17 @@
using System.Windows.Media;
using Filtration.ObjectModel;
using Moq;
namespace Filtration.ItemFilterPreview.UserControls.DesignTime
{
public class DesignTimeItemControl
{
public IFilteredItem FilteredItem
{
get
{
return Mock.Of<IFilteredItem>(f => f.BackgroundColor == Colors.Bisque && f.TextColor == Colors.Maroon && f.BorderColor == Colors.CornflowerBlue && f.FontSize == 15);
}
}
}
}

View File

@@ -0,0 +1,39 @@
<UserControl x:Class="Filtration.ItemFilterPreview.UserControls.ItemControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:designTime="clr-namespace:Filtration.ItemFilterPreview.UserControls.DesignTime"
xmlns:converters="clr-namespace:Filtration.Common.Converters;assembly=Filtration.Common"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=designTime:DesignTimeItemControl, IsDesignTimeCreatable=True}"
d:DesignHeight="35" d:DesignWidth="170">
<UserControl.Resources>
<Style x:Key="PathOfExileFont" TargetType="{x:Type TextBlock}">
<Setter Property="FontFamily" Value="pack://application:,,,/resources/#Fontin SmallCaps" />
</Style>
<converters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter"/>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Row="1" Grid.Column="1" Margin="3" Padding="4,0,4,0" BorderThickness="1" BorderBrush="{Binding FilteredItem.BorderColor, Converter={StaticResource ColorToSolidColorBrushConverter}}">
<Border.Background>
<SolidColorBrush Color="{Binding FilteredItem.BackgroundColor}" />
</Border.Background>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding FilteredItem.Item.Description}" Style="{StaticResource PathOfExileFont}" FontSize="{Binding FilteredItem.FontSize}">
<TextBlock.Foreground>
<SolidColorBrush Color="{Binding FilteredItem.TextColor}" />
</TextBlock.Foreground>
</TextBlock>
</Border>
</Grid>
</UserControl>

View File

@@ -0,0 +1,29 @@
using System.Windows;
using Filtration.ObjectModel;
namespace Filtration.ItemFilterPreview.UserControls
{
public partial class ItemControl
{
public ItemControl()
{
InitializeComponent();
// ReSharper disable once PossibleNullReferenceException
(Content as FrameworkElement).DataContext = this;
}
public static readonly DependencyProperty FilteredItemProperty = DependencyProperty.Register(
"FilteredItem",
typeof (IFilteredItem),
typeof (ItemControl),
new FrameworkPropertyMetadata()
);
public IFilteredItem FilteredItem
{
get { return (IFilteredItem)GetValue(FilteredItemProperty); }
set { SetValue(FilteredItemProperty, value); }
}
}
}

View File

@@ -0,0 +1,55 @@
<UserControl x:Class="Filtration.ItemFilterPreview.UserControls.ItemSocketsControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Filtration.ItemFilterPreview.UserControls"
mc:Ignorable="d" SizeChanged="ItemSocketsControl_OnSizeChanged" RenderOptions.EdgeMode="Aliased" SnapsToDevicePixels="True"
Height="29" Width="17" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2"/>
<RowDefinition Height="3"/>
<RowDefinition Height="2"/>
<RowDefinition Height="4"/>
<RowDefinition Height="2"/>
<RowDefinition Height="3"/>
<RowDefinition Height="2"/>
<RowDefinition Height="4"/>
<RowDefinition Height="2"/>
<RowDefinition Height="3"/>
<RowDefinition Height="2"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="3" Background="Tomato" />
<Border Grid.Row="1" Grid.Column="3" Background="White" />
<Border Grid.Row="0" Grid.RowSpan="3" Grid.Column="4" Grid.ColumnSpan="3" Background="GreenYellow" />
<Border Grid.Row="3" Grid.Column="5" Background="White" />
<Border Grid.Row="4" Grid.RowSpan="3" Grid.Column="4" Grid.ColumnSpan="3" Background="GreenYellow" />
<Border Grid.Row="5" Grid.Column="3" Background="White" />
<Border Grid.Row="4" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="3" Background="CornflowerBlue" />
<Border Grid.Row="7" Grid.Column="1" Background="White" />
<Border Grid.Row="8" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="3" Background="CornflowerBlue" />
<Border Grid.Row="9" Grid.Column="3" Background="White" />
<Border Grid.Row="8" Grid.RowSpan="3" Grid.Column="4" Grid.ColumnSpan="3" Background="Tomato" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,18 @@
using System.Windows;
namespace Filtration.ItemFilterPreview.UserControls
{
public partial class ItemSocketsControl
{
public ItemSocketsControl()
{
InitializeComponent();
}
private void ItemSocketsControl_OnSizeChanged(object sender, SizeChangedEventArgs e)
{
const double ratio = 2d/3d;
Width = Height * ratio;
}
}
}

View File

@@ -0,0 +1,29 @@
<UserControl x:Class="Filtration.ItemFilterPreview.UserControls.LootExplosionSceneUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Filtration.ItemFilterPreview.UserControls"
xmlns:model="clr-namespace:Filtration.ObjectModel;assembly=Filtration.ObjectModel"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance local:LootExplosionSceneUserControl}">
<Grid Background="DimGray">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Click="ButtonBase_OnClick">Test Canvas</Button>
<ItemsControl Grid.Row="1" ItemsSource="{Binding FilteredItems}" x:Name="FilteredItemsControl" Height="800">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type model:IFilteredItem}">
<local:ItemControl FilteredItem="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</UserControl>

View File

@@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using Filtration.ObjectModel;
namespace Filtration.ItemFilterPreview.UserControls
{
public partial class LootExplosionSceneUserControl : UserControl
{
public LootExplosionSceneUserControl()
{
InitializeComponent();
}
public static readonly DependencyProperty FilteredItemsProperty = DependencyProperty.Register(
"FilteredItems",
typeof(IEnumerable<IFilteredItem>),
typeof(LootExplosionSceneUserControl),
new FrameworkPropertyMetadata()
);
public IEnumerable<IFilteredItem> FilteredItems
{
get { return (IEnumerable<IFilteredItem>)GetValue(FilteredItemsProperty); }
set
{
SetValue(FilteredItemsProperty, value);
}
}
private void LootCanvas_OnSourceUpdated(object sender, DataTransferEventArgs e)
{
var canvas = sender as Canvas;
}
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
var canvas = GetItemsPanel(FilteredItemsControl) as Canvas;
if (canvas == null) return;
var rand = new Random();
foreach (var child in canvas.Children.OfType<ContentPresenter>())
{
Canvas.SetLeft(child, rand.Next((int)(canvas.ActualWidth - child.ActualWidth)));
Canvas.SetTop(child, rand.Next((int)(canvas.ActualHeight - child.ActualHeight)));
}
}
private static Panel GetItemsPanel(DependencyObject itemsControl)
{
var itemsPresenter = GetVisualChild<ItemsPresenter>(itemsControl);
var itemsPanel = VisualTreeHelper.GetChild(itemsPresenter, 0) as Panel;
return itemsPanel;
}
private static T GetVisualChild<T>(DependencyObject parent) where T : Visual
{
var child = default(T);
var numVisuals = VisualTreeHelper.GetChildrenCount(parent);
for (var i = 0; i < numVisuals; i++)
{
var v = (Visual)VisualTreeHelper.GetChild(parent, i);
child = v as T;
if (child == null)
{
child = GetVisualChild<T>(v);
}
if (child != null)
{
break;
}
}
return child;
}
}
}

View File

@@ -0,0 +1,10 @@
namespace Filtration.ItemFilterPreview.ViewModels
{
internal class LootExplosionViewModel
{
public LootExplosionViewModel()
{
}
}
}

View File

@@ -0,0 +1,189 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Filtration.ItemFilterPreview.Properties;
using Filtration.ItemFilterPreview.Services;
using Filtration.ObjectModel;
using Filtration.ObjectModel.Enums;
using Filtration.Parser.Interface.Services;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
namespace Filtration.ItemFilterPreview.ViewModels
{
internal interface IMainWindowViewModel
{
}
internal class MainWindowViewModel : ViewModelBase, IMainWindowViewModel
{
private readonly IItemFilterScriptTranslator _itemFilterScriptTranslator;
private readonly IItemFilterProcessor _itemFilterProcessor;
private IItemFilterScript _itemFilterScript;
public MainWindowViewModel(IItemFilterScriptTranslator itemFilterScriptTranslator, IItemFilterProcessor itemFilterProcessor)
{
_itemFilterScriptTranslator = itemFilterScriptTranslator;
_itemFilterProcessor = itemFilterProcessor;
LoadScriptCommand = new RelayCommand(OnLoadScriptCommand);
LoadAlternateScriptCommand = new RelayCommand(OnLoadAlternateScriptCommand);
ProcessItemFilterCommand = new RelayCommand(OnProcessItemFilterCommand);
}
public RelayCommand LoadScriptCommand { get; private set; }
public RelayCommand LoadAlternateScriptCommand { get; private set; }
public RelayCommand ProcessItemFilterCommand { get; private set; }
public IEnumerable<IFilteredItem> FilteredItems
{
get { return _filteredItems; }
private set
{
_filteredItems = value;
RaisePropertyChanged();
}
}
private void OnLoadScriptCommand()
{
_itemFilterScript = _itemFilterScriptTranslator.TranslateStringToItemFilterScript(Resources.neversinkfilter);
}
private void OnLoadAlternateScriptCommand()
{
_itemFilterScript = _itemFilterScriptTranslator.TranslateStringToItemFilterScript(Resources.muldini);
}
private void OnProcessItemFilterCommand()
{
FilteredItems = _itemFilterProcessor.ProcessItemsAgainstItemFilterScript(_itemFilterScript, TestItems);
}
private readonly List<IItem> TestItems = new List<IItem>
{
new Item
{
Description = "Full Plate",
BaseType = "Full Plate",
ItemClass = "Body Armors",
ItemRarity = ItemRarity.Normal,
ItemLevel = 66,
DropLevel = 28,
Height = 3,
Width = 2,
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> { new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) }, true)}
},
new Item
{
Description = "Scroll of Wisdom",
BaseType = "Scroll of Wisdom",
ItemClass = "Currency",
ItemRarity = ItemRarity.Normal,
ItemLevel = 75,
DropLevel = 1,
Height = 1,
Width = 1,
SocketGroups = new List<SocketGroup>()
},
new Item
{
Description = "Unset Ring",
BaseType = "Unset Ring",
ItemClass = "Rings",
ItemRarity = ItemRarity.Rare,
ItemLevel = 53,
DropLevel = 45,
Height = 1,
Width = 1,
SocketGroups = new List<SocketGroup>()
},
new Item
{
Description = "Incinerate",
BaseType = "Incinerate",
ItemClass = "Active Skill Gems",
ItemRarity = ItemRarity.Normal,
ItemLevel = 9,
DropLevel = 9,
Quality = 10,
Height = 1,
Width = 1,
SocketGroups = new List<SocketGroup>()
},
new Item
{
Description = "Mirror of Kalandra",
BaseType = "Mirror of Kalandra",
ItemClass = "Currency",
ItemRarity = ItemRarity.Normal,
ItemLevel = 77,
DropLevel = 1,
Height = 1,
Width = 1,
SocketGroups = new List<SocketGroup>()
},
new Item
{
Description = "The Gemcutter",
BaseType = "The Gemcutter",
ItemClass = "Divination Card",
ItemRarity = ItemRarity.Normal,
ItemLevel = 1,
DropLevel = 72,
Height = 1,
Width = 1,
SocketGroups = new List<SocketGroup>()
},
new Item
{
Description = "Thaumetic Sulphite",
BaseType = "Thaumetic Sulphite",
ItemClass = "Quest Items",
ItemRarity = ItemRarity.Normal,
ItemLevel = 32,
DropLevel = 1,
Height = 2,
Width = 2,
SocketGroups = new List<SocketGroup>()
},
new Item
{
Description = "Fishing Rod",
BaseType = "Fishing Rod",
ItemClass = "Fishing Rods",
ItemRarity = ItemRarity.Normal,
ItemLevel = 1,
DropLevel = 1,
Height = 4,
Width = 1,
SocketGroups = new List<SocketGroup>()
},
new Item
{
Description = "Dry Peninsula Map",
BaseType = "Dry Peninsula Map",
ItemClass = "Maps",
ItemRarity = ItemRarity.Magic,
ItemLevel = 75,
DropLevel = 75,
Height = 1,
Width = 1,
SocketGroups = new List<SocketGroup>()
},
new Item
{
Description = "Stone Hammer",
BaseType = "Stone Hammer",
ItemClass = "One Hand Maces",
ItemRarity = ItemRarity.Normal,
ItemLevel = 1,
DropLevel = 1,
Height = 3,
Width = 2,
SocketGroups = new List<SocketGroup>()
}
};
private IEnumerable<IFilteredItem> _filteredItems;
}
}

View File

@@ -0,0 +1,13 @@
<UserControl x:Class="Filtration.ItemFilterPreview.Views.LootExplosionView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Filtration.ItemFilterPreview.Views"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
</Grid>
</UserControl>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Filtration.ItemFilterPreview.Views
{
/// <summary>
/// Interaction logic for LootExplosionView.xaml
/// </summary>
public partial class LootExplosionView : UserControl
{
public LootExplosionView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,22 @@
<Window x:Class="Filtration.ItemFilterPreview.Views.MainWindow"
x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:userControls="clr-namespace:Filtration.ItemFilterPreview.UserControls"
xmlns:viewModels="clr-namespace:Filtration.ItemFilterPreview.ViewModels"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance viewModels:MainWindowViewModel}"
Title="MainWindow" Height="960" Width="1280" >
<Grid>
<StackPanel>
<StackPanel Orientation="Horizontal">
<Button Command="{Binding LoadScriptCommand}">Load Neversink Script</Button>
<Button Command="{Binding LoadAlternateScriptCommand}">Load Muldini Script</Button>
</StackPanel>
<Button Command="{Binding ProcessItemFilterCommand}">Process Item Filter</Button>
<userControls:LootExplosionSceneUserControl FilteredItems="{Binding FilteredItems}" />
</StackPanel>
</Grid>
</Window>

View File

@@ -0,0 +1,18 @@
using Filtration.ItemFilterPreview.ViewModels;
namespace Filtration.ItemFilterPreview.Views
{
public interface IMainWindow
{
void Show();
}
internal partial class MainWindow : IMainWindow
{
public MainWindow(IMainWindowViewModel mainWindowViewModel)
{
DataContext = mainWindowViewModel;
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,23 @@
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using Filtration.ItemFilterPreview.Services;
namespace Filtration.ItemFilterPreview.WindsorInstallers
{
public class ServicesInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(
Component.For<IBlockItemMatcher>()
.ImplementedBy<BlockItemMatcher>()
.LifeStyle.Singleton);
container.Register(
Component.For<IItemFilterProcessor>()
.ImplementedBy<ItemFilterProcessor>()
.LifeStyle.Singleton);
}
}
}

View File

@@ -0,0 +1,18 @@
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using Filtration.ItemFilterPreview.ViewModels;
namespace Filtration.ItemFilterPreview.WindsorInstallers
{
public class ViewModelsInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(
Component.For<IMainWindowViewModel>()
.ImplementedBy<MainWindowViewModel>()
.LifeStyle.Singleton);
}
}
}

View File

@@ -0,0 +1,18 @@
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using Filtration.ItemFilterPreview.Views;
namespace Filtration.ItemFilterPreview.WindsorInstallers
{
public class ViewsInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.Register(
Component.For<IMainWindow>()
.ImplementedBy<MainWindow>()
.LifeStyle.Singleton);
}
}
}

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
<package id="Castle.Windsor" version="3.4.0" targetFramework="net461" />
<package id="CommonServiceLocator" version="1.3" targetFramework="net461" />
<package id="Moq" version="4.5.30" targetFramework="net461" />
<package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net461" />
</packages>

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{537BE676-2FF6-4995-B05B-9CFACE852EC9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Filtration.ObjectModel.Tests</RootNamespace>
<AssemblyName>Filtration.ObjectModel.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Moq, Version=4.5.30.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.5.30\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestItemFilterBlock.cs" />
<Compile Include="TestItemFilterBlockGroup.cs" />
<Compile Include="TestItemFilterScript.cs" />
<Compile Include="ThemeEditor\TestThemeComponentCollection.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
<Name>Filtration.ObjectModel</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Filtration.ObjectModel.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Filtration.ObjectModel.Tests")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7ed27cde-6bc5-4d11-b45d-8823de2077ce")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,54 @@
using Filtration.ObjectModel.BlockItemTypes;
using NUnit.Framework;
namespace Filtration.ObjectModel.Tests
{
[TestFixture]
public class TestItemFilterBlock
{
[Test]
public void ItemFilterBlock_AddBlockItemAllowed_LessThanMaximum_ReturnsTrue()
{
// Arrange
var block = new ItemFilterBlock();
block.BlockItems.Add(new ItemLevelBlockItem());
// Act
bool result = block.AddBlockItemAllowed(typeof (ItemLevelBlockItem));
// Assert
Assert.IsTrue(result);
}
[Test]
public void ItemFilterBlock_AddBlockItemAllowed_MoreThanMaximum_ReturnsFalse()
{
// Arrange
var block = new ItemFilterBlock();
block.BlockItems.Add(new SoundBlockItem());
// Act
bool result = block.AddBlockItemAllowed(typeof (SoundBlockItem));
// Assert
Assert.IsFalse(result);
}
[Test]
public void HasParentInBlockGroupHierarchy_ReturnsCorrectResult()
{
// Arrange
var testInputRootBlockGroup = new ItemFilterBlockGroup("Root Block Group", null);
var testInputSubBlockGroup = new ItemFilterBlockGroup("Sub Block Group", testInputRootBlockGroup);
var testInputSubSubBlockGroup = new ItemFilterBlockGroup("Sub Sub Block Group", testInputSubBlockGroup);
var block = new ItemFilterBlock {BlockGroup = testInputSubSubBlockGroup};
// Act
// Assert
Assert.AreEqual(true, block.HasBlockGroupInParentHierarchy(testInputRootBlockGroup, block.BlockGroup));
Assert.AreEqual(true, block.HasBlockGroupInParentHierarchy(testInputSubBlockGroup, block.BlockGroup));
}
}
}

View File

@@ -0,0 +1,42 @@
using NUnit.Framework;
namespace Filtration.ObjectModel.Tests
{
[TestFixture]
public class TestItemFilterBlockGroup
{
[Test]
public void ToString_ReturnsFullBlockHierarchy()
{
// Arrange
const string expectedResult = "Child 1 Block Group - Child 2 Block Group";
var rootBlockGroup = new ItemFilterBlockGroup("Root Block Group", null);
var child1BlockGroup = new ItemFilterBlockGroup("Child 1 Block Group", rootBlockGroup);
var child2BlockGroup = new ItemFilterBlockGroup("Child 2 Block Group", child1BlockGroup);
// Act
var result = child2BlockGroup.ToString();
// Assert
Assert.AreEqual(expectedResult, result);
}
[Test]
public void ToString_AddsTildeForAdvancedBlock()
{
// Arrange
const string expectedResult = "~Child 1 Block Group - Child 2 Block Group";
var rootBlockGroup = new ItemFilterBlockGroup("Root Block Group", null);
var child1BlockGroup = new ItemFilterBlockGroup("Child 1 Block Group", rootBlockGroup, true);
var child2BlockGroup = new ItemFilterBlockGroup("Child 2 Block Group", child1BlockGroup);
// Act
var result = child2BlockGroup.ToString();
// Assert
Assert.AreEqual(expectedResult, result);
}
}
}

View File

@@ -1,25 +1,19 @@
using System; using System.Linq;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media; using System.Windows.Media;
using Filtration.Models; using Filtration.ObjectModel.BlockItemTypes;
using Filtration.Models.BlockItemTypes;
using NUnit.Framework; using NUnit.Framework;
namespace Filtration.Tests.Models namespace Filtration.ObjectModel.Tests
{ {
[TestFixture] [TestFixture]
public class TestLootFilterScript public class TestItemFilterScript
{ {
[Test] [Test]
public void Validate_AtLeastOneBlock_Fail_ReturnsListWithCorrectError() public void Validate_AtLeastOneBlock_Fail_ReturnsListWithCorrectError()
{ {
// Arrange // Arrange
var script = new LootFilterScript(); var script = new ItemFilterScript();
// Act // Act
var result = script.Validate(); var result = script.Validate();
@@ -33,10 +27,8 @@ namespace Filtration.Tests.Models
{ {
// Arrange // Arrange
var script = new LootFilterScript var script = new ItemFilterScript();
{ script.ItemFilterBlocks.Add(new ItemFilterBlock());
LootFilterBlocks = new ObservableCollection<LootFilterBlock> {new LootFilterBlock()}
};
// Act // Act
var result = script.Validate(); var result = script.Validate();
@@ -59,22 +51,19 @@ namespace Filtration.Tests.Models
ReplaceBackgroundColor = true ReplaceBackgroundColor = true
}; };
var testInputBlock1 = new LootFilterBlock(); var testInputBlock1 = new ItemFilterBlock();
testInputBlock1.BlockItems.Add(new BackgroundColorBlockItem(new Color {A = 255, R = 255, G = 0, B = 0})); testInputBlock1.BlockItems.Add(new BackgroundColorBlockItem(new Color {A = 255, R = 255, G = 0, B = 0}));
var testInputBlock2 = new LootFilterBlock(); var testInputBlock2 = new ItemFilterBlock();
testInputBlock2.BlockItems.Add(new BackgroundColorBlockItem(new Color { A = 255, R = 255, G = 1, B = 0 })); testInputBlock2.BlockItems.Add(new BackgroundColorBlockItem(new Color { A = 255, R = 255, G = 1, B = 0 }));
var testInputBlock3 = new LootFilterBlock(); var testInputBlock3 = new ItemFilterBlock();
testInputBlock3.BlockItems.Add(new BackgroundColorBlockItem(new Color { A = 255, R = 255, G = 0, B = 0 })); testInputBlock3.BlockItems.Add(new BackgroundColorBlockItem(new Color { A = 255, R = 255, G = 0, B = 0 }));
var script = new LootFilterScript() var script = new ItemFilterScript();
{
LootFilterBlocks = new ObservableCollection<LootFilterBlock> script.ItemFilterBlocks.Add(testInputBlock1);
{ script.ItemFilterBlocks.Add(testInputBlock2);
testInputBlock1, script.ItemFilterBlocks.Add(testInputBlock3);
testInputBlock2,
testInputBlock3
}
};
// Act // Act
script.ReplaceColors(testInputReplaceColors); script.ReplaceColors(testInputReplaceColors);
@@ -105,21 +94,16 @@ namespace Filtration.Tests.Models
ReplaceTextColor = true ReplaceTextColor = true
}; };
var testInputBlock1 = new LootFilterBlock(); var testInputBlock1 = new ItemFilterBlock();
testInputBlock1.BlockItems.Add(new BackgroundColorBlockItem(oldBackgroundColor)); testInputBlock1.BlockItems.Add(new BackgroundColorBlockItem(oldBackgroundColor));
testInputBlock1.BlockItems.Add(new TextColorBlockItem(oldTextColor)); testInputBlock1.BlockItems.Add(new TextColorBlockItem(oldTextColor));
var testInputBlock2 = new LootFilterBlock(); var testInputBlock2 = new ItemFilterBlock();
testInputBlock2.BlockItems.Add(new BackgroundColorBlockItem(oldBackgroundColor)); testInputBlock2.BlockItems.Add(new BackgroundColorBlockItem(oldBackgroundColor));
testInputBlock2.BlockItems.Add(new TextColorBlockItem(new Color {A = 1, R = 2, G = 3, B = 4})); testInputBlock2.BlockItems.Add(new TextColorBlockItem(new Color {A = 1, R = 2, G = 3, B = 4}));
var script = new LootFilterScript var script = new ItemFilterScript();
{ script.ItemFilterBlocks.Add(testInputBlock1);
LootFilterBlocks = new ObservableCollection<LootFilterBlock> script.ItemFilterBlocks.Add(testInputBlock2);
{
testInputBlock1,
testInputBlock2
}
};
// Act // Act
script.ReplaceColors(testInputReplaceColors); script.ReplaceColors(testInputReplaceColors);
@@ -135,3 +119,4 @@ namespace Filtration.Tests.Models
} }
} }
} }

View File

@@ -0,0 +1,30 @@
using System.Windows.Media;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.ThemeEditor;
using NUnit.Framework;
namespace Filtration.ObjectModel.Tests.ThemeEditor
{
[TestFixture]
public class TestThemeComponentCollection
{
[Test]
public void AddComponent_ReturnsFirstAddedComponent_WhenComponentAddedTwice()
{
// Arrange
var testInputTargetType = ThemeComponentType.TextColor;
var testInputComponentName = "testComponent";
var testInputColor = new Color();
var componentCollection = new ThemeComponentCollection();
// Act
var firstResult = componentCollection.AddComponent(testInputTargetType, testInputComponentName, testInputColor);
var secondResult = componentCollection.AddComponent(testInputTargetType, testInputComponentName, testInputColor);
// Assert
Assert.AreSame(firstResult, secondResult);
}
}
}

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
<package id="Moq" version="4.5.30" targetFramework="net461" />
<package id="NUnit" version="3.6.1" targetFramework="net461" />
</packages>

View File

@@ -0,0 +1,51 @@
using System.Windows.Media;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.Extensions;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public sealed class ActionBlockItem : BlockItemBase
{
private BlockAction _action;
public ActionBlockItem(BlockAction action)
{
Action = action;
}
public BlockAction Action
{
get => _action;
set
{
_action = value;
IsDirty = true;
OnPropertyChanged();
OnPropertyChanged(nameof(SummaryText));
OnPropertyChanged(nameof(SummaryBackgroundColor));
OnPropertyChanged(nameof(SummaryTextColor));
}
}
public override string OutputText => Action.GetAttributeDescription();
public override string PrefixText => string.Empty;
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Action";
public override string SummaryText => Action == BlockAction.Show ? "Show" : "Hide";
public override Color SummaryBackgroundColor => Action == BlockAction.Show ? Colors.LimeGreen : Colors.OrangeRed;
public override Color SummaryTextColor => Action == BlockAction.Show ? Colors.Black : Colors.White;
public override int SortOrder => 0;
public void ToggleAction()
{
Action = Action == BlockAction.Show ? BlockAction.Hide : BlockAction.Show;
}
}
}

View File

@@ -0,0 +1,41 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Media;
using Filtration.ObjectModel.Annotations;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class BlockItemBase : IItemFilterBlockItem
{
private bool _isDirty;
public abstract string PrefixText { get; }
public abstract string OutputText { get; }
public abstract int MaximumAllowed { get; }
public abstract string DisplayHeading { get; }
public abstract string SummaryText { get; }
public abstract Color SummaryBackgroundColor { get; }
public abstract Color SummaryTextColor { get; }
public abstract int SortOrder { get; }
public string Comment { get; set; }
public bool IsDirty
{
get { return _isDirty; }
protected set
{
_isDirty = value;
OnPropertyChanged();
}
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -0,0 +1,38 @@
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class BooleanBlockItem : BlockItemBase
{
private bool _booleanValue;
protected BooleanBlockItem()
{
}
protected BooleanBlockItem(bool booleanValue)
{
BooleanValue = booleanValue;
}
public bool BooleanValue
{
get { return _booleanValue; }
set
{
_booleanValue = value;
IsDirty = true;
OnPropertyChanged();
OnPropertyChanged(nameof(SummaryText));
}
}
public override string OutputText => PrefixText + " " + BooleanValue;
public override string SummaryText => PrefixText + " = " + BooleanValue;
public override int MaximumAllowed => 1;
public void ToggleValue()
{
BooleanValue = !BooleanValue;
}
}
}

View File

@@ -0,0 +1,74 @@
using System;
using System.Windows.Media;
using Filtration.ObjectModel.ThemeEditor;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class ColorBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
{
private Color _color;
private ThemeComponent _themeComponent;
protected ColorBlockItem()
{
}
protected ColorBlockItem(Color color)
{
Color = color;
}
public override string OutputText => PrefixText + " " + +Color.R + " " + Color.G + " "
+ Color.B + (Color.A != 240 ? " " + Color.A : string.Empty) +
(ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
public override string SummaryText => string.Empty;
public ThemeComponent ThemeComponent
{
get { return _themeComponent; }
set
{
if (_themeComponent == value){ return;}
if (_themeComponent != null)
{
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
}
if (value != null)
{
value.ThemeComponentUpdated += OnThemeComponentUpdated;
value.ThemeComponentDeleted += OnThemeComponentDeleted;
}
_themeComponent = value;
OnPropertyChanged();
}
}
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public Color Color
{
get { return _color; }
set
{
_color = value;
IsDirty = true;
OnPropertyChanged();
}
}
private void OnThemeComponentUpdated(object sender, EventArgs e)
{
Color = ((ColorThemeComponent) sender).Color;
}
private void OnThemeComponentDeleted(object sender, EventArgs e)
{
ThemeComponent = null;
}
}
}

View File

@@ -0,0 +1,53 @@
using System;
using System.Windows.Media;
using Filtration.ObjectModel.ThemeEditor;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class ColorBooleanBlockItem : BlockItemBase, IAudioVisualBlockItem
{
private Color _color;
private bool _booleanValue;
protected ColorBooleanBlockItem()
{
}
protected ColorBooleanBlockItem(Color color, bool booleanValue)
{
Color = color;
BooleanValue = booleanValue;
}
public override string OutputText => PrefixText + " " + +Color.R + " " + Color.G + " "
+ Color.B + (Color.A < 255 ? " " + Color.A : string.Empty) +
(BooleanValue ? " True" : " False");
public override string SummaryText => string.Empty;
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public Color Color
{
get { return _color; }
set
{
_color = value;
IsDirty = true;
OnPropertyChanged();
}
}
public bool BooleanValue
{
get { return _booleanValue; }
set
{
_booleanValue = value;
IsDirty = true;
OnPropertyChanged();
}
}
}
}

View File

@@ -0,0 +1,48 @@
using System.Windows.Media;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class DualIntegerBlockItem : BlockItemBase, IAudioVisualBlockItem
{
private int _value;
private int _secondValue;
protected DualIntegerBlockItem()
{
}
protected DualIntegerBlockItem(int value, int secondValue)
{
Value = value;
SecondValue = secondValue;
}
public override string OutputText => PrefixText + " " + Value + " " + SecondValue;
public override string SummaryText => string.Empty;
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public int Value
{
get { return _value; }
set
{
_value = value;
IsDirty = true;
OnPropertyChanged();
}
}
public int SecondValue
{
get { return _secondValue; }
set
{
_secondValue = value;
IsDirty = true;
OnPropertyChanged();
}
}
}
}

View File

@@ -0,0 +1,90 @@
using System;
using System.Windows.Media;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.Extensions;
using Filtration.ObjectModel.ThemeEditor;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class EffectColorBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
{
private EffectColor _color;
private bool _temporary;
private ThemeComponent _themeComponent;
protected EffectColorBlockItem()
{
}
protected EffectColorBlockItem(EffectColor color, bool temporary)
{
Color = color;
Temporary = temporary;
}
public override string OutputText => PrefixText + " " + Color.GetAttributeDescription() +
(Temporary ? " " + "Temp" : string.Empty) +
(ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
public override string SummaryText => string.Empty;
public ThemeComponent ThemeComponent
{
get { return _themeComponent; }
set
{
if (_themeComponent == value) { return; }
if (_themeComponent != null)
{
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
}
if (value != null)
{
value.ThemeComponentUpdated += OnThemeComponentUpdated;
value.ThemeComponentDeleted += OnThemeComponentDeleted;
}
_themeComponent = value;
OnPropertyChanged();
}
}
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public EffectColor Color
{
get { return _color; }
set
{
_color = value;
IsDirty = true;
OnPropertyChanged();
}
}
public bool Temporary
{
get { return _temporary; }
set
{
_temporary = value;
IsDirty = true;
OnPropertyChanged();
}
}
private void OnThemeComponentUpdated(object sender, EventArgs e)
{
Color = ((EffectColorThemeComponent)sender).EffectColor;
Temporary = ((EffectColorThemeComponent)sender).Temporary;
}
private void OnThemeComponentDeleted(object sender, EventArgs e)
{
ThemeComponent = null;
}
}
}

View File

@@ -0,0 +1,103 @@
using System;
using System.Windows.Media;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.Extensions;
using Filtration.ObjectModel.ThemeEditor;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class IconBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
{
private IconSize _size;
private IconColor _color;
private IconShape _shape;
private ThemeComponent _themeComponent;
protected IconBlockItem()
{
}
protected IconBlockItem(IconSize size, IconColor color, IconShape shape)
{
Size = size;
Color = color;
Shape = shape;
}
public override string OutputText => PrefixText + " " + (int)Size + " " + Color.GetAttributeDescription() + " " + Shape.GetAttributeDescription() +
(ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
public override string SummaryText => string.Empty;
public ThemeComponent ThemeComponent
{
get { return _themeComponent; }
set
{
if (_themeComponent == value) { return; }
if (_themeComponent != null)
{
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
}
if (value != null)
{
value.ThemeComponentUpdated += OnThemeComponentUpdated;
value.ThemeComponentDeleted += OnThemeComponentDeleted;
}
_themeComponent = value;
OnPropertyChanged();
}
}
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public IconSize Size
{
get { return _size; }
set
{
_size = value;
IsDirty = true;
OnPropertyChanged();
}
}
public IconColor Color
{
get { return _color; }
set
{
_color = value;
IsDirty = true;
OnPropertyChanged();
}
}
public IconShape Shape
{
get { return _shape; }
set
{
_shape = value;
IsDirty = true;
OnPropertyChanged();
}
}
private void OnThemeComponentUpdated(object sender, EventArgs e)
{
Size = ((IconThemeComponent)sender).IconSize;
Color = ((IconThemeComponent)sender).IconColor;
Shape = ((IconThemeComponent)sender).IconShape;
}
private void OnThemeComponentDeleted(object sender, EventArgs e)
{
ThemeComponent = null;
}
}
}

View File

@@ -0,0 +1,74 @@
using System;
using System.Windows.Media;
using Filtration.ObjectModel.ThemeEditor;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class IntegerBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
{
private int _value;
private ThemeComponent _themeComponent;
protected IntegerBlockItem()
{
}
protected IntegerBlockItem(int value)
{
Value = value;
}
public override string OutputText => PrefixText + " " + Value + (ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
public override string SummaryText => string.Empty;
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public abstract int Minimum { get; }
public abstract int Maximum { get; }
public ThemeComponent ThemeComponent
{
get { return _themeComponent; }
set
{
if (_themeComponent == value) { return; }
if (_themeComponent != null)
{
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
}
if (value != null)
{
value.ThemeComponentUpdated += OnThemeComponentUpdated;
value.ThemeComponentDeleted += OnThemeComponentDeleted;
}
_themeComponent = value;
OnPropertyChanged();
}
}
public int Value
{
get { return _value; }
set
{
_value = value;
IsDirty = true;
OnPropertyChanged();
}
}
private void OnThemeComponentUpdated(object sender, EventArgs e)
{
Value = ((IntegerBlockItem)sender).Value;
}
private void OnThemeComponentDeleted(object sender, EventArgs e)
{
ThemeComponent = null;
}
}
}

View File

@@ -0,0 +1,46 @@
using System;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.Extensions;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class NumericFilterPredicateBlockItem : BlockItemBase
{
private NumericFilterPredicate _filterPredicate;
protected NumericFilterPredicateBlockItem()
{
FilterPredicate = new NumericFilterPredicate();
FilterPredicate.PropertyChanged += OnFilterPredicateChanged;
}
protected NumericFilterPredicateBlockItem(FilterPredicateOperator predicateOperator, int predicateOperand)
{
FilterPredicate = new NumericFilterPredicate(predicateOperator, predicateOperand);
FilterPredicate.PropertyChanged += OnFilterPredicateChanged;
}
public override string OutputText => PrefixText + " " + FilterPredicate.PredicateOperator.GetAttributeDescription() +
" " + FilterPredicate.PredicateOperand;
public abstract int Minimum { get; }
public abstract int Maximum { get; }
public NumericFilterPredicate FilterPredicate
{
get { return _filterPredicate; }
protected set
{
_filterPredicate = value;
OnPropertyChanged();
}
}
private void OnFilterPredicateChanged(object sender, EventArgs e)
{
IsDirty = true;
OnPropertyChanged(nameof(FilterPredicate));
OnPropertyChanged(nameof(SummaryText));
}
}
}

View File

@@ -0,0 +1,87 @@
using System;
using System.Windows.Media;
using Filtration.ObjectModel.ThemeEditor;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class StrIntBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
{
private string _value;
private int _secondValue;
private ThemeComponent _themeComponent;
protected StrIntBlockItem()
{
}
protected StrIntBlockItem(string value, int secondValue)
{
Value = value;
SecondValue = secondValue;
Value = value;
SecondValue = secondValue;
}
public override string OutputText => PrefixText + " " + Value + " " + SecondValue + (ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
public override string SummaryText => string.Empty;
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public ThemeComponent ThemeComponent
{
get { return _themeComponent; }
set
{
if (_themeComponent == value) { return; }
if (_themeComponent != null)
{
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
}
if (value != null)
{
value.ThemeComponentUpdated += OnThemeComponentUpdated;
value.ThemeComponentDeleted += OnThemeComponentDeleted;
}
_themeComponent = value;
OnPropertyChanged();
}
}
public string Value
{
get { return _value; }
set
{
_value = value;
IsDirty = true;
OnPropertyChanged();
}
}
public int SecondValue
{
get { return _secondValue; }
set
{
_secondValue = value;
IsDirty = true;
OnPropertyChanged();
}
}
private void OnThemeComponentUpdated(object sender, EventArgs e)
{
Value = ((StrIntBlockItem)sender).Value;
SecondValue = ((StrIntBlockItem)sender).SecondValue;
}
private void OnThemeComponentDeleted(object sender, EventArgs e)
{
ThemeComponent = null;
}
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Windows.Media;
using Filtration.ObjectModel.ThemeEditor;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class StringBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
{
private string _value;
private ThemeComponent _themeComponent;
protected StringBlockItem()
{
}
protected StringBlockItem(string value)
{
Value = value;
}
public override string OutputText => PrefixText + " \"" + Value + "\""
+ (ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
public override string SummaryText => string.Empty;
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public ThemeComponent ThemeComponent
{
get { return _themeComponent; }
set
{
if (_themeComponent == value) { return; }
if (_themeComponent != null)
{
_themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
_themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
}
if (value != null)
{
value.ThemeComponentUpdated += OnThemeComponentUpdated;
value.ThemeComponentDeleted += OnThemeComponentDeleted;
}
_themeComponent = value;
OnPropertyChanged();
}
}
public string Value
{
get { return _value; }
set
{
_value = value;
IsDirty = true;
OnPropertyChanged();
}
}
private void OnThemeComponentUpdated(object sender, EventArgs e)
{
Value = ((StringThemeComponent)sender).Value;
}
private void OnThemeComponentDeleted(object sender, EventArgs e)
{
ThemeComponent = null;
}
}
}

View File

@@ -0,0 +1,40 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class StringListBlockItem : BlockItemBase
{
protected StringListBlockItem()
{
Items = new ObservableCollection<string>();
Items.CollectionChanged += OnItemsCollectionChanged;
}
public override string OutputText
{
get
{
var enumerable = Items as IList<string> ?? Items.ToList();
if (enumerable.Count > 0)
{
return PrefixText + " " +
$"\"{string.Join("\" \"", enumerable.ToArray())}\"";
}
return string.Empty;
}
}
public ObservableCollection<string> Items { get; protected set; }
private void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
IsDirty = true;
OnPropertyChanged(nameof(Items));
OnPropertyChanged(nameof(SummaryText));
}
}
}

View File

@@ -0,0 +1,22 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
namespace Filtration.ObjectModel.BlockItemTypes
{
public class BackgroundColorBlockItem : ColorBlockItem
{
public BackgroundColorBlockItem()
{
Color = new Color { A = 240, R = 0, G = 0, B = 0 };
}
public BackgroundColorBlockItem(Color color) : base(color)
{
}
public override string PrefixText => "SetBackgroundColor";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Background Color";
public override int SortOrder => 23;
}
}

Some files were not shown because too many files have changed in this diff Show More