Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
roydukkey committed Apr 11, 2016
0 parents commit 9eac4e1
Show file tree
Hide file tree
Showing 40 changed files with 3,407 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# editorconfig.org

# top-most EditorConfig file
root = true

# Default settings:
# A newline ending every file
# Use 1 table as indentation
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = tab
insert_final_newline = true
tab_width = 2
trim_trailing_whitespace = true

# Shell scripts
[*.sh]
end_of_line = lf
[*.{cmd, bat}]
end_of_line = crlf
67 changes: 67 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

# Force bash scripts to always use lf line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.sh text eol=lf
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# User-specific files
*.user
*.suo
*.userprefs

# Package Managers
.nuget/
nuget.exe
bower_components/
node_modules/

# Build Artifacts
.vs/
artifacts/
[Oo]bj/
[Bb]in/
*launchSettings.json
*.lock.json
*.cache

# Other
*DS_Store
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributions

Contributions are welcome, however it may beneficial to open a discussion about new feature and improvements before beginning development. Pull requests that fix bugs, typos, or improve documentation are generally acceptable without discussion.

## Requirements

Work will only be consider once the follow criteria have been met:

1. Pull requests adhere to current coding style.
2. Pull requests for new features or improvements provide a clear and proven argument of necessity for the changes.
3. Pull requests for new features or improvements provide appropriate unit tests.
4. Pull requests that introduce new `MutationAttributes` should name the new type in a way that indicates an action. For example, for the `ReplaceAttribute` the verb 'replace' is indicating the attribute is going to perform a replacement. Likewise, the `EnsureCaseAttribute` indicates a typographically case will be forced.
5. Pull requests don't introduce new, unjustified, StyleCop errors or warnings and don't supress StyleCop.
123 changes: 123 additions & 0 deletions Documentation/Attributes/EnsureCaseAttribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# EnsureCaseAttribute [..](../README.md#documentation-index 'Documentation Index')

Used to mutated the specified string to a specified case.

**Namespace:** System.ComponentModel.DataMutations<br />
**Implements:** System.ComponentModel.DataMutations.MutationAttribute (in System.ComponentModel.Mutations)

#### Syntax

```csharp
[AttributeUsage(AttributeTargets.Property)]
public class EnsureCaseAttribute : MutationAttribute
```

#### Remarks

**@!coreclr =>** Generally, title casing converts the first character of a word to uppercase and the rest of the characters to lowercase. However, this method does not currently provide proper casing to convert a word that is entirely uppercase, such as an acronym.


### Constructors

