Interaction logic for MainWindow.xaml
Inheritance: System.Windows.Window
Esempio n. 1
0
        public static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                MessageBox.Show("Pass the argument to the program: the directory with movies");
                return;
            }

            var model = EditorModelIO.Load(EditorModelIO.SubstituteDebugDirectories(args[0]));

            if (model.Montage.SoundIntervals == null || model.Montage.SoundIntervals.Count == 0)
            {
                try
                {
                    new Tuto.TutoServices.PraatService().DoWork(model);
                }
                catch(Exception e)
                {
                    MessageBox.Show("Praat failed. Separation by sound will not be available\n\n" + e.Message,
                        "Tuto.Editor",
                         MessageBoxButton.OK,
                          MessageBoxImage.Exclamation);
                }
            }

             var window = new MainWindow();
            window.DataContext=model;
            new Application().Run(window);
        }
        public MainWindow()
        {
            Instance = this;
            InitializeComponent();

            foreach (var v in worldView.GetStateNames())
                modeComboBox.Items.Add(v);
            modeComboBox.SelectedIndex = 0;

            worldView.StateChanged += new EventHandler(worldView_StateChanged);
            worldView.Frame += new Graphics.View.FrameEventHandler(worldView_Frame);

            worldView.InitEvent += new EventHandler(worldView_InitEvent);

            /*autoSaveTimer = new Timer();
            autoSaveTimer.Interval = 60 * 1000;
            autoSaveTimer.Tick += new EventHandler(autoSaveTimer_Tick);
            autoSaveTimer.Enabled = true;*/
        }
        static void Main(string[] args)
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture;
            foreach (var v in args)
            {
                var ss = v.Split('=');
                var p = Settings.GetType().GetProperty(ss[0].Substring(1));
                if (p != null)
                    p.SetValue(Settings, System.Convert.ChangeType(ss[1], p.PropertyType), null);
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            MainWindow m = new MainWindow();
            Graphics.GraphicsDevice.SettingsUtilities.Initialize(Graphics.GraphicsDevice.DeviceMode.Windowed);
            m.worldView.GraphicsDevice = new Graphics.GraphicsDevice.GraphicsDevice9() { Settings = ClientDefaultSettings.GraphicsDeviceSettings };
            Graphics.Application.Init(m);
            Application.Run(m);
        }
Esempio n. 4
0
        void LevelProperties_Loaded(object sender, RoutedEventArgs e)
        {
            if (!isLoaded)
            {
                mainWindow = this.TryFindParent<MainWindow>();
                Game = mainWindow.editor.Game;

                Game.LevelManager.LevelLoaded += new LevelLoadedEventHandler(Level_Loaded);

                isLoaded = true;
            }
        }
 public static void Init(MainWindow _window)
 {
     window = _window;
 }
Esempio n. 6
0
 public static void Init(MainWindow _window)
 {
     window = _window;
 }
 public CustomZoomWindow(MainWindow mainWindow)
 {
     this.mainWindow = mainWindow;
     InitializeComponent();
     numberBox.Focus();
 }