Inheritance: MonoBehaviour
Ejemplo n.º 1
0
 /// <summary>
 /// Gets the page by ID.
 /// </summary>
 /// <returns></returns>
 public static Page GetDefaultPage()
 {
     return CacheHelper.CacheObject<Page>(delegate {
     Page pageItem = new PageController().FetchDefaultPage();
     if(pageItem != null) {
       return !pageItem.IsNew ? pageItem : null;
     }
     else {
       return null;
     }
       }, string.Format(CACHE_PAGE_ITEM, "Default"), CacheLength.GetDefaultCacheTime, CacheItemPriority.BelowNormal);
 }
Ejemplo n.º 2
0
        protected ActionResult HomePageResult()
        {
            PageController pageController = new PageController();
            System.Web.Routing.RouteData routeData = this.RouteData;
            routeData.Values["action"] = "Display";
            routeData.Values["controller"] = "Page";
            routeData.DataTokens["area"] = "";

            pageController.ControllerContext = this.ControllerContext;
            pageController.TempData = this.TempData;
            return pageController.Display();
        }
Ejemplo n.º 3
0
    void Start()
    {
        collectedPages = new List<journalPage>();
        prefab = Resources.Load("Journal", typeof(GameObject)) as GameObject;
        journalGUI = Instantiate(prefab) as GameObject;
        journalActive = false;
        journalGUI.name = "ActiveJournal";

        journalCanvas = journalGUI.GetComponent<Canvas>();
        journalCanvasGroup = journalGUI.GetComponent<CanvasGroup>();
        pageControl = GameObject.Find("Player").GetComponent<PageController>();
        buttons = GameObject.Find("ActiveJournal").GetComponentsInChildren<Button>();

        buttons[0].onClick.AddListener(delegate { clickForward(); });
        buttons[1].onClick.AddListener(delegate { clickBack(); });
    }
Ejemplo n.º 4
0
    public void Create_Post()
    {
        dynamic data = new ExpandoObject();
        data.Id = "new-page";

        dynamic model = new Mock();
        model.Setup("Create", new object[] { It.Is<dynamic>(item => item.Title == "new page") }, model);
        model.SetupGet("Value", data);
        model.SetupGet("HasError", false);

        var form = new NameValueCollection();
        form["title"] = "new page";

        dynamic page = new MockPost(new string[] { "Pages", "Create" }, form);
        var controller = new PageController();
        controller.Model = model;

        Mvc.Run(page, controller);

        Assert.AreEqual("~/Pages/new-page", page.Page.Redirect);
        model.Verify();
    }
Ejemplo n.º 5
0
    public void Create_Post_Should_Handle_Error()
    {
        dynamic data = new ExpandoObject();
        data.Id = "id";

        dynamic model = new Mock();
        model.Setup("Create", new object[] { It.Is<dynamic>(item => item.Title == "new page") }, model);
        model.SetupGet("Value", data);
        model.SetupGet("HasError", true); // this raises validation error
        model.SetupGet("Errors", "x");

        var form = new NameValueCollection();
        form["title"] = "new page";

        dynamic page = new MockPost(new string[] { "Pages", "Create" }, form);
        var controller = new PageController();
        controller.Model = model;

        Mvc.Run(page, controller);

        Assert.AreEqual("~/Views/Pages/_Page_Create.cshtml", page.Page.View); // stayed on create page
        Assert.AreEqual("x", page.Page.Model.Errors); // pushed error messages
        model.Verify();
    }
Ejemplo n.º 6
0
    public void Edit_Get()
    {
        dynamic data = new ExpandoObject();
        data.Id = "id";
        dynamic model = new Mock();
        model.Setup("Load", new object[] { It.Is<dynamic>(item => item.Id == "id") }, model);
        model.SetupGet("Value", data);

        dynamic page = new MockGet(new string[] { "Pages", "Edit", "id" });
        var controller = new PageController();
        controller.Model = model;

        Mvc.Run(page, controller);
        var view = SiteEngine.RunHook("GET_Pages_Page_Edit_View", page.Page.View) as string;
        Assert.AreEqual(view, page.Page.View);
        Assert.AreEqual("id", page.Page.Model.Id);
        model.Verify();
    }
 protected override void OnAttachedToWindow()
 {
     base.OnAttachedToWindow();
     PageController.SendAppearing();
 }
