Example #1
0
 /// <summary>
 /// 加载
 /// </summary>
 /// <param name="name">名称</param>
 public void LoadXml(String name)
 {
     if (name == "MainFrame")
     {
         m_xml = new MainFrame();
     }
     m_xml.CreateNative();
     m_native                = m_xml.Native;
     m_native.Paint          = new GdiPlusPaintEx();
     m_host                  = new WinHostEx();
     m_host.Native           = m_native;
     m_native.Host           = m_host;
     m_host.HWnd             = Handle;
     m_native.AllowScaleSize = true;
     m_native.DisplaySize    = new SIZE(ClientSize.Width, ClientSize.Height);
     m_xml.ResetScaleSize(GetClientSize());
     m_xml.Script = new GaiaScript(m_xml);
     m_xml.Native.ResourcePath = DataCenter.GetAppPath() + "\\config";
     m_xml.Load(DataCenter.GetAppPath() + "\\config\\" + name + ".html");
     m_host.ToolTip      = new ToolTipA();
     m_host.ToolTip.Font = new FONT("SimSun", 20, true, false, false);
     (m_host.ToolTip as ToolTipA).InitialDelay = 250;
     m_native.Update();
     Invalidate();
     if (name == "MainFrame")
     {
         LoginForm loginForm = new LoginForm();
         loginForm.ShowDialog();
         DataCenter.StartService();
     }
 }
Example #2
0
        static void Main()
        {
            FormulaProxy.FormulaInit();
            IList <Formula> formulas = FormulaProxy.GetSystemFormulas();
            int             id       = 0;

            foreach (Formula la in formulas)
            {
                Formula formula = new Formula();
                FormulaProxy.GetDbFormula(id, ref formula);
                String text = Marshal.PtrToStringAnsi(formula.src);
                id++;
            }
            DataCenter.StartService();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MainForm mainFrom = new MainForm();

            mainFrom.LoadXml("MainFrame");
            Application.Run(mainFrom);
        }