Esempio n. 1
0
 /// <summary>
 /// 切换K线
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void rmiKLine_Click(object sender, EventArgs e)
 {
     if (fl != null && fl.DockState != DockState.Hidden)
     {
         fl.Text = DataManager.Instance.CurrentContractCode;
         fl.OpenData(DataManager.Instance.CurrentContractCode);
         this.radDock1.DockWindow(fl, DockPosition.Right);
     }
     else
     {
         fl = new FormKLine(DataManager.Instance.CurrentContractCode);
         fl.OpenData(DataManager.Instance.CurrentContractCode);
         this.radDock1.AddDocument(fl);
     }
 }
Esempio n. 2
0
        private PublishForm m_publishForm;     //供需发布窗口

        public MainForm()
        {
            InitializeComponent();
            this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea;
            this.radDock1.ShowDocumentCloseButton = true;
            this.radDock1.DocumentManager.DocumentCloseActivation = DocumentCloseActivation.FirstInZOrder;

            #region 滚动新闻栏
            mScrollingText                    = new MScrollingText();
            mScrollingText.Dock               = DockStyle.Fill;
            mScrollingText.Cursor             = Cursors.Hand;
            mScrollingText.Font               = new Font("微软雅黑", 14F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0)));
            mScrollingText.ForeColor          = Color.White;
            mScrollingText.Location           = new Point(0, 0);
            mScrollingText.Name               = "mScrollingText";
            mScrollingText.ScrollText         = "滚动新闻";
            mScrollingText.Size               = new Size(462, 65);
            mScrollingText.Text               = "mScrollingText";
            mScrollingText.TextScrollDistance = 2;
            mScrollingText.TextClicked       += new Action <MScrollingItem>(MScrollingText_TextClicked);
            panel2.Controls.Add(mScrollingText);

            for (int i = 0; i < 30; i++)
            {
                MScrollingItem item = new MScrollingItem();
                item.Text = "滚动新闻" + i;
                mScrollingText.Items.Add(item);
            }
            #endregion
            //CreatePanel("Tool Window", DockPosition.Right, new Size(this.Width / 2, this.Height / 2), Color.FromArgb(255, 192, 192));
            //CreatePanel("Tool Window", DockPosition.Top, new Size(this.Width / 2, this.Height / 2), Color.FromArgb(192, 255, 192));
            if (File.Exists("default.xml"))
            {
                radDock1.LoadFromXml("default.xml");
            }
            else
            {
                PublishForm windows1 = new PublishForm("供需发布");
                windows1.Initialize();
                this.radDock1.DockWindow(windows1, DockPosition.Bottom);
                this.radDock1.AutoHideWindow(windows1);

                FormBrowser docWindow5 = new FormBrowser("数据中心");
                this.radDock1.AddDocument(docWindow5);

                FormBrowser docWindow6 = new FormBrowser("资讯");
                this.radDock1.AddDocument(docWindow6);

                FormKLine docWindow4 = new FormKLine("K线");
                this.radDock1.AddDocument(docWindow4);

                FormBrowser docWindow2 = new FormBrowser("资金管理");
                this.radDock1.AddDocument(docWindow2);

                FormBrowser docWindow3 = new FormBrowser("基础管理");
                this.radDock1.AddDocument(docWindow3);

                MUseMainForm docWindow1 = new MUseMainForm("行情");
                this.radDock1.AddDocument(docWindow1);
            }

            foreach (DocumentWindow v in this.radDock1.DockWindows.DocumentWindows)
            {
                if (v.Text == "行情")
                {
                    table = v as MUseMainForm;
                    if (table != null)
                    {
                        table.SelectTextChangeEvent += new Action <object, string>(Table_SelectTextChangeEvent);
                    }
                }
                else if (v.Text == "资金管理")
                {
                    fbMoney = v as FormBrowser;
                }
                else if (v.Text == "基础管理")
                {
                    fbBase = v as FormBrowser;
                }
                else if (v.Text == "数据中心")
                {
                    fbDataCenter = v as FormBrowser;
                }
                else if (v.Text == "资讯")
                {
                    fbInformation = v as FormBrowser;
                }
                else if (v is FormKLine)
                {
                    fl = v as FormKLine;
                }
            }

            foreach (ToolWindow v in this.radDock1.DockWindows.ToolWindows)
            {
                if (v.Text == "供需发布")
                {
                    m_publishForm = v as PublishForm;
                }
            }

            ThemeResolutionService.ApplyThemeToControlTree(this, Program.vt1.ThemeName);
            DataManager.Instance.IsLoginingEvent                  += Instance_IsLoginingEvent;
            DataManager.Instance.IsLoginEvent                     += Instance_IsLoginEvent;
            DataManager.Instance.UpdataCommodityInfoEvent         += Instance_UpdataCommodityInfoEvent;
            DataManager.Instance.UpdataAllContractEvent           += Instance_UpdataAllContractEvent;
            DataManager.Instance.UpdataAllCommodityEvent          += Instance_UpdataAllCommodityEvent;
            USeManager.Instance.MQTTService.UpdataMarketDataEvent += MQTTService_UpdataMarketDataEvent;
            //初始化数据
            //DataManager.Instance.InitializationData();
            //USeManager.Instance.Start();

            if (fbDataCenter != null)
            {
                fbDataCenter.InitializeBrowser();
            }
            if (fbInformation != null)
            {
                fbInformation.InitializeBrowser();
            }
        }