Skip to content

Commit 95ca8d9

Browse files
author
Nedyalko Nikolov
committed
Replace knownEvents modules with static strings.
1 parent 8023390 commit 95ca8d9

File tree

101 files changed

+514
-465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+514
-465
lines changed

apps/TelerikNEXT/app-view-model.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class AppViewModel extends observable.Observable {
116116
set search(value: string) {
117117
if (this._search !== value) {
118118
this._search = value;
119-
this.notify({ object: this, eventName: observable.knownEvents.propertyChange, propertyName: "search", value: value });
119+
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: "search", value: value });
120120

121121
this.filter();
122122
}
@@ -128,7 +128,7 @@ export class AppViewModel extends observable.Observable {
128128
set selectedIndex(value: number) {
129129
if (this._selectedIndex !== value) {
130130
this._selectedIndex = value;
131-
this.notify({ object: this, eventName: observable.knownEvents.propertyChange, propertyName: "selectedIndex", value: value });
131+
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: "selectedIndex", value: value });
132132

133133
this.set("dayHeader", conferenceDays[value].title);
134134

@@ -150,7 +150,7 @@ export class AppViewModel extends observable.Observable {
150150
this._sessions = this._sessions.filter(i=> { return i.favorite });
151151
}
152152

153-
this.notify({ object: this, eventName: observable.knownEvents.propertyChange, propertyName: "sessions", value: this._sessions });
153+
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: "sessions", value: this._sessions });
154154
}
155155

156156
public onDataLoaded() {
@@ -171,7 +171,7 @@ export class AppViewModel extends observable.Observable {
171171
this.selectedViewIndex = 2;
172172
}
173173

174-
this.notify({ object: this, eventName: observable.knownEvents.propertyChange, propertyName: "selectedViewIndex", value: this.selectedViewIndex });
174+
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: "selectedViewIndex", value: this.selectedViewIndex });
175175
}
176176
}
177177

@@ -242,7 +242,7 @@ export class SessionModel extends observable.Observable implements Session {
242242
set favorite(value: boolean) {
243243
if (this._favorite !== value) {
244244
this._favorite = value;
245-
this.notify({ object: this, eventName: observable.knownEvents.propertyChange, propertyName: "favorite", value: this._favorite });
245+
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: "favorite", value: this._favorite });
246246
}
247247
}
248248

apps/cuteness.io/reddit-app-view-model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class AppViewModel extends observable.Observable {
2727
if (!this._redditItems) {
2828
this._redditItems = new virtualArray.VirtualArray<redditViewModel.RedditViewModel>(1000);
2929
this._redditItems.loadSize = 50;
30-
this._redditItems.on(virtualArray.knownEvents.itemsLoading, (args: virtualArray.ItemsLoading) => {
30+
this._redditItems.on(virtualArray.VirtualArray.itemsLoadingEvent, (args: virtualArray.ItemsLoading) => {
3131

3232
http.getJSON<redditModel.Data>(redditUrl + args.count +
3333
(after ? "&after=" + after : "")).then(result => {
@@ -69,7 +69,7 @@ export class AppViewModel extends observable.Observable {
6969
cache.enableDownload();
7070
}
7171

72-
this.notify({ object: this, eventName: observable.knownEvents.propertyChange, propertyName: ISSCROLLING, value: value });
72+
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: ISSCROLLING, value: value });
7373
}
7474
}
7575

apps/cuteness.io/reddit-item-view-model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class RedditViewModel extends observable.Observable {
3838
set isLoading(value: boolean) {
3939
if (this._isLoading !== value) {
4040
this._isLoading = value;
41-
this.notify({ object: this, eventName: observable.knownEvents.propertyChange, propertyName: ISLOADING, value: value });
41+
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: ISLOADING, value: value });
4242
}
4343
}
4444

@@ -69,7 +69,7 @@ export class RedditViewModel extends observable.Observable {
6969
completed: (image: any, key: string) => {
7070
if (url === key) {
7171
this.isLoading = false;
72-
this.notify({ object: this, eventName: observable.knownEvents.propertyChange, propertyName: THUMBNAIL_IMAGE, value: image });
72+
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: THUMBNAIL_IMAGE, value: image });
7373
}
7474
}
7575
});
@@ -87,7 +87,7 @@ export class RedditViewModel extends observable.Observable {
8787

8888
imageSource.fromUrl(url).then(result => {
8989
this.isLoading = false;
90-
this.notify({ object: this, eventName: observable.knownEvents.propertyChange, propertyName: IMAGE_SOURCE, value: result });
90+
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: IMAGE_SOURCE, value: result });
9191
});
9292
}
9393
}

