예제 #1
0
        public void DNN_13659_WithTabName_NullTabName()
        {
            //Setup
            var tabCollection = new TabCollection();
            tabCollection.Add(new TabInfo {PortalID = 1, TabID = 1});

            //Act
            var tab = tabCollection.WithTabName("TestName");

            Assert.IsNull(tab);
        }
예제 #2
0
 private static void AddChildTabsToList(TabInfo currentTab, ref TabCollection allPortalTabs, ref IDictionary <int, TabInfo> tabsWithModule, ref IDictionary <int, TabInfo> tabsInOrder)
 {
     if ((tabsWithModule.ContainsKey(currentTab.TabID) && !tabsInOrder.ContainsKey(currentTab.TabID)))
     {
         //add current tab
         tabsInOrder.Add(currentTab.TabID, currentTab);
         //add children of current tab
         foreach (TabInfo tab in allPortalTabs.WithParentId(currentTab.TabID))
         {
             AddChildTabsToList(tab, ref allPortalTabs, ref tabsWithModule, ref tabsInOrder);
         }
     }
 }
예제 #3
0
 private static void AddChildTabsToList(TabInfo currentTab, ref TabCollection allPortalTabs, ref IDictionary<int, TabInfo> tabsWithModule, ref IDictionary<int, TabInfo> tabsInOrder)
 {
     if ((tabsWithModule.ContainsKey(currentTab.TabID) && !tabsInOrder.ContainsKey(currentTab.TabID)))
     {
         //add current tab
         tabsInOrder.Add(currentTab.TabID, currentTab);
         //add children of current tab
         foreach (TabInfo tab in allPortalTabs.WithParentId(currentTab.TabID))
         {
             AddChildTabsToList(tab, ref allPortalTabs, ref tabsWithModule, ref tabsInOrder);
         }
     }
 }
예제 #4
0
        private IDictionary <int, TabInfo> BuildData(int portalID)
        {
            IDictionary <int, TabInfo> tabsWithModule = TabCtrl.GetTabsByPackageID(portalID, PackageID, false);
            TabCollection allPortalTabs            = TabCtrl.GetTabsByPortal(portalID);
            IDictionary <int, TabInfo> tabsInOrder = new Dictionary <int, TabInfo>();

            //must get each tab, they parent may not exist
            foreach (TabInfo tab in allPortalTabs.Values)
            {
                AddChildTabsToList(tab, ref allPortalTabs, ref tabsWithModule, ref tabsInOrder);
            }
            return(tabsInOrder);
        }
예제 #5
0
        private void InicializarTab(string tipoTarea, bool isNew = false)
        {
            TabCollection tabCollection = new TabCollection();

            tabCollection.Add("tabdato", TabTarget.HtmlElement, "#tabdato", Rp3.AgendaComercial.Resources.TitleFor.DatosGenerales, true);

            if (!isNew)
            {
                if (tipoTarea == Rp3.AgendaComercial.Models.Constantes.TipoTarea.ActualizacionClientes)
                {
                    tabCollection.Add("tabnuevos", TabTarget.HtmlElement, "#tabnuevos", Rp3.AgendaComercial.Resources.TitleFor.Nuevos, false);
                    tabCollection.Add("tabexistentes", TabTarget.HtmlElement, "#tabexistentes", Rp3.AgendaComercial.Resources.TitleFor.Existentes, false);
                    tabCollection.Add("tabgestion", TabTarget.HtmlElement, "#tabgestion", Rp3.AgendaComercial.Resources.TitleFor.GestionVisita, false);
                }

                if (tipoTarea != Rp3.AgendaComercial.Models.Constantes.TipoTarea.CheckListOportunidad)
                {
                    tabCollection.Add("tabruta", TabTarget.HtmlElement, "#tabruta", Rp3.AgendaComercial.Resources.TitleFor.Ruta, false);
                }

                tabCollection.Add("tabactividad", TabTarget.HtmlElement, "#tabactividad", Rp3.AgendaComercial.Resources.TitleFor.Actividades, false);
            }

            ViewBag.TabCollection = tabCollection;

            ViewBag.ClienteCampoGrupos = new List <ClienteCampoGrupo>()
            {
                new ClienteCampoGrupo()
                {
                    IdGrupo = 1, Grupo = Rp3.AgendaComercial.Resources.LabelFor.PersonaNatural
                },
                new ClienteCampoGrupo()
                {
                    IdGrupo = 2, Grupo = Rp3.AgendaComercial.Resources.LabelFor.PersonaJuridica
                },
                new ClienteCampoGrupo()
                {
                    IdGrupo = 3, Grupo = Rp3.AgendaComercial.Resources.LabelFor.Persona
                },
                new ClienteCampoGrupo()
                {
                    IdGrupo = 4, Grupo = Rp3.AgendaComercial.Resources.LabelFor.Direccion
                },
                new ClienteCampoGrupo()
                {
                    IdGrupo = 5, Grupo = Rp3.AgendaComercial.Resources.LabelFor.Contacto
                }
            };

            ViewBag.ClienteCampos = DataBase.ParametroClienteCampos.Get();
        }
