コード例 #1
0
        public static void Main()
        {
            Thread.CurrentThread.SetApartmentState(ApartmentState.STA);

            if (!Debugger.IsAttached &&
                OneProgramInstance.HasAnotherInstance &&
                MessageBox.Show(
                    "Do you want to proceed anyway?",
                    "Another instance of Tomato25 is running already",
                    MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.No)
            {
                return;
            }

            Application app = new Application();

            // Setup Quick Converter.
            // Add the System namespace so we can use primitive types (i.e. int, etc.).
            EquationTokenizer.AddNamespace(typeof(object));
            // Add the System.Windows namespace so we can use Visibility.Collapsed, etc.
            EquationTokenizer.AddNamespace(typeof(Visibility));
            EquationTokenizer.AddNamespace(typeof(TimeSpan));
            EquationTokenizer.AddNamespace(typeof(string));
            EquationTokenizer.AddNamespace(typeof(Mode));

            MainWindow mainWindow = new MainWindow();

            NotifyIconManager.Init(mainWindow.Model);

            app.Run(mainWindow);
        }
コード例 #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            EquationTokenizer.AddNamespace(typeof(object));
            EquationTokenizer.AddNamespace(typeof(System.Windows.Visibility));

            //bool existed;
            //string id = Marshal.GetTypeLibGuidForAssembly(Assembly.GetExecutingAssembly()).ToString();
            //MessageBox.Show(id);
            //Mutex mutex = new Mutex(true, id, out existed);
            //if (existed == false)
            //{
            //    MessageBox.Show("App is already opened");
            //    Application.Current.Shutdown();
            //    return;
            //}

            base.OnStartup(e);
        }
コード例 #3
0
        /// <summary>
        /// QuickConverter の設定を初期化します。
        /// </summary>
        private void InitializeQuickConverter()
        {
            // System
            EquationTokenizer.AddNamespace(typeof(System.Object));                   // System                  : mscorlib.dll
            EquationTokenizer.AddNamespace(typeof(System.IO.Path));                  // System.IO               : mscorlib.dll
            EquationTokenizer.AddNamespace(typeof(System.Text.Encoding));            // System.Text             : mscorlib.dll
            EquationTokenizer.AddNamespace(typeof(System.Reflection.Assembly));      // System.Reflection       : mscorlib.dll
            EquationTokenizer.AddNamespace(typeof(System.Windows.Point));            // System.Windows          : WindowsBase.dll
            EquationTokenizer.AddNamespace(typeof(System.Windows.UIElement));        // System.Windows          : PresentationCore.dll
            EquationTokenizer.AddNamespace(typeof(System.Windows.Input.Key));        // System.Windows.Input    : WindowsBase.dll
            EquationTokenizer.AddNamespace(typeof(System.Windows.Input.Cursor));     // System.Windows.Input    : PresentationCore.dll
            EquationTokenizer.AddNamespace(typeof(System.Windows.Controls.Control)); // System.Windows.Controls : PresentationFramework.dll
            EquationTokenizer.AddExtensionMethods(typeof(System.Linq.Enumerable));   // System.Linq             : System.Core.dll

            // Lib
            EquationTokenizer.AddNamespace(typeof(Microsoft.VisualBasic.Globals));   // Microsoft.VisualBasic   : Microsoft.VisualBasic.dll
            EquationTokenizer.AddNamespace(typeof(MyLib.Wpf.Interactions.InteractionNotification));
        }
コード例 #4
0
            public static void InitQuickConverter()
            {
#pragma warning disable IDE0049
                EquationTokenizer.AddNamespace(typeof(System.Object));                           // System                  : System.Runtime.dll
                EquationTokenizer.AddNamespace(typeof(System.IO.Path));                          // System.IO               : System.Runtime.dll
                EquationTokenizer.AddNamespace(typeof(System.Text.Encoding));                    // System.Text             : System.Runtime.dll
                EquationTokenizer.AddNamespace(typeof(System.Reflection.Assembly));              // System.Reflection       : System.Runtime.dll
                EquationTokenizer.AddNamespace(typeof(System.Windows.Point));                    // System.Windows          : WindowsBase.dll
                EquationTokenizer.AddNamespace(typeof(System.Windows.UIElement));                // System.Windows          : PresentationCore.dll
                EquationTokenizer.AddNamespace(typeof(System.Windows.Window));                   // System.Windows          : PresentationFramework.dll
                EquationTokenizer.AddNamespace(typeof(System.Windows.Input.Key));                // System.Windows.Input    : WindowsBase.dll
                EquationTokenizer.AddNamespace(typeof(System.Windows.Input.Cursor));             // System.Windows.Input    : PresentationCore.dll
                EquationTokenizer.AddNamespace(typeof(System.Windows.Input.KeyboardNavigation)); // System.Windows.Input    : PresentationFramework.dll
                EquationTokenizer.AddNamespace(typeof(System.Windows.Controls.Control));         // System.Windows.Controls : PresentationFramework.dll
                EquationTokenizer.AddNamespace(typeof(System.Windows.Media.Brush));              // System.Windows.Media    : PresentationFramework.dll
                EquationTokenizer.AddNamespace(typeof(System.Linq.Enumerable));                  // System.Linq             : System.Linq.dll
                EquationTokenizer.AddExtensionMethods(typeof(System.Linq.Enumerable));           // System.Linq             : System.Linq.dll
#pragma warning restore IDE0049
            }
コード例 #5
0
 public void OnInitialized(IContainerProvider containerProvider)
 {
     //Инициализация QuickConverter
     EquationTokenizer.AddNamespace(typeof(object));
     EquationTokenizer.AddNamespace(typeof(Visibility));
 }
コード例 #6
0
 public App()
 {
     //Инициализация QuickConverter
     EquationTokenizer.AddNamespace(typeof(object));
     EquationTokenizer.AddNamespace(typeof(Visibility));
 }