apps/editable-text-demo/model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export class WebViewModel extends observable.Observable {
1212
set text(value: string) {
1313
console.log(value);
1414
this._text = value;
15-
this.notify({ object: this, eventName: observable.knownEvents.propertyChange, propertyName: "text", value: value });
15+
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: "text", value: value });
1616
}
1717
}

apps/perf-tests/ApplicationLoadTimeAndFPS/mainPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function createPage() {
2929
var listView = new listViewModule.ListView();
3030
listView.items = new Array(100);
3131

32-
listView.on(listViewModule.knownEvents.itemLoading, (args: listViewModule.ItemEventData) => {
32+
listView.on(listViewModule.ListView.itemLoadingEvent, (args: listViewModule.ItemEventData) => {
3333
var StackLayout = <stackLayoutModule.StackLayout>args.view;
3434
if (!StackLayout) {
3535
StackLayout = createListViewItemFunc();

apps/perf-tests/ComplexObjectGraphMemoryTest/mainPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function createPage() {
3636
mainStackLayout.addChild(childStackLayout);
3737
for (var j = 0; j < buttonsPerRow; j++) {
3838
button = new buttonModule.Button();
39-
button.on(buttonModule.knownEvents.tap, function (data) {
39+
button.on(buttonModule.Button.tapEvent, function (data) {
4040
trace.write("eventName=" + data.eventName + " object=" + data.object, trace.categories.Test, trace.messageType.info);
4141
});
4242
button.text = "" + i + j;

apps/perf-tests/ControlCreationSpeedTest/mainPage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function createPage() {
2727
var button = new buttonModule.Button();
2828
button.text = text;
2929
button.width = 40;
30-
button.on(buttonModule.knownEvents.tap, function (eventData) {
30+
button.on(buttonModule.Button.tapEvent, function (eventData) {
3131
count = ((<any>eventData.object).text) * 1000;
3232
countLabel.text = "Create " + count + " objects of type:";
3333
});
@@ -79,7 +79,7 @@ export function createPage() {
7979
var addControlButtonFunc = function (text) {
8080
var button = new buttonModule.Button();
8181
button.text = text;
82-
button.on(buttonModule.knownEvents.tap, onClickHandler);
82+
button.on(buttonModule.Button.tapEvent, onClickHandler);
8383
mainLayout.addChild(button);
8484
};
8585

apps/perf-tests/LargeObjectArrayMemoryLeakTest/mainPage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function createPage() {
2525
var startButtonClickHandler = function () {
2626
allocateMemory();
2727
};
28-
startButton.on(buttonModule.knownEvents.tap, startButtonClickHandler);
28+
startButton.on(buttonModule.Button.tapEvent, startButtonClickHandler);
2929

3030
var stopButton = new buttonModule.Button();
3131
stopButton.height = 50;
@@ -34,7 +34,7 @@ export function createPage() {
3434
var stopButtonClickHandler = function () {
3535
nativeCallsWrapper.forceGarbageCollection();
3636
};
37-
stopButton.on(buttonModule.knownEvents.tap, stopButtonClickHandler);
37+
stopButton.on(buttonModule.Button.tapEvent, stopButtonClickHandler);
3838

3939
mainStackLayout.addChild(startButton);
4040
mainStackLayout.addChild(stopButton);

apps/perf-tests/NavigationMemoryLeakTest/mainPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function createPage() {
1616
var forwardIntervalId;
1717
var backIntervalId;
1818

19-
startButton.on(buttonModule.knownEvents.tap, function () {
19+
startButton.on(buttonModule.Button.tapEvent, function () {
2020

2121
forwardIntervalId = setInterval(function () {
2222
console.log("Navigating to controls page...");

apps/perf-tests/NavigationTest/details-page.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ export function createPage() {
1313

1414
var backButton = new buttonModule.Button();
1515
backButton.text = "< back";
16-
backButton.on(buttonModule.knownEvents.tap, () => { page.frame.goBack(); });
16+
backButton.on(buttonModule.Button.tapEvent, () => { page.frame.goBack(); });
1717
stackLayout.addChild(backButton);
1818

1919
var label = new labelModule.Label();
2020
stackLayout.addChild(label);
2121

22-
page.on(pagesModule.knownEvents.navigatedTo, () => {
22+
page.on(pagesModule.Page.navigatedToEvent, () => {
2323
var item = page.navigationContext;
2424
label.text = "I am detail for " + item;
2525
});
@@ -30,7 +30,7 @@ export function createPage() {
3030

3131
var actionButton = new buttonModule.Button();
3232
actionButton.text = "Copy";
33-
actionButton.on(buttonModule.knownEvents.tap, () => {
33+
actionButton.on(buttonModule.Button.tapEvent, () => {
3434
label.text = textField.text;
3535
});
3636
stackLayout.addChild(actionButton);

0 commit comments

Comments
 (0)