예제 #6
0
        private void LoadTabs(string storePageID, string cartPageID)
        {
            TabController tabController = new TabController();
            TabCollection tabs          = tabController.GetTabsByPortal(PortalId);
            string        tabHidden     = Localization.GetString("TabHidden", LocalResourceFile);

            foreach (TabInfo tabInfo in tabs.Values)
            {
                if (!tabInfo.IsDeleted && !tabInfo.IsSuperTab)
                {
                    string tabID = tabInfo.TabID.ToString(CultureInfo.InvariantCulture);
                    string tabName;
                    if (tabInfo.IsVisible)
                    {
                        tabName = tabInfo.TabName;
                    }
                    else
                    {
                        tabName = tabInfo.TabName + tabHidden;
                    }
                    lstStorePageID.Items.Add(new ListItem(tabName, tabID));
                    lstShoppingCartPageID.Items.Add(new ListItem(tabName, tabID));
                }
            }

            string   select = Localization.GetString("EmptyComboValue", LocalResourceFile);
            ListItem none   = new ListItem(select, "-1");

            lstStorePageID.Items.Insert(0, none);
            none = new ListItem(select, "-1");
            lstShoppingCartPageID.Items.Insert(0, none);

            if (!string.IsNullOrEmpty(storePageID))
            {
                ListItem storeItem = lstStorePageID.Items.FindByValue(storePageID);
                if (storeItem != null)
                {
                    storeItem.Selected = true;
                }
            }

            if (!string.IsNullOrEmpty(cartPageID))
            {
                ListItem cartItem = lstShoppingCartPageID.Items.FindByValue(cartPageID);
                if (cartItem != null)
                {
                    cartItem.Selected = true;
                }
            }
        }
예제 #7
0
파일: NodeNaviTree.cs 프로젝트: wl147/mycms
//        protected void GetCmsMenu(StringBuilder builder,ECmsType type,bool isOpen )
//        {
//            string title = $@"
//<tr style='display:' treeItemLevel='1'>
//  <td nowrap>
//	<img align=""absmiddle"" style=""cursor: pointer; "" onClick=""displayChildren(this); "" isOpen=""{isOpen}"" src=""/siteserver/assets/icons/tree/{(isOpen? "minus.png":"plus.png")}""/>
//    <img align=""absmiddle"" src=""/siteserver/assets/icons/menu/content.png""/>&nbsp;
//    {ECmsTypeUtils.GetText(type)}
//  </td >
//</tr > ";

//            builder.Append(title);
//            var _publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(PublishmentSystemId);
//            try
//            {
//                var nodeIdList = DataProvider.NodeDao.GetNodeIdListByLevel(1, ECmsTypeUtils.GetDBType(type));
//                foreach (var nodeId in nodeIdList)
//                {
//                    var nodeInfo = NodeManager.GetNodeInfo(1, nodeId);
//                    if (nodeInfo != null)
//                    {
//                        builder.Append(GetChannelHtml(nodeInfo.PublishmentSystemId, nodeInfo.NodeId, nodeInfo.NodeName,isOpen));
//                    }
//                }

//            }
//            catch (Exception ex)
//            {
//                PageUtils.RedirectToErrorPage(ex.Message);
//            }

