Ejemplo n.º 1
0
 public void Initialize(CoreMain mainGame, GraphicsDevice graphicsDevice)
 {
     m_mainGame = mainGame;
     m_graphicsDevice = graphicsDevice;
     m_spriteBatch = new SpriteBatch(m_graphicsDevice);
     m_renderObjects = new LinkedList<RenderObject>();
 }
Ejemplo n.º 2
0
 private void SortableListView_Loaded(object sender, RoutedEventArgs e)
 {
     sv = CoreMain.FindVisualChild <ScrollViewer>(this);
     if (sv != null)
     {
         sv.ScrollChanged += sv_ScrollChanged;
     }
 }
Ejemplo n.º 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            OwnerWindow.MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Theme;

            var mySettings = new MetroDialogSettings()
            {
                AffirmativeButtonText    = "Yes",
                NegativeButtonText       = "Not now",
                FirstAuxiliaryButtonText = "Never",
                ColorScheme = MetroDialogColorScheme.Theme
            };

            var result = UserRequest.ShowDialogBox("New updates available! Do you want to update now?",
                                                   "Yes", "Not now", "Never", "UPDATE");

            if (result != ConfirmResult.Auxiliary)
            {
                switch (result)
                {
                case ConfirmResult.Negative:

                    break;

                case ConfirmResult.Affirmative:
                    const int ERROR_CANCELLED = 1223;                             //The operation was canceled by the user.

                    ProcessStartInfo info = new ProcessStartInfo(CoreMain.MyPath() + @"\upd.exe");
                    info.UseShellExecute = true;
                    info.Verb            = "runas";
                    try
                    {
                        Process.Start(info);
                        App.Current.Shutdown();
                    }
                    catch (Win32Exception ex)
                    {
                        if (ex.NativeErrorCode == ERROR_CANCELLED)
                        {
                            OwnerWindow.ShowMessageAsync("Error", "Update was cancelled!");
                        }
                    }
                    break;

                case ConfirmResult.Auxiliary:
                    Settings.Default.checkUpdates = false;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }
        public MainWindow()
        {
            Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            InitializeComponent();
            this.Hide();
            TextBox_SSID.Text = configuration.AppSettings.Settings["SSID"].Value;

            CoreMain core       = new CoreMain();
            Thread   coreThread = new Thread(new ThreadStart(core.runCore));

            coreThread.IsBackground = true;
            coreThread.Start();     // 主程序运行
        }
Ejemplo n.º 5
0
        public Updates()
        {
            InitializeComponent();

            SupportSkinner.SetSkin(this);
            InvalidateVisual();
            Definition cdef = Util.BinaryDeSerializeObject <Definition>(CoreMain.MyPath() + @"\myDef.bin");

            if (cdef != null)
            {
                currentVersion.Text = "Current version details:\nVersion: \t" + cdef.Version + "\nReleased on:" +
                                      cdef.ReleasedDateTime.ToShortDateString();
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 导出脚本
        /// </summary>
        /// <param name="connName">连接库</param>
        /// <param name="name">名称</param>
        /// <param name="xmlPath">xml路径</param>
        /// <param name="outPutPath">导出地址</param>
        public void ExportScript(string connName, string name, string xmlPath, string outPutPath)
        {
            Method(connName, name, xmlPath, (ms, my, oracl, sqllite) =>
            {
                if (ms != null)
                {
                    CoreMain.GetInstance().CoreOutPut(factoryConfig.SQLConnDict[connName], name, ms, factoryConfig.MaxCondition[connName], Core.DBType.MSSQL, outPutPath);
                }

                if (sqllite != null)
                {
                    CoreMain.GetInstance().CoreOutPut(factoryConfig.SQLConnDict[connName], name, sqllite, factoryConfig.MaxCondition[connName], Core.DBType.SQLLITE, outPutPath);
                }
            });
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 构建代码
        /// </summary>
        /// <param name="connName">连接库</param>
        /// <param name="name">存储名称</param>
        /// <param name="xmlPath">xml资源路径</param>
        public void BuildMethod(string connName, string name, string xmlPath)
        {
            Method(connName, name, xmlPath, (ms, my, oracl, sqllite) =>
            {
                if (ms != null)
                {
                    CoreMain.GetInstance().CoreBuild(factoryConfig.SQLConnDict[connName], name, ms, factoryConfig.MaxCondition[connName], Core.DBType.MSSQL);
                }

                if (sqllite != null)
                {
                    CoreMain.GetInstance().CoreBuild(factoryConfig.SQLConnDict[connName], name, sqllite, factoryConfig.MaxCondition[connName], Core.DBType.SQLLITE);
                }
            });
        }
Ejemplo n.º 8
0
        public static void Start(string[] args)
        {
            if (WriteLineEvent == null || WriteEvent == null)
            {
                throw new NullReferenceException();
            }

            MethodInfo WriteLineMethod = null, WriteMethod = null;

            foreach (var m in typeof(Main).GetMethods())
            {
                if (m.Name == "WriteLine")
                {
                    WriteLineMethod = m;
                }
                else if (m.Name == "Write")
                {
                    WriteMethod = m;
                }
            }

            GlobalVars.API = new APICore(new Main(), WriteLineMethod, WriteMethod);
            CoreMain.Init(args);
        }