473,666 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What 'type' of member is this?

Console.WriteLi ne("Current OS: {0} ", Environment.OSV ersion)

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 1535
Hello Gary,

Environment.OSV ersion.GetType( )

Will get you the type of the property.

--
Cheers,
Gary
http://www.garyshort.org/
ga********@mywa y.com wrote:
Console.WriteLi ne("Current OS: {0} ", Environment.OSV ersion)

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.Environm ent.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********@myw ay.comwrote in message
news:11******** **************@ n67g2000cwd.goo glegroups.com.. .
Console.WriteLi ne("Current OS: {0} ", Environment.OSV ersion)

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********@myw ay.comwrote in message
news:11******** **************@ n67g2000cwd.goo glegroups.com.. .
Console.WriteLi ne("Current OS: {0} ", Environment.OSV ersion)

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********@myw ay.comwrote in message
news:11******** **************@ n67g2000cwd.goo glegroups.com.. .
Console.WriteLi ne("Current OS: {0} ", Environment.OSV ersion)

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********@mywa y.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
2763
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
4031
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' The error shows compiler is quite confused - x is not a template parameter at all. I have found two workarounds, but still I think the code should compile.
3
5406
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, interest NUMBER, year NUMBER,
4
4854
by: mosfet | last post by:
class CSyncClient { public: CSyncClient(void); virtual ~CSyncClient(void); //DECLARE_PROPERTY(Login, char*); friend class Login_;
2
6108
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 pointers, but I'm not sure. Please help. The code: void equate(matrix *A, matrix *B) { int i, j; assert(A.row_dim == B.col_dim && A.col_dim == B.col_dim); for(i=0; i < A.row_dim; i++) for(j=0; j < A.col_dim; j++)
23
3649
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 the built-in types, the value is usually garbage. Is this right? However, I'm a bit confused about value-initialization, when does it happen, and what kind of values are assigned to objects?
8
1629
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
2715
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 issue. A noddy mixin layer example should illustrate the issue... class Base { protected: int m_Field;
11
3665
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
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8352
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6189
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.