//        }
//        protected string GetChannelHtml(int publishmentId,int nodeId,string menuText,bool isDisplay)
//        {
//            string menuTemplete = $@"
//<tr style='{(isDisplay ? "display:" : "display: none")}' treeItemLevel='2'>
//     <td nowrap>
//         <img align = ""absmiddle"" src = ""/siteserver/assets/icons/tree/empty.gif"" />
//         <img align = ""absmiddle"" src = ""/siteserver/assets/icons/tree/empty.gif"" />
//         <img align = ""absmiddle"" src = ""/siteserver/assets/icons/menu/itemContainer.png"" /> &nbsp;
//         <a href='/siteserver/cms/pagecontent.aspx?PublishmentSystemID={publishmentId}&NodeID={nodeId}'  target = 'right' onclick = 'openFolderByA(this);' isTreeLink = 'true' >{menuText} </a> &nbsp;
//         </td >
//</tr > ";
//            return menuTemplete;
//        }
        /// <summary>
        /// Creates the markup for the current TabCollection
        /// </summary>
        /// <returns></returns>
        protected void BuildNavigationTree(StringBuilder builder, TabCollection tc, int parentsCount, bool isDisplay)
        {
            if (tc?.Tabs == null)
            {
                return;
            }

            foreach (var parent in tc.Tabs)
            {
                //    var nodeInfo = NodeManager.GetNodeInfo(1,nodeId);//子站继承主站栏目
                //    var enabled = AdminUtility.IsOwningNodeIdAll(body.AdministratorName, nodeInfo.NodeId);//管理员拥有权限的栏目
                //}
                //
                //if (!TabManager.IsValid(parent, PermissionList)) continue;
                if (parent.MenuType != null && parent.MenuType.Equals("cmsItem", StringComparison.OrdinalIgnoreCase))
                {
                    if (!AdminUtility.IsOwningNodeIdByPublishmentSystem(UserName, parent.NodeId))
                    {
                        continue;
                    }
                }
                //if ((parent.MenuType != null && parent.MenuType.Equals("cms", StringComparison.OrdinalIgnoreCase) && !CmsHasChildrenPerminssion(parent))) continue;
                if (!HasFirstRootMenu(parent))
                {
                    continue;
                }

                var linkUrl = FormatLink(parent);

                if (!string.IsNullOrEmpty(linkUrl) && !StringUtils.EqualsIgnoreCase(linkUrl, PageUtils.UnclickedUrl))
                {
                    linkUrl = PageUtils.GetLoadingUrl(linkUrl);
                }
                if (parent.MenuType != null && parent.MenuType.Equals("cmsItem", StringComparison.OrdinalIgnoreCase))
                {
                    linkUrl = PageUtils.GetAdminDirectoryUrl(parent.Href);
                }
                var hasChildren = parent.Children != null && parent.Children.Length > 0;
                var openWindow  = !hasChildren && StringUtils.EndsWithIgnoreCase(parent.Href, "main.aspx");

                var item = NavigationTreeItem.CreateNavigationBarItem(isDisplay, parent.Selected, parentsCount, hasChildren, openWindow, parent.Text, linkUrl, parent.Target, parent.Enabled, parent.IconUrl);

                builder.Append(item.GetTrHtml());
                if (parent.Children != null && parent.Children.Length > 0)
                {
                    var tc2 = NodeNaviTabManager.GetTabCollection(parent, PublishmentSystemId);
                    BuildNavigationTree(builder, tc2, parentsCount + 1, parent.Selected);
                }
            }
        }
예제 #8
0
        public void WithTabName_NoMatch()
        {
            //Setup
            var tabCollection = new TabCollection();
            tabCollection.Add(new TabInfo {TabName = "TestName1", PortalID = 1, TabID = 1});
            tabCollection.Add(new TabInfo {TabName = "TestName2", PortalID = 1, TabID = 2});
            tabCollection.Add(new TabInfo {TabName = "TestName3", PortalID = 1, TabID = 3});

            //Act
            var tab = tabCollection.WithTabName("NO_MATCH");

            //Assert
            Assert.IsNull(tab);
        }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Tab"/> class with the specified category text.
 /// </summary>
 /// <param name="text">The text to display for the tab.</param>
 public Tab(string text)
 {
     if (string.IsNullOrEmpty(text))
     {
         text = Resources.ToolboxTabDefaultName;
     }
     this._text               = text;
     this._items              = new ItemCollection(this);
     this._tabs               = new TabCollection(this);
     this.PointerItem         = this.CreatePointerItem(Resources.ToolboxPointerItem);
     this.PointerItem.Owner   = this;
     this.PointerItem.Image   = _pointer;
     this.PointerItem.Enabled = false;
 }
예제 #10
0
 internal static void smethod_1(TabCollection A_0, Class345 A_1)
 {
     if (A_0.Count != 0)
     {
         int num  = 0;
         int num2 = 0;
         for (int i = 0; i < A_0.Count; i++)
         {
             if (!A_0[i].IsClear && ((A_0[i].Position != 0f) || (A_0[i].DeletePosition == 0f)))
             {
                 num2++;
             }
             else
             {
                 num++;
             }
         }
         A_1.method_5(SprmCode.PChgTabs);
         int num4 = ((((1 + (num * 2)) + 0) + 1) + (num2 * 2)) + num2;
         A_1.Write((byte)num4);
         A_1.Write((byte)num);
         for (int j = 0; j < A_0.Count; j++)
         {
             if (A_0[j].IsClear || ((A_0[j].Position == 0f) && (A_0[j].DeletePosition != 0f)))
             {
                 A_1.Write((short)A_0[j].DeletePosition);
             }
         }
         A_1.Write((byte)num2);
         for (int k = 0; k < A_0.Count; k++)
         {
             if (!A_0[k].IsClear && ((A_0[k].Position != 0f) || (A_0[k].DeletePosition == 0f)))
             {
                 A_1.Write((short)Class59.smethod_8(A_0[k].Position * 20f, 0));
             }
         }
         for (int m = 0; m < A_0.Count; m++)
         {
             Tab tab = A_0[m];
             if (!A_0[m].IsClear && ((A_0[m].Position != 0f) || (A_0[m].DeletePosition == 0f)))
             {
                 int num8 = 0;
                 num8  = (int)(TabJustification.Left | tab.Justification);
                 num8 |= ((int)tab.TabLeader) << 3;
                 num8 |= tab.Undocumented40 ? 0x40 : 0;
                 A_1.Write((byte)num8);
             }
         }
     }
 }
