Inheritance: MonoBehaviour
        public void OpenNewWindow(IMainVM model)
        {
            if (model is IMainWindowVM)
                using (var container = AutofacHelper.Container)
                {
                    try
                    {
                        var newWindow = new MainView((IMainWindowVM)model);
                        newWindow.ShowDialog();
                    }
                    catch(UriFormatException)
                    {
                        throw new UriFormatException();
                    }
                }

            if (model is INewDownloadVM)
                using (var container = AutofacHelper.Container)
                {
                    var newWindow = new NewDownloadView((INewDownloadVM)model);
                    newWindow.ShowDialog();
                }

            //if (model is IAppSettingsVM)
            //    using (var container = AutofacHelper.Container)
            //    {
            //        var newWindow = new AppSettingsView((IAppSettingsVM)model);
            //        newWindow.ShowDialog();
            //    }
        }
Esempio n. 2
0
    public virtual IView Create(ViewTypes type)
    {
        IView view = null;
        switch (type) {
            case ViewTypes.GAME:
                view = new GameView(services.Updateables, services.GameService);
            break;
            case ViewTypes.INIT:
                view = new InitView();
            break;
            case ViewTypes.LOAD:
                view = new LoadView();
            break;
            case ViewTypes.MAIN:
                view = new MainView(services);
                break;
            case ViewTypes.RESULTS:
                view = new ResultsView(services);
                break;
            case ViewTypes.LEVEL_UP:
                view = new LevelUpView(services);
                break;
        }
        initView(view);

        return view;
    }
Esempio n. 3
0
        private static void Main(string[] args)
        {
            Options.Initialize(args);
            Encoding.Initalize(Settings.Default.UseUTF8);
            ZLib.Initialize();

            try
            {
                AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

                Settings.Default.Reload();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                var main = new MainView();
                foreach (string arg in Options.Value.Plugins)
                {
                    main.LoadPlugin(arg);
                }

                try
                {
                    Application.Run(main);
                    Settings.Default.Save();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error running main window: \n" + ex, Resources.ErrorText);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error initializing main view: \n" + ex, Resources.ErrorText);
            }
        }
Esempio n. 4
0
		public MainViewController()
		{
			View = mainView = new MainView(this)
			{
				ViewModel = new VMMainPage()
			};
			this.NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Add, (sender, args) => ShowVisitDetails(new VMVisit(new Visit(){VisitDateTime = DateTime.Now}, 0)));
		}
Esempio n. 5
0
 public ResultController(MainController mainController)
 {
     this.mainController = mainController;
     this.resultView = mainController.resultView;
     this.mainView = mainController.mainView;
     this.dataView = resultView.dataView;
     this.connection = mainController.dbConnection.connection;
     checkedItems = new List<int>();
 }
Esempio n. 6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var view = new MainView();
            var viewModel = new MainViewModel();

            view.DataContext = viewModel;
            view.Show();
        }
Esempio n. 7
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            VoiceDetector detector = new VoiceDetector(null, new System.Speech.Recognition.Choices(new string[] { "computer hello", "computer shields", "computer power", "computer attack" }));

            MainView gui = new MainView(detector);
            Application.Run(gui);
        }
Esempio n. 8
0
        static void Main()
        {
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

            _context = new AppContext();
            MainView view = new MainView(_context);
            _context.AddObject<IMessageOutput>(view);

            System.Windows.Forms.Application.Run(view);
        }
Esempio n. 9
0
        public App()
        {
            var rootwindow = new MainView();

            ViewService.Configure(e =>
            {
                e.RootWindow = rootwindow;
                e.Bind<ModalView, ModalViewModel>();
            });
            rootwindow.Show();
        }
        public void GetBinding_When_Valid_View_Passed_In()
        {
            //  Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            IView<MainFormModel> mainView = new MainView();

            //  Act
            var actualBinding = strategy.GetBinding(mainView);

            //  Assert
            Assert.IsTrue(actualBinding.Bindings.Any());
            Assert.IsTrue(actualBinding.Bindings.First().PresenterType == typeof(MainEntryMenuPresenter));
        }
