Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Is there any difference between input declaration
Collapse
X
-
Hello TazoTodua,
Thanks for your post.
You are correct. The top code sample is essentially short hand for the second code sample. The pro of using the top sample would be that it is simpler and in most cases eliminates extra steps. You would really only want to use the second sample if you had a specific reason for overriding those values.
I am including the following publicly available link for the msdn page on using properties, for your convenience.
https://docs.microsoft.com/en-us/dot...ing-properties
Please let me know if you have any further questions.
-
Is there any difference between input declaration
is this :
Code:.... [Display(Name = "Long Alert File Name")] public string something { get; set; }
Code:.... [Display(Name = "Long Alert File Name")] public string something { get { return this.XYZ; } set { this.XYZ= value; } } private string XYZ= "smth.wav";
what are pros and cons of using either? does it matter if we use the first (simple) example ?Last edited by ttodua; 02-02-2018, 01:51 AM.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by mulshah, Yesterday, 11:12 PM
|
0 responses
2 views
0 likes
|
Last Post
![]()
by mulshah
Yesterday, 11:12 PM
|
||
Started by tvaughan4, Yesterday, 10:46 PM
|
0 responses
0 views
0 likes
|
Last Post
![]()
by tvaughan4
Yesterday, 10:46 PM
|
||
Started by digibob, Yesterday, 10:01 PM
|
0 responses
1 view
0 likes
|
Last Post
![]()
by digibob
Yesterday, 10:01 PM
|
||
Started by ptertich, Yesterday, 09:59 PM
|
0 responses
2 views
0 likes
|
Last Post
![]()
by ptertich
Yesterday, 09:59 PM
|
||
Started by sledge, Yesterday, 06:11 PM
|
1 response
13 views
0 likes
|
Last Post
![]()
by sledge
Yesterday, 06:17 PM
|
Leave a comment: