[newbie] nested struct?
-
Is it correct to create a struct that is nested within a class e.g. public partial class _Default : System.Web.UI.Page { protected struct SupportStruc { protected string var1 protected string var2 } SupportStruc supporter = new SupportStruc(); protected void Page_Load (..) { supporter... //var1 and var2 are not displayed here... } }
Jon
-
Is it correct to create a struct that is nested within a class e.g. public partial class _Default : System.Web.UI.Page { protected struct SupportStruc { protected string var1 protected string var2 } SupportStruc supporter = new SupportStruc(); protected void Page_Load (..) { supporter... //var1 and var2 are not displayed here... } }
Jon
It's neither correct nor incorrect. I try to limit nested types to private types only used from within the outer type, and you'll find that the .NET Framework has only very few public nested types.
David Anton http://www.tangiblesoftwaresolutions.com Convert VB to C#, C++, or Java Convert C# to VB, C++, or Java Convert C++ to C#, VB, or Java Convert Java to C#, C++, or VB
-
It's neither correct nor incorrect. I try to limit nested types to private types only used from within the outer type, and you'll find that the .NET Framework has only very few public nested types.
David Anton http://www.tangiblesoftwaresolutions.com Convert VB to C#, C++, or Java Convert C# to VB, C++, or Java Convert C++ to C#, VB, or Java Convert Java to C#, C++, or VB