Esempio n. 1
0
    public AppViewObserver()
    {
        GameObject gameMgr = GameObject.Find("GlobalGenerator");
        AppView    appView = gameMgr.GetComponent <AppView>();

        appViewCtrl = new AppViewCtrl(appView);
    }
Esempio n. 2
0
    public override void Execute(IMessage message)
    {
        if (!Util.CheckEnvironment())
        {
            return;
        }

        GameObject gameMgr = GameObject.Find("GlobalGenerator");

        if (gameMgr != null)
        {
            AppView appView = gameMgr.AddComponent <AppView>();
        }
        //-----------------关联命令-----------------------
        AppFacade.Instance.RegisterCommand(NotiConst.DISPATCH_MESSAGE, typeof(SocketCommand));

        //-----------------初始化管理器-----------------------
        AppFacade.Instance.AddManager <LuaManager>(ManagerName.Lua);
        AppFacade.Instance.AddManager <PanelManager>(ManagerName.Panel);
        AppFacade.Instance.AddManager <SoundManager>(ManagerName.Sound);
        AppFacade.Instance.AddManager <TimerManager>(ManagerName.Timer);
        AppFacade.Instance.AddManager <NetworkManager>(ManagerName.Network);
        AppFacade.Instance.AddManager <ResourceManager>(ManagerName.Resource);
        AppFacade.Instance.AddManager <ThreadManager>(ManagerName.Thread);
        AppFacade.Instance.AddManager <ObjectPoolManager>(ManagerName.ObjectPool);
        AppFacade.Instance.AddManager <GameManager>(ManagerName.Game);
        AppFacade.Instance.AddManager <UtilManager>(ManagerName.Util);
    }
Esempio n. 3
0
    public override void BindView()
    {
        //view.NextStage = root.
        view.InspectBtn  = root.Find("Deck").GetComponent <Button>();
        view.ScheduleBtn = root.Find("Schedule").GetComponent <Button>();
        view.NextStage   = root.Find("NextTurn").GetComponent <Button>();


        view.PhoneBigPic   = root.Find("PhoneMenu").GetComponent <Image>();
        view.Close         = view.PhoneBigPic.transform.Find("Close").GetComponent <Image>();
        view.PhoneMiniIcon = root.Find("Phone_miniicon").GetComponent <Image>();

        view.Properties = root.Find("Properties");

        view.EventsContainer = root.Find("Events");

        view.AppsContainer = view.PhoneBigPic.transform.Find("Apps");

        foreach (AppInfo app in model.UnlockedApps)
        {
            GameObject go      = pResLoader.Instantiate("UI/app", view.AppsContainer);
            AppView    appView = new AppView();
            appView.BindView(go.transform);
            appView.icon.sprite = pResLoader.LoadResource <Sprite>("Textures/" + app.AppId);
            appView.title.text  = app.ShowName;
            view.appViews.Add(appView);
        }
    }
Esempio n. 4
0
        /// <summary>
        /// SecondaryViewを閉じます。
        /// MainViewから呼び出すと別スレッドアクセスでエラーになるはず
        /// </summary>
        public async Task Close()
        {
            if (_SecondaryViewVM == null)
            {
                return;
            }

            NavigationService.Navigate(nameof(Views.BlankPage), null);

            await ShowMainView();

            if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 4))
            {
                await AppView.TryConsolidateAsync().AsTask()
                .ContinueWith(prevTask =>
                {
//                        CoreAppView = null;
//                        AppView = null;
//                        _SecondaryViewVM = null;
//                        NavigationService = null;
                });
            }
            else
            {
                AppView.Consolidated -= SecondaryAppView_Consolidated;

                CoreAppView.CoreWindow.Close();

                CoreAppView       = null;
                AppView           = null;
                _SecondaryViewVM  = null;
                NavigationService = null;
            }
        }