예제 #11
0
        public void WithTabName_Match()
        {
            //Setup
            var tabCollection = new TabCollection();
            tabCollection.Add(new TabInfo {TabName = "TestName1", PortalID = 1, TabID = 1});
            tabCollection.Add(new TabInfo {TabName = "TestName2", PortalID = 1, TabID = 2});
            tabCollection.Add(new TabInfo {TabName = "TestName3", PortalID = 1, TabID = 3});

            //Act
            var tab = tabCollection.WithTabName("TestName2");

            //Assert
            Assert.AreEqual("TestName2", tab.TabName);
        }
예제 #12
0
        public void DNN_13659_WithTabName_NullTabName()
        {
            //Setup
            var tabCollection = new TabCollection();

            tabCollection.Add(new TabInfo {
                PortalID = 1, TabID = 1
            });

            //Act
            var tab = tabCollection.WithTabName("TestName");

            Assert.IsNull(tab);
        }
예제 #13
0
        public MainWindowViewModel()
        {
            BrowserTabItemViewModel btivm = new();

            btivm.Source = new Uri(@"https://bing.com");
            btivm.BrowserTabNewWindowRequestedEvent += Btivm_BrowserTabNewWindowRequestedEvent;
            TabCollection.Add(btivm);
            BrowserTabControlSelectedIndex = 0;

            BrowserTabItemViewModel btivm1 = new();

            btivm1.Source = new Uri(@"https://microsoft.com");
            btivm1.BrowserTabNewWindowRequestedEvent += Btivm_BrowserTabNewWindowRequestedEvent;
            TabCollection.Add(btivm1);
        }
예제 #14
0
 public override void OnLoad()
 {
     Version = Globals.Assembly.EXE_VERSION;
     if (_appUser != null && _appUser.RoleId == Role.ADMIN)
     {
         TabCollection.Add(AppuserVM);
     }
     TabCollection.Add(HardwareVM);
     TabCollection.Add(UserVM);
     TabCollection.Add(SupplierVM);
     TabCollection.Add(ReportVM);
     TabCollection.Add(BbSearchVM);
     TabCollection.Add(BbCircularVM);
     SelectedTab = TabCollection.FirstOrDefault();
 }
예제 #15
0
        public SettingsViewModel()
        {
            Tabs = new ObservableCollection <TabItem>();
            var catalog   = new AssemblyCatalog(Assembly.GetExecutingAssembly());
            var container = new CompositionContainer(catalog);

            container.ComposeParts(this);
            foreach (var customTabControl in TabCollection.OrderBy(tab => tab.Order).Where(t => t.Settings != null))
            {
                Tabs.Add(new TabItem()
                {
                    Header = customTabControl.Header, Content = customTabControl.Settings
                });
            }
        }
예제 #16
0
 /// <summary>
 /// Returns the current instance of the TabCollection
 /// </summary>
 /// <returns></returns>
 protected TabCollection GetTabs()
 {
     if (tabs != null)
     {
         return(tabs);
     }
     else
     {
         if (!string.IsNullOrEmpty(FileName))
         {
             var path = FileLocation;
             return(TabCollection.GetTabs(path));
         }
         return(new TabCollection());
     }
 }
예제 #17
0
        private void LoadData()
        {
            var currentLocale = LocaleController.Instance.GetCurrentLocale(PortalId);

            TabCollection tabsList = modeButtonList.SelectedValue == "ALL"
                             ? TabController.Instance.GetTabsByPortal(PortalId)
                             : TabController.Instance.GetTabsByPortal(PortalId).WithCulture(currentLocale.Code, true);

            DeletedTabs = tabsList.Values.Where(tab => tab.IsDeleted)
                          .OrderBy(tab => tab.TabPath)
                          .ToList();

            DeletedModules = ModuleController.Instance.GetModules(PortalId)
                             .Cast <ModuleInfo>()
                             .Where(module => module.IsDeleted && (modeButtonList.SelectedValue == "ALL" || module.CultureCode == currentLocale.Code))
                             .ToList();
        }
