Click here to Skip to main content
15,880,725 members
Home / Discussions / C#
   

C#

 
GeneralRe: 921600 Pin
Pete O'Hanlon5-Nov-12 6:58
mvePete O'Hanlon5-Nov-12 6:58 
GeneralRe: 921600 Pin
C-P-User-35-Nov-12 7:19
C-P-User-35-Nov-12 7:19 
GeneralRe: 921600 Pin
Pete O'Hanlon5-Nov-12 7:27
mvePete O'Hanlon5-Nov-12 7:27 
GeneralRe: 921600 Pin
C-P-User-35-Nov-12 7:48
C-P-User-35-Nov-12 7:48 
GeneralRe: 921600 Pin
C-P-User-35-Nov-12 8:16
C-P-User-35-Nov-12 8:16 
GeneralRe: 921600 Pin
Pete O'Hanlon5-Nov-12 8:30
mvePete O'Hanlon5-Nov-12 8:30 
GeneralRe: 921600 Pin
C-P-User-35-Nov-12 9:25
C-P-User-35-Nov-12 9:25 
GeneralRe: 921600 Pin
C-P-User-35-Nov-12 9:54
C-P-User-35-Nov-12 9:54 
Okay, I'm studying the suggested app from the 2nd message in this thread.

I see this magic word "SerialPortManager" in different files, and C# knows they are there.

When I try to put something in a different file, C# can't see it.

What's going on with this correct app that isn't going on with mine ?

I'll mark the SerialPortManager with bold type in these file clips.





File: SerialPortManager.cs

C#
File: MainForm.cs
namespace SerialPortListener
{
    public partial class MainForm : Form
    {
        SerialPortManager _spManager;
        public MainForm()
        {
            InitializeComponent();

            UserInitialization();
        }

      
        private void UserInitialization()
        {
            _spManager = new SerialPortManager();
             (more stuff)
             (more stuff)
             (more stuff)
             (more stuff)
             (more stuff)





File: SerialPortManager.cs

C#
namespace SerialPortListener.Serial
{
    /// <summary>
    /// Manager for serial port data
    /// </summary>
    public class SerialPortManager : IDisposable
    {
        public SerialPortManager()
        {
            // Finding installed serial ports on hardware
            _currentSerialSettings.PortNameCollection = SerialPort.GetPortNames();
            _currentSerialSettings.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_currentSerialSettings_PropertyChanged);

            // If serial ports is found, we select the first found
            if (_currentSerialSettings.PortNameCollection.Length > 0)
                _currentSerialSettings.PortName = _currentSerialSettings.PortNameCollection[0];
        }

        
        ~SerialPortManager()
        {
            Dispose(false);
        }


Sorry, no clue why the formatting goes into all italics in the second code snip

Anyway, which lines in his code are giving him the ability to share the names between files ? Why can't I share the name of this group of bytes between files ?

C#
namespace SerialPortPractice_03
{
    public partial class Form1 : Form
    {
        public byte[] This_Does_Not_Work = new byte[] { 0x01, 0x02, 0x03, 0x04 };
        
        public byte[] A_Test_To_Experiment = new byte[] {
                                                0xFF, 0xFE, 0xFD, 0xFC, 
                                                0x11, 0x22, 0x33, 0x44, 
                                                0x55, 0x66, 0x77 
                                                }
                                                ;


        


    }


Really hate this, but until I figure out the secret, I'm going to have to adopt the use of one huge source file with all 17 commands typed out.
GeneralRe: 921600 Pin
Pete O'Hanlon5-Nov-12 22:54
mvePete O'Hanlon5-Nov-12 22:54 
GeneralRe: 921600 Pin
C-P-User-36-Nov-12 6:34
C-P-User-36-Nov-12 6:34 
GeneralRe: 921600 Pin
Pete O'Hanlon6-Nov-12 6:44
mvePete O'Hanlon6-Nov-12 6:44 
GeneralRe: 921600 Pin
C-P-User-36-Nov-12 6:57
C-P-User-36-Nov-12 6:57 
GeneralRe: 921600 Pin
Pete O'Hanlon6-Nov-12 7:59
mvePete O'Hanlon6-Nov-12 7:59 
GeneralRe: 921600 Pin
C-P-User-36-Nov-12 6:53
C-P-User-36-Nov-12 6:53 
GeneralRe: 921600 Pin
Pete O'Hanlon6-Nov-12 8:10
mvePete O'Hanlon6-Nov-12 8:10 
GeneralRe: 921600 Pin
C-P-User-36-Nov-12 9:37
C-P-User-36-Nov-12 9:37 
AnswerRe: 921600 Pin
Dave Kreskowiak1-Nov-12 5:11
mveDave Kreskowiak1-Nov-12 5:11 
GeneralRe: 921600 Pin
C-P-User-31-Nov-12 6:46
C-P-User-31-Nov-12 6:46 
GeneralRe: 921600 Pin
C-P-User-312-Nov-12 6:17
C-P-User-312-Nov-12 6:17 
QuestionThreads and semaphores Pin
C-P-User-331-Oct-12 7:11
C-P-User-331-Oct-12 7:11 
AnswerRe: Threads and semaphores Pin
Clifford Nelson31-Oct-12 8:02
Clifford Nelson31-Oct-12 8:02 
GeneralRe: Threads and semaphores Pin
C-P-User-32-Nov-12 6:27
C-P-User-32-Nov-12 6:27 
GeneralRe: Threads and semaphores Pin
Clifford Nelson2-Nov-12 6:44
Clifford Nelson2-Nov-12 6:44 
Questioncasting at runtime in c# Pin
prasadbuddhika31-Oct-12 6:15
prasadbuddhika31-Oct-12 6:15 
AnswerRe: casting at runtime in c# Pin
Simon_Whale31-Oct-12 6:31
Simon_Whale31-Oct-12 6:31 

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.