Beispiel #1
0
        private void BindValues()
        {
            string[] parts = FullId.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);

            string path = "Navigation/Tabs";

            if (parts.Length > 0)
            {
                path += String.Format(CultureInfo.InvariantCulture, "/Tab[@id='{0}']", parts[0]);
            }

            for (int i = 1; i < parts.Length; i++)
            {
                path += String.Format(CultureInfo.InvariantCulture, "/Link[@id='{0}']", parts[i]);
            }

            string profileString   = ProfileId.HasValue ? ProfileId.Value.ToString() : String.Empty;
            string principalString = PrincipalId.HasValue ? PrincipalId.Value.ToString() : String.Empty;

            if (PrincipalId.HasValue)
            {
                profileString = ProfileManager.GetProfileIdByUser(PrincipalId.Value).ToString();
            }

            Mediachase.Ibn.XmlTools.Selector selector = new Mediachase.Ibn.XmlTools.Selector(string.Empty, string.Empty, string.Empty, profileString, principalString);
            IXPathNavigable navigable = Mediachase.Ibn.XmlTools.XmlBuilder.GetCustomizationXml(null, Mediachase.Ibn.XmlTools.StructureType.Navigation, selector);
            XPathNavigator  node      = navigable.CreateNavigator().SelectSingleNode(path);

            if (node != null)
            {
                ctrlTitleText.Text = node.GetAttribute("text", string.Empty);

                ItemOrder.Text = node.GetAttribute("order", string.Empty);

                SavedText  = ctrlTitleText.Text;
                SavedOrder = int.Parse(ItemOrder.Text);
            }
        }
Beispiel #2
0
        private void BindValues()
        {
            string[] parts = FullId.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);

            string path = "Navigation/Tabs";
            if (parts.Length > 0)
                path += String.Format(CultureInfo.InvariantCulture, "/Tab[@id='{0}']", parts[0]);

            for (int i = 1; i < parts.Length; i++)
                path += String.Format(CultureInfo.InvariantCulture, "/Link[@id='{0}']", parts[i]);

            string profileString = ProfileId.HasValue ? ProfileId.Value.ToString() : String.Empty;
            string principalString = PrincipalId.HasValue ? PrincipalId.Value.ToString() : String.Empty;
            if (PrincipalId.HasValue)
                profileString = ProfileManager.GetProfileIdByUser(PrincipalId.Value).ToString();

            Mediachase.Ibn.XmlTools.Selector selector = new Mediachase.Ibn.XmlTools.Selector(string.Empty, string.Empty, string.Empty, profileString, principalString);
            IXPathNavigable navigable = Mediachase.Ibn.XmlTools.XmlBuilder.GetCustomizationXml(null, Mediachase.Ibn.XmlTools.StructureType.Navigation, selector);
            XPathNavigator node = navigable.CreateNavigator().SelectSingleNode(path);
            if (node != null)
            {
                ctrlTitleText.Text = node.GetAttribute("text", string.Empty);

                ItemOrder.Text = node.GetAttribute("order", string.Empty);

                SavedText = ctrlTitleText.Text;
                SavedOrder = int.Parse(ItemOrder.Text);
            }
        }