Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8058331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:19:19+00:00 2026-06-05T09:19:19+00:00

I need help with the following design. Basically I have a Main form which

  • 0

I need help with the following design. Basically I have a Main form which initializes a class called Settings. When the user clicks on a form called CommunicationsSetupForm, Main passes the Settings class in its ctor. From this CommunicationsSetupForm, the user can change settings such as the type of communication (RS232, RS485, TCP/IP, etc), baud rates, COM port names, etc.

Once this is done, focus is back to the Main form. From here, the user can send a packet to the respective hardware, such as a RUN packet. The packet is initalized through the Init Packet class, which also takes in the Settings class in its CTOR, than InitalizePacket calls PacketGenerate, which also passes the Settings class in its CTOR, and than finally CommunicationMediator is called via an event from PacketGenerate. CommunicationMediator is actually initialized in the Main Form, and also takes in the Settings class via its CTOR. Below is a picture of what is going on and I hope it makes the situation a little more clear:
enter image description here

My question is, what is the best way for CommunicationMediator to know if the Settings class has changed. For example, the user now has changed the baud rate to 300 from 9600. From my research, I have read about “Deep Copy” and a way to implement it: How do you do a deep copy of an object in .NET (C# specifically)?. Using this technique, I can create a non-referenced copy of the class called OldSettings and compare it with the current Settings class each time I need to send something out via the hardware. If OldSettings != Settings, I change the settings on the hardware first.

How can I compare an old Settings class with the current Settings class if I implement it this way? Is this the best way for CommunicationMediator to check if the Settings class has changed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:19:21+00:00Added an answer on June 5, 2026 at 9:19 am

    Your Settings class could just implement INotifyPropertyChanged. This is a standard interface in the framework which allows you to subscribe to notifications if properties within a class have changed, and is far simpler than deep copying and comparing each time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help on the best way to design a database/tables for the following
I need syntax help with the following code logic: I have a code block
I need help to design the best data structure for a GRAPH. The following
Need help on this following code. the problem is it only trigger the last
I need help doing the following: a preprocessor macro label(x) shall output #x, e.g.,
I need some help extracting the following bits of information using regular expressions. Here
Need help with deleting call log from multi numbers, using the following code i
I need help trying set-up Foreign Keys after having difficulty following Music library MySQL
So I need help in trying to understand the following? In mongo shell, I
Hello I would need some help with the following code and memory leak. Error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.