Esempio n. 11
0
 /// <summary>
 /// 今開いているROMを閉じる
 /// </summary>
 /// <returns>実際に閉じたならfalse, 閉じなかったならtrue</returns>
 public bool closeRomFile()
 {
     try
     {
         rom.Dispose();
         rom = null;
         mainView.Dispose();
         objectPlaceList.mainView = mainView = null;
         setInfoStatusText("ROM closed");
         return false;
     }
     catch (ROM.UserCancel)
     {
         return true;
     }
 }
Esempio n. 12
0
        /// <summary>
        /// All the variables are initialized here.
        /// </summary>
        private void Initialize()
        {
            //Other
            this.resultModelList = new List<ResultModel>();
            this.resultList = new ArrayList();

            //Model
            dbConnection = new ConnectionModel();

            //View
            this.mainForm = new MainForm();
            this.mainView = new MainView(this);
            this.adminLoginView = new AdminLoginView();
            this.inleesView = new InleesView(this);
            this.resultView = new ResultView(this);
            this.loadMapView = new LoadMapView(this);
            this.statisticView = new StatisticView(this);

            //Controller
            this.mainViewController = new MainViewController(this);
            this.inleesViewController = new InleesViewController(this);
            this.resultController = new ResultController(this);
            this.resultDialogController = new ResultDialogController(this);
            this.colonyController = new ColonyController();
            this.fileSelectController = new FileController(this);
            this.statisticController = new StatisticController(this);

            // ADD INLEESVIEW AND RESULTVIEW TO MAINVIEW
            this.mainViewController.AddToPage(inleesView, 0);
            this.mainViewController.AddToPage(resultView, 1);
            this.mainViewController.AddToPage(statisticView, 2);
            this.mainForm.Controls.Add(mainView);
            this.mainView.Dock = DockStyle.Fill;
            this.resultView.Dock = DockStyle.Fill;
            this.statisticView.Dock = DockStyle.Fill;

            // START APP
            Application.EnableVisualStyles();
            Application.Run(mainForm);
        }
Esempio n. 13
0
    public MainApp()
    {
        pm = new PreferencesModel(prefsPath);
        //dbm = new MySqlPartsDb();
        dbm = new SqlPartsDb();
        mv = new MainView();
        pm.Changed += new EventHandler(PrefsChanged);
        mv.PrefsView.OnSavePrefs += pm.Save;
        mv.RawSqlView.OnSQLExecute += SQLExecute;
        mv.PartsView.OnShowParts += ShowParts;
        mv.PartsView.OnEditPart += EditPart;
        mv.PartsView.OnNewPart += NewPart;
        mv.PartsView.OnDeletePart += DeletePart;
        mv.PartsView.OnRepairMissingAttributes += RepairMissingAttributes;
        mv.PartEditView.OnSavePart += SavePart;

        pm.Load();

        dbm.GetPartTypes(delegate(List<PartType> partTypes) {
            mv.PartsView.PartTypes = partTypes;
        }, null);
    }
Esempio n. 14
0
        public void ChangeProperties()
        {
            // Получаем текущий документ, его БД и Editor
            Document acDocument = Application.DocumentManager.MdiActiveDocument;
            Database acCurDb = acDocument.Database;
            Editor acEditor = acDocument.Editor;

            // Начинаем транзакцию
            Transaction transaction = acCurDb.TransactionManager.StartTransaction();

            #if !DEBUG
            try
            {
            #endif
                // Создаём окно плагина
                MainView mainWindow = new MainView();

                //Создаём модель данных
                DataService dataService = new DataService(transaction, acCurDb, acEditor);

                //Создаём viewmodel и соединяем элементы под MVVM
                MainViewModel mainViewModel = new MainViewModel(dataService);
                mainWindow.DataContext = mainViewModel;

                //Вызов окна плагина в режиме диалога
                Application.ShowModalWindow(mainWindow);
            #if !DEBUG
            }
            catch (Exception exception)
            {
                acEditor.WriteMessage("Error: " + exception.Message);
            }
            #endif

            // Освобождение транзакции, если у транзакции не было Commit(), то изменения не применяются
            transaction.Dispose();
        }
Esempio n. 15
0
File: Map.cs Progetto: anta-/YSedit
        /// <summary>
        /// Mapに関してデータを読み、初期化をする
        /// </summary>
        /// <exception cref="ArgumentException">mapNumberが大きすぎた場合</exception>
        /// <exception cref="DataException">mapNumberが無効なマップを指している、またはROMが壊れている場合</exception>
        public Map(ROM rom_, byte mapNumber, MainView mainView)
        {
            rom = rom_;
            romIF = rom.romIF;
            this.mainView = mainView;
            mainView.onChanged += () => { rom.newChange(true); };

            if (romIF.mapNumbers <= mapNumber)
                throw new ArgumentException("map number is too big");

            currentMapNumber = mapNumber;
            ustruct5 = rom.readData(romIF.ustruct5Table + mapNumber * romIF.ustruct5_size, romIF.ustruct5_size);
            var iUStruct3 = ustruct5.getDataID(romIF.uttruct5_iUStruct3);
            ustruct3 = rom.readData(iUStruct3, romIF.ustruct3_size);
            var iiPlaceVector = ustruct3.getDataID(romIF.ustruct3_iiPlaceVector);
            var iPlaceVector = rom.readData(iiPlaceVector, 4).getDataID(0);
            placeVector = rom.readData(iPlaceVector, romIF.placeVector_size);
            var iObjPlaces = placeVector.getDataID(romIF.placeVector_iObjPlaces);
            var objPlaces = rom.readData(iObjPlaces,
                placeVector.getHalf(romIF.placeVector_numberOfObjPlaces) * romIF.objPlaceC_size);

            mainView.setObjPlaces(objPlaces);   //objPlacesはmainViewが持つ
            mainView.size = new System.Drawing.Size(0x2000, 0x200); //TODO: データから読み込む
        }
Esempio n. 16
0
        public void SetUp()
        {
//			view = new DynamicMock("MainView", typeof(IWinMainView));
            view      = new MainView();
            presenter = new MainPresenterTestInt(view);
        }
Esempio n. 17
0
 public GetDocumentData(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
Esempio n. 18
0
 private void OnStartup(object sender, StartupEventArgs e)
 {
     var view = new MainView();
     view.DataContext = new MainViewModel(new BlockingMediator());
     view.Show();
 }
Esempio n. 19
0
 static ViewLocator()
 {
     MainView = new MainView();
 }
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (HomeItem.IsSelected)
            {
                if (!DataUnit.IsSignUp)
                {
                    UnsignedError();
                }
                else
                {
                    MainView.Navigate(typeof(UserWelcome));
                    SplitVIew.IsPaneOpen = false;
                }
            }
            else if (QuickDiaryItem.IsSelected)
            {
                if (!DataUnit.IsSignUp)
                {
                    UnsignedError();
                }
                else
                {
                    MainView.Navigate(typeof(QuickDiary));
                    SplitVIew.IsPaneOpen = false;
                }
            }
            else if (DailyDiaryItem.IsSelected)
            {
                if (!DataUnit.IsSignUp)
                {
                    UnsignedError();
                }
                else
                {
                    MainView.Navigate(typeof(Diary));
                    SplitVIew.IsPaneOpen = false;
                }
            }
            else if (SearchItem.IsSelected)
            {
                if (!DataUnit.IsSignUp)
                {
                    UnsignedError();
                }
                else
                {
                    MainView.Navigate(typeof(Search));
                    SplitVIew.IsPaneOpen = false;
                }
            }

            /*else if (AboutUsItem.IsSelected)
             * {
             *  if (!DataUnit.IsSignUp)
             *  {
             *      MainView.Navigate(typeof(Welcome));
             *      SplitVIew.IsPaneOpen = false;
             *  }
             *  else
             *  {
             *      MainView.Navigate(typeof(UserWelcome));
             *      SplitVIew.IsPaneOpen = false;
             *  }
             * }*/
        }
Esempio n. 21
0
        /// <summary>
        /// pathのROMファイルを開く。既に開いていたら閉じる
        /// </summary>
        /// <returns>成功したかどうか</returns>
        public bool openRomFile(string path)
        {
            Action<string> err = s =>
            {
                MessageBox.Show(s, "Error");
            };

            if (rom != null)
                closeRomFile();

            bool proceeded = false;
            try
            {
                rom = new ROM(path);
                rom.changedChanged += romChangedChanged;

                objectPlaceList.mainView = rom.mainView = mainView =
                     new MainView(mainViewPanel, rom.romIF,
                         objectPlaceList, objectSelector);

                rom.openPracticeMap();
                setInfoStatusText("ROM \"" + path + "\", practice map opened");
                proceeded = true;
            }
            catch (System.IO.IOException)
            {
                err("Can't open ROM file");
            }
            catch (UnauthorizedAccessException)
            {
                err("Can't open ROM file");
            }
            catch (ROM.UnknownROMException)
            {
                err("Unknown ROM file");
            }
            catch (DataException e)
            {
                err("ROM is broken (" + e.Message + ")");
            }
            finally
            {
                if (!proceeded)
                {
                    if (rom != null)
                        rom.Dispose();
                    rom = null;
                    if (mainView != null)
                        mainView.Dispose();
                    mainView = null;
                }
            }
            return proceeded;
        }
 public NetworkController(MainView mainView)
 {
     this.mainView    = mainView;
     ioController     = new IOController();
     progressScanning = mainView.getMainProgressBar();
 }
Esempio n. 23
0
 public MainViewController(MainController mainController)
 {
     this.mainView = mainController.mainView;
     this.mainController = mainController;
 }
 public void detach()
 {
     mView = null;
 }
 public void attach(MainView mainForm)
 {
     mView = mainForm;
 }
 public MainPresenterImpl()
 {
     mModel    = DataManager.getInstance();
     mGameList = null;
     mView     = null;
 }
Esempio n. 27
0
        private async void App_OnStartup(object sender, StartupEventArgs e)
        {
            try
            {
                Log.Info("Boot strapping the services and UI.");

                //Apply theme
                applyTheme();

                //Create services
                var              errorNotifyingServices = new List <INotifyErrors>();
                IAudioService    audioService           = new AudioService();
                IKeyStateService keyStateService        = new KeyStateService();
                IInputService    inputService           = CreateInputService();
                errorNotifyingServices.Add(audioService);
                errorNotifyingServices.Add(inputService);

                //Load pronunciation and quiz from files
                var pronunciation = LoadPronunciation();

                //Compose UI
                mainWindow = new MainWindow(audioService, inputService);
                var mainViewModel = new MainViewModel(audioService, inputService,
                                                      keyStateService, errorNotifyingServices, pronunciation);
                var mainView = new MainView {
                    DataContext = mainViewModel
                };
                mainWindow.Content = mainView;

                //Setup actions to take once main view is loaded (i.e. the view is ready, so hook up the services which kicks everything off)
                Action postMainViewLoaded = () =>
                {
                    mainViewModel.AttachServiceEventHandlers();
                };
                if (mainView.IsLoaded)
                {
                    postMainViewLoaded();
                }
                else
                {
                    RoutedEventHandler loadedHandler = null;
                    loadedHandler = (s, a) =>
                    {
                        postMainViewLoaded();
                        mainView.Loaded -= loadedHandler; //Ensure this handler only triggers once
                    };
                    mainView.Loaded += loadedHandler;
                }

                //Show the main window
                mainWindow.Show();

                await CheckForUpdates(inputService, audioService, mainViewModel);

                inputService.RequestResume(); //Start the input service
            }
            catch (Exception ex)
            {
                Log.Error("Error starting up application", ex);
                throw;
            }
        }
Esempio n. 28
0
 public GetCurrentWorkorder(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
Esempio n. 29
0
 public MainController()
 {
     _view = new MainView(this);
     _settingsController = new SettingsController(this);
     _presentationController = new PresentationController(this);
 }
Esempio n. 30
0
        public ActionResult SetMainScreen(int id, MainView view)
        {
            Initalize(id);

            if (player.Ship != null)
                player.Ship.MainView = view;

            return null;
        }
Esempio n. 31
0
        public App()
        {
            InitializeComponent();

            MainPage = new MainView();
        }
 public GetNextSerialNumber(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
Esempio n. 33
0
 public App()
 {
     MainPage = new MainView();
 }
Esempio n. 34
0
 public MainModel(MainView mainView)
 {
     MainView = mainView;
 }
Esempio n. 35
0
 public MainView()
 {
     InitializeComponent();
     View = this;
 }
Esempio n. 36
0
 private void OnStartup(object sender, StartupEventArgs e)
 {
     // Create the ViewModel and expose it using the View's DataContext
     var view = new MainView { DataContext = new MainViewModel() };
     view.Show();
 }
 public InitializeMainGUI(IMSApiSessionContextStruct sessionContext, ApplicationConfiguration config, MainView view, LanguageResources lang)
 {
     this.sessionContext = sessionContext;
     this.config         = config;
     this.view           = view;
     this.lang           = lang;
 }
Esempio n. 38
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var mainView = new MainView();

            mainView.Show();
        }
Esempio n. 39
0
 static void Main(string[] args)
 {
     MainView.GenerateMenu();
 }
Esempio n. 40
0
 public MainController(MainView view)
 {
     this.view = view;
 }
Esempio n. 41
0
 private void FileNewTabCommand(object sender, EventArgs e)
 {
     MainView.NewTab(HomeUrl);
 }
Esempio n. 42
0
 private void Start()
 {
     ViewPresenter = FindObjectOfType <ViewPresenter>();
     MainView      = FindObjectOfType <MainView>();
     GUIScene      = FindObjectOfType <GUIScene>();
 }
Esempio n. 43
0
 public GetProductQuantity(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
Esempio n. 44
0
 public override void InitView(BaseController controller)
 {
     base.InitView(controller);
     Instance = this;
 }
Esempio n. 45
0
        public void Run()
        {
            var view = new MainView(this);
            view.AccountSelected += AccountSelected;
            view.AccountDeselected += AccountDeselected;

            Application.Run(view);
        }
        internal void setMainView(MainView mainView)
        {
            this.mainView = mainView;
            if (this.mainView.ContextMenu == null)
            {
                this.mainView.ContextMenu = menu;
            }

        }
		public override void LoadView ()
		{
			View = view = new MainView ();
		}
Esempio n. 48
0
 public MainViewModel(ViewWindow ThisWindow)
 {
     ThisView = new MainView();
     ThisView.OpenInWindow(ThisWindow);
 }
Esempio n. 49
0
 public MainView()
 {
     InitializeComponent();
     View = this;
 }
Esempio n. 50
0
 private void SchemeHandlerDumpRequestCommand(object sender, EventArgs e)
 {
     MainView.NavigateTo("http://" + DumpRequestDomain);
 }
Esempio n. 51
0
        /// <inheritdoc/>
        public override IDock CreateLayout()
        {
            // Home

            var homeView = new HomeView
            {
                Id     = "Home",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Home"
            };

            // Center

            var centerView = new CenterView
            {
                Id     = "Center",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Center"
            };

            // Left / Top

            var leftTopView1 = new LeftTopView1
            {
                Id     = "LeftTop1",
                Dock   = "LeftTop1",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftTop1"
            };

            var leftTopView2 = new LeftTopView2
            {
                Id     = "LeftTop2",
                Dock   = "",
                Width  = 200,
                Height = 200,
                Title  = "LeftTop2"
            };

            var leftTopView3 = new LeftTopView3
            {
                Id     = "LeftTop3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftTop3"
            };

            // Left / Bottom

            var leftBottomView1 = new LeftBottomView1
            {
                Id     = "LeftBottom1",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom1"
            };

            var leftBottomView2 = new LeftBottomView2
            {
                Id     = "LeftBottom2",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom2"
            };

            var leftBottomView3 = new LeftBottomView3
            {
                Id     = "LeftBottom3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom3"
            };

            // Right / Top

            var rightTopView1 = new RightTopView1
            {
                Id     = "RightTop1",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop1"
            };

            var rightTopView2 = new RightTopView2
            {
                Id     = "RightTop2",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop2"
            };

            var rightTopView3 = new RightTopView3
            {
                Id     = "RightTop3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop3"
            };

            // Right / Bottom

            var rightBottomView1 = new RightBottomView1
            {
                Id     = "RightBottom1",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom1"
            };

            var rightBottomView2 = new RightBottomView2
            {
                Id     = "RightBottom2",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom2"
            };

            var rightBottomView3 = new RightBottomView3
            {
                Id     = "RightBottom3",
                Dock   = "",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom3"
            };

            // Left Pane

            var leftPane = new DockLayout
            {
                Id          = "LeftPane",
                Dock        = "Left",
                Width       = 200,
                Height      = double.NaN,
                Title       = "LeftPane",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    new DockStrip
                    {
                        Id          = "LeftPaneTop",
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "LeftPaneTop",
                        CurrentView = leftTopView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            leftTopView1,
                            leftTopView2,
                            leftTopView3
                        }
                    },
                    new DockSplitter()
                    {
                        Id    = "LeftPaneTopSplitter",
                        Dock  = "Top",
                        Title = "LeftPaneTopSplitter"
                    },
                    new DockStrip
                    {
                        Id          = "LeftPaneBottom",
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "LeftPaneBottom",
                        CurrentView = leftBottomView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            leftBottomView1,
                            leftBottomView2,
                            leftBottomView3
                        }
                    }
                }
            };

            // Right Pane

            var rightPane = new DockLayout
            {
                Id          = "RightPane",
                Dock        = "Right",
                Width       = 240,
                Height      = double.NaN,
                Title       = "RightPane",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    new DockStrip
                    {
                        Id          = "RightPaneTop",
                        Dock        = "Top",
                        Width       = double.NaN,
                        Height      = 340,
                        Title       = "RightPaneTop",
                        CurrentView = rightTopView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            rightTopView1,
                            rightTopView2,
                            rightTopView3
                        }
                    },
                    new DockSplitter()
                    {
                        Id    = "RightPaneTopSplitter",
                        Dock  = "Top",
                        Title = "RightPaneTopSplitter"
                    },
                    new DockStrip
                    {
                        Id          = "RightPaneBottom",
                        Dock        = "Bottom",
                        Width       = double.NaN,
                        Height      = double.NaN,
                        Title       = "RightPaneBottom",
                        CurrentView = rightBottomView1,
                        Views       = new ObservableCollection <IDock>
                        {
                            rightBottomView1,
                            rightBottomView2,
                            rightBottomView3
                        }
                    }
                }
            };

            // Main

            var mainLayout = new DockLayout
            {
                Id          = "MainLayout",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "MainLayout",
                CurrentView = null,
                Views       = new ObservableCollection <IDock>
                {
                    leftPane,
                    new DockSplitter()
                    {
                        Id    = "LeftSplitter",
                        Dock  = "Left",
                        Title = "LeftSplitter"
                    },
                    rightPane,
                    new DockSplitter()
                    {
                        Id    = "RightSplitter",
                        Dock  = "Right",
                        Title = "RightSplitter"
                    },
                    centerView
                }
            };

            var mainView = new MainView
            {
                Id          = "Main",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Main",
                CurrentView = mainLayout,
                Views       = new ObservableCollection <IDock>
                {
                    mainLayout
                }
            };

            // Root

            var layout = new DockRoot
            {
                Id          = "Root",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Root",
                CurrentView = homeView,
                DefaultView = homeView,
                Views       = new ObservableCollection <IDock>
                {
                    homeView,
                    mainView,
                }
            };

            return(layout);
        }