예제 #18
0
        private void GetSystem()
        {
            foreach (var s in CommunicationViewModel.OpenConnections.Where(s => s.ConnectMode == ConnectMode.Install).Select(n => n.UnitId)
                     .Except(TabCollection.OfType <MainUnitViewModel>().Select(u => u.Id)))
            {
                AddMainUnit(s);
            }

            var nq = new DownloadView();

            nq.Title      = "Download to PC ESC => GUI";
            nq.Background = System.Windows.Media.Brushes.LightGreen;
            var qq = new CommunicationReceive(this);//  EscCommunicationBase(this);

            nq.DataContext = qq;
            nq.Show();
        }
        //Set Taburl active to redirect when language is disabled
        internal static void SetTabUrlsActiveToRedirect(int languageID)
        {
            Locale        language = LocaleController.Instance.GetLocale(languageID);
            TabCollection tabs     = TabController.Instance.GetTabsByPortal(PortalSettings.Current.PortalId);

            foreach (KeyValuePair <int, TabInfo> tab in tabs)
            {
                foreach (TabUrlInfo taburl in tab.Value.TabUrls)
                {
                    if (taburl.CultureCode == language.Code && taburl.HttpStatus == "200")
                    {
                        taburl.HttpStatus = "301";
                        SaveTabUrl(taburl, PortalSettings.Current.PortalId, true);
                    }
                }
            }
        }
        private TabInfo GetTab(int tabId, TabCollection tabs)
        {
            TabInfo activeTab = null;

            if (tabId != Null.NullInteger)
            {
                TabInfo tab;
                if (tabs.TryGetValue(tabId, out tab))
                {
                    if (!tab.IsDeleted)
                    {
                        activeTab = tab.Clone();
                    }
                }
            }
            return(activeTab);
        }
        internal static List <string> GetPages(int PortalID, int PackageID, UserInfo UserInfo)
        {
            IDictionary <int, TabInfo> tabsWithModule = TabController.Instance.GetTabsByPackageID(PortalID, PackageID, false);
            TabCollection allPortalTabs            = TabController.Instance.GetTabsByPortal(PortalID);
            IDictionary <int, TabInfo> tabsInOrder = new Dictionary <int, TabInfo>();

            foreach (TabInfo tab in allPortalTabs.Values)
            {
                AddChildTabsToList(tab, ref allPortalTabs, ref tabsWithModule, ref tabsInOrder);
            }
            List <string> PackageUsage = new List <string>();

            foreach (KeyValuePair <int, TabInfo> item in tabsInOrder)
            {
                PackageUsage.Add(GetFormattedLink(item.Value));
            }
            return(PackageUsage);
        }