Esempio n. 5
0
 public void SaveUserConfig()
 {
     using (Stream outputStream = AppView.GetUserConfigStreamToWrite())
     {
         UserConfig.SaveFile(outputStream);
     }
 }
Esempio n. 6
0
        public async Task <bool> ChangeFullScreenStateAsync(FullScreenChangeType changeType)
        {
            if ((changeType == FullScreenChangeType.Enter && IsFullScreenMode) || (changeType == FullScreenChangeType.Exit && !IsFullScreenMode))
            {
                return(true);
            }

            if (changeType == FullScreenChangeType.Toggle)
            {
                changeType = IsFullScreenMode ? FullScreenChangeType.Exit : FullScreenChangeType.Enter;
            }

            var result = false;

            switch (changeType)
            {
            case FullScreenChangeType.Enter:
                result = AppView.TryEnterFullScreenMode();
                break;

            case FullScreenChangeType.Exit:
                AppView.ExitFullScreenMode();
                result = true;
                break;

            default:
                throw new Exception("this should never happen");
            }

            await Task.Delay(100);

            return(result);
        }
Esempio n. 7
0
        private static void RunBankAccountDemo(AppView view)
        {
            BankAccount.InterestRate = 0.012M;
            var accounts = BankAccountProvider.GetBankAccounts();

            view.Show(accounts);
        }
 public void InfoForListBox()
 {
     using (SQL_course_work cw = new SQL_course_work())
     {
         int[] idFilms     = new int[50];
         bool  coincidence = true;
         var   info        = cw.Film.ToList();
         infoforfilm = new ObservableCollection <AppView>();
         var forBD = cw.Database.SqlQuery <Session>($"select * from Session");
         foreach (var check in forBD)
         {
             if (check.date == Datepic.SelectedDate.Value)
             {
                 foreach (var i in info)
                 {
                     for (int f = 0; f < idFilms.Length; f++)
                     {
                         if (idFilms[f] == Convert.ToInt32(i.filmID))
                         {
                             coincidence = false;
                         }
                     }
                     if (i.filmID == check.filmID && coincidence == true)
                     {
                         AppView allFilms = new AppView();
                         allFilms.Add(i.filmName, (int)i.year, i.genres, (float)i.rating, i.countries, i.director, (int)i.duration, i.poster, i.filmID);
                         infoforfilm.Add(allFilms);
                         for (int n = 0; n < idFilms.Length; n++)
                         {
                             if (n == 0)
                             {
                                 if (idFilms[n] == 0)
                                 {
                                     idFilms[n] = Convert.ToInt32(i.filmID);
                                 }
                             }
                             bool fi = true;
                             if (idFilms[n] == 0 && n != 0)
                             {
                                 for (int o = 0; o < idFilms.Length; o++)
                                 {
                                     if (idFilms[o] == Convert.ToInt32(i.filmID))
                                     {
                                         fi = false;
                                     }
                                 }
                                 if (idFilms[n] != Convert.ToInt32(i.filmID) && fi == true)
                                 {
                                     idFilms[n] = Convert.ToInt32(i.filmID);
                                 }
                             }
                         }
                     }
                     coincidence = true;
                 }
             }
         }
         ListBoxFilms.ItemsSource = infoforfilm;
     }
 }
