Ejemplo n.º 1
0
        private void Init()
        {
            Id          = ConfigHelper.GetValueRegex("<Id>(.*)</Id>", _configContent);
            Name        = ConfigHelper.GetValueRegex("<Name>(.*)</Name>", _configContent);
            Enabled     = ConfigHelper.GetValueRegex("<Enabled>(.*)</Enabled>", _configContent) != "false";
            Visible     = ConfigHelper.GetValueRegex("<Visible>(.*)</Visible>", _configContent) != "false";
            UserGranted = !_configContent.ToLower().Contains("approvedusers") ||
                          ConfigHelper.GetValuesRegex("<user>(.*?)</user>", _configContent)
                          .Any(user => user.Equals(Environment.UserName, StringComparison.OrdinalIgnoreCase));

            if (Visible && UserGranted)
            {
                var tabDirectoryPath = Path.Combine(ResourceManager.Instance.DataFolder.LocalPath, Id);
                if (Directory.Exists(tabDirectoryPath))
                {
                    foreach (var p in Directory.GetDirectories(tabDirectoryPath))
                    {
                        var tabGroup = new TabGroup(p);
                        if (tabGroup.Visible && tabGroup.UserGranted)
                        {
                            Groups.Add(tabGroup);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
		private RibbonBar CreateBrowserBar(TabGroup groupConfig)
		{
			var ribbonBar = new RibbonBar
			{
				Text = groupConfig.Name,
				HorizontalItemAlignment = eHorizontalItemsAlignment.Center,
				VerticalItemAlignment = eVerticalItemsAlignment.Middle,
				AutoOverflowEnabled = false
			};
			foreach (BaseItem buttonItem in ribbonBarBrowsers.Items)
				ribbonBar.Items.Add((BaseItem)buttonItem.Clone());
			return ribbonBar;
		}
Ejemplo n.º 3
0
		private RibbonBar CreateGroupBar(TabGroup groupConfig)
		{
			var ribbonBar = new RibbonBar
			{
				Text = groupConfig.Name,
				HorizontalItemAlignment = eHorizontalItemsAlignment.Center,
				VerticalItemAlignment = eVerticalItemsAlignment.Middle,
				AutoOverflowEnabled = false
			};
			ribbonBar.Items.Add(CreateBarItem(groupConfig.Items));
			return ribbonBar;
		}