Exemplo n.º 1
0
        // =========================================================================================================
        public MainForm()
        {
            InitializeComponent();
            this.AddToLog      = new AddToTextBoxDelegate(this.AddToLogMethod);
            this.AddToMessages = new AddToTextBoxDelegate(this.AddToMessagesMethod);
            this.Log           = new CLog(this.tbLog, this.AddToLog);
            this.Messages      = new CMessages(this.tbMessages, this.AddToMessages);
            var base_path = Environment.GetEnvironmentVariable("USERPROFILE");

            if (base_path == null)
            {
                base_path = Environment.GetEnvironmentVariable("HOME");
            }
            if (base_path == null)
            {
                base_path = Path.GetDirectoryName(Application.ExecutablePath);
            }
            this._settings_file_name = Path.Combine(base_path, ".wialon_ips_emulator.settings");
            this._log_file_name      = Path.Combine(base_path, ".wialon_ips_emulator.log");
            this.tmrPing             = new System.Threading.Timer(new TimerCallback(this.PingTimerCallback), null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
        }
Exemplo n.º 2
0
 // =========================================================================================================
 public MainForm()
 {
     InitializeComponent();
     this.AddToLog = new AddToTextBoxDelegate(this.AddToLogMethod);
     this.AddToMessages = new AddToTextBoxDelegate(this.AddToMessagesMethod);
     this.Log = new CLog(this.tbLog, this.AddToLog);
     this.Messages = new CMessages(this.tbMessages, this.AddToMessages);
     var base_path = Environment.GetEnvironmentVariable("USERPROFILE");
     if (base_path == null)
         base_path = Environment.GetEnvironmentVariable("HOME");
     if (base_path == null)
         base_path = Path.GetDirectoryName(Application.ExecutablePath);
     this._settings_file_name = Path.Combine(base_path, ".wialon_ips_emulator.settings");
     this._log_file_name = Path.Combine(base_path, ".wialon_ips_emulator.log");
     this.tmrPing = new System.Threading.Timer(new TimerCallback(this.PingTimerCallback), null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
 }
Exemplo n.º 3
0
 // =========================================================================================================
 public MainForm()
 {
     InitializeComponent();
     this.AddToLog = new AddToTextBoxDelegate(this.AddToLogMethod);
     this.AddToMessages = new AddToTextBoxDelegate(this.AddToMessagesMethod);
     this.Log = new CLog(this.tbLog, this.AddToLog);
     this.Messages = new CMessages(this.tbMessages, this.AddToMessages);
     this._settings_file_name = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "settings.xml");
     this._last_log_file_name = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "last_log.txt");
     this.tmrPing = new System.Threading.Timer(new TimerCallback(this.PingTimerCallback), null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
 }