Пример #1
0
        /// <summary>
        /// SaveConnectionsCommandCF
        /// </summary>
        private void SaveConnectionsCommandCF()
        {
            MdiChild tw = GetTopMDIWindow();

            if (tw == null)
            {
                _logger.Info("Nothing to save!!");
                return;
            }

            string configFileName = LST.SaveFileDialog("Cmc Datein (*.cmc)|*.cmc;|Alle Dateien (*.*)|*.*\"");

            if (String.IsNullOrEmpty(configFileName))
            {
                return;
            }

            RecentFileList.InsertFile(configFileName);
            Filepath      = configFileName;
            _IsFileLoaded = true;
            _IsFileNamed  = true;

            ((UserControlTCPMDIChild)tw.Content).SetNewConnectionName(Path.GetFileName(configFileName));
            tw.Title = Path.GetFileName(configFileName);
            if (((UserControlTCPMDIChild)tw.Content).IsConnected)
            {
                tw.Title += " (!)";
            }
            else
            {
                tw.Title += " ( )";
            }
            Connection.Save(((UserControlTCPMDIChild)tw.Content).MyConnection, configFileName);
            _logger.Info(String.Format("Save Connection File {0}", configFileName));
        }
Пример #2
0
        /// <summary>
        /// SaveMessageFileAsCommandCF
        /// </summary>
        private void SaveMessageFileAsCommandCF()
        {
            MdiChild tw = GetTopMDIWindow();

            if (tw == null)
            {
                _logger.Info("Nothing to save!!");
                return;
            }

            string messageFileName = LST.SaveFileDialog("Cmm Datein (*.cmm)|*.cmm;|Alle Dateien (*.*)|*.*\"");

            if (String.IsNullOrEmpty(messageFileName))
            {
                return;
            }

            ((UserControlTCPMDIChild)tw.Content).MessageFileName = messageFileName;
            LST.SaveList <Message>(((UserControlTCPMDIChild)tw.Content).MessageList, messageFileName);
            _logger.Info(String.Format("Save MessageFile File As {0}", messageFileName));
        }