-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from dills122/nuget-package
Nuget package
- Loading branch information
Showing
16 changed files
with
383 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,43 @@ | ||
using System; | ||
using ShamWow.Constants; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace ShamWow.Attributes | ||
{ | ||
public class StringAtr : Attribute | ||
{ | ||
private enum StringTypes | ||
{ | ||
Address, | ||
AddressTwo, | ||
Phone, | ||
SSN, | ||
Email, | ||
City, | ||
State, | ||
Zip | ||
} | ||
public string scrubType { get; private set; } | ||
public int length { get; private set; } | ||
|
||
public StringAtr(string scrubType) | ||
{ | ||
if (CheckAttr(scrubType)) | ||
{ | ||
this.scrubType = scrubType; | ||
} | ||
} | ||
|
||
public StringAtr(string scrubType, int length) | ||
{ | ||
if (CheckAttr(scrubType) && length > 0) | ||
{ | ||
this.scrubType = scrubType; | ||
this.length = length; | ||
} | ||
} | ||
|
||
private bool CheckAttr(string scrubType) | ||
{ | ||
StringTypes type; | ||
Enum.TryParse(scrubType, out type); | ||
this.scrubType = scrubType; | ||
|
||
if (!Enum.IsDefined(typeof(StringTypes), scrubType)) | ||
{ | ||
//Not the best fit, but good for now | ||
throw new InvalidOperationException("Not Valid Scrub Type"); | ||
} | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using ShamWow.Constants; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace ShamWow.Processor | ||
{ | ||
public class Factory | ||
{ | ||
private Func<Object, ScrubTypes, ProcessDocument> _ctorCaller; | ||
|
||
public Factory (Func<Object, ScrubTypes, ProcessDocument> ctorCaller) | ||
{ | ||
_ctorCaller = ctorCaller; | ||
} | ||
|
||
public ProcessDocument Create(object unScrubbedData, ScrubTypes scrubType) | ||
{ | ||
if(unScrubbedData != null) | ||
{ | ||
return _ctorCaller(unScrubbedData, scrubType); | ||
} | ||
else | ||
{ | ||
return null; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace ShamWow.Processor | ||
{ | ||
public interface IProcessDocument | ||
{ | ||
object CleanData(); | ||
ProcessDocument Scrub(); | ||
bool CheckManifest(); | ||
DocumentManifest GetManifest(); | ||
} | ||
} |
Oops, something went wrong.