Beispiel #1
0
        public NetworkViewModel(Network network) : base(network)
        {
            DateTime start = DateTime.Now;

            Console.WriteLine("Starting initialization of ViewModel for Network " + network.Name);
            Network = network;
            TimeSpan t = DateTime.Now - start;

            ReadSettings();
            UpdateAddressInfo();
            Application.Current.Dispatcher.Invoke(new Action(() => EntityPage        = new NetworkPage(this)));
            Application.Current.Dispatcher.Invoke(new Action(() => ConsolePage       = new ConsolePage(this)));
            Application.Current.Dispatcher.Invoke(new Action(() => PluginsPage       = new PluginsPage(new PluginViewModel(this))));
            Application.Current.Dispatcher.Invoke(new Action(() => SettingsViewModel = new SettingsViewModel(this)));

            DropHandler = new ServerDropHandler(this);

            if (!ApplicationManager.Initialized)
            {
                ApplicationManager.ApplicationInitialized +=
                    () => Application.Current.Dispatcher?.Invoke(StartSettingsReader);
            }
            else
            {
                Application.Current.Dispatcher?.Invoke(StartSettingsReader);
            }

            Console.WriteLine("Server ViewModel for " + network.Name + " initialized in " + t.Seconds + "." +
                              t.Milliseconds + "s");
        }
Beispiel #2
0
        public MainTabbedViewModel(ISuburbService repo)
        {
            _repo = repo;

            var map = new MappingPage();

            map.BindingContext = new MappingViewModel(Mvx.Resolve <ISuburbService>());
            map.Title          = "Map";
            Pages.Add(map);

            var page1 = new MainPage();

            page1.BindingContext = new MainViewModel(Mvx.Resolve <ISuburbService>());
            page1.Title          = "Main";
            Pages.Add(page1);

            var page2 = new NetworkPage();

            page2.BindingContext = new NetworkViewModel(Mvx.Resolve <INetworkAPIService>());
            page2.Title          = "Network";
            Pages.Add(page2);

            // tell all child pages to load
            MessagingCenter.Send <ReloadMessage>(new ReloadMessage(), AppMessage.Reload.ToString());
        }
Beispiel #3
0
        private void Save()
        {
            NetworkPage.Save();
            GeneralPage.Save();
            SnapshottingPage.Save();
            ReplicationPage.Save();
            ClientsPage.Save();
            MemoryManagementPage.Save();
            LazyFreeingPage.Save();
            AppendOnlyModePage.Save();
            LuaScriptingPage.Save();
            RedisClusterPage.Save();
            ClusterNatSupportPage.Save();
            SlowLogPage.Save();
            LatencyMonitorPage.Save();
            EventNotificationPage.Save();
            AdvancedConfigPage.Save();
            ActiveDefragmentationPage.Save();

            // always last to save password and don't lose connection
            SecurityPage.Save();
        }