Exemplo n.º 1
0
        private void uiContextMenu_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            //if (Globals.Licenses.Count == 0)
            //{
            //    UriHelper.NavigateTo("#/Administration/LicenseAdminPage.xaml");
            //    return;
            //}

            if (MenuItemClicked != null)
            {
                MenuItemClicked(this, null);
            }

            RadMenuItem radMenuItem = e.OriginalSource as RadMenuItem;

            if (radMenuItem != null)
            {
                SiteMapMenuItem menuItem = radMenuItem.DataContext as SiteMapMenuItem;
                if (menuItem != null && !string.IsNullOrEmpty(menuItem.Url))
                {
                    nsTooltips.ToolTipService.ClearAllToolTip();
                    Navigate(menuItem.Url, menuItem.Target);
                }
            }
        }
Exemplo n.º 2
0
        void uiMenu_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            RadMenuItem radMenuItem = e.OriginalSource as RadMenuItem;

            if (radMenuItem != null)
            {
                SiteMapMenuItem menuItem = radMenuItem.DataContext as SiteMapMenuItem;
                if (menuItem != null)
                {
                    UriHelper.NavigateTo(menuItem.Url, menuItem.Target);
                }
            }
        }
Exemplo n.º 3
0
        /*  ======================================================================
         *      PAGE FUNCTIONS
         *  ====================================================================== */
        private SiteMapMenuItem ChildMenuItem(XElement siteMapNode)
        {
            SiteMapMenuItem result =
                new SiteMapMenuItem()
                {
                    Title = (string)siteMapNode.Attribute("title"),
                    Description = (string)siteMapNode.Attribute("description"),
                    ModuleType = (string)siteMapNode.Attribute("moduleType"),
                    Url = (string)siteMapNode.Attribute("url"),
                    IsEnabled = CheckRoleAccess((string)siteMapNode.Attribute("roles")),
                    Target = (string)siteMapNode.Attribute("target"),
                    Items =
                        from childNode in siteMapNode.Elements(SiteMapHelper.XNameSiteMapNode)
                        select ChildMenuItem(childNode)
                };

            return result;
        }
Exemplo n.º 4
0
        /*  ======================================================================
         *      PAGE FUNCTIONS
         *  ====================================================================== */
        private SiteMapMenuItem ChildMenuItem(XElement siteMapNode)
        {
            SiteMapMenuItem result =
                new SiteMapMenuItem()
            {
                Title       = (string)siteMapNode.Attribute("title"),
                Description = (string)siteMapNode.Attribute("description"),
                ModuleType  = (string)siteMapNode.Attribute("moduleType"),
                Url         = (string)siteMapNode.Attribute("url"),
                IsEnabled   = CheckRoleAccess((string)siteMapNode.Attribute("roles")),
                Target      = (string)siteMapNode.Attribute("target"),
                Items       =
                    from childNode in siteMapNode.Elements(SiteMapHelper.XNameSiteMapNode)
                    select ChildMenuItem(childNode)
            };

            return(result);
        }
Exemplo n.º 5
0
        private SiteMapMenuItem ChildMenuItem(XElement siteMapNode)
        {
            bool isEnabled = (string.IsNullOrEmpty((string)siteMapNode.Attribute("disabled")));

            SiteMapMenuItem result =
                new SiteMapMenuItem()
            {
                Title       = (string)siteMapNode.Attribute("title"),
                Description = (string)siteMapNode.Attribute("description"),
                ModuleType  = (string)siteMapNode.Attribute("moduleType"),
                Url         = (string)siteMapNode.Attribute("url"),
                IsEnabled   = isEnabled,
                Target      = (string)siteMapNode.Attribute("target"),
                Items       =
                    from childNode in siteMapNode.Elements(SiteMapHelper.XNameSiteMapNode)
                    select ChildMenuItem(childNode)
            };

            return(result);
        }
Exemplo n.º 6
0
        private void uiContextMenu_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            RadMenuItem radMenuItem = e.OriginalSource as RadMenuItem;

            if (radMenuItem != null)
            {
                SiteMapMenuItem menuItem = radMenuItem.DataContext as SiteMapMenuItem;

                if (menuItem != null && !string.IsNullOrEmpty(menuItem.Url))
                {
                    nsTooltips.ToolTipService.ClearAllToolTip();
                    if (menuItem.Url.Contains(".xaml"))
                    {
                        UriHelper.NavigateTo("#" + menuItem.Url, menuItem.Target);
                    }
                    else
                    {
                        UriHelper.NavigateTo(menuItem.Url, menuItem.Target);
                    }
                }
            }
        }