| Name | Description |
| ---- | ----------- |
| [EnsureCaseAttribute(CaseOptions)](#EnsureCaseAttributeCaseOptions) | Initializes a new instance of the EnsureCaseAttribute class. |


### Properties

| Name | Description |
| ---- | ----------- |
| [Case](#Case) | Gets the desired case of the string after mutation. |
| [CultureInfo](#CultureInfo) | Gets or sets the CultureInfo to be used when determining the appropriate case. |


### Methods

| Name | Description |
| ---- | ----------- |
| [Mutate(Object, IMutationContext)](MutationAttribute.md#MutateObjectIMutationContext) | Mutates the given value according to this MutationContext&lt;T&gt;. |
| [MutateValue(Object, IMutationContext)](#MutateValueObjectIMutationContext) | Implement the mutation logic for this EnsureCaseAttribute. |


<a name='EnsureCaseAttributeCaseOptions'></a>
## EnsureCaseAttribute(CaseOptions)

Initializes a new instance of the *EnsureCaseAttribute* class.

#### Syntax

```csharp
public EnsureCaseAttribute(
CaseOptions caseOption
)
```

#### Parameters

<dl>
<dt>caseOption</dt>
<dd>Type: System.ComponentModel.DataMutations.CaseOptions<br />The desired case of the string after mutation.</dd>
</dl>


<a name='Case'></a>
## Case

Gets the desired case of the string after mutation.

#### Syntax

```csharp
public CaseOptions Case { get; private set; }
```

<dl>
<dt>Type</dt>
<dd>System.ComponentModel.DataMutations.CaseOptions</dd>
</dl>


<a name='CultureInfo'></a>
## CultureInfo

Gets or sets the *CultureInfo* to be used when determining the appropriate case.

#### Syntax

```csharp
public CultureInfo CultureInfo { get; set; }
```

<dl>
<dt>Type</dt>
<dd>System.Globalization.CultureInfo</dd>
</dl>


<a name='MutateValueObjectIMutationContext'></a>
## MutateValue(Object, IMutationContext)

Implement the mutation logic for this *EnsureCaseAttribute*.

#### Syntax

```csharp
protected override object MutateValue(
object value,
IMutationContext context
)
```

#### Returns

The specified `value` converted to the specified *Case*.

#### Parameters

<dl>
<dt>value</dt>
<dd>Type: System.Object<br />The value to mutate.</dd>
<dt>context</dt>
<dd>Type: System.ComponentModel.DataMutations.IMutationContext<br />Describes the <code>value</code> being mutated and provides services and context for mutation.</dd>
</dl>
90 changes: 90 additions & 0 deletions Documentation/Attributes/EnsureNumericAttribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# EnsureNumericAttribute [..](../README.md#documentation-index 'Documentation Index')

Used to mutated a string to allow only numeric characters.

**Namespace:** System.ComponentModel.DataMutations<br />
**Implements:** System.ComponentModel.DataMutations.MutationAttribute (in System.ComponentModel.Mutations)

#### Syntax

```csharp
[AttributeUsage(AttributeTargets.Property)]
public class EnsureNumericAttribute : MutationAttribute
```


### Properties

| Name | Description |
| ---- | ----------- |
| [PreserveFloatingPoint](#PreserveFloatingPoint) | Gets or sets a value indicating whether a floating point indication (.) should be preserved during mutation. |
| [PreserveSign](#PreserveSign) | Gets or sets a value indicating whether a sign indication (±) should be preserved during mutation. |


### Methods

| Name | Description |
| ---- | ----------- |
| [Mutate(Object, IMutationContext)](MutationAttribute.md#MutateObjectIMutationContext) | Mutates the given value according to this MutationContext&lt;T&gt;. |
| [MutateValue(Object, IMutationContext)](#MutateValueObjectIMutationContext) | Implement the mutation logic for this EnsureNumericAttribute. |


<a name='PreserveFloatingPoint'></a>
## PreserveFloatingPoint

Gets or sets a value indicating whether a floating point indication (.) should be preserved during mutation.

#### Syntax

```csharp
public bool PreserveFloatingPoint { get; set; }
```

<dl>
<dt>Type</dt>
<dd>System.Boolean</dd>
</dl>

<a name='PreserveSign'></a>
## PreserveSign

Gets or sets a value indicating whether a sign indication (±) should be preserved during mutation.

#### Syntax

```csharp
public bool PreserveSign { get; set; }
```

<dl>
<dt>Type</dt>
<dd>System.Boolean</dd>
</dl>


<a name='MutateValueObjectIMutationContext'></a>
## MutateValue(Object, IMutationContext)

Implement the mutation logic for this *EnsureNumericAttribute*.

#### Syntax

```csharp
protected override object MutateValue(
object value,
IMutationContext context
)
```

#### Returns

The resulting mutated value in the specified numeric format.

#### Parameters

<dl>
<dt>value</dt>
<dd>Type: System.Object<br />The value to mutate.</dd>
<dt>context</dt>
<dd>Type: System.ComponentModel.DataMutations.IMutationContext<br />Describes the <code>value</code> being mutated and provides services and context for mutation.</dd>
</dl>
Loading

0 comments on commit 9eac4e1

Please sign in to comment.