Home > Net >  How to STRUCT associated ENUM
How to STRUCT associated ENUM

Time:09-29

How do I put the ID and the shaft of the shaft of the speed of each associate,

Such as I want to get the speed of the shaft 1 1, direct axis is 1. Speed 1
In such as I want to get the speed of the shaft 1 2, shaft directly 1. Speed 2

//shaft ID
Public enum AxisID
{
1=1,
Axis 2,
Shaft 3,
}
Public struct stuaxis
{
Public string handspeed1;//speed 1
Public string handspeed2;//speed 2
Public string handspeed3;//speed 3
Public string handspeed4;//
Public string handspeed5;//
}
The static public stuaxis axisparm;

CodePudding user response:

Public string handspeed1 {get {... } the set {... }}

CodePudding user response:

reference 1st floor asq985 response:
public string handspeed1 {get {... } the set {... }}


Behind the number axis in front first, and then the parameters, you are so difficult to write
Don't know can use an array or LIST are no

CodePudding user response:

reference Confucianism 9 2 floor response:
Quote: refer to 1st floor asq985 response:

Public string handspeed1 {get {... } the set {... }}


Behind the number axis in front first, and then the parameters, you are so difficult to write
Don't know to use an array or a LIST can veto

You need a shaft after the array of objects to enum extend a ToInt method
Then you can shaft array [AxisID. The shaft 1. ToInt ()]. Handspeed1; This writing

CodePudding user response:

reference Confucianism 9 2 floor response:
Quote: refer to 1st floor asq985 response:

Public string handspeed1 {get {... } the set {... }}


Behind the number axis in front first, and then the parameters, you are so difficult to write
Don't know to use an array or a LIST can veto

How can, of course, how to use convenient, you can also do not change the situation of the class, storage directly, when to display directly use Enum. GetNames displayed

CodePudding user response:

reference OrdinaryCoder reply: 3/f
Quote: refer to the second floor Confucianism reply:

Quote: refer to 1st floor asq985 response:

Public string handspeed1 {get {... } the set {... }}


Behind the number axis in front first, and then the parameters, you are so difficult to write
Don't know to use an array or a LIST can veto

You need a shaft after the array of objects to enum extend a ToInt method
Then you can shaft array [AxisID. The shaft 1. ToInt ()]. Handspeed1; This

Specific how ah
  •  Tags:  
  • C#
  • Related