Hi newsgroup,
I have a C# code that I tried to convert to VB.NET using a snippet
converter.
The converter produced something I don't understand, namely:
<Config("Camera ", "cameraType ")_
Shared cameraType As CameraType
What does the "<" statement do, please?
Thanks
Mike
C#:
public class ActionGameWindo w : GameWindow
{
enum CameraType
{
FPS,
TPS,
Free,
Count,
}
[Config( "Camera", "cameraType " )]
static CameraType cameraType;
[Config( "Camera", "tpsCameraDista nce" )]
static float tpsCameraDistan ce = 4;
[Config( "Camera", "tpsCameraCente rOffset" )]
static float tpsCameraCenter Offset = 1.6f;
is being translated to:
VB.NET:
Public Class ActionGameWindo w
Inherits GameWindow
Private Enum CameraType
FPS
TPS
Free
Count
End Enum
<Config("Camera ", "cameraType ")_
Shared cameraType As CameraType
<Config("Camera ", "tpsCameraDista nce")_
Shared tpsCameraDistan ce As Single = 4
<Config("Camera ", "tpsCameraCente rOffset")_
Shared tpsCameraCenter Offset As Single = 1.6F 3 1171
These are "attributes " applied to the object.
Steve C.
MCAD,MCSE,MCP+I ,CNE,CNA,CCNA
Mike Hamilton wrote:
Hi newsgroup,
I have a C# code that I tried to convert to VB.NET using a snippet
converter.
The converter produced something I don't understand, namely:
<Config("Camera ", "cameraType ")_
Shared cameraType As CameraType
What does the "<" statement do, please?
Thanks
Mike
C#:
public class ActionGameWindo w : GameWindow
{
enum CameraType
{
FPS,
TPS,
Free,
Count,
}
[Config( "Camera", "cameraType " )]
static CameraType cameraType;
[Config( "Camera", "tpsCameraDista nce" )]
static float tpsCameraDistan ce = 4;
[Config( "Camera", "tpsCameraCente rOffset" )]
static float tpsCameraCenter Offset = 1.6f;
is being translated to:
VB.NET:
Public Class ActionGameWindo w
Inherits GameWindow
Private Enum CameraType
FPS
TPS
Free
Count
End Enum
<Config("Camera ", "cameraType ")_
Shared cameraType As CameraType
<Config("Camera ", "tpsCameraDista nce")_
Shared tpsCameraDistan ce As Single = 4
<Config("Camera ", "tpsCameraCente rOffset")_
Shared tpsCameraCenter Offset As Single = 1.6F
Mike Hamilton wrote:
The converter produced something I don't understand, namely:
<Config("Camera ", "cameraType ")_
Shared cameraType As CameraType
What does the "<" statement do, please?
That is VB.NET syntax for applying an attribute. See
<http://msdn2.microsoft .com/en-us/library/5x6cd29c(VS.80) .aspxfor
attributes in the .NET framework.
--
Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Eric A. Forgy |
last post by:
Hello,
I am just learning Java and am trying to write a method that does
something like
//===========================================
public Static List find(double array,double val,String relationalOp)
{
List list = new ArrayList();
|
by: Ensoul Chee |
last post by:
I used
#include <iostream.h>
int m;
cout << "Hexadecimal == 0x" << hex << m << endl;
to print value of m in hexadecimal mode.
But I got the compile error like this
couttest.cpp:20 `hex' undeclared (first use this function)
|
by: Christian Schmidbauer |
last post by:
Hello!
I prepare my XML document like this way:
-------------------------------------------------------
PrintWriter writer;
Document domDocument;
Element domElement;
// Root tag
|
by: Diandian Zhang |
last post by:
Does anyone have an idea, how to do it? Thanks in advance!
|
by: wangzhihuii |
last post by:
Hi all,
I'm really confused, can
cout<<"";
contribute anything to the routine ?!!
my programm won't work properly without this trivial sentence.
Sincerely
vivian
| |
by: Jon Noring |
last post by:
Out of curiosity, may a CDATA section appear within an attribute
value with datatype CDATA? And if so, how about other attribute
value datatypes which accept the XML markup characters?
To me, the XML specification seems a little ambiguous on this, so
I defer to the XML authorities. Refer to sections 2.4 and 2.7 (it all
hinges on if CDATA attribute values are part of markup or not.)
Thanks.
|
by: Filipe Sousa |
last post by:
Hi!
Could someone explain to me why this operation is not what I was expecting?
int main()
{
int x = 2;
std::cout << x << " " << x++ << std::endl;
return 0;
}
|
by: Holger |
last post by:
Hi
I have not been able to figure out how to do compound statement from C
- "<test>?<true-val>:<false-val>"
But something similar must exist...?!
I would like to do the equivalent if python of the C line:
printf("I saw %d car%s\n", n, n != 1 ? "s" : "")
|
by: ismailc |
last post by:
Hi, I need help please.
Update system to to new version & moved on to .Net2
But now my code that worked in my .Net1 xslt does not work.
.Net1 fine:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:asp="remove" xmlns:igchart="remove" xmlns:igsch="remove">
<td class='rowDet' id="td_<xsl:value-of select='@name' />">
.Net2 don't work:
<xsl:stylesheet...
|
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...
|
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,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |