Beispiel #1
0
        /// <summary>
        /// Serialize helper function to get the saved data from the File
        /// </summary>
        /// <param name="info"></param>
        /// <param name="ctxt"></param>
        public SingleConnectionSettings(SerializationInfo info, StreamingContext ctxt)
        {
            try
            {
                this.currentConnectionSetting = (int)info.GetValue("connection", typeof(int));
            }
            catch
            {
                this.currentConnectionSetting = 1;
                Console.WriteLine("Das laden der verbindungseinstellung hat nicht geklappt");
            }


            try
            {
                this.serialSettings = (rs232Settings)info.GetValue("rs232Settings", typeof(rs232Settings));
            }
            catch
            {
                this.serialSettings = new rs232Settings();
                Console.WriteLine("Das laden der verbindungseinstellung hat nicht geklappt");
            }


            try
            {
                this.tcpSettings = (tcpIpSettings)info.GetValue("tcpIpSettings", typeof(tcpIpSettings));
            }
            catch
            {
                this.tcpSettings = new tcpIpSettings();
                Console.WriteLine("Das laden der verbindungseinstellung hat nicht geklappt");
            }

            try
            {
                this.connectionName = (String)info.GetValue("connectionName", typeof(String));
            }
            catch
            {
                this.connectionName = "Verbindung 1";
                Console.WriteLine("Das laden des connectionName hat nicht geklappt");
            }
        }
Beispiel #2
0
        }                                       // Number of the Connection Interface

        /// <summary>
        /// Constructor
        /// </summary>
        public TcpConnection()
        {
            // Preset the Settings for the TCP IP Connections
            settings = new tcpIpSettings();
        }
Beispiel #3
0
        }                                              // TCP Settings


        /// <summary>
        /// Construtor
        /// </summary>
        public SingleConnectionSettings()
        {
            currentConnectionSetting = 1;
            serialSettings           = new rs232Settings();
            tcpSettings = new tcpIpSettings();
        }