예제 #22
0
        public override void LoadSettings()
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    // Fill display mode combo
                    cmbDisplayMode.Items.Add(new ListItem(Localization.GetString("TableMode", LocalResourceFile), "T"));
                    cmbDisplayMode.Items.Add(new ListItem(Localization.GetString("ListMode", LocalResourceFile), "L"));
                    cmbDisplayMode.SelectedValue = _settings.CategoryMenu.DisplayMode;

                    // Fill Catalog Page combo
                    TabController tabController = new TabController();
                    TabCollection tabs          = tabController.GetTabsByPortal(PortalId);

                    cmbCatalogPage.Items.Add(new ListItem(Localization.GetString("SamePage", LocalResourceFile), "0"));

                    foreach (TabInfo tabInfo in tabs.Values)
                    {
                        if (tabInfo.IsVisible && !tabInfo.IsDeleted && !tabInfo.IsSuperTab)
                        {
                            cmbCatalogPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString()));
                        }
                    }

                    // Get values from settings
                    txtColumnCount.Text = _settings.CategoryMenu.ColumnCount.ToString();

                    int catalogTabID = _settings.CategoryMenu.CatalogPage;
                    if (catalogTabID <= 0)
                    {
                        cmbCatalogPage.SelectedIndex = 0;
                    }
                    else
                    {
                        cmbCatalogPage.SelectedValue = catalogTabID.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
예제 #23
0
        private void AddMainUnit(int id)
        {
            if (!LibraryData.SystemIsOpen)
            {
                LibraryData.CreateEmptySystem();
            }
            var esc = LibraryData.AddEsc(id);

            if (esc == null)
            {
                return;
            }
            var escview = new MainUnitViewModel(esc, this);

            if (!TabCollection.Contains(escview))
            {
                TabCollection.Add(escview);
            }
        }
예제 #24
0
        /// <summary>
        /// Adds al the mainunits and the matrix tab
        /// </summary>
        private async void AddMainUnitsToTab()
        {
            if (!LibraryData.SystemIsOpen)
            {
                return;
            }

            TabCollection.Clear();
            await Task.Delay(150);

            foreach (var m in LibraryData.FuturamaSys.MainUnits)
            {
                TabCollection.Add(new MainUnitViewModel(m, this));
            }
            SelectedTab = TabCollection.FirstOrDefault(i => i.Id == 0);

            TabCollection.Add(new PanelViewModel(this));
            TabCollection.Add(_comViewModel);
        }
        internal static void UpdateTabUrlsDefaultLocale()
        {
            List <PortalAliasInfo> PortalAliases   = PortalAliasController.Instance.GetPortalAliasesByPortalId(PortalSettings.Current.PortalId).ToList();
            PortalAliasInfo        portalAliasInfo = PortalAliases.Where(x => string.IsNullOrEmpty(x.CultureCode)).FirstOrDefault();
            PortalAliasInfo        DefaultLocalePortalAliasInfo = PortalAliases.Where(x => x.CultureCode.ToLower() == PortalSettings.Current.DefaultLanguage.ToLower()).FirstOrDefault();
            TabCollection          tabs = TabController.Instance.GetTabsByPortal(PortalSettings.Current.PortalId);

            foreach (KeyValuePair <int, TabInfo> tab in tabs)
            {
                foreach (TabUrlInfo taburl in tab.Value.TabUrls)
                {
                    if (taburl.PortalAliasId == portalAliasInfo.PortalAliasID)
                    {
                        taburl.PortalAliasId = DefaultLocalePortalAliasInfo.PortalAliasID;
                        SaveTabUrl(taburl, PortalSettings.Current.PortalId, true);
                    }
                }
            }
        }
예제 #26
0
        /// <summary>
        /// Checks timestamps
        /// </summary>
        /// <returns>true in case timestamp does compare</returns>
        private async Task <List <MainUnitViewModel> > VerifyIntegratyAsync()
        {
            var list = new List <MainUnitViewModel>();

            foreach (var tab in TabCollection.OfType <MainUnitViewModel>()
                     .Where(model => model.ConnectType != ConnectType.None))
            {
                MainUnitViewModel tab1 = tab;
                var q = await Task.Run(() => tab1.TimestampIsEqual());

                if (q)
                {
                    continue;    //checksum O.K.
                }
                list.Add(tab);
            }

            return(list);
        }
예제 #27
0
        private void AddTabsToCollection(TabCollection inTabs, TabCollection outtabs)
        {
            // 1.0.2 - Workaround for dnn powered content localization - [alexander.zimmer] & [simon.meraner]
            // serialize tab object in order to be able to identify whether the content localization is active.
            System.Xml.Serialization.XmlSerializer tabSerializer = new System.Xml.Serialization.XmlSerializer(typeof(DotNetNuke.Entities.Tabs.TabInfo));
            foreach (System.Collections.Generic.KeyValuePair <int, DotNetNuke.Entities.Tabs.TabInfo> kvp in inTabs)
            {
                if (!outtabs.ContainsKey(kvp.Key))
                {
                    System.IO.StringWriter stream = new System.IO.StringWriter();

                    tabSerializer.Serialize(stream, kvp.Value);

                    System.IO.StringReader sr     = new System.IO.StringReader(stream.ToString());
                    XmlDocument            xmlDoc = new XmlDocument();
                    xmlDoc.Load(sr);

                    stream.Close();

                    var tabCulture = xmlDoc.SelectSingleNode("/tab/cultureCode");

                    bool showCulture = true;

                    if (tabCulture != null)
                    {
                        XmlNode cultureNode = tabCulture.FirstChild;

                        // dnn 5.5.x detected ... exclude tabs where the cultures doesn`t matcj the current culture
                        if (cultureNode != null && cultureNode.Value != System.Threading.Thread.CurrentThread.CurrentCulture.Name)
                        {
                            showCulture = false;
                        }
                    }
                    // -------------------------------------------------------------------------------------------------------

                    if (showCulture)
                    {
                        outtabs.Add(kvp.Key, kvp.Value);
                    }
                }
            }
        }
예제 #28
0
 private void SendUnitData()
 {
     if (TabCollection.OfType <MainUnitViewModel>().All(model => model.ConnectType == ConnectType.None))
     {
         MessageBox.Show(Main.MessageBoxUploadText, Main.MessageBoxUploadTitle,
                         MessageBoxButton.OK, MessageBoxImage.Question);
         SwitchToCommunicationTab();
     }
     else
     {
         var nq = new DownloadView
         {
             Title      = "UPLOAD to ESC: GUI => ESC",
             Background = System.Windows.Media.Brushes.LightCoral
         };
         var qq = new CommunicationSend(this);//  EscCommunicationBase(this);
         nq.DataContext = qq;
         nq.Show();
     }
 }
예제 #29
0
        public static List <Tab> GetTopMenuTabs()
        {
            var list = new List <Tab>();

            var menuPath = PathUtils.GetMenusPath("Top.config");

            if (!FileUtils.IsFileExists(menuPath))
            {
                return(list);
            }

            var tabs = TabCollection.GetTabs(menuPath);

            foreach (var parent in tabs.Tabs)
            {
                list.Add(parent);
            }

            return(list);
        }
예제 #30
0
    private static TabCollection smethod_6(Class857 A_0, double A_1)
    {
        int           num    = 11;
        TabCollection tabs   = new TabCollection(A_0.method_9());
        Class396      class2 = A_0.method_11();

        while (class2.method_9(BookmarkStart.b("䔰刲圴ᨶ䨸伺刼伾㉀", num)))
        {
            string str;
            if (((str = class2.method_1()) != null) && (str == BookmarkStart.b("䔰刲圴ᨶ䨸伺刼伾", num)))
            {
                tabs.method_6(smethod_7(A_0, A_1));
            }
            else
            {
                class2.vmethod_1();
            }
        }
        return(tabs);
    }
예제 #31
0
        public TabControl() : base()
        {
            this.AllowDrop      = true;
            this.BackColor      = Color.White;
            this.DoubleBuffered = true;

            this.CloseTabOnMiddleClick = true;

            _tabCollection = new TabCollection(this);

            _painter = new TabPainter(this);

            _dragDropHelper = new TabControlDragDropHelper(this);
            _dragDropHelper.AddControl(this);

            _tabToolTip = new ToolTip()
            {
                AutomaticDelay = 750
            };
        }
예제 #32
0
 protected TabCollection GetAllTabs(int publishmentSystemId)
 {
     if (tabs != null)
     {
         return(tabs);
     }
     else
     {
         if (!string.IsNullOrEmpty(FileName))
         {
             var path = FileLocation;
             var tc   = TabCollection.GetTabs(path);
             foreach (Tab tab in tc.Tabs)
             {
                 if (!tab.HasChildren && StringUtils.EqualsIgnoreCase("cms", tab.MenuType))
                 {
                     var nodeIdList = DataProvider.NodeDao.GetHomeSiteNodeIdList();
                     foreach (var nodeId in nodeIdList)
                     {
                         var nodeInfo = NodeManager.GetNodeInfo(1, nodeId);
                         if (tab.Id != null && tab.Id.Equals(NodeManager.GetNodeModel(nodeInfo), StringComparison.OrdinalIgnoreCase))
                         {
                             if (nodeInfo != null)
                             {
                                 List <Tab> tabList    = tab.ChildrenChannels;
                                 Tab        tabChannel = ChannelInfoToTable(nodeInfo, publishmentSystemId);
                                 tabList.Add(tabChannel);
                                 if (tabList != null && tabList.Count > 0)
                                 {
                                     tab.Children = TabListToArray(tabList);
                                 }
                             }
                         }
                     }
                 }
             }
             return(tc);
         }
         return(new TabCollection());
     }
 }
예제 #33
0
        public void WithTabName_NoMatch()
        {
            //Setup
            var tabCollection = new TabCollection();

            tabCollection.Add(new TabInfo {
                TabName = "TestName1", PortalID = 1, TabID = 1
            });
            tabCollection.Add(new TabInfo {
                TabName = "TestName2", PortalID = 1, TabID = 2
            });
            tabCollection.Add(new TabInfo {
                TabName = "TestName3", PortalID = 1, TabID = 3
            });

            //Act
            var tab = tabCollection.WithTabName("NO_MATCH");

            //Assert
            Assert.IsNull(tab);
        }
예제 #34
0
        public void WithTabName_Match()
        {
            //Setup
            var tabCollection = new TabCollection();

            tabCollection.Add(new TabInfo {
                TabName = "TestName1", PortalID = 1, TabID = 1
            });
            tabCollection.Add(new TabInfo {
                TabName = "TestName2", PortalID = 1, TabID = 2
            });
            tabCollection.Add(new TabInfo {
                TabName = "TestName3", PortalID = 1, TabID = 3
            });

            //Act
            var tab = tabCollection.WithTabName("TestName2");

            //Assert
            Assert.AreEqual("TestName2", tab.TabName);
        }
예제 #35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Tab"/> class with the specified category text.
 /// </summary>
 /// <param name="text">The text to display for the tab.</param>
 public Tab(string text)
 {
     if (string.IsNullOrEmpty(text)) {
         text = Resources.ToolboxTabDefaultName;
     }
     this._text = text;
     this._items = new ItemCollection(this);
     this._tabs = new TabCollection(this);
     this.PointerItem = this.CreatePointerItem(Resources.ToolboxPointerItem);
     this.PointerItem.Owner = this;
     this.PointerItem.Image = _pointer;
     this.PointerItem.Enabled = false;
 }
        private TabInfo GetTab(int tabId, TabCollection tabs)
        {
            TabInfo activeTab = null;

            if (tabId != Null.NullInteger)
            {
                TabInfo tab;
                if (tabs.TryGetValue(tabId, out tab))
                {
                    if (!tab.IsDeleted)
                    {
                        activeTab = tab.Clone();
                    }
                }
            }
            return activeTab;
        }
예제 #37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Toolbox"/> class and creating a 'General' category tab if needed.
 /// </summary>
 /// <param name="createGeneral">Indicates whether to create a 'General' category tab.</param>
 public Toolbox(bool createGeneral)
 {
     this.SetStyle(ControlStyles.UserPaint, true);
     this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
     this.SetStyle(ControlStyles.ResizeRedraw, true);
     this.SetStyle(ControlStyles.Selectable, true);
     this.SetStyle(ControlStyles.StandardDoubleClick, true);
     this.AllowDrop = true;
     this._items = new ItemCollection(this);
     this._tabs = new TabCollection(this);
     this._verticalScroll = new VScrollBar();
     this._verticalScroll.Visible = false;
     this._verticalScroll.Dock = DockStyle.Right;
     this._verticalScroll.Scroll += new ScrollEventHandler(this.OnVerticalScroll);
     this.Controls.Add(this._verticalScroll);
     this._toolTip = new BalloonToolTip();
     this.TabMenu = this.CreateTabMenu();
     this.ItemMenu = this.CreateItemMenu();
     if (createGeneral) {
         this._generalCategoryTab = this.CreateNewTab(Resources.ToolboxTabGeneral);
         this._generalCategoryTab.AllowDelete = false;
         this.Categories.Add(this._generalCategoryTab);
     }
 }
예제 #38
0
        private void SerializeTabs(XmlWriter writer, PortalInfo portal, Hashtable tabs, TabCollection tabCollection)
        {
            foreach (TabInfo tab in tabCollection.Values)
            {
                //if not deleted
                if (!tab.IsDeleted)
                {
                    XmlNode tabNode = null;
                    if (string.IsNullOrEmpty(tab.CultureCode) || tab.CultureCode == portal.DefaultLanguage)
                    {
                        // page in default culture and checked
                        if (ctlPages.CheckedNodes.Any(p => p.Value == tab.TabID.ToString(CultureInfo.InvariantCulture)))
                            tabNode = TabController.SerializeTab(new XmlDocument(), tabs, tab, portal, chkContent.Checked);
                    }
                    else
                    {
                        // check if default culture page is selected
                        TabInfo defaultTab = tab.DefaultLanguageTab;
                        if (defaultTab == null || ctlPages.CheckedNodes.Count(p => p.Value == defaultTab.TabID.ToString(CultureInfo.InvariantCulture)) > 0)
                            tabNode = TabController.SerializeTab(new XmlDocument(), tabs, tab, portal, chkContent.Checked);
                    }

                    if (tabNode != null)
                        tabNode.WriteTo(writer);
                }
            }

        }
예제 #39
0
        private bool VerifyTabExists(int tabId, TabCollection tabs)
        {
            bool isVerified = false;

            if (tabId != Null.NullInteger)
            {
                TabInfo tab;
                if (tabs.TryGetValue(tabId, out tab))
                {
                    if (!tab.IsDeleted)
                    {
                        ActiveTab = tab.Clone();
                        isVerified = true;
                    }
                }
            }
            return isVerified;
        }
예제 #40
0
 private TabCollection GetExportableTabs(TabCollection tabs)
 {
     var exportableTabs = tabs.Where(kvp => !kvp.Value.IsSystem).Select(kvp => kvp.Value);
     return new TabCollection(exportableTabs);
 }
예제 #41
0
        public void WithTabName_Empty()
        {
            //Setup
            var tabCollection = new TabCollection();
            tabCollection.Add(new TabInfo {TabName = "TestName1", PortalID = 1, TabID = 1});
            tabCollection.Add(new TabInfo {TabName = "TestName2", PortalID = 1, TabID = 2});
            tabCollection.Add(new TabInfo {TabName = "TestName3", PortalID = 1, TabID = 3});

            //Act
            var tab = tabCollection.WithTabName(String.Empty);

            //Assert
            Assert.IsNull(tab);
        }
예제 #42
0
        private void SerializeTabs(XmlWriter writer, PortalInfo portal, Hashtable tabs, TabCollection tabCollection)
        {
            foreach (TabInfo tab in tabCollection.Values)
            {
                //if not deleted
                if (!tab.IsDeleted)
                {
                    //Serialize the Tab
                    XmlNode tabNode = TabController.SerializeTab(new XmlDocument(), tabs, tab, portal, chkContent.Checked);

                    tabNode.WriteTo(writer);
                }
            }
        }