Click here to Skip to main content
15,906,569 members
Home / Discussions / C#
   

C#

 
GeneralRe: Accesing Data using DMO Pin
Nandakumar.n.pai6-May-10 20:46
Nandakumar.n.pai6-May-10 20:46 
GeneralRe: Accesing Data using DMO Pin
Henry Minute7-May-10 1:32
Henry Minute7-May-10 1:32 
GeneralRe: Accesing Data using DMO Pin
Nandakumar.n.pai7-May-10 18:57
Nandakumar.n.pai7-May-10 18:57 
QuestionSelect local class pointer to static class instance with property explorer (Best description I can manage!). Pin
kevsticle25-May-10 2:37
kevsticle25-May-10 2:37 
AnswerRe: Select local class pointer to static class instance with property explorer (Best description I can manage!). Pin
Michel Godfroid5-May-10 3:29
Michel Godfroid5-May-10 3:29 
GeneralRe: Select local class pointer to static class instance with property explorer (Best description I can manage!). Pin
kevsticle25-May-10 3:37
kevsticle25-May-10 3:37 
GeneralRe: Select local class pointer to static class instance with property explorer (Best description I can manage!). Pin
Michel Godfroid5-May-10 6:25
Michel Godfroid5-May-10 6:25 
AnswerRe: Select local class pointer to static class instance with property explorer (Best description I can manage!). Pin
OriginalGriff5-May-10 6:09
mveOriginalGriff5-May-10 6:09 
What are you actually trying to achieve with this?

I ask because it seems a long winded way to do whatever it is you are trying to do.

What is it not working? I tried it and it worked fine (I had to dummy the Freds_Box class):
public class Fred
    {
    public static Freds_Box Freds_Box1 = new Freds_Box("Box 1");
    public static Freds_Box Freds_Box2 = new Freds_Box("Box 2");
    }

public class Freds_Box
    {
    public string Fred;
    public Freds_Box(string init)
        {
        Fred = init;
        }
    }

public partial class SomeComponent
    {
    //the code way which works but isn't selectable:-
    //private Freds_Box _Local_Freds_Box = Fred.Freds_Box1;

    private Freds_Box _Local_Freds_Box;

    public SomeComponent(int i)
        {
        if (i == 1)
            {
            _Local_Freds_Box = Fred.Freds_Box1;
            }
        else
            {
            _Local_Freds_Box = Fred.Freds_Box2;
            }
        }
    //this property does not allow selecting anything, how can I "point" it at "Fred"
    //so that I can select say "Freds_Box_1" from the list?
    public Freds_Box Local_Freds_Box
        {
        get { return _Local_Freds_Box; }
        set { Local_Freds_Box = value; }
        }
    }

and a button:
private void button1_Click(object sender, EventArgs e)
    {
    SomeComponent sc1 = new SomeComponent(1);
    SomeComponent sc2 = new SomeComponent(2);
    MessageBox.Show("sc1: " + sc1.Local_Freds_Box.Fred + "\n" + "sc2: " + sc2.Local_Freds_Box.Fred);
    }
Message box:
"sc1: Box 1"
"sc2: Box 2"
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace

C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

QuestionDisplay List items? Pin
spankyleo1235-May-10 1:12
spankyleo1235-May-10 1:12 
AnswerRe: Display List items? Pin
Henry Minute5-May-10 1:15
Henry Minute5-May-10 1:15 
AnswerRe: Display List items? Pin
Peace ON5-May-10 2:01
Peace ON5-May-10 2:01 
AnswerRe: Display List items? Pin
Luc Pattyn5-May-10 2:52
sitebuilderLuc Pattyn5-May-10 2:52 
QuestionTCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 0:58
Tunisien865-May-10 0:58 
AnswerRe: TCP/IP connexion failed in csharp smart device Pin
Eddy Vluggen5-May-10 1:03
professionalEddy Vluggen5-May-10 1:03 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 1:10
Tunisien865-May-10 1:10 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Eddy Vluggen5-May-10 1:22
professionalEddy Vluggen5-May-10 1:22 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 2:25
Tunisien865-May-10 2:25 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 2:52
Tunisien865-May-10 2:52 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Michel Godfroid5-May-10 4:04
Michel Godfroid5-May-10 4:04 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 4:22
Tunisien865-May-10 4:22 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Michel Godfroid5-May-10 4:47
Michel Godfroid5-May-10 4:47 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 5:24
Tunisien865-May-10 5:24 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Michel Godfroid5-May-10 5:52
Michel Godfroid5-May-10 5:52 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien866-May-10 1:43
Tunisien866-May-10 1:43 
AnswerRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien8611-May-10 6:03
Tunisien8611-May-10 6:03 

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.