Beispiel #1
0
        internal Category(XElement eltCategory, IconLibrary library)
        {
            Name    = eltCategory.Attribute("name")?.Value;
            Library = library;

            foreach (XElement eltIcon in eltCategory.Elements(MainModel.NSIconMaker + "Icon"))
            {
                Icons.Add(new Icon(eltIcon));
                ProgressDialog.ProgressDialog.Current.Report(value: double.PositiveInfinity);
            }
        }
Beispiel #2
0
        private IconLibrary FindLibrary(string libraryName)
        {
            IconLibrary library = Libraries.FirstOrDefault(l => l.Name.Equals(libraryName));

            if (library != null)
            {
                return(library);
            }

            library = new IconLibrary(libraryName);
            Libraries.InsertSorted(library);
            return(library);
        }
Beispiel #3
0
        public void AddIcon(string relativeFileName, Viewbox viewbox)
        {
            string[] parts = relativeFileName.Split(@"\".ToCharArray(), 3, StringSplitOptions.RemoveEmptyEntries);
            if (parts.Length != 3)
            {
                return;
            }

            string      libraryName = parts[0];
            IconLibrary library     = FindLibrary(libraryName);

            string   categoryName = parts[1];
            Category category     = library.FindCategory(categoryName);

            string iconName = new string(parts[2].TakeWhile(c => c != '.').ToArray());

            category.FindIcon(iconName, viewbox);
        }
Beispiel #4
0
        public void AddOverlay(string relativeFileName, Viewbox viewbox)
        {
            string[] parts = relativeFileName.Split(@"\".ToCharArray(), 3, StringSplitOptions.RemoveEmptyEntries);
            if (parts.Length != 3)
            {
                return;
            }

            string      libraryName = parts[0];
            IconLibrary library     = FindLibrary(libraryName);

            string iconName = new string(parts[2].TakeWhile(c => c != '.').ToArray());

            parts = iconName.Split("_".ToCharArray());
            if (parts.Length != 2)
            {
                return;
            }

            string      overlayName = parts[0];
            IconOverlay overlay     = library.FindOverlay(overlayName);

            switch (parts[1])
            {
            case "TL":
                overlay.TL = viewbox;
                break;

            case "TR":
                overlay.TR = viewbox;
                break;

            case "BL":
                overlay.BL = viewbox;
                break;

            case "BR":
                overlay.BR = viewbox;
                break;
            }
        }
Beispiel #5
0
 internal Category(string name, IconLibrary library)
 {
     Name    = name;
     Library = library;
 }