Click here to Skip to main content
15,922,533 members
Home / Discussions / C#
   

C#

 
GeneralRe: yield Pin
Luc Pattyn5-Dec-10 11:37
sitebuilderLuc Pattyn5-Dec-10 11:37 
GeneralRe: yield Pin
igalep13211-Dec-10 0:45
igalep13211-Dec-10 0:45 
GeneralRe: yield Pin
Luc Pattyn11-Dec-10 1:00
sitebuilderLuc Pattyn11-Dec-10 1:00 
GeneralRe: yield [modified] Pin
igalep13211-Dec-10 4:53
igalep13211-Dec-10 4:53 
AnswerRe: yield Pin
Luc Pattyn11-Dec-10 14:03
sitebuilderLuc Pattyn11-Dec-10 14:03 
GeneralRe: events between two threads Pin
Not Active5-Dec-10 11:38
mentorNot Active5-Dec-10 11:38 
GeneralRe: events between two threads [modified] Pin
igalep1326-Dec-10 10:40
igalep1326-Dec-10 10:40 
GeneralRe: events between two threads Pin
Not Active6-Dec-10 10:58
mentorNot Active6-Dec-10 10:58 
GeneralRe: events between two threads Pin
igalep1326-Dec-10 11:14
igalep1326-Dec-10 11:14 
AnswerRe: events between two threads Pin
Luc Pattyn5-Dec-10 12:27
sitebuilderLuc Pattyn5-Dec-10 12:27 
AnswerRe: events between two threads Pin
Pete O'Hanlon5-Dec-10 9:31
mvePete O'Hanlon5-Dec-10 9:31 
GeneralRe: events between two threads Pin
igalep1325-Dec-10 9:37
igalep1325-Dec-10 9:37 
GeneralRe: events between two threads Pin
Not Active5-Dec-10 9:55
mentorNot Active5-Dec-10 9:55 
GeneralRe: events between two threads Pin
Pete O'Hanlon5-Dec-10 9:55
mvePete O'Hanlon5-Dec-10 9:55 
AnswerRe: events between two threads Pin
PIEBALDconsult5-Dec-10 13:48
mvePIEBALDconsult5-Dec-10 13:48 
Questionhow make textbox or masked textbox take month and year only such as "mm/yyyy" Pin
Nabawoka5-Dec-10 5:43
Nabawoka5-Dec-10 5:43 
AnswerRe: how make textbox or masked textbox take month and year only such as "mm/yyyy" Pin
OriginalGriff5-Dec-10 6:11
mveOriginalGriff5-Dec-10 6:11 
AnswerRe: how make textbox or masked textbox take month and year only such as "mm/yyyy" Pin
Manfred Rudolf Bihy5-Dec-10 6:14
professionalManfred Rudolf Bihy5-Dec-10 6:14 
AnswerRe: how make textbox or masked textbox take month and year only such as "mm/yyyy" Pin
Nabawoka5-Dec-10 11:06
Nabawoka5-Dec-10 11:06 
AnswerRe: how make textbox or masked textbox take month and year only such as "mm/yyyy" Pin
Eddy Vluggen5-Dec-10 12:01
professionalEddy Vluggen5-Dec-10 12:01 
QuestionWeb Browser Tab Control problem Pin
nawoc5-Dec-10 5:06
nawoc5-Dec-10 5:06 
AnswerRe: Web Browser Tab Control problem Pin
Luc Pattyn5-Dec-10 7:46
sitebuilderLuc Pattyn5-Dec-10 7:46 
GeneralRe: Web Browser Tab Control problem Pin
nawoc5-Dec-10 9:42
nawoc5-Dec-10 9:42 
GeneralRe: Web Browser Tab Control problem Pin
Luc Pattyn5-Dec-10 9:44
sitebuilderLuc Pattyn5-Dec-10 9:44 
QuestionShould I be using inhertance for this? Pin
Jacob D Dixon4-Dec-10 15:26
Jacob D Dixon4-Dec-10 15:26 
Well I am sad to say that I have usually avoided inheritance because I don't have a full understanding of it and/or I haven't yet found a good use for it.

So my newest learning project is a client / server (have been posting about it you may notice alot). A brief overview of what I have been doing is passing my custom object over TCP. My custom object is a seperate DLL project.

Erik didn't like it but to be honest I haven't came up with a better way or fully understood. AFter reviewing hie article that he pointed me to I'm just wondering if I should be using a interface and/or inheritance.

Here is my Commons object:

[Serializable]
public class Commons
{
    public Commons()
    {
        TimeStamp = DateTime.Now;
    }

    public enum Tasks
    {
        CHECKIN,            // Checkin which updates the checkin time of agents (Default)
        DISKDRIVE,          // So the agent / server will update the disk dives
        DRIVEINFO,          // So the agent / server will update the drive info
        FAN,                // So the agent / server will update the fan info
        MESSAGE,            // Used by server to send message to agent
        PHYSICALMEMORY,     // So the agent / server will update the physical memory info
        PRINTERS,           // So the agent / server will update the printers
        PROCESSES,          // So the agent / server will update the processes
        REGISTER,           // So the agent / server will register a new agent
        SERVICES,           // So the agent / server will update the services
        SOFTWARE,           // So the agent / server will update the software

        // Commands
        ADD_CMD,            // * Used by control center to add agent command
        CLOSECD,            // Causes the agent to close the CD ROM
        GET_ALL,            // * Used by control center to get all information on a certain agent
        REBOOT,             // Causes the agent to reboot
        OPENCD,             // Causes the agent to open the CD ROM
        SHUTDOWN            // Causes the agent to shutdown
    }

    /// <summary>
    /// The task we are performing
    /// </summary>
    public Tasks Task { get; set; }

    /// <summary>
    /// The tasks we are adding to memory
    /// </summary>
    public Tasks AddTask { get; set; }

    /// <summary>
    /// Time stamp this object was created
    /// </summary>
    public DateTime TimeStamp { get; set; }

    public string AgentId { get; set; }             // This must be set
    public string Netbios { get; set; }
    public string IpAddresses { get; set; }
    public string PhysicalAddresses { get; set; }
    public string Message { get; set; }

    public int LocationID { get; set; }

    // ***************************************
    // Holds the arrays of what is being updated
    // These can be null.
    // If the task is set to PROCESSES then the Processes array should
    // be populated
    public Software[]   Software { get; set; }
    public Services[]   Services { get; set; }
    public DiskDrive[]  DiskDrive { get; set; }
    public DrivesInfo[] DriveInfo { get; set; }
    public Memory[]     Memory { get; set; }
    public Printers[]   Printers { get; set; }
    public Processes[]  Processes { get; set; }
    public Fan[]        Fan { get; set; }
}


Now those other classes look like this:
[Serializable]
public class Printers
{
    public string PrinterName { get; set; }
    public string PaperSizes { get; set; }
    public string PrinterResolutions { get; set; }

    public bool SupportsColor { get; set; }
    public bool IsDefaultPrinter { get; set; }
    public bool CanDuplex { get; set; }
    public bool IsPlotter { get; set; }
}


So getting an idea of what I'm trying to do, I am wondering if a situation like this will best serve using a interface and/or inheriting a class? I get the idea, you implement a interface, you inherit a class.. but like I said I haven't put together a good use for something I'm trying to do.

Now what I am doing with this data once it reaches the server is inserting it into SQL. If a client gets the TASK == PRINTERS, then it will perform a lookup using WMI of all local printers, poopulate the Printers[] array and send back to the server. So server gets the TASK == PRINTERS and see the Printers[] array is populated and proceeds to insert that data into SQL.

Sorry if this question is kind of broad.

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.