I haven't worked much with C#. The language is familiar enough, but using the language in VS 2019 is not. Therefore, I'm way behind the curve on this and figure that I HAVE to be missing a bunch of tips for working with the IDE, because this is painful.
1) I declared a class which had to implement an interface. That's easy enough, put in the class name : interface name. It doesn't automatically implement the interface?!? I have to tell it to do so? Seriously? Under what circumstances would I implement an interface and NOT want the class to implement the interface? Why does it need to be told? What am I missing there?
3) I remember somebody (Techgnome, I think it was) mentioning a quick way to get close brackets, parenthesis, etc, but I don't remember what it was. The formatting that I end up with is not to my liking. I prefer a style like this:
Which I can do, but not easily. The IDE prefers to put the } on the same line as the {, and is happy with the {} on the same line as the method name, so there are a couple extra keystrokes to change it. I'm not so concerned with not having the brackets on the same line, but it would certainly not be my preference to do it that way.
Is there a simple stylistic way to get my preferred layout?
If anybody is wondering, there WAS a question #2, and it was FAR more involved and significant than the trivial questions that remain. It was also a style choice, and after taking a deep dive into the options for the IDE, I found one that changed the behavior to the way I want it. That's one of the great things about the IDE=>If your prefer it to be one way, you can generally get it to behave that way. Thus I leave these two questions, and have removed the one that was more complex and had the simpler answer.
1) I declared a class which had to implement an interface. That's easy enough, put in the class name : interface name. It doesn't automatically implement the interface?!? I have to tell it to do so? Seriously? Under what circumstances would I implement an interface and NOT want the class to implement the interface? Why does it need to be told? What am I missing there?
3) I remember somebody (Techgnome, I think it was) mentioning a quick way to get close brackets, parenthesis, etc, but I don't remember what it was. The formatting that I end up with is not to my liking. I prefer a style like this:
Code:
public bool Dividable
{
get
{
return false;
}
}
Is there a simple stylistic way to get my preferred layout?
If anybody is wondering, there WAS a question #2, and it was FAR more involved and significant than the trivial questions that remain. It was also a style choice, and after taking a deep dive into the options for the IDE, I found one that changed the behavior to the way I want it. That's one of the great things about the IDE=>If your prefer it to be one way, you can generally get it to behave that way. Thus I leave these two questions, and have removed the one that was more complex and had the simpler answer.