New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update names per naming guidelines. #1012
Conversation
Hmmm. OPS build didn't happen. closing and reopening. |
Open Publishing Build Service: The pull request content has been published and here are some sample preview links:
|
Open Publishing Build Service: The pull request content has been published and here are some sample preview links:
|
@@ -126,15 +126,15 @@ that the event objects can only be accessed in safe ways. The only | |||
operations available on a field-like event are add handler: | |||
|
|||
```cs | |||
EventHandler<FileFoundArgs> handler = (sender, eventArgs) => | |||
EventHandler<FileFoundArgs> OnFoundFile = (sender, eventArgs) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a local variable, so it should use camelCase, not PascalCase.
@svick provides the usual very thorough review.
Open Publishing Build Service: The pull request content has been published and here are some sample preview links:
|
Open Publishing Build Service: The pull request content has been published and here are some sample preview links:
|
``` | ||
|
||
The type of the event (`EventHandler<FileListArgs>` in this example) must be a | ||
delegate type. There are a number of conventions that you should follow | ||
when declaring an event. Typically, the event delegate type has a void return. | ||
Prefix event declarations with 'On'. | ||
The remainder of the name is a verb. Use past tense (as in this example) when | ||
Event declarations should be a verb, or verb phrase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: or a verb phrase
the event reports something that has happened. Use a present tense verb (for | ||
example, `OnClosing`) to report something that is about to happen. Often, using | ||
example, `Closing`) to report something that is about to happen. Often, using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing would be present participle no? And we also have some that are simple present that don't have cancellation such as Authenticate. Any recommendation on when to use one vs. the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the present participle: I'd prefer not going into that much grammatical detail for developers. Would you agree?
On the guidance: I'll do a bit of research and add a paragraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
Open Publishing Build Service: The pull request content has been published and here are some sample preview links:
|
There's one remaining open feedback item. I'll propose this: Proposal: Change event names that are verb phrases from VerbNoun (ChangedDirectory) to NounVerb (DirectoryChanged). Remain silent on whether this is a standard or not. Can I get upvotes @mairaw and @terrajobst ? Once that happens, I'll make that change and merge. |
👍 That's what the framework does. |
LGTM! |
Open Publishing Build Service: The pull request content has been published and here are some sample preview links:
|
Fixes #1011
The section on "events" incorrectly recommended naming events with the "On" prefix. Events should be the verb or verb phrase, and the handlers should have the "On" prefix.