コード例 #1
0
        private void SaveEcryptCtrlDataSettings(EcryptCtrlMsgStruct ecm)
        {
            StreamWriter writer;

            if (File.Exists(_EncryCtrlRestoredFilePath))
            {
                if ((File.GetAttributes(_EncryCtrlRestoredFilePath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
                {
                    MessageBox.Show(string.Format("File is read only - Window locations were not saved!\n{0}", _EncryCtrlRestoredFilePath), "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }
                writer = new StreamWriter(_EncryCtrlRestoredFilePath);
            }
            else
            {
                writer = File.CreateText(_EncryCtrlRestoredFilePath);
            }
            if (writer != null)
            {
                writer.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                writer.WriteLine("<EncryptionControl>");
                string       str2   = string.Empty;
                string       format = string.Empty;
                frmEncryCtrl encryptCtrlFormHandle = frmEncryCtrl.encryptCtrlFormHandle;
                format = "<Window name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\" LevelChange=\"{6}\" strDbgLevels=\"{7}\" >";
                str2   = string.Format(format, new object[] { encryptCtrlFormHandle.Name, encryptCtrlFormHandle.Top.ToString(), encryptCtrlFormHandle.Left.ToString(), encryptCtrlFormHandle.Width.ToString(), encryptCtrlFormHandle.Height.ToString(), encryptCtrlFormHandle.WindowState.ToString(), EcryptCtrlMsg.LevelChange.ToString(), EcryptCtrlMsg.strDbgLevels });
                writer.WriteLine(str2);
                writer.WriteLine("</Window>");
                writer.WriteLine("</EncryptionControl>");
                writer.Close();
            }
        }
コード例 #2
0
ファイル: frmEncryCtrl.cs プロジェクト: facchinm/SiRFLive
 public frmEncryCtrl(CommunicationManager mainComWin)
 {
     this.InitializeComponent();
     encryptCtrlFormHandle = this;
     this.currentDirInfo = Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory);
     this.InstalledDirectory = this.currentDirInfo.Parent.FullName;
     _EncryCtrlRestoredFilePath = ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Config\EncryptControlRestore.xml";
     this.CommWindow = mainComWin;
     this.CMC = new CommMgrClass();
     this.DrawTheEncryptControl(this.EncryCtrlDataGridView);
     this.AddRowNamesToEncryptControl(this.EncryCtrlDataGridView);
     this.SetAllCheckBoxesToAValue(this.EncryCtrlDataGridView, false);
 }
コード例 #3
0
 public frmEncryCtrl(CommunicationManager mainComWin)
 {
     this.InitializeComponent();
     encryptCtrlFormHandle      = this;
     this.currentDirInfo        = Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory);
     this.InstalledDirectory    = this.currentDirInfo.Parent.FullName;
     _EncryCtrlRestoredFilePath = ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Config\EncryptControlRestore.xml";
     this.CommWindow            = mainComWin;
     this.CMC = new CommMgrClass();
     this.DrawTheEncryptControl(this.EncryCtrlDataGridView);
     this.AddRowNamesToEncryptControl(this.EncryCtrlDataGridView);
     this.SetAllCheckBoxesToAValue(this.EncryCtrlDataGridView, false);
 }
コード例 #4
0
ファイル: frmCommOpen.cs プロジェクト: facchinm/SiRFLive
 internal frmEncryCtrl CreateEncrypCtrlWin()
 {
     if (!base.IsDisposed)
     {
         string str = this.comm.sourceDeviceName + ": Set Developer Debug Levels";
         if ((this._encryCtrl == null) || this._encryCtrl.IsDisposed)
         {
             this._encryCtrl = new frmEncryCtrl(this.comm);
             this._encryCtrl.Show();
         }
         this._encryCtrl.CommWindow = this.comm;
         this._encryCtrl.Text = str;
         this._encryCtrl.updateMainWindow += new frmEncryCtrl.updateParentEventHandler(this.updateSubWindowState);
         this._encryCtrl.BringToFront();
     }
     else
     {
         MessageBox.Show("COM window not initialized!", "Information");
     }
     return this._encryCtrl;
 }
コード例 #5
0
ファイル: frmCommOpen.cs プロジェクト: facchinm/SiRFLive
        internal void updateSubWindowState(string subWinName)
        {
            EventHandler method = null;
            EventHandler handler2 = null;
            EventHandler handler3 = null;
            EventHandler handler4 = null;
            EventHandler handler5 = null;
            EventHandler handler6 = null;
            switch (subWinName)
            {
                case "frmCommInputMessage":
                    this._inputCommands = null;
                    return;

                case "frmCommRadarMap":
                    this._signalMapPanel = null;
                    if (method == null)
                    {
                        method = delegate {
                            this.toolBarRadarBtn.CheckState = CheckState.Unchecked;
                        };
                    }
                    base.Invoke(method);
                    return;

                case "frmEncryCtrl":
                    this._encryCtrl = null;
                    return;

                case "frmSatelliteStats":
                    this._SatelliteStats = null;
                    return;

                case "frmCommLocationMap":
                    this._locationViewPanel = null;
                    if (handler2 == null)
                    {
                        handler2 = delegate {
                            this.toolBarLocationBtn.CheckState = CheckState.Unchecked;
                        };
                    }
                    base.Invoke(handler2);
                    return;

                case "frmCommSignalView":
                    this._signalStrengthPanel = null;
                    if (handler3 == null)
                    {
                        handler3 = delegate {
                            this.toolBarSignalViewBtn.CheckState = CheckState.Unchecked;
                        };
                    }
                    base.Invoke(handler3);
                    return;

                case "frmCommMessageFilter":
                    this._messageFilterCustom = null;
                    return;

                case "frmTTFFDisplay":
                    this._ttffDisplay = null;
                    if (handler4 == null)
                    {
                        handler4 = delegate {
                            this.toolBarTTFFBtn.CheckState = CheckState.Unchecked;
                        };
                    }
                    base.Invoke(handler4);
                    return;

                case "frmInterferenceReport":
                    this._interferenceReport = null;
                    return;

                case "frmSiRFAware":
                    this._SiRFAware = null;
                    return;

                case "frmCommResponseView":
                    this._responseView = null;
                    if (handler5 == null)
                    {
                        handler5 = delegate {
                            this.toolBarResponseViewBtn.CheckState = CheckState.Unchecked;
                        };
                    }
                    base.Invoke(handler5);
                    return;

                case "frmCommErrorView":
                    this._errorView = null;
                    if (handler6 == null)
                    {
                        handler6 = delegate {
                            this.toolBarErrorViewBtn.CheckState = CheckState.Unchecked;
                        };
                    }
                    base.Invoke(handler6);
                    return;
            }
        }
コード例 #6
0
ファイル: frmMDIMain.cs プロジェクト: facchinm/SiRFLive
 public void CreateEncrypCtrlWin(ref PortManager target)
 {
     if (target != null)
     {
         if (!base.IsDisposed)
         {
             string str = target.comm.sourceDeviceName + ": Set Developer Debug Levels";
             frmEncryCtrl ctrl = new frmEncryCtrl(target.comm);
             ctrl.CommWindow = target.comm;
             ctrl.Text = str;
             ctrl.ShowDialog();
         }
         else
         {
             MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         }
     }
 }
コード例 #7
0
ファイル: frmMDIMain.cs プロジェクト: facchinm/SiRFLive
 public void CreateEncrypCtrlWin()
 {
     if (PortManagerHash.Count > 0)
     {
         bool flag = false;
         PortManager manager = null;
         foreach (string str in PortManagerHash.Keys)
         {
             if (!(str == clsGlobal.FilePlayBackPortName))
             {
                 manager = (PortManager) PortManagerHash[str];
                 if ((manager != null) && manager.comm.IsSourceDeviceOpen())
                 {
                     flag = true;
                     break;
                 }
             }
         }
         if (flag && (manager != null))
         {
             string str2 = "Set Debug Level: All";
             frmEncryCtrl ctrl = new frmEncryCtrl(manager.comm);
             ctrl.CommWindow = manager.comm;
             ctrl.Text = str2;
             ctrl.ShowDialog();
         }
     }
 }
コード例 #8
0
ファイル: frmMDIMain.cs プロジェクト: facchinm/SiRFLive
 private object GetContentFromPersistString(string persistString)
 {
     if (persistString == typeof(frmAutomationTests).ToString())
     {
         _objFrmAutoTest = CreateAutomationTestWindow();
         return _objFrmAutoTest;
     }
     if (persistString == typeof(frmPerformanceMonitor).ToString())
     {
         _objFrmPerfMonitor = CreatefrmPerformanceMonitorWindow();
         return _objFrmPerfMonitor;
     }
     if (persistString == typeof(frmPython).ToString())
     {
         _objFrmPython = CreatePythonWindow();
         return _objFrmPython;
     }
     if (persistString == typeof(frmCommInputMessage).ToString())
     {
         if ((_objFrmCommOpen != null) && !_objFrmCommOpen.IsDisposed)
         {
             _objFrmCommInputMessage = new frmCommInputMessage();
             _objFrmCommInputMessage.CommWindow = _objFrmCommOpen.comm;
             _objFrmCommOpen._inputCommands = _objFrmCommInputMessage;
         }
         return _objFrmCommInputMessage;
     }
     if (persistString == typeof(frmCommLocationMap).ToString())
     {
         if ((_objFrmCommOpen != null) && !_objFrmCommOpen.IsDisposed)
         {
             _objFrmCommLocationMap = new frmCommLocationMap();
             _objFrmCommLocationMap.CommWindow = _objFrmCommOpen.comm;
             _objFrmCommOpen._locationViewPanel = _objFrmCommLocationMap;
         }
         return _objFrmCommLocationMap;
     }
     if (persistString == typeof(frmCommSignalView).ToString())
     {
         if ((_objFrmCommOpen != null) && !_objFrmCommOpen.IsDisposed)
         {
             _objFrmCommSignalView = new frmCommSignalView();
             _objFrmCommSignalView.CommWindow = _objFrmCommOpen.comm;
             _objFrmCommOpen._signalStrengthPanel = _objFrmCommSignalView;
         }
         return _objFrmCommSignalView;
     }
     if (persistString == typeof(frmEncryCtrl).ToString())
     {
         if ((_objFrmCommOpen != null) && !_objFrmCommOpen.IsDisposed)
         {
             _objFrmEncryCtrl = new frmEncryCtrl(_objFrmCommOpen.comm);
             _objFrmEncryCtrl.CommWindow = _objFrmCommOpen.comm;
         }
         return _objFrmEncryCtrl;
     }
     if (persistString == typeof(frmRFCaptureCtrl).ToString())
     {
         _objFrmCaptureCtrl = CreateRFReplayCaptureWindow();
         return _objFrmCaptureCtrl;
     }
     if (persistString == typeof(frmRFPlaybackConfig).ToString())
     {
         _objFrmRFPlaybackConfig = CreateRFReplayConfigWindow();
         return _objFrmRFPlaybackConfig;
     }
     if (persistString == typeof(frmRFPlaybackCtrl).ToString())
     {
         _objFrmRFPlaybackCtrl = CreateRFReplayPlaybackWindow();
         return _objFrmRFPlaybackCtrl;
     }
     if (persistString == typeof(frmSimplexCtrl).ToString())
     {
         _objFrmSimplexCtrl = frmSimplexCtrl.GetChildInstance();
         return _objFrmSimplexCtrl;
     }
     if (persistString == typeof(frmSPAzCtrl).ToString())
     {
         _objFrmSPAzCtrl = frmSPAzCtrl.GetChildInstance();
         return _objFrmSPAzCtrl;
     }
     if (persistString == typeof(frmRackCtrl).ToString())
     {
         _objFrmRackCtrl = frmRackCtrl.GetChildInstance();
         return _objFrmRackCtrl;
     }
     if (persistString == typeof(frmE911Report).ToString())
     {
         _objFrmE911Report = frmE911Report.GetChildInstance("E911");
         return _objFrmE911Report;
     }
     if (persistString == typeof(frmNavPerformanceReport).ToString())
     {
         _objFrmNavPerformanceReport = frmNavPerformanceReport.GetChildInstance();
         return _objFrmNavPerformanceReport;
     }
     /*
      * //!
     if (persistString == typeof(frmGPIBCtrl).ToString())
     {
         _objFrmGPIBCtrl = frmGPIBCtrl.GetChildInstance();
         return _objFrmNavPerformanceReport;
     }
      */
     if (persistString.Contains("frmCommOpen"))
     {
         _objFrmCommOpen = new frmCommOpen();
         return _objFrmCommOpen;
     }
     return null;
 }