473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

What 'type' of member is this?

Console.WriteLine("Current OS: {0} ", Environment.OSVersion)

I'm trying to find out what .OSVersion is.

It returns an object which details the OS.

I know it's not a method, because it doesnt have any empty brackets ()
after it.

Is it a property?

How do i find out for future reference what 'type' of member a given
entity is after the period of a namespace? I tried using 'go to
defintion' and found this: -

public static OperatingSystem OSVersion { get; }

But this didn't really help me.

Could someone assist please.

Thanks,

Gary-

Dec 19 '06 #1
5 1515
Hello Gary,

Environment.OSVersion.GetType()

Will get you the type of the property.

--
Cheers,
Gary
http://www.garyshort.org/
ga********@myway.com wrote:
Console.WriteLine("Current OS: {0} ", Environment.OSVersion)

I'm trying to find out what .OSVersion is.

It returns an object which details the OS.

I know it's not a method, because it doesnt have any empty brackets ()
after it.

Is it a property?

How do i find out for future reference what 'type' of member a given
entity is after the period of a namespace? I tried using 'go to
defintion' and found this: -

public static OperatingSystem OSVersion { get; }

But this didn't really help me.

Could someone assist please.

Thanks,

Gary-
Dec 19 '06 #2
Hi,

Environment is a class that has a read-only property, OSVersion, of the
type, OperatingSystem.

IntelliSense will show you the type of the property in a tooltip when it's
selected in the list.

If you place your mouse over the property in code you'll see the type in a
tooltip.

In Visual Studio try using the Object Browser. You can search for the
property by entering, "OSVersion". Select System.Environment.OSVersion from
the search results and look at the definition in the right-hand, bottom
window. Since it's a property you'll see that the definition is in the form
of a property. You can click the type and it will show you more information
(the empty window above it will show all of the members of the
OperatingSystem type).

If you're not using Visual Studio you can use Reflector:

"Lutz Roeder's Progamming .NET"
http://www.aisto.com/roeder/dotnet/

You can also search MSDN:

"Results 1 - 25 of about 250 for osversion"
http://search.msdn.microsoft.com/sea...uery=osversion

Choose the first result.

--
Dave Sexton

<ga********@myway.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Console.WriteLine("Current OS: {0} ", Environment.OSVersion)

I'm trying to find out what .OSVersion is.

It returns an object which details the OS.

I know it's not a method, because it doesnt have any empty brackets ()
after it.

Is it a property?

How do i find out for future reference what 'type' of member a given
entity is after the period of a namespace? I tried using 'go to
defintion' and found this: -

public static OperatingSystem OSVersion { get; }

But this didn't really help me.

Could someone assist please.

Thanks,

Gary-

Dec 19 '06 #3
Hi,

My previous response was really aimed at discovering the framework Type, not
the type of the member, so I'll add this as well:
public static OperatingSystem OSVersion { get; }
It's a property because of the "{ get; }", but you don't need to go to the
definition to find that out. Actually, any of my previous suggestions could
also help you to discover the type of the member, but you can also do that
easily using the icons in the IntelliSense list (which I can't find a
reference to for some reason)

--
Dave Sexton

<ga********@myway.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Console.WriteLine("Current OS: {0} ", Environment.OSVersion)

I'm trying to find out what .OSVersion is.

It returns an object which details the OS.

I know it's not a method, because it doesnt have any empty brackets ()
after it.

Is it a property?

How do i find out for future reference what 'type' of member a given
entity is after the period of a namespace? I tried using 'go to
defintion' and found this: -

public static OperatingSystem OSVersion { get; }

But this didn't really help me.

Could someone assist please.

Thanks,

Gary-

Dec 19 '06 #4
Hi thankyou both very much.

I find that the suggestion that I use the object browser is the one
that works for me because i can see the icon like you said Dave and I
can regonise the basic icon types!

thanks very much,

Gary-

Dave Sexton wrote:
Hi,

My previous response was really aimed at discovering the framework Type, not
the type of the member, so I'll add this as well:
public static OperatingSystem OSVersion { get; }

It's a property because of the "{ get; }", but you don't need to go to the
definition to find that out. Actually, any of my previous suggestions could
also help you to discover the type of the member, but you can also do that
easily using the icons in the IntelliSense list (which I can't find a
reference to for some reason)

--
Dave Sexton

<ga********@myway.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Console.WriteLine("Current OS: {0} ", Environment.OSVersion)

I'm trying to find out what .OSVersion is.

It returns an object which details the OS.

I know it's not a method, because it doesnt have any empty brackets ()
after it.

Is it a property?

How do i find out for future reference what 'type' of member a given
entity is after the period of a namespace? I tried using 'go to
defintion' and found this: -

public static OperatingSystem OSVersion { get; }

But this didn't really help me.

Could someone assist please.

Thanks,

Gary-
Dec 19 '06 #5
Hi,

ga********@myway.com wrote:
Hi thankyou both very much.

I find that the suggestion that I use the object browser is the one
that works for me because i can see the icon like you said Dave and I
can regonise the basic icon types!

thanks very much,

Gary-
Additionally to the other answers, note that the knowledge of
Microsoft's coding guidelines help to detect more easily what a given
identifier does. In that case, the Pascal casing and the lack of
parenthesis showed that it was a property.

http://blogs.msdn.com/brada/articles/361363.aspx

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Dec 19 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: damian birchler | last post by:
Hi I'm wondering of what type a structure is. Of course, it is a _structure_, but an array isn't an _array_ either. So of what type is a structure? I'd say a pointer, am I right?
4
by: Ondrej Spanel | last post by:
The code below does not compile with .NET 2003, I get folowing error: w:\c\Pokusy\delegTemplArg\delegTemplArg.cpp(11) : error C2993: 'float' : illegal type for non-type template parameter 'x' ...
3
by: Neena Paul | last post by:
Hi, I ve a below structured object TYPE in Oracle to calculate the Simple and Compound interest for an amount.. CREATE TYPE pnr_typ AS OBJECT ( principle NUMBER, ...
4
by: mosfet | last post by:
class CSyncClient { public: CSyncClient(void); virtual ~CSyncClient(void); //DECLARE_PROPERTY(Login, char*); friend class Login_;
2
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
23
by: Jess | last post by:
Hello, I understand the default-initialization happens if we don't initialize an object explicitly. I think for an object of a class type, the value is determined by the constructor, and for...
8
by: Daniel T. | last post by:
#include <cassert> class Foo { public: virtual void fnA() = 0; virtual void fnB() = 0; }; int main() { assert( &Foo::fnB );
32
by: Stephen Horne | last post by:
I've been using Visual C++ 2003 for some time, and recently started working on making my code compile in GCC and MinGW. I hit on lots of unexpected problems which boil down to the same template...
11
by: Neo | last post by:
If i have a : typedef struct str32{ uint32_t word1; uint32_t word2; } word_array; word_array *my_array; what would be the data type of this: myarray->word1
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.