Click here to Skip to main content
15,883,827 members
Home / Discussions / C#
   

C#

 
JokeRe: Regarding Modbus Pin
Mycroft Holmes23-Aug-12 12:53
professionalMycroft Holmes23-Aug-12 12:53 
AnswerRe: Regarding Modbus Pin
Mc_Topaz23-Aug-12 3:05
Mc_Topaz23-Aug-12 3:05 
AnswerRe: Regarding Modbus Pin
Pete O'Hanlon23-Aug-12 4:30
mvePete O'Hanlon23-Aug-12 4:30 
Questionpassing enum value to other method in different namespace Pin
Blubbo23-Aug-12 1:59
Blubbo23-Aug-12 1:59 
AnswerRe: passing enum value to other method in different namespace Pin
Pete O'Hanlon23-Aug-12 2:03
mvePete O'Hanlon23-Aug-12 2:03 
GeneralRe: passing enum value to other method in different namespace Pin
Blubbo23-Aug-12 2:15
Blubbo23-Aug-12 2:15 
AnswerRe: passing enum value to other method in different namespace Pin
DaveyM6923-Aug-12 2:04
professionalDaveyM6923-Aug-12 2:04 
AnswerRe: passing enum value to other method in different namespace Pin
pramod.hegde23-Aug-12 20:21
professionalpramod.hegde23-Aug-12 20:21 
If these enums are not going to change over time and they are similar, I suggest you to have it in a common namespace and access it in both places.

like,
C#
namespace Common
{
    public enum Output_State
    {
        OFF,
        ON,
        Dont_Care,
    }
}
 
namespace junk
{
    using junkie;
    using Common;
    
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        public void button1_Click(object sender, EventArgs e)
        {
            ClassTwo testClassTwo = new ClassTwo();
            testClassTwo.TestMethod(Output_State.Dont_Care);
        }
    }
 
    public class ClassTwo
    {
        junkie.NewClass1 testClassThree = new junkie.NewClass1();
 
        public void TestMethod(Output_State output)
        {
            testClassThree.TestMethod(output);
        }
    }
}

namespace junkie
{
    using Common;

    class NewClass1
    {
        public void TestMethod(Output_State output)
        {
            switch (output)
            {
                case Output_State.ON: MessageBox.Show("ON"); break;
                case Output_State.OFF: MessageBox.Show("OFF"); break;
                case Output_State.Dont_Care: MessageBox.Show("Don't Care"); break;
                default: MessageBox.Show("HUH?"); break;
            }
        }
    }
}

GeneralRe: passing enum value to other method in different namespace Pin
Blubbo27-Aug-12 2:04
Blubbo27-Aug-12 2:04 
QuestionLet Windows service OnStop() wait longer Pin
Mc_Topaz23-Aug-12 1:32
Mc_Topaz23-Aug-12 1:32 
AnswerRe: Let Windows service OnStop() wait longer Pin
Eddy Vluggen23-Aug-12 1:45
professionalEddy Vluggen23-Aug-12 1:45 
GeneralRe: Let Windows service OnStop() wait longer Pin
Mc_Topaz23-Aug-12 3:01
Mc_Topaz23-Aug-12 3:01 
GeneralRe: Let Windows service OnStop() wait longer Pin
Eddy Vluggen23-Aug-12 3:06
professionalEddy Vluggen23-Aug-12 3:06 
AnswerRe: Let Windows service OnStop() wait longer Pin
BobJanova23-Aug-12 2:37
BobJanova23-Aug-12 2:37 
GeneralRe: Let Windows service OnStop() wait longer Pin
Mc_Topaz23-Aug-12 3:03
Mc_Topaz23-Aug-12 3:03 
GeneralRe: Let Windows service OnStop() wait longer Pin
PIEBALDconsult23-Aug-12 3:06
mvePIEBALDconsult23-Aug-12 3:06 
GeneralRe: Let Windows service OnStop() wait longer Pin
Mc_Topaz23-Aug-12 3:39
Mc_Topaz23-Aug-12 3:39 
GeneralRe: Let Windows service OnStop() wait longer Pin
BobJanova23-Aug-12 3:37
BobJanova23-Aug-12 3:37 
AnswerRe: Let Windows service OnStop() wait longer Pin
jschell23-Aug-12 8:47
jschell23-Aug-12 8:47 
AnswerRe: Let Windows service OnStop() wait longer Pin
Vijay Selvaraj26-Aug-12 22:00
Vijay Selvaraj26-Aug-12 22:00 
QuestionSystem.Drawing.Pen-type property does not expand in property grid Pin
TetheredSun22-Aug-12 22:51
TetheredSun22-Aug-12 22:51 
AnswerRe: System.Drawing.Pen-type property does not expand in property grid Pin
Eddy Vluggen23-Aug-12 1:12
professionalEddy Vluggen23-Aug-12 1:12 
GeneralRe: System.Drawing.Pen-type property does not expand in property grid Pin
TetheredSun23-Aug-12 1:34
TetheredSun23-Aug-12 1:34 
GeneralRe: System.Drawing.Pen-type property does not expand in property grid Pin
Eddy Vluggen23-Aug-12 1:43
professionalEddy Vluggen23-Aug-12 1:43 
GeneralRe: System.Drawing.Pen-type property does not expand in property grid Pin
TetheredSun23-Aug-12 1:46
TetheredSun23-Aug-12 1:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.