Esempio n. 9
0
    public override void Execute(IMessage message)
    {
        //首先检查运行环境,这个函数只在UNITY_EDITOR下有用
        //其他时候都是直接返回true的
        if (!Util.CheckEnvironment())
        {
            return;
        }

        //如果需要显示AppView信息,需要在场景上添加GlobalGenerator对象
        //AppView里面只是显示一些消息
        GameObject gameMgr = GameObject.Find("GlobalGenerator");

        if (gameMgr != null)
        {
            AppView appView = gameMgr.AddComponent <AppView>();
        }
        //-----------------关联命令-----------------------
        //SocketCommand处理网关相关指令  socket消息
        AppFacade.Instance.RegisterCommand(NotiConst.DISPATCH_MESSAGE, typeof(SocketCommand));

        //-----------------初始化管理器-----------------------
        AppFacade.Instance.AddManager <LuaManager>(ManagerName.Lua);
        AppFacade.Instance.AddManager <PanelManager>(ManagerName.Panel);
        AppFacade.Instance.AddManager <SoundManager>(ManagerName.Sound);
        AppFacade.Instance.AddManager <TimerManager>(ManagerName.Timer);
        AppFacade.Instance.AddManager <NetworkManager>(ManagerName.Network);
        AppFacade.Instance.AddManager <ResourceManager>(ManagerName.Resource);
        AppFacade.Instance.AddManager <ThreadManager>(ManagerName.Thread);
        AppFacade.Instance.AddManager <ObjectPoolManager>(ManagerName.ObjectPool);
        AppFacade.Instance.AddManager <XPageManager>(ManagerName.XPage); //UI管理器
        AppFacade.Instance.AddManager <AtlasManager>(ManagerName.Atlas); //UI管理器
        //游戏下载资源,解包都在GameManager内完成
        AppFacade.Instance.AddManager <GameManager>(ManagerName.Game);
    }
Esempio n. 10
0
    public override void Execute(IMessage message)
    {
        if (!Util.CheckEnvironment())
        {
            return;
        }

        GameObject gameMgr = GameObject.Find("GlobalGenerator");

        if (gameMgr != null)
        {
            AppView appView = gameMgr.AddComponent <AppView>();
        }

        //-----------------初始化管理器-----------------------
        AppFacade.Instance.AddManager <LuaManager>(ManagerName.Lua);
        AppFacade.Instance.AddManager <TimerManager>(ManagerName.Timer);
        AppFacade.Instance.AddManager <ResourceManager>(ManagerName.Resource);
        AppFacade.Instance.AddManager <ThreadManager>(ManagerName.Thread);
        AppFacade.Instance.AddManager <GameManager>(ManagerName.Game);
        AppFacade.Instance.AddManager <SDKManager>(ManagerName.SDK);
        AppFacade.Instance.AddManager <NativeManager>(ManagerName.Native);
        AppFacade.Instance.AddManager <ShopManager>(ManagerName.Shop);
        AppFacade.Instance.AddManager <WWWManager>(ManagerName.WWW);
        AppFacade.Instance.AddManager <SoundManager>(ManagerName.Sound);
    }
Esempio n. 11
0
    public override void Execute(IMessage message)
    {
        if (!Util.CheckEnvironment())
        {
            return;
        }

        GameObject gameMgr = GameObject.Find("GlobalGenerator");

        if (gameMgr != null)
        {
            AppView appView = gameMgr.AddComponent <AppView>();
        }
        //-----------------关联命令-----------------------
        AppFacade.Instance.RegisterCommand(NotiConst.DISPATCH_MESSAGE, typeof(SocketCommand));

        //-----------------初始化管理器-----------------------
        AppFacade.Instance.AddManager(ManagerName.Lua, new LuaScriptMgr());

        AppFacade.Instance.AddManager <PanelManager>(ManagerName.Panel);
        AppFacade.Instance.AddManager <MusicManager>(ManagerName.Music);
        AppFacade.Instance.AddManager(ManagerName.Timer, new TimerManager());
        AppFacade.Instance.AddManager <NetworkManager>(ManagerName.Network);
        AppFacade.Instance.AddManager <ResourceManager>(ManagerName.Resource);
        AppFacade.Instance.AddManager <ThreadManager>(ManagerName.Thread);
        AppFacade.Instance.AddManager <SimpleFramework.Manager.GameManager>(ManagerName.Game);

        Debug.Log("SimpleFramework StartUp-------->>>>>");
    }
