public void MergeWith(XmlStyleRepository styleRepository) { LinkedList <XmlRepositoryItem> newItems = new LinkedList <XmlRepositoryItem>(); for (int i = 0; i < styleRepository.xmlRepositoryItems.Count; i++) { XmlRepositoryItem newList = styleRepository.xmlRepositoryItems[i]; bool found = false; for (int k = 0; k < this.xmlRepositoryItems.Count; k++) { XmlRepositoryItem existingList = this.xmlRepositoryItems[k]; if (existingList.Key == newList.Key) { this.xmlRepositoryItems[k] = styleRepository.xmlRepositoryItems[i]; found = true; break; } } if (!found) { newItems.AddLast(newList); } } this.xmlRepositoryItems.AddRange(newItems); }
public static void RegisterThemeRepository(Telerik.WinControls.Styles.XmlStyleRepository styleRepository, string themeName) { XmlStyleRepository existingRepository = registeredStyleRepositoriesByThemeName[themeName] as XmlStyleRepository; if (existingRepository != null) { existingRepository.MergeWith(styleRepository); } else { registeredStyleRepositoriesByThemeName[themeName] = styleRepository; } RaiseThemeChanged(themeName); }
private void ProcessStyle() { if (this.OwnerStyleManager != null && this.OwnerStyleManager.Owner != null) { XmlStyleRepository repository = ThemeResolutionService.GetThemeRepository(this.OwnerStyleManager.Owner.ThemeName); if (repository != null) { this.styleSheet.ProcessGroupsInheritance(repository); } } this.stylesheetTree = new StylesheetTree(this); this.stylesheetTree.CreateNodesFromStyle(this.styleSheet); //Part of brute force algorithm test implemetation this.stylesheetTree.AttachElement(this.styleRootElement); }
public void MergeWith(XmlStyleRepository styleRepository) { LinkedList <XmlRepositoryItem> linkedList = new LinkedList <XmlRepositoryItem>(); for (int index1 = 0; index1 < styleRepository.xmlRepositoryItems.Count; ++index1) { XmlRepositoryItem xmlRepositoryItem = styleRepository.xmlRepositoryItems[index1]; bool flag = false; for (int index2 = 0; index2 < this.xmlRepositoryItems.Count; ++index2) { if (this.xmlRepositoryItems[index2].Key == xmlRepositoryItem.Key) { this.xmlRepositoryItems[index2] = styleRepository.xmlRepositoryItems[index1]; flag = true; break; } } if (!flag) { linkedList.AddLast(xmlRepositoryItem); } } this.xmlRepositoryItems.AddRange((IEnumerable <XmlRepositoryItem>)linkedList); }