Esempio n. 52
0
 /// <summary>
 /// 向UI添加并注册组件
 /// </summary>
 /// <param name="uIElement"></param>
 /// <param name="elementID"></param>
 private void AddToView(UIElement uIElement, string elementID)
 {
     MainView.Children.Add(uIElement);
     MainView.RegisterName(elementID, uIElement);
 }
Esempio n. 53
0
        private void TransparentPopupWindowCommand(object sender, EventArgs e)
        {
            var url = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(new Uri(typeof(DemoApp).Assembly.CodeBase).LocalPath), "transparency.html");

            MainView.NewWebView(url, true);
        }
Esempio n. 54
0
        private static void Main(string[] args)
        {
            Platform.Initialize();
            Options.Initialize(args);
            Scripting.Initialize();
            Encoding.Initalize(TESVSnip.Framework.Properties.Settings.Default.UseUTF8);
            try
            {
                //AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

                // Add an event handler for unhandled exception
                AppDomain.CurrentDomain.UnhandledException += Program.CurrentDomainUnhandledException;

                // Add an event handler for handling UI thread exceptions to the event
                //Application.ThreadException += Program.ApplicationThreadException;

                TESVSnip.Properties.Settings.Default.Reload();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                var main = new MainView();
                foreach (string arg in Options.Value.Plugins)
                {
                    main.LoadPlugin(arg);
                }

                try
                {
                    Application.Run(main);
                    TESVSnip.Properties.Settings.Default.Save();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error running main window: \n" + ex, Resources.ErrorText);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error initializing main view: \n" + ex, Resources.ErrorText);
            }
        }