Esempio n. 12
0
        /// <summary>
        /// 获取所有EXE程序信息
        /// </summary>
        /// <returns></returns>
        public static List <AppView> GetAllExeAppInfo()
        {
            List <AppView> res = new List <AppView>();

            try
            {
                string   mgeProcessFileName    = SettingLogic.GetMgeProcessFullName();
                string   processMgeXmlFullName = Path.Combine(Directory.GetParent(mgeProcessFileName).FullName, "ProcessInfo.xml");
                XElement element = XElement.Load(processMgeXmlFullName);
                foreach (XElement processElement in element.Elements())
                {
                    AppView view = new AppView
                    {
                        AppName         = processElement.Attribute("Name")?.Value ?? string.Empty,
                        Id              = processElement.Attribute("ID")?.Value ?? string.Empty,
                        AppPhysicalPath = processElement.Attribute("Path")?.Value ?? string.Empty,
                        AppAlias        = processElement.Attribute("Desc")?.Value ?? string.Empty,
                        Status          = ((processElement.Attribute("IsDie")?.Value ?? "") == "False") ? 0 : 1,
                    };
                    res.Add(view);
                }
            }
            catch (Exception e)
            {
                TxtLogService.WriteLog(e, "获取所有EXE程序信息异常");
            }
            return(res);
        }
Esempio n. 13
0
 //MainWindow app = new MainWindow();
 public App()
 {
     var viewModelLocator = new ViewModelLocator();
     var app = new AppView();
     app.DataContext = viewModelLocator.AppViewModel;
     app.ShowDialog();
 }
Esempio n. 14
0
        /// <summary>
        /// 获取EXE程序信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static AppView GetExeAppInfoById(this string id)
        {
            AppView res = null;

            try
            {
                string   mgeProcessFileName    = SettingLogic.GetMgeProcessFullName();
                string   processMgeXmlFullName = Path.Combine(Directory.GetParent(mgeProcessFileName).FullName, "ProcessInfo.xml");
                XElement element        = XElement.Load(processMgeXmlFullName);
                XElement processElement = element.Elements().FirstOrDefault(n => n.Attribute("ID")?.Value == id);
                if (processElement == null)
                {
                    return(null);
                }
                return(new AppView
                {
                    AppName = processElement.Attribute("Name")?.Value ?? string.Empty,
                    Id = processElement.Attribute("ID")?.Value ?? string.Empty,
                    AppPhysicalPath = processElement.Attribute("Path")?.Value ?? string.Empty,
                    AppAlias = processElement.Attribute("Desc")?.Value ?? string.Empty,
                    Status = ((processElement.Attribute("IsDie")?.Value ?? "") == "False") ? 0 : 1,
                });
            }
            catch (Exception e)
            {
                TxtLogService.WriteLog(e, "获取EXE程序信息异常,信息:" + id);
            }
            return(res);
        }
        public static Form Compose()
        {
            var view = new AppView();

#if DEBUG
            DebugHideBehavior.Mediate(view);
#else
            ReleaseHideBehavior.Mediate(view);
#endif

            var configurationFactory = new XmlConfigurationFactory();

            var adapter = new WindowsShellAdapter(configurationFactory);

            var controller = new AppController(
                view,
                FileSystem.GetFileSystem(),

                new VirtualDesktopStateMonitor(
                    new WindowsDesktop(adapter),
                    adapter,
                    configurationFactory),

                new ConfigurationController(
                    new XmlConfigurationProvider(configurationFactory)),

                configurationFactory);

            view.Controller = controller;

            AppViewMediator.Mediate(view, controller);

            return(view);
        }