Exemplo n.º 7
0
        //private SiteMapMenuItem ChildMenuItem(XElement siteMapNode)
        //{
        //    SiteMapMenuItem result =
        //        new SiteMapMenuItem()
        //        {
        //            Title = (string)siteMapNode.Attribute("title"),
        //            Description = (string)siteMapNode.Attribute("description"),
        //            Url = (string)siteMapNode.Attribute("url"),
        //            Target = (string)siteMapNode.Attribute("target"),
        //            IsEnabled = (string.IsNullOrEmpty((string)siteMapNode.Attribute("disabled"))) && CheckRoleAccess((string)siteMapNode.Attribute("roles")),
        //            Items =
        //                from childNode in siteMapNode.Elements(SiteMapHelper.XNameSiteMapNode)
        //                select ChildMenuItem(childNode)
        //        };
        //    return result;
        //}

        private SiteMapMenuItem ChildMenuItem(XElement siteMapNode)
        {
            bool   isEnabled = (string.IsNullOrEmpty((string)siteMapNode.Attribute("disabled")));
            string title     = (string)siteMapNode.Attribute("title");
            //if (this.Name == "uiEmployees" && isEnabled && title == "Reports")
            //{
            //    isEnabled = Globals.UserLogin.UserModuleTypes.Contains(ModuleTypes.Employees);
            //}
            SiteMapMenuItem result =
                new SiteMapMenuItem()
            {
                Title       = (string)siteMapNode.Attribute("title"),
                Description = (string)siteMapNode.Attribute("description"),
                Url         = (string)siteMapNode.Attribute("url"),
                Target      = (string)siteMapNode.Attribute("target"),
                IsEnabled   = isEnabled,
                Items       =
                    from childNode in siteMapNode.Elements(SiteMapHelper.XNameSiteMapNode)
                    where isEnabled && (string.IsNullOrEmpty((string) childNode.Attribute("disabled")))
                    select ChildMenuItem(childNode)
            };

            return(result);
        }
Exemplo n.º 8
0
        //private SiteMapMenuItem ChildMenuItem(XElement siteMapNode)
        //{
        //    SiteMapMenuItem result =
        //        new SiteMapMenuItem()
        //        {
        //            Title = (string)siteMapNode.Attribute("title"),
        //            Description = (string)siteMapNode.Attribute("description"),
        //            Url = (string)siteMapNode.Attribute("url"),
        //            Target = (string)siteMapNode.Attribute("target"),
        //            IsEnabled = (string.IsNullOrEmpty((string)siteMapNode.Attribute("disabled"))) && CheckRoleAccess((string)siteMapNode.Attribute("roles")),
        //            Items =
        //                from childNode in siteMapNode.Elements(SiteMapHelper.XNameSiteMapNode)
        //                select ChildMenuItem(childNode)
        //        };
        //    return result;
        //}
        private SiteMapMenuItem ChildMenuItem(XElement siteMapNode)
        {
            bool isEnabled = (string.IsNullOrEmpty((string)siteMapNode.Attribute("disabled")));
            string title = (string)siteMapNode.Attribute("title");
            //if (this.Name == "uiEmployees" && isEnabled && title == "Reports")
            //{
            //    isEnabled = Globals.UserLogin.UserModuleTypes.Contains(ModuleTypes.Employees);
            //}
            SiteMapMenuItem result =
                new SiteMapMenuItem()
                {
                    Title = (string)siteMapNode.Attribute("title"),
                    Description = (string)siteMapNode.Attribute("description"),
                    Url = (string)siteMapNode.Attribute("url"),
                    Target = (string)siteMapNode.Attribute("target"),
                    IsEnabled = isEnabled,
                    Items =
                        from childNode in siteMapNode.Elements(SiteMapHelper.XNameSiteMapNode)
                        where isEnabled && (string.IsNullOrEmpty((string)childNode.Attribute("disabled")))
                        select ChildMenuItem(childNode)
                };

            return result;
        }
Exemplo n.º 9
0
        private SiteMapMenuItem ChildMenuItem(XElement siteMapNode)
        {
            bool isEnabled = (string.IsNullOrEmpty((string)siteMapNode.Attribute("disabled")));

            SiteMapMenuItem result =
                new SiteMapMenuItem()
                {
                    Title = (string)siteMapNode.Attribute("title"),
                    Description = (string)siteMapNode.Attribute("description"),
                    ModuleType = (string)siteMapNode.Attribute("moduleType"),
                    Url = (string)siteMapNode.Attribute("url"),
                    IsEnabled = isEnabled,
                    Target = (string)siteMapNode.Attribute("target"),
                    Items =
                        from childNode in siteMapNode.Elements(SiteMapHelper.XNameSiteMapNode)
                        select ChildMenuItem(childNode)
                };

            return result;
        }