Why is this permissible
public struct MyStruct { public MyStruct(double value) { myField = value; } private double myField; public double MyProperty { get { return myField; } set { myField = value; } } }
and it is not
public struct MyStruct { public MyStruct(double value) { MyProperty = value; } public double MyProperty { get; set; } }
You need this syntax:
public struct MyStruct { public MyStruct(double value) : this() { MyProperty = value; } public double MyProperty { get; set; } }
I got this information from after the SO post.
Can you change your constructor to this:
public MyStruct(double value) : this() { myField = value; }
, , . , , , . , ( ).
, .
get, - . . : { ; ; }
Source: https://habr.com/ru/post/1724251/More articles:Constants in python? - pythonComparing cocoa and .net structures - c #In Pinax, how to invite when ACCOUNT_OPEN_SIGNUP = False? - pythonCopying only nonexistent files in ant - javaWhat is a good service that offers registration code and activation services for Cocoa / OSX applications? - installationTomTom or Navigon apps register URL handler on iPhone? - urlFirst page load time compilation - asp.netcustom url scheme not working! Navigon AppInteract - iphonehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1724255/how-do-i-export-changesets-from-hg-repository-to-svn-repository&usg=ALkJrhjbazvfknIlHYZfkZiOdzcLP2hVJgHow to create a super-huge file with pure c or linux-shell or dos commands? - linuxAll Articles