Esempio n. 16
0
        /// <summary>
        /// 获取所有iis应用程序名称
        /// </summary>
        /// <returns>应用程序信息</returns>
        public static AppView GetIISAppInfoById(this string id)
        {
            AppView res = new AppView();

            try
            {
                using (var mgr = new ServerManager(@"C:\Windows\System32\inetsrv\config\applicationHost.config"))
                {
                    var site = mgr.Sites.FirstOrDefault(n => n.Id.ToString() == id);
                    if (site != null)
                    {
                        res = new AppView
                        {
                            AppName         = site.Name,
                            AppPhysicalPath = site.Applications["/"]?.VirtualDirectories["/"]?.PhysicalPath ?? string.Empty,
                            AppAlias        = site.Name,
                            Id     = site.Id.ToString(),
                            Status = site.State == ObjectState.Started ? 0 : 1,
                        };
                    }
                }
            }
            catch (Exception e)
            {
                TxtLogService.WriteLog(e, "获取指定iis应用程序名称异常,id=" + id);
            }
            return(res);
        }
Esempio n. 17
0
        public App()
        {
            var window = new AppView();

            window.DataContext = new ViewModelLocator().AppViewModel;
            window.ShowDialog();
        }
Esempio n. 18
0
        public App()
        {
            var window = new AppView();

            window.DataContext = new MainViewModel();
            window.ShowDialog();
        }
Esempio n. 19
0
        public DebugHideBehavior(AppView form)
        {
            _form            = form;
            form.MinimizeBox = true;

            form.Resize += Form_Resize;
        }
Esempio n. 20
0
    public override void Execute(IMessage message)
    {
        if (!Util.CheckEnvironment())
        {
            return;
        }

        GameObject gameMgr = GameObject.Find("GlobalGenerator");

        if (gameMgr != null)
        {
            AppView appView = gameMgr.GetComponent <AppView>();
            if (appView == null)
            {
                appView = gameMgr.AddComponent <AppView>();
            }
            //AppView appView = gameMgr.AddComponent<AppView>();
        }

        //-----------------初始化管理器-----------------------
        AppFacade.Instance.AddManager <LuaManager>(ManagerName.Lua);
        AppFacade.Instance.AddManager <SoundManager>(ManagerName.Sound);
        AppFacade.Instance.AddManager <TimerManager>(ManagerName.Timer);
        AppFacade.Instance.AddManager <NetworkManager>(ManagerName.Network);
        AppFacade.Instance.AddManager <ResourceManager>(ManagerName.Resource);
        AppFacade.Instance.AddManager <ThreadManager>(ManagerName.Thread);
        AppFacade.Instance.AddManager <ObjectPoolManager>(ManagerName.ObjectPool);
        AppFacade.Instance.AddManager <NativePlatformMessageManager> (ManagerName.NativePlatformMessage);
        AppFacade.Instance.AddManager <GameManager>(ManagerName.Game);
    }
Esempio n. 21
0
        private static void RunSwitchDemoWithPasenger(AppView view)
        {
            // switch with passenger exapmle
            var passengers = FlightPatternsProvider.GetFlightPassengers();

            view.Show(passengers);
        }
Esempio n. 22
0
        /// <summary>
        /// 获取EXE程序信息
        /// </summary>
        /// <param name="appName"></param>
        /// <returns></returns>
        public static List <AppView> GetExeAppInfoByName(this string appName)
        {
            List <AppView> res = new List <AppView>();

            try
            {
                string   mgeProcessFileName    = SettingLogic.GetMgeProcessFullName();
                string   processMgeXmlFullName = Path.Combine(Directory.GetParent(mgeProcessFileName).FullName, "ProcessInfo.xml");
                XElement element     = XElement.Load(processMgeXmlFullName);
                var      subElements = element.Elements();
                if (!appName.IsNullOrEmpty())
                {
                    subElements = subElements.Where(n => n.Attribute("Name").Value.ToLower().StartsWith(appName.ToLower()));
                }
                foreach (XElement processElement in subElements)
                {
                    AppView view = new AppView
                    {
                        AppName         = processElement.Attribute("Name")?.Value ?? string.Empty,
                        Id              = processElement.Attribute("ID")?.Value ?? string.Empty,
                        AppPhysicalPath = processElement.Attribute("Path")?.Value ?? string.Empty,
                        AppAlias        = processElement.Attribute("Desc")?.Value ?? string.Empty,
                        Status          = ((processElement.Attribute("IsDie")?.Value ?? "") == "False") ? 0 : 1,
                    };
                    res.Add(view);
                }
            }
            catch (Exception e)
            {
                TxtLogService.WriteLog(e, "获取EXE程序信息异常,信息:" + appName);
            }
            return(res);
        }
Esempio n. 23
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.tv_episode_detail);

            toolbar = FindViewById<Toolbar>(Resource.Id.image_toolbar_main_toolbar);
            appBarLayout = FindViewById<AppBarLayout>(Resource.Id.image_toolbar_appbar_layout);
            collapseToolbar = FindViewById<CollapsingToolbarLayout>(Resource.Id.image_toolbar_collapsing_layout);
            collapseToolbar.TitleEnabled = true;
            titleContainer = FindViewById<Android.Widget.LinearLayout>(Resource.Id.image_toolbar_collapsing_root);
            
            dataRV = FindViewById<RecyclerView>(Resource.Id.tv_episode_detail_rv);
            dataRV.SetLayoutManager(new CachingLayoutManager(this));
            loadingView = FindViewById<ContentLoadingProgressBar>(Resource.Id.image_toolbar_loading);

            AppView.SetActionBarForActivity(toolbar, this);
            appBarLayout.OffsetChanged += AppLayout_OffsetChanged;
            callBack = new JavaValueCallback();
            callBack.ValueReceived += JavaCallBack_ValueReceived;

            canGoBackToSeriesHome = Intent.GetBooleanExtra("canGoBackToSeriesHome", false);
            var link = Intent.GetStringExtra("itemLink");
            LoadEpisodeData(link);
        }
Esempio n. 24
0
        /// <summary>
        /// Navigate to the selected view
        /// </summary>
        /// <param name="view">The View to switch to</param>
        /// <param name="viewModel">The ViewModel (if any) to set to the specified View</param>
        public void SwitchToView(AppView view, BaseViewModel viewModel = null)
        {
            // Set the ViewModel first
            CurrentViewModel = viewModel;

            // Then set the View afterwards
            CurrentView = view;
        }
Esempio n. 25
0
    /// <summary>
    /// 执行启动命令
    /// </summary>
    /// <param name="notification"></param>
    public override void Execute(INotification noti)
    {
        GameObject gameMgr = GameObject.Find("GlobalGenerator");

        AppView appView = gameMgr.GetComponent <AppView>();

        Facade.RegisterMediator(new AppMediator(appView));
    }
Esempio n. 26
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var locator = new ViewModelLocator();
            var window  = new AppView();

            window.DataContext = locator.GetAppViewModel();
            window.ShowDialog();
        }
Esempio n. 27
0
        public override void Initialize(AppView view, Application app)
        {
            base.Initialize(view, app);

            backBtn.onClick.AddListener(BackToMainApp);
            nextBtn.onClick.AddListener(NextHistory);
            previousBtn.onClick.AddListener(PreviousHistory);
        }
Esempio n. 28
0
        public ReleaseHideBehavior(AppView form)
        {
            _form            = form;
            form.MinimizeBox = false;

            form.Load        += Form_Load;
            form.FormClosing += Form_FormClosing;
            form.Resize      += Form_Resize;
        }
Esempio n. 29
0
        public App()
        {
            var locator = new ViewModelLocator();

            var window = new AppView();

            window.DataContext = locator.GetMainViewModel();
            window.ShowDialog();
        }
Esempio n. 30
0
 public void LoadAppConfig()
 {
     using (Stream inputStream = AppView.GetAppConfigStream())
     {
         AppConfig.LoadFile(inputStream);
     }
     AppConfig.MarkAsReadOnly();
     AppConfigLoaded = true;
 }
            public void When_service_return_null_should_get_993_error()
            {
                var imsi = "12345";
                var appno = "3001";
                var list = new AppView();
                //setup
                this.AppStoreServiceMock.Setup<AppView>(s => s.AppDetail(appno, null)).Returns(list);

                var ret = this.Controller.AppDetail(imsi, appno.ToString());

                Assert.True(ret.IsContentActionResult());
            }
Esempio n. 32
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            var rootView = Window.Current.Content as AppView;

            // TODO: Replace this when C# 7 introduces local functions.
            var loadFirstPage = new Action(() =>
            {
                var frame = rootView.Frame;

                if (frame.Content == null) // If we haven't navigated to a page yet...
                    frame.Navigate(typeof(MainPage), e.Arguments); // go to the first one
            });

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootView == null)
            {
                // Create a AppView to act as the navigation context and navigate to the first page
                rootView = new AppView();

                // We can't use the AppView's Frame yet since it's still loading,
                // so hook up a few handlers to the rootView.Loaded event.
                rootView.Loaded += (o, args) => rootView.Frame.NavigationFailed += OnNavigationFailed;
                rootView.Loaded += (o, args) => loadFirstPage();

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the view in the current Window
                Window.Current.Content = rootView;
            }
            else
            {
                // Just do it.
                loadFirstPage();
            }

            // Ensure the current window is active
            Window.Current.Activate();
        }
		protected override void DoShowView (AppView view)
		{
			
			string viewName = null;
			switch (view) {
			case AppView.ListInteresting:
			case AppView.Favorites:
				viewName = "ListPhotos";
				break;
			case AppView.About:
				viewName = "About";
				break;
			}
			var vc = ((AppDelegate)UIApplication.SharedApplication.Delegate).Window.RootViewController;
			var newView = vc.Storyboard.InstantiateViewController (viewName);
			vc.ShowDetailViewController (newView, null);
		}
Esempio n. 34
0
        /// <summary>
        /// Display the selected view with the given folder, passing through the address and options.
        /// </summary>
        /// <param name="requestedView">The ID of the type of the view requested</param>
        /// <param name="folder">The folder to be displayed in the view</param>
        /// <param name="address">The address of the item within the folder to be selected</param>
        /// <param name="options">Options controlling the folder selection</param>
        /// <returns>True if the view was successfully selected, false otherwise</returns>
        private bool SelectView(AppView requestedView, FolderBase folder, Address address, FolderOptions options)
        {
            ViewBaseView newView = _allViews[requestedView];

            if (newView != _currentView)
            {
                if (_currentView != null)
                {
                    _currentView.Visible = false;
                    frmSplitContainer.Panel2.Controls.Remove(_currentView);
                }
                if (newView != null)
                {
                    frmSplitContainer.Panel2.Controls.Add(newView);

                    _currentView = newView;
                    SetSubviewSize();
                    newView.Visible = true;
                    newView.Update();
                }
            }

            ShowSearchBar(SearchBarVisibility.FastHide);

            if (folder != null)
            {
                string placeholder = folder.AllowsScopedSearch
                    ? string.Format(Resources.SearchForTextIn, folder.Name)
                    : Resources.Search;
                MainForm.SetSearchFieldPlaceholder(placeholder);

                SetTopicName(folder.FullName);
            }
            return (_currentView != null) && _currentView.ViewFromFolder(folder, address, options);
        }
Esempio n. 35
0
 /// <summary>
 /// Return the address of the selected item in the specified view.
 /// </summary>
 public Address AddressFromView(AppView view)
 {
     return new Address(_allViews[view].Address);
 }
		protected abstract void DoShowView(AppView view);
		private void OnBeforeShowingView(AppView view)
        {
            EventHandler handler = BeforeShowingView;

            handler?.Invoke(this, EventArgs.Empty);
        }
			public MenuOption(AppView view, string name){
				Name = name;
				View = view;
			}
		public void ShowView(AppView view)
        {
            OnBeforeShowingView(view);
            DoShowView(view);
            OnAfterShowingView(view);
        }