Esempio n. 55
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var size   = (SizeF)this.View.Frame.Size;
            var width  = 0f;
            var height = 0f;

            if (size.Width < size.Height)
            {
                width  = size.Height;
                height = size.Width;
            }
            else
            {
                width  = size.Width;
                height = size.Height;
            }

            UILabel Label = new UILabel();

            Label.Frame         = new CGRect(width * 0.15f, height * 0.02f, width * 0.7f, height * 0.12f);
            Label.TextAlignment = UITextAlignment.Center;
            Label.Font          = UIFont.FromName("Arial-BoldMT", height * 0.075f);
            Label.TextColor     = UIColor.FromRGB(153, 163, 164);//FromRGB(102, 207, 120);
            Label.Text          = "Lighting Scheme";
            MainView.AddSubview(Label);

            UIButton LightingScheme1 = CreateButton(height * 0.125f, width, height, "1 LightingScheme");

            MainView.AddSubview(LightingScheme1);
            LightingScheme1.TouchDown += (sender, e) =>
            {
                ButtonEvent(LightingScheme1, "ShowGallery", 1);
            };

            UIButton LightingScheme2 = CreateButton(height * 0.25f, width, height, "2 LightingScheme");

            MainView.AddSubview(LightingScheme2);
            LightingScheme2.TouchUpInside += (sender, e) =>
            {
                ButtonEvent(LightingScheme2, "ShowGallery", 2);
            };

            UIButton LightingScheme3 = CreateButton(height * 0.375f, width, height, "3 LightingScheme");

            MainView.AddSubview(LightingScheme3);
            LightingScheme3.TouchUpInside += (sender, e) =>
            {
                ButtonEvent(LightingScheme3, "ShowGallery", 3);
            };

            UIButton LightingScheme4 = CreateButton(height * 0.5f, width, height, "4 or more Sources of Light");

            MainView.AddSubview(LightingScheme4);
            LightingScheme4.TouchUpInside += (sender, e) =>
            {
                ButtonEvent(LightingScheme4, "ShowGallery", 4);
            };

            UIButton LightingScheme5 = CreateButton(height * 0.625f, width, height, "Mobile Photo Tricks");

            MainView.AddSubview(LightingScheme5);
            LightingScheme5.TouchUpInside += (sender, e) =>
            {
                ButtonEvent(LightingScheme5, "ShowGallery", 5);
            };

            UIButton Equipment = CreateButton(height * 0.75f, width, height, "Equipment & Marking");

            MainView.AddSubview(Equipment);
            Equipment.TouchUpInside += (sender, e) =>
            {
                ButtonEvent(Equipment, "ShowEquipment", 6);
            };

            UIButton About = CreateButton(height * 0.875f, width, height, "About");

            MainView.AddSubview(About);
            About.TouchUpInside += (sender, e) =>
            {
                ButtonEvent(About, "ShowAbout", 0);
            };
        }
Esempio n. 56
0
 private void btnHambuger_Click(object sender, RoutedEventArgs e)
 {
     MainView.GetInstance().HideOpenSplitView();
 }
Esempio n. 57
0
 public MaterialManager(IMSApiSessionContextStruct sessionContext, InitModel init, MainView view)
 {
     this.sessionContext = sessionContext;
     this.init           = init;
     this.view           = view;
 }
Esempio n. 58
0
 private void FileExitCommand(object sender, EventArgs e)
 {
     MainView.Close();
 }
 public MainViewModel(MainView mainView) : base(mainView)
 {
     MainView = mainView;
     Current  = this;
 }