Click here to Skip to main content
15,881,248 members
Home / Discussions / C#
   

C#

 
GeneralRe: Is there any technique available for copying one object of class A to another object of class B ? Pin
Nadia Monalisa5-Aug-10 16:58
Nadia Monalisa5-Aug-10 16:58 
AnswerRe: Is there any technique available for copying one object of class A to another object of class B ? Pin
Giorgi Dalakishvili5-Aug-10 20:27
mentorGiorgi Dalakishvili5-Aug-10 20:27 
AnswerRe: Is there any technique available for copying one object of class A to another object of class B ? PinPopular
Bernhard Hiller5-Aug-10 20:33
Bernhard Hiller5-Aug-10 20:33 
GeneralRe: Is there any technique available for copying one object of class A to another object of class B ? [modified] Pin
Nadia Monalisa5-Aug-10 20:41
Nadia Monalisa5-Aug-10 20:41 
GeneralRe: Is there any technique available for copying one object of class A to another object of class B ? Pin
PIEBALDconsult7-Aug-10 4:21
mvePIEBALDconsult7-Aug-10 4:21 
GeneralRe: Is there any technique available for copying one object of class A to another object of class B ? Pin
il_manti3-Nov-10 23:36
il_manti3-Nov-10 23:36 
AnswerRe: Is there any technique available for copying one object of class A to another object of class B ? Pin
Łukasz Nowakowski5-Aug-10 21:41
Łukasz Nowakowski5-Aug-10 21:41 
QuestionBest Way to Go About Updating Forms When A Piece of Data Is Changed Pin
Matt U.5-Aug-10 11:44
Matt U.5-Aug-10 11:44 
So in an application that I am writing the main form has "IsMdiContainer" set to "True". There are a different forms for which I set the application form as the child's "MdiParent". I have these different forms working together.

For example, one form contains information about a session. In another form I have a TabControl with one tab page containing a ListView control. That ListView is supposed to contain information about "Session" objects that are associated with the current Artist (which is what the "another form" is for). The Session form also contains a few controls that hold certain information about an associated "Artist" object.

What is the best method for updating specific data on another form when the data on a form is changed? For example, the artist's name is used on the Session form and if the artist's name is changed and then saved, the necessary session forms (if visible) need to update the name as well. I currently have it doing this using code like this:

private void btnSaveArtist_Click(object sender, EventArgs e)
{
    // Some code here
    // ...

    // Update the necessary "Session" forms
    foreach (Form child in this.MdiChildren)
    {
        if ((child is SessionInfoForm) && (thisArtist.ContainsSession(child.Name))
            ((SessionInfoForm)child).UpdateArtistName();
    }

    // Some more code
    // ...
}


I use "child.Name" as the parameter to "thisArtist.ContainsSession()" because a session form's name is set to the session's Unique ID (a string).

There can be more than one artist form open. And there can be more than one session form open. Each one holds the data specific to an artist or session. The reason I say only if a form is open is because, if I were to update an artist's name for session "abc123" but session form "abc123" isn't open, then I open "abc123" AFTER updating the artist, the "abc123" form pulls the information to display it.

I hope this makes sense and if it doesn't then let me know what more information you may need.
AnswerRe: Best Way to Go About Updating Forms When A Piece of Data Is Changed Pin
Chris Trelawny-Ross9-Aug-10 8:23
Chris Trelawny-Ross9-Aug-10 8:23 
QuestionInterface Events Pin
Ian Grech5-Aug-10 10:52
Ian Grech5-Aug-10 10:52 
AnswerRe: Interface Events Pin
PIEBALDconsult5-Aug-10 16:56
mvePIEBALDconsult5-Aug-10 16:56 
AnswerRe: Interface Events Pin
Chris Trelawny-Ross9-Aug-10 8:53
Chris Trelawny-Ross9-Aug-10 8:53 
GeneralRe: Interface Events Pin
Ian Grech13-Aug-10 0:34
Ian Grech13-Aug-10 0:34 
QuestionEfficient way to create a bitmap from a stream of bits in a file Pin
Adam Covitch5-Aug-10 10:50
Adam Covitch5-Aug-10 10:50 
AnswerRe: Efficient way to create a bitmap from a stream of bits in a file Pin
Eddy Vluggen5-Aug-10 11:31
professionalEddy Vluggen5-Aug-10 11:31 
AnswerRe: Efficient way to create a bitmap from a stream of bits in a file Pin
harold aptroot5-Aug-10 11:43
harold aptroot5-Aug-10 11:43 
AnswerRe: Efficient way to create a bitmap from a stream of bits in a file [modified] Pin
Luc Pattyn5-Aug-10 12:03
sitebuilderLuc Pattyn5-Aug-10 12:03 
GeneralRe: Efficient way to create a bitmap from a stream of bits in a file Pin
Adam Covitch9-Aug-10 7:02
Adam Covitch9-Aug-10 7:02 
GeneralRe: Efficient way to create a bitmap from a stream of bits in a file Pin
Luc Pattyn9-Aug-10 7:28
sitebuilderLuc Pattyn9-Aug-10 7:28 
GeneralRe: Efficient way to create a bitmap from a stream of bits in a file Pin
Adam Covitch9-Aug-10 7:34
Adam Covitch9-Aug-10 7:34 
GeneralRe: Efficient way to create a bitmap from a stream of bits in a file Pin
Luc Pattyn9-Aug-10 7:48
sitebuilderLuc Pattyn9-Aug-10 7:48 
Questionclass function Pin
v_neil875-Aug-10 10:46
v_neil875-Aug-10 10:46 
AnswerRe: class function Pin
Pete O'Hanlon5-Aug-10 12:16
mvePete O'Hanlon5-Aug-10 12:16 
QuestionInvoking C code from C# Pin
tamash_ionut5-Aug-10 9:59
tamash_ionut5-Aug-10 9:59 
AnswerRe: Invoking C code from C# Pin
DaveyM695-Aug-10 10:06
professionalDaveyM695-Aug-10 10:06 

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.