Ejemplo n.º 8
0
 public override void ViewDidAppear(bool animated)
 {
     PageController.SendAppearing();
     base.ViewDidAppear(animated);
 }
 public int FitFontSize()
 {
     return(PageController.FitFontSize());
 }
Ejemplo n.º 10
0
 protected override void OnDetachedFromWindow()
 {
     base.OnDetachedFromWindow();
     PageController?.SendDisappearing();
 }
Ejemplo n.º 11
0
 void OnUnloaded(object sender, RoutedEventArgs args)
 {
     PageController?.SendDisappearing();
 }
Ejemplo n.º 12
0
 private void ApplyPrivacyPolicy()
 {
     PlayerPrefs.SetInt(TutorialPage.PRIVACY_POLICY_APPLY, 1);
     PageController.SwitchPageOn <ScanTargetPage>();
 }
Ejemplo n.º 13
0
 void OnLoaded(object sender, RoutedEventArgs args)
 {
     PageController?.SendAppearing();
     UpdateBarTextColor();
     UpdateBarBackgroundColor();
 }
Ejemplo n.º 14
0
 /// <summary>
 /// this function will force the submit on the form
 /// </summary>
 private async void SubmitForm()
 {
     PageController.SetBaseValuesFromController();
     await BuyerForm.SubmitAsync();
 }
Ejemplo n.º 15
0
 /// <summary>
 /// the main initialization of the form
 /// </summary>
 protected override void OnInitialized()
 {
     PageController.SetControllerValuesFromBase();
     EditContext = new EditContext(PageController);
     base.OnInitialized();
 }
Ejemplo n.º 16
0
        public Page1(MainWindow wind, int pageNumber)
        {
            InitializeComponent();
            parent = wind;

            this.pageNumber = pageNumber;

            viewController  = new ViewController(parent);
            pageController  = new PageController();
            imageController = new ImageController();

            PageWithTextAndImage page = pageController.findOneByPage(pageNumber);

            addRichTextBox(page);
            pageController.close();



            switch (pageNumber)
            {
            case 2:
            {
                label.Content = "Вступ";
            }  break;

            case 3:
            {
                label.Content = "Органічна хімія";
            } break;

            default:
            {
                label.Content = "Атом";
            } break;
            }

            label1.Content = pageNumber + " сторінка";

            pageController = new PageController();
            page.Pictures  = pageController.findAllPicturesByIdPage(page.Id);
            int marginLeft = 800;
            int marginTop  = -400;
            int index      = 0;

            foreach (Picture p in page.Pictures)
            {
                if (index % 2 == 0)
                {
                    addImage(p.UrlOfImage, -800, marginTop);
                    marginTop += 500;
                }
                else
                {
                    addImage(p.UrlOfImage, marginLeft, marginTop);
                    marginTop += 500;
                }

                index++;
            }
            pageController.close();


            pageController = new PageController();
            maxPageNumber  = pageController.findMaxPage();
            pageController.close();
        }
Ejemplo n.º 17
0
 // Use this for initialization
 void Start()
 {
     dropdowns      = Resources.FindObjectsOfTypeAll <DropdownID>();
     pagecontroller = GameObject.FindObjectOfType <PageController>();
 }
Ejemplo n.º 18
0
    public void Edit_Post_Should_Handle_Error()
    {
        dynamic data = new ExpandoObject();
        data.Id = "id";

        dynamic model = new Mock();
        model.Setup("Update", new object[] { It.Is<dynamic>(item => item.Id == "id") }, model);
        model.SetupGet("Value", data);
        model.SetupGet("HasError", true); // this raises validation error
        model.SetupGet("Errors", "x");

        var form = new NameValueCollection();
        form["OldId"] = "id";

        dynamic page = new MockPost(new string[] { "Pages", "Edit", "id" }, form);
        var controller = new PageController();
        controller.Model = model;

        Mvc.Run(page, controller);

        var view = SiteEngine.RunHook("GET_Pages_Page_Edit_View", page.Page.View) as string;
        Assert.AreEqual(view, page.Page.View); //stayed on edit page
        Assert.AreEqual("x", page.Page.Model.Errors); // pushed error message
        model.Verify();
    }
Ejemplo n.º 19
0
    public void List_Should_Use_PageSize()
    {
        dynamic model = new Mock();
        model.Setup("List", new object[] { 5, 30 }, model);
        model.SetupGet("Value", new ExpandoObject());

        dynamic page = new MockGet(new string[] { "Pages", "List", "5", "30" });
        var controller = new PageController();
        controller.Model = model;
        Mvc.Run(page, controller);
        Assert.AreEqual("~/Views/Pages/_Page_List.cshtml", page.Page.View);
        model.Verify();
    }
Ejemplo n.º 20
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (comboBox.SelectedIndex == 0)
     {
         string forChar = tBoxes[7].Text;
         char[] c       = forChar.ToCharArray();
         try
         {
             chemistryController = new ChemistryElementController();
             ChemistryElement element = new ChemistryElement(tBoxes[0].Text, tBoxes[1].Text, tBoxes[2].Text,
                                                             int.Parse(tBoxes[3].Text), tBoxes[4].Text, int.Parse(tBoxes[5].Text),
                                                             double.Parse(tBoxes[6].Text), c[0], "/MyImages/Графічні моделі/" + tBoxes[0].Text + ".png", tBoxes[9].Text, tBoxes[10].Text
                                                             );
             chemistryController.add(element);
             MessageBox.Show("Successfully added " + element);
             for (int i = 0; i < tBoxes.Length; i++)
             {
                 tBoxes[i].Text = "";
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Failed, something is wrong");
         }
         chemistryController.close();
     }
     else if (comboBox.SelectedIndex == 1)
     {
         try
         {
             organicController = new OrganicController();
             OrganicElement element = new OrganicElement(tBoxes[0].Text, tBoxes[1].Text, tBoxes[2].Text,
                                                         tBoxes[3].Text);
             organicController.add(element);
             MessageBox.Show("Successfully added " + element);
             for (int i = 0; i < tBoxes.Length; i++)
             {
                 tBoxes[i].Text = "";
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Failed, something is wrong");
         }
         organicController.close();
     }
     else if (comboBox.SelectedIndex == 2)
     {
         try
         {
             pageController = new PageController();
             PageWithTextAndImage element = new PageWithTextAndImage(int.Parse(tBoxes[0].Text), tBoxes[1].Text);
             pageController.add(element);
             MessageBox.Show("Successfully added " + element);
             for (int i = 0; i < tBoxes.Length; i++)
             {
                 tBoxes[i].Text = "";
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Failed, something is wrong");
         }
         pageController.close();
     }
     else if (comboBox.SelectedIndex == 3)
     {
         try
         {
             imageController = new ImageController();
             Picture picture = new Picture(tBoxes[0].Text);
             imageController.add(picture);
             MessageBox.Show("Successfully added " + picture);
             for (int i = 0; i < tBoxes.Length; i++)
             {
                 tBoxes[i].Text = "";
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Failed, something is wrong");
         }
         imageController.close();
     }
 }
Ejemplo n.º 21
0
 public override void initState()
 {
     base.initState();
     this._selectedIndex  = 1;
     this._pageController = new PageController(initialPage: this._selectedIndex);
 }
Ejemplo n.º 22
0
 public override void OnResume()
 {
     PageController?.SendAppearing();
     base.OnResume();
 }
Ejemplo n.º 23
0
 public override void initState()
 {
     base.initState();
     this._pageController = new PageController();
     this._selectedIndex  = 0;
 }
Ejemplo n.º 24
0
 private void StartGame()
 {
     PageController.EnviromentController.SwitchEnviromentOn <EnviromentSolarSystem>();
     PageController.SwitchPageOn <GamePlayPage>();
 }
 public int ZoomOutFontSize()
 {
     return(PageController.ZoomOutFontSize());
 }
Ejemplo n.º 26
0
        protected void GetSuperRoleID()
        {
            PageController objCon = new PageController();

            RoleID = objCon.GetSuperRoleID();
        }
Ejemplo n.º 27
0
 protected override void OnDetachedFromWindow()
 {
     base.OnDetachedFromWindow();
     PageController.SendDisappearing();
     _isAttachedToWindow = false;
 }
Ejemplo n.º 28
0
		public override void OnPause()
		{
			PageController?.SendDisappearing();
			base.OnPause();
		}
Ejemplo n.º 29
0
 public override void ViewDidDisappear(bool animated)
 {
     base.ViewDidDisappear(animated);
     PageController.SendDisappearing();
 }
Ejemplo n.º 30
0
		public override void OnResume()
		{
			if (UserVisibleHint)
				PageController?.SendAppearing();
			base.OnResume();
		}
Ejemplo n.º 31
0
 public void Delete_Post()
 {
     dynamic model = new Mock();
     model.Setup("Delete", new object[] { It.Is<dynamic>(item => item.Id == "id") }, null);
     dynamic page = new MockPost(new string[] { "Pages", "Delete", "id" }, null); //get id from url
     var controller = new PageController();
     controller.Model = model;
     Mvc.Run(page, controller);
     model.Verify();
     Assert.AreEqual("~/Pages/List", page.Page.Redirect);
 }
Ejemplo n.º 32
0
 public override void OnDetachedFromWindow()
 {
     base.OnDetachedFromWindow();
     PageController.SendDisappearing();
 }
Ejemplo n.º 33
0
    public void Edit_Post_SaveAs()
    {
        dynamic data = new ExpandoObject();
        data.Id = "new-id";

        dynamic model = new Mock();
        model.Setup("SaveAs", new object[] { It.Is<dynamic>(item => item.Id == "old-id"), "new-id" }, model);
        model.SetupGet("Value", data);
        model.SetupGet("HasError", false); //this bypasses validation
        model.Setup("Load", new object[] { It.Is<dynamic>(item => item.Id == "new-id") }, model);
        model.SetupGet("Value", data);

        var form = new NameValueCollection();
        form["OldId"] = "old-id";
        form["Id"] = "new-id";

        dynamic page = new MockPost(new string[] { "Pages", "Edit", "id" }, form);
        var controller = new PageController();
        controller.Model = model;

        Mvc.Run(page, controller);
        Assert.AreEqual("~/Pages/new-id", page.Page.Redirect);
    }
Ejemplo n.º 34
0
        public MainWindow()
        {
            InitializeComponent();


            try
            {
                if (!File.Exists(Config.PathToXLSX))
                {
                    new StartPage().ShowDialog();
                }
                else
                {
                    ThreatController.InitializeViaJSON();
                }
                PageBack.IsEnabled = false;

                var pager = new PageController <ThreatShortForm>(ThreatController.ThreatCollection, 15);
                pager.IsFirstPage  += () => PageBack.IsEnabled = false;
                pager.IsLastPage   += () => PageForward.IsEnabled = false;
                pager.NotFirstPage += () => PageBack.IsEnabled = true;
                pager.NotLastPage  += () => PageForward.IsEnabled = true;


                Table.ItemsSource       = pager.MoveForward();
                ShowFullButton.Click   += GetFullInfo;
                LastUpdateLabel.Content = Config.LastUpdate.ToString("dd.MM.yyyy HH:mm");
                UpdateButton.Click     += UpdateClick;

                SettingsButton.Click += (sender, args) =>
                {
                    new SettingsPage().ShowDialog();
                };

                FindButton.Click    += Find;
                RefreshButton.Click += (sender, args) =>
                {
                    Table.ItemsSource = pager.CurrentPage;
                    FindBox.Text      = "";
                };

                FindBox.GotFocus += (sender, args) =>
                {
                    if (FindBox.Text == "Введите название...")
                    {
                        FindBox.Text = "";
                    }
                };

                var interval = Config.LastUpdate + Config.UpdateInterval - Config.LastUpdate;
                timer.Tick += AutomaticUpdate;

                if (DateTime.Now - Config.LastUpdate > interval)
                {
                    AutomaticUpdate(new object(), new EventArgs());
                }
                else
                {
                    timer.Interval = interval;
                }

                timer.Start();

                PageInfo.Content = $"1/{pager.PagesCount}";

                PageBack.Click += (sender, args) =>
                {
                    Table.ItemsSource = pager.MoveBack();
                    PageInfo.Content  = pager.CurrentPageNum + $"/{pager.PagesCount}";
                };

                PageForward.Click += (sender, args) =>
                {
                    Table.ItemsSource = pager.MoveForward();
                    PageInfo.Content  = pager.CurrentPageNum + $"/{pager.PagesCount}";
                };
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace, ex.Source);
            }
            finally
            {
                //Close();
            }
        }
Ejemplo n.º 35
0
    public void Edit_Post_Update()
    {
        dynamic data = new ExpandoObject();
        data.Id = "id";

        dynamic model = new Mock();
        model.Setup("Update", new object[] { It.Is<dynamic>(item=>item.Id=="id") }, model);
        model.SetupGet("Value", data);
        model.SetupGet("HasError", false); //this bypasses validation

        var form = new NameValueCollection();
        form["OldId"] = "id";

        dynamic page = new MockPost(new string[] { "Pages", "Edit" }, form);
        page.Response.Setup("Redirect", new object[] { "~/Pages/List", false });

        var controller = new PageController();
        controller.Model = model;

        Mvc.Run(page, controller);

        Assert.AreEqual("~/Pages/id", page.Page.Redirect); // redirect
        model.Verify();
    }
Ejemplo n.º 36
0
        public void ManageSSLConnection()
        {
            ApplicationController objAppController = new ApplicationController();

            if (!objAppController.CheckRequestExtension(Request))
            {
                if (Session[SessionKeys.Ssl] == null)
                {
                    Session[SessionKeys.Ssl] = "True";
                    //check logic redirect to or not
                    //btn click login and logout prob
                    PageController        objController = new PageController();
                    List <SecurePageInfo> sp            = objController.GetSecurePage(currentportalID, GetCurrentCulture());
                    string pagename = GetPageSEOName(PagePath);
                    if (pagename != "Page-Not-Found")
                    {
                        if (Session[SessionKeys.pagename] != null)
                        {
                            prevpage = Session[SessionKeys.pagename].ToString();
                        }
                        if (prevpage != pagename)
                        {
                            Session[SessionKeys.pagename] = pagename;
                            for (int i = 0; i < sp.Count; i++)
                            {
                                if (pagename.ToLower() == sp[i].SecurePageName.ToString().ToLower())
                                {
                                    if (bool.Parse(sp[i].IsSecure.ToString()))
                                    {
                                        if (!HttpContext.Current.Request.IsSecureConnection)
                                        {
                                            if (!HttpContext.Current.Request.Url.IsLoopback) //Don't check when in development mode (i.e. localhost)
                                            {
                                                Session[SessionKeys.prevurl] = "https";
                                                Response.Redirect(Request.Url.ToString().Replace("http://", "https://"));
                                            }
                                        }
                                    }
                                    else
                                    {
                                        Session[SessionKeys.prevurl] = "http";
                                        Response.Redirect(Request.Url.ToString().Replace("https://", "http://"));
                                    }
                                }
                            }
                        }
                        else if (Session[SessionKeys.prevurl] != null)
                        {
                            if (Session[SessionKeys.prevurl].ToString() != Request.Url.ToString().Split(':')[0].ToString())
                            {
                                for (int i = 0; i < sp.Count; i++)
                                {
                                    if (pagename.ToLower() == sp[i].SecurePageName.ToString().ToLower())
                                    {
                                        if (bool.Parse(sp[i].IsSecure.ToString()))
                                        {
                                            if (!HttpContext.Current.Request.IsSecureConnection)
                                            {
                                                if (!HttpContext.Current.Request.Url.IsLoopback) //Don't check when in development mode (i.e. localhost)
                                                {
                                                    Response.Redirect(Request.Url.ToString().Replace("http://", "https://"));
                                                }
                                            }
                                        }
                                        else
                                        {
                                            Response.Redirect(Request.Url.ToString().Replace("https://", "http://"));
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
 public static PresetInfo GetPresetDetails(string TemplateName, int PortalID)
 {
     string presetPath = Decide.IsTemplateDefault(TemplateName.Trim()) ? Utils.GetPresetPath_DefaultTemplate(TemplateName) : Utils.GetPresetPath(TemplateName);
     presetPath += "/" + "pagepreset.xml";
     PresetInfo objPreset = new PresetInfo();
     try
     {
         objPreset = PresetHelper.LoadPresetDetails(presetPath);
         PageController objPageController = new PageController();
         List<PageEntity> lstMenu = objPageController.GetMenuFront(PortalID, false);
         foreach (PageEntity obj in lstMenu)
         {
             obj.ChildCount = lstMenu.Count(
                 delegate(PageEntity objMenu)
                 {
                     return (objMenu.ParentID == obj.PageID);
                 }
                 );
         }
         List<string> lstPages = new List<string>();
         List<KeyValue> lstLayout = new List<KeyValue>();
         foreach (KeyValue kvp in objPreset.lstLayouts)
         {
             string[] arrPage = kvp.Value.Split(',');
             List<string> lstNewPage = new List<string>();
             foreach (string page in arrPage)
             {
                 bool exists = lstMenu.Exists(
                        delegate(PageEntity obj)
                        {
                            return obj.PageName.TrimStart('-') == page;
                        }
                     );
                 if (exists || page.ToLower() == "all")
                 {
                     lstNewPage.Add(page);
                 }
             }
             if (lstNewPage.Count > 0)
             {
                 lstLayout.Add(new KeyValue(kvp.Key, string.Join(",", lstNewPage.ToArray())));
             }
         }
         objPreset.lstLayouts = lstLayout;
         PresetHelper.WritePreset(presetPath, objPreset);
         return objPreset;
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 38
0
 public void OnClickGirlBookBtn()
 {
     PageController.GoToGirlBook();
 }
 // Use this for initialization
 void Start()
 {
     launcherController = GameObject.FindGameObjectWithTag("GameController").GetComponent <LauncherController> ();
     pageController     = launcherController.pageController;
 }
Ejemplo n.º 40
0
        public override SyncFeed GetFeed()
        {
            bool   includeUuid;
            string whereClause = string.Empty;

            OleDbParameter[] oleDbParameters = null;

            if (this is IEntityQueryWrapper)
            {
                QueryFilterBuilder queryFilterBuilder = new QueryFilterBuilder((IEntityQueryWrapper)this);

                queryFilterBuilder.BuildSqlStatement(_context, out whereClause, out oleDbParameters);
            }

            SyncFeed feed = new SyncFeed();

            feed.Title = _resourceKind.ToString() + ": " + DateTime.Now.ToString();

            Token emptyToken = new Token();


            List <Identity> identities = new List <Identity>();

            if (String.IsNullOrEmpty(_context.ResourceKey))
            {
                identities = _entity.GetAll(_context.Config, whereClause, oleDbParameters);
            }
            else
            {
                identities.Add(GetIdentity(_context.ResourceKey));
            }


            int totalResult = identities.Count;

            #region PAGING & OPENSEARCH

            /* PAGING */
            feed.Links = FeedMetadataHelpers.CreatePageFeedLinks(_context, totalResult, FeedMetadataHelpers.RequestKeywordType.none);

            /* OPENSEARCH */
            PageController pageController = FeedMetadataHelpers.GetPageLinkBuilder(_context, totalResult, FeedMetadataHelpers.RequestKeywordType.none);

            feed.Opensearch_ItemsPerPageElement = pageController.GetOpensearch_ItemsPerPageElement();
            feed.Opensearch_StartIndexElement   = pageController.GetOpensearch_StartIndexElement();
            feed.Opensearch_TotalResultsElement = pageController.GetOpensearch_TotalResultsElement();

            #endregion

            feed.Id = _context.SdataUri.ToString();

            string tmpValue;
            // ?includeUuid
            includeUuid = false;    // default value, but check for settings now
            if (_context.SdataUri.QueryArgs.TryGetValue("includeUuid", out tmpValue))
            {
                includeUuid = System.Xml.XmlConvert.ToBoolean(tmpValue);
            }

            ICorrelatedResSyncInfoStore correlatedResSyncStore = null;
            if (includeUuid)
            {
                // get store to request the correlations
                correlatedResSyncStore = RequestReceiver.NorthwindAdapter.StoreLocator.GetCorrelatedResSyncStore(_context.SdataContext);
            }

            for (int pageIndex = pageController.StartIndex; pageIndex <= pageController.LastIndex; pageIndex++)
            {
                int           zeroBasedIndex = pageIndex - 1;
                Identity      identity       = identities[zeroBasedIndex];
                SyncFeedEntry entry;
                if (_context.SdataUri.Precedence == null)
                {
                    entry = GetFeedEntry(identity.Id);
                }
                else
                {
                    entry = new SyncFeedEntry();
                }

                entry.Id = String.Format("{0}{1}('{2}')", _context.DatasetLink, _resourceKind.ToString(), identity.Id);

                entry.Title   = String.Format("{0}: {1}", _resourceKind.ToString(), identity.Id);
                entry.Updated = DateTime.Now;

                // warning add links

                if (includeUuid)
                {
                    CorrelatedResSyncInfo[] infos = correlatedResSyncStore.GetByLocalId(_context.ResourceKind.ToString(), new string[] { identity.Id });
                    entry.Uuid = (infos.Length > 0) ? infos[0].ResSyncInfo.Uuid : Guid.Empty;
                }

                if (entry != null)
                {
                    feed.Entries.Add(entry);
                }
            }

            return(feed);
        }
Ejemplo n.º 41
0
        protected override void OnElementChanged(ElementChangedEventArgs <BottomTabbedPage> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                BottomTabbedPage bottomBarPage = e.NewElement;

                if (_bottomBar == null)
                {
                    _pageController = PageController.Create(bottomBarPage);

                    _rootLayout = new LinearLayout(Context)
                    {
                        LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent)
                    };
                    AddView(_rootLayout);

                    // create a view which will act as container for Page's
                    _frameLayout = new FrameLayout(Context)
                    {
                        LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent)
                    };
                    _rootLayout.AddView(_frameLayout);

                    _bottomBar = new BottomNavigationViewEx(Context)
                    {
                        LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent)
                    };

                    _rootLayout.AddView(_bottomBar);
                    _bottomBar.SetOnNavigationItemSelectedListener(this);

                    if (BackgroundColor.HasValue)
                    {
                        _bottomBar.SetBackgroundColor(BackgroundColor.Value);
                    }

                    if (ItemIconTintList != null)
                    {
                        _bottomBar.ItemIconTintList = ItemIconTintList;
                    }
                    if (ItemTextColor != null)
                    {
                        _bottomBar.ItemTextColor = ItemTextColor;
                    }
                    if (ItemBackgroundResource.HasValue)
                    {
                        _bottomBar.ItemBackgroundResource = ItemBackgroundResource.Value;
                    }
                    // Resource.Drawable.bnv_selector

                    _menu = (BottomNavigationMenu)_bottomBar.Menu;

                    UpdateTabs();
                }

                if (bottomBarPage.CurrentPage != null)
                {
                    SwitchContent(bottomBarPage.CurrentPage);
                }
            }
        }
Ejemplo n.º 42
0
 public void OnClickGrilLostBtn()
 {
     PageController.GoToGirlLost();
 }