コード例 #1
0
        /// <summary>
        /// OpenMessageFileCommandCF
        /// </summary>
        private void OpenMessageFileCommandCF()
        {
            MdiChild tw = GetTopMDIWindow();

            if (tw == null)
            {
                return;
            }

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

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

            ((UserControlTCPMDIChild)tw.Content).MessageList     = LST.LoadList <Message>(messageFileName);
            ((UserControlTCPMDIChild)tw.Content).MessageFileName = messageFileName;
            if (((UserControlTCPMDIChild)tw.Content).MessageList.Count > 0)
            {
                ((UserControlTCPMDIChild)tw.Content).FocusMessageIndex = 0;
                ((UserControlTCPMDIChild)tw.Content).FocusMessage      = ((UserControlTCPMDIChild)tw.Content).MessageList[0];
            }
            _logger.Info(String.Format("Lode MessageFile File {0}", messageFileName));
        }
コード例 #2
0
        /// <summary>
        /// LoadConnectionsCommandCF
        /// </summary>
        private void LoadConnectionsCommandCF()
        {
            double AcParentWindoHeight = ActualHeight;
            double AcParentWindoWidth  = ActualWidth;

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

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

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

            Connection newConnection = Connection.Load(configFileName);

            _logger.Info(String.Format("Load Connection File {0}", configFileName));

            MdiChild MdiChild = new MdiChild()
            {
                Title   = String.Format("{0} ( )", Path.GetFileName(configFileName)),
                Height  = (AcParentWindoHeight - MainMenu.ActualHeight - MainToolBar.ActualHeight) * 0.6,
                Width   = AcParentWindoWidth * 0.6,
                Content = new UserControlTCPMDIChild(newConnection, this)
            };

            ((UserControlTCPMDIChild)MdiChild.Content).TheMdiChild = MdiChild;
            MainMdiContainer.Children.Add(MdiChild);
        }