Line | |
---|
1 | $path = $args[0]
|
---|
2 | $code = Get-Content -Path $path
|
---|
3 |
|
---|
4 | Clear-Content $path
|
---|
5 |
|
---|
6 | for ($i = 0; $code[$i] -ne $NULL; $i++) {
|
---|
7 | $str = $code[$i]
|
---|
8 | $ignore = $FALSE
|
---|
9 |
|
---|
10 | # change base class of data contracts from "object" to "OKBItem"
|
---|
11 | $str = $str.Replace("object, ", "OKBItem, ")
|
---|
12 |
|
---|
13 | # remove public event "PropertyChanged"
|
---|
14 | if ($str.Contains("public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;")) {
|
---|
15 | $ignore = $TRUE
|
---|
16 | }
|
---|
17 |
|
---|
18 | # remove protected method "RaisePropertyChanged(string propertyName)"
|
---|
19 | if ($str.Contains("protected void RaisePropertyChanged(string propertyName)")) {
|
---|
20 | $ignore = $TRUE
|
---|
21 | $i = $i + 7
|
---|
22 | }
|
---|
23 |
|
---|
24 | if (-not $ignore) {
|
---|
25 | Add-Content $path $str
|
---|
26 | }
|
---|
27 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.