Пример #1
0
        private void Process_Initialize(ProcessForm processForm)
        {
            SaveConfigFormInfo();
            processForm.EndProcessForm();

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Пример #2
0
        private void Process_Initialize(ProcessForm processForm)
        {
            if (GlobalSetting.LoadGlobalSetting() == true)
            {
                ReloadOptionFormInfo();
            }
            else
            {
                MainForm.ShowPopupMessage("读取配置文件失败!", "可能文件不存在或格式错误。。。");
            }

            processForm.EndProcessForm();
        }
Пример #3
0
        private void Process_Initialize(ProcessForm processForm)
        {
            GlobalSetting.LoadGlobalRegistry();

            if (GlobalSetting.IsAutoLoadConfigSetting == true)
            {
                if (GlobalSetting.LoadGlobalSetting() == false)
                {
                    MainForm.ShowPopupMessage("读取配置文件失败!", "可能文件不存在或格式错误。。。", "请点击<主选项>的<设置配置文件>");
                }
            }

            this.m_OptionForm.Initialize();
            this.m_U50Form.Initialize();
            this.m_D50Form.Initialize();

            this.m_NotifyIcon.Visible = true;
            if (GlobalSetting.IsPopStartupInfo == true)
            {
                this.m_NotifyIcon.ShowBalloonTip(1000);
            }

            processForm.EndProcessForm();
        }
Пример #4
0
        private void Process_LoadNewDocument(ProcessForm processForm)
        {
            if (m_DirNumber != 0)
            {
                MSFL.MSFL1_CloseDirectory(m_DirNumber);

                m_SecurityDictionary.Clear();
                m_DirNumber = 0;
            }

            do
            {
                int iErr = MSFL.MSFL1_OpenDirectory(m_strSelectedPath, ref m_DirNumber, MSFL.MSFL_DIR_FORCE_USER_IN);
                if (iErr != (int)MSFL.MSFL_ERR.MSFL_NO_ERR)
                {
                    break;
                }

                MSFL.MSFLDirectoryStatus msflDirectoryStatus = new MSFL.MSFLDirectoryStatus();
                msflDirectoryStatus.dwTotalSize = (uint)Marshal.SizeOf(msflDirectoryStatus);

                iErr = MSFL.MSFL1_GetDirectoryStatus(m_DirNumber, string.Empty, ref msflDirectoryStatus);
                if (iErr != (int)MSFL.MSFL_ERR.MSFL_NO_ERR)
                {
                    break;
                }

                //MSFL.DisplayMSFLError( iErr );

                List <MSFL.MSFLSecurityInfo> listMSFLSecurityInfo = new List <MSFL.MSFLSecurityInfo>(1024);

                MSFL.MSFLSecurityInfo msflSecurityInfo = new MSFL.MSFLSecurityInfo();
                msflSecurityInfo.dwTotalSize = (uint)Marshal.SizeOf(msflSecurityInfo);

                if (msflDirectoryStatus.bExists &&          // if it exists
                    msflDirectoryStatus.bOpen &&            // AND if it's open
                    msflDirectoryStatus.bMetaStockDir)      // AND if it's a MetaStock directory...
                {
                    StringBuilder dateString = new StringBuilder(MSFL.MSFL_MAX_NAME_LENGTH + 1);

                    iErr = MSFL.MSFL1_GetFirstSecurityInfo(m_DirNumber, ref msflSecurityInfo);
                    while (iErr == (int)MSFL.MSFL_ERR.MSFL_NO_ERR || iErr == (int)MSFL.MSFL_Messages.MSFL_MSG_LAST_SECURITY_IN_DIR)
                    {
                        //m_SecurityDictionary.Add( listViewItem, msflSecurityInfo.hSecurity );

                        listMSFLSecurityInfo.Add(msflSecurityInfo);

                        if (iErr == (int)MSFL.MSFL_Messages.MSFL_MSG_LAST_SECURITY_IN_DIR)
                        {
                            break;
                        }

                        msflSecurityInfo             = new MSFL.MSFLSecurityInfo();
                        msflSecurityInfo.dwTotalSize = (uint)Marshal.SizeOf(msflSecurityInfo);

                        iErr = MSFL.MSFL1_GetNextSecurityInfo(msflSecurityInfo.hSecurity, ref msflSecurityInfo);
                    }
                }

                MSFL.MSFLSecurityInfo[] msflSecurityInfoArray = listMSFLSecurityInfo.ToArray();
                if (msflSecurityInfoArray.Length <= 0)
                {
                    break;
                }

                KLineViewFormSubForm klineViewFormSubForm = new KLineViewFormSubForm(msflSecurityInfoArray);
                if (klineViewFormSubForm.ShowDialog() == DialogResult.OK)
                {
                    msflSecurityInfoArray = klineViewFormSubForm.ToSecurityInfo();
                    if (msflSecurityInfoArray.Length > 0)
                    {
                        for (int iIndex = 0; iIndex < msflSecurityInfoArray.Length; iIndex++)
                        {
                            MSFL.MSFLSecurityInfo msflSecurityInfoIndex = msflSecurityInfoArray[iIndex];
                            KLineViewFormDocument frmDocument           = new KLineViewFormDocument(msflSecurityInfoIndex);
                            frmDocument.MdiParent = this;
                            frmDocument.Text      = msflSecurityInfoIndex.szName + "[" + msflSecurityInfoIndex.szSymbol + "]";
                            frmDocument.Show();
                        }
                    }
                }
            } while (false);

            processForm.EndProcessForm();
        }