示例#1
0
        public static void SetIcon(this ImageList @this, object type, int size = 0, Color?color = null, Brush brush = null)
        {
            var declaringType = type.GetType().DeclaringType;
            var instance      = Pictogram.GetInstance(declaringType);

            @this.SetIcon(instance, type, size, color, brush);
        }
示例#2
0
        /// <summary>
        /// Checks if the user has some form of ownership of the pictogram.
        /// </summary>
        /// <param name="picto">The Pictogram in need of checking.</param>
        /// <param name="usr">The user in question.</param>
        /// <returns>A bool indicating whether the user owns the pictogram or not.</returns>
        private async Task <bool> CheckOwnership(Pictogram picto, GirafUser usr)
        {
            var ownsPictogram = false;

            switch (picto.AccessLevel)
            {
            case AccessLevel.PUBLIC:
                ownsPictogram = true;
                break;

            case AccessLevel.PROTECTED:
                ownsPictogram = await _giraf.CheckProtectedOwnership(picto, usr);

                break;

            case AccessLevel.PRIVATE:
                ownsPictogram = await _giraf.CheckPrivateOwnership(picto, usr);

                break;
            }
            if (!ownsPictogram)
            {
                return(false);
            }
            return(true);
        }
示例#3
0
        private void InitializeComponent()
        {
            //
            // fontAwesomeIcon
            //
            fontIcon = new Icon(Pictogram.GetTypeface())
            {
                FontSize = IconSize,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                AutoSize = true
            };

            //
            // labelText
            //
            labelMessage = new Label()
            {
                FontSize = Helpers.Common.GetNamedSize(NamedSize.Small),
                HorizontalTextAlignment = TextAlignment.Center,
                FontAttributes          = FontAttributes.Bold
            };
            StackLayout StackContent = new StackLayout()
            {
                Spacing           = 0,
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };

            StackContent.Children.Add(fontIcon);
            StackContent.Children.Add(labelMessage);

            this.Children.Add(StackContent, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.SizeProportional);
        }
示例#4
0
        public static void SetText(this Component @this, object type, float size = 0)
        {
            var declaringType = type.GetType().DeclaringType;
            var instance      = Pictogram.GetInstance(declaringType);

            @this.SetText(instance, type, size);
        }
示例#5
0
        public RecipePictogramPair(RecipeEntity recipe, Pictogram pictogram)
        {
            Recipe    = recipe;
            Pictogram = pictogram;

            RecipeId    = recipe.Id;
            PictogramId = pictogram.Id;
        }
示例#6
0
 public static object Convert(object value)
 {
     if (value != null)
     {
         return(Pictogram.GetInstance <T>().GetText((int)value));
     }
     return(null);
 }
示例#7
0
        public static void SetIcon(this NotifyIcon @this, Pictogram pictogram, object type, int size = 0, Color?color = null, Brush brush = null)
        {
            if (size == 0)
            {
                size = 16;
            }

            SetImage(@this, pictogram, type, size, color, brush);
        }
 public PictogramDto Map(Pictogram entity)
 {
     return new PictogramDto
            {
                Id = entity.Id,
                Title = entity.Title,
                HazardousSubstanceStandard = entity.HazardousSubstanceStandard
            };
 }
示例#9
0
 public WeekPictogramDTO(Pictogram pictogram)
 {
     if (pictogram != null)
     {
         this.Title       = pictogram.Title;
         this.AccessLevel = pictogram.AccessLevel;
         this.Id          = pictogram.Id;
         this.LastEdit    = pictogram.LastEdit;
         this.Image       = pictogram.Image;
     }
 }
示例#10
0
        private XmlElement CreatePictogram(Pictogram pictogram)
        {
            XmlElement pictogramElement = xmlDocLog.CreateElement("pictogram");

            pictogramElement.SetAttribute("index", pictogram.Index.ToString());
            pictogramElement.SetAttribute("sound", pictogram.Sound);
            pictogramElement.SetAttribute("textToRead", pictogram.TextToRead);
            pictogramElement.SetAttribute("word", pictogram.Word);
            pictogramElement.SetAttribute("image", pictogram.ImageName);
            pictogramElement.SetAttribute("wordType", pictogram.Type.ToString());

            return(pictogramElement);
        }
示例#11
0
        public NavPanelPageControl(string code, bool isExpanded, Action <NavPanelPageControl> closeClicked)
        {
            Code       = code;
            IsExpanded = isExpanded;
            Height     = isExpanded ? 100 : HeaderHeight;
            Title      = pageTitles[code];
            fontTitle  = new Font(Font, FontStyle.Bold);

            pictExpand = new Pictogram(new Rectangle(0, 0, 16, 16),
                                       isExpanded ? Pictogram.figureCollapse : Pictogram.figureExpand)
            {
                onClick = OnExpand
            };
            pictClose = new Pictogram(new Rectangle(0, 0, 16, 16), Pictogram.figureCross)
            {
                onClick = () => closeClicked(this)
            };
            pictograms[0] = pictExpand;
            pictograms[1] = pictClose;

            // добавить в контрол содержимое
            Control content =
                code == PageCodeAccount
                    ? new NavPageAccountControl()
                    : code == PageCodeIndicators
                          ? new NavPageIndicatorsControl()
                          : code == PageCodeDeals
                                ? new NavPageDealsControl()
                                : code == PageCodeQuotes ? new NavPageQuoteControl()
                                    : (Control) new NavPaneScriptControl();

            content.Dock   = DockStyle.Bottom;
            content.Parent = this;
            Controls.Add(content);

            // контрол (содержимое) запросил изменить высоту
            if (content is INavPageContent)
            {
                ((INavPageContent)content).ContentHeightChanged += ht =>
                {
                    var newHeight = ht + HeaderHeight;
                    heightInExpandedMode = newHeight;
                    if (IsExpanded)
                    {
                        Height = newHeight;
                    }
                };
            }

            ArrangePictograms();
        }
示例#12
0
        public async Task <Response <WeekPictogramDTO> > CreatePictogram([FromBody] PictogramDTO pictogram)
        {
            var user = await _giraf.LoadUserWithResources(HttpContext.User);

            if (user == null)
            {
                return(new ErrorResponse <WeekPictogramDTO>(ErrorCode.NotFound));
            }

            if (pictogram == null)
            {
                return(new ErrorResponse <WeekPictogramDTO>(ErrorCode.MissingProperties,
                                                            "Could not read pictogram DTO. Please make sure not to include image data in this request. " +
                                                            "Use POST localhost/v1/pictogram/{id}/image instead."));
            }

            if (!ModelState.IsValid)
            {
                return(new ErrorResponse <WeekPictogramDTO>(ErrorCode.InvalidProperties));
            }

            //Create the actual pictogram instance
            // if access level is not specified, missing properties
            if (pictogram.AccessLevel == null || !Enum.IsDefined(typeof(AccessLevel), pictogram.AccessLevel))
            {
                return(new ErrorResponse <WeekPictogramDTO>(ErrorCode.MissingProperties, "access level, pictogram"));
            }

            Pictogram pict =
                new Pictogram(pictogram.Title, (AccessLevel)pictogram.AccessLevel);

            if (pictogram.AccessLevel == AccessLevel.PRIVATE)
            {
                //Add relation between pictogram and current user
                new UserResource(user, pict);
            }
            else if (pictogram.AccessLevel == AccessLevel.PROTECTED)
            {
                //Add the pictogram to the user's department
                new DepartmentResource(user.Department, pict);
            }

            await _giraf._context.Pictograms.AddAsync(pict);

            await _giraf._context.SaveChangesAsync();

            return(new Response <WeekPictogramDTO>(new WeekPictogramDTO(pict)));
        }
示例#13
0
        public static void SetText(this Control @this, Pictogram pictogram, object type, float size = 0)
        {
            if (size == 0)
            {
                size = @this.Font.Size;
            }

            if (typeof(ButtonBase).IsAssignableFrom(@this.GetType()) ||
                typeof(Label).IsAssignableFrom(@this.GetType()) ||
                typeof(GroupBox).IsAssignableFrom(@this.GetType()) ||
                typeof(TabPage).IsAssignableFrom(@this.GetType()))
            {
                @this.Text = pictogram.GetText((int)type);
                @this.Font = new Font(pictogram.FontFamily, size, @this.Font.Style, @this.Font.Unit);
            }
        }
        public NavPanelPageControl(string code, bool isExpanded, Action<NavPanelPageControl> closeClicked)
        {
            Code = code;
            IsExpanded = isExpanded;
            Height = isExpanded ? 100 : HeaderHeight;
            Title = pageTitles[code];
            fontTitle = new Font(Font, FontStyle.Bold);

            pictExpand = new Pictogram(new Rectangle(0, 0, 16, 16),
                                       isExpanded ? Pictogram.figureCollapse : Pictogram.figureExpand)
                {
                    onClick = OnExpand
                };
            pictClose = new Pictogram(new Rectangle(0, 0, 16, 16), Pictogram.figureCross)
                {
                    onClick = () => closeClicked(this)
                };
            pictograms[0] = pictExpand;
            pictograms[1] = pictClose;

            // добавить в контрол содержимое
            Control content =
                code == PageCodeAccount
                    ? new NavPageAccountControl()
                    : code == PageCodeIndicators
                          ? new NavPageIndicatorsControl()
                          : code == PageCodeDeals
                                ? new NavPageDealsControl()
                                : code == PageCodeQuotes ? new NavPageQuoteControl()
                                    : (Control) new NavPaneScriptControl();
            content.Dock = DockStyle.Bottom;
            content.Parent = this;
            Controls.Add(content);

            // контрол (содержимое) запросил изменить высоту
            if (content is INavPageContent)
            {
                ((INavPageContent) content).ContentHeightChanged += ht =>
                    {
                        var newHeight = ht + HeaderHeight;
                        heightInExpandedMode = newHeight;
                        if (IsExpanded) Height = newHeight;
                    };
            }

            ArrangePictograms();
        }
示例#15
0
        public Task <bool> CheckPrivateOwnership(Pictogram pictogram, GirafUser user)
        {
            if (user == null)
            {
                return(Task.FromResult(false));
            }

            var ownsResource = _context.UserResources
                               .Any(ur => ur.Pictogram == pictogram && ur.Other == user);

            if (ownsResource)
            {
                return(Task.FromResult(true));
            }

            return(Task.FromResult(false));
        }
示例#16
0
        public Task <bool> CheckProtectedOwnership(Pictogram pictogram, GirafUser user)
        {
            if (user == null)
            {
                return(Task.FromResult(false));
            }

            var ownsResource = _context.DepartmentResources
                               .Any(dr => dr.PictogramKey == pictogram.Id &&
                                    dr.OtherKey == user.DepartmentKey);

            if (ownsResource)
            {
                return(Task.FromResult(true));
            }

            return(Task.FromResult(false));
        }
示例#17
0
        /// <summary>
        /// Checks if the user owns the given <paramref name="pictogram"/>.
        /// </summary>
        /// <param name="pictogram">The pictogram to check the ownership for.</param>
        /// <param name="user"></param>
        /// <returns>True if the user is authorized to see the resource and false if not.</returns>
        public async Task <bool> CheckPrivateOwnership(Pictogram pictogram, GirafUser user)
        {
            if (pictogram.AccessLevel != AccessLevel.PRIVATE)
            {
                return(false);
            }

            //The pictogram was not public, check if the user owns it.
            if (user == null)
            {
                return(false);
            }
            var ownedByUser = await _context.UserResources
                              .Where(ur => ur.PictogramKey == pictogram.Id && ur.OtherKey == user.Id)
                              .AnyAsync();

            return(ownedByUser);
        }
示例#18
0
        /// <summary>
        /// Checks if the current user's department owns the given resource.
        /// </summary>
        /// <param name="resource">The resource to check ownership for.</param>
        /// <param name="user"></param>
        /// <returns>True if the user's department owns the pictogram, false if not.</returns>
        public async Task <bool> CheckProtectedOwnership(Pictogram resource, GirafUser user)
        {
            if (resource.AccessLevel != AccessLevel.PROTECTED)
            {
                return(false);
            }

            if (user == null)
            {
                return(false);
            }

            //The pictogram was not owned by user, check if his department owns it.
            var ownedByDepartment = await _context.DepartmentResources
                                    .Where(dr => dr.PictogramKey == resource.Id && dr.OtherKey == user.Department.Key)
                                    .AnyAsync();

            return(ownedByDepartment);
        }
示例#19
0
        /// <summary>
        /// From the given DTO, set the name, thumbnail and days of the given week object.
        /// </summary>
        /// <param name="weekDTO">The DTO from which values are read.</param>
        /// <param name="week">The week object to which values are written.</param>
        /// <param name="_giraf">An instance of the GirafService from which the database will be accessed when reading the DTO.</param>
        /// <returns>MissingProperties if thumbnail is missing.
        /// ResourceNotFound if any pictogram id is invalid.
        /// null otherwise.</returns>
        public static async Task <ErrorResponse> SetWeekFromDTO(WeekBaseDTO weekDTO, WeekBase week, IGirafService _giraf)
        {
            var modelErrorCode = weekDTO.ValidateModel();

            if (modelErrorCode.HasValue)
            {
                return(new ErrorResponse(modelErrorCode.Value));
            }

            week.Name = weekDTO.Name;

            Pictogram thumbnail = _giraf._context.Pictograms
                                  .FirstOrDefault(p => p.Id == weekDTO.Thumbnail.Id);

            if (thumbnail == null)
            {
                return(new ErrorResponse(ErrorCode.MissingProperties, "thumbnail"));
            }

            week.Thumbnail = thumbnail;

            foreach (var day in weekDTO.Days)
            {
                var wkDay = new Weekday(day);
                if (!(await AddPictogramsToWeekday(wkDay, day, _giraf)))
                {
                    return(new ErrorResponse(ErrorCode.ResourceNotFound, "pictogram"));
                }

                week.UpdateDay(wkDay);
            }

            //All week days that were not specified in the new schedule, but existed before
            var toBeDeleted = week.Weekdays.Where(wd => !weekDTO.Days.Any(d => d.Day == wd.Day)).ToList();

            foreach (var deletedDay in toBeDeleted)
            {
                week.Weekdays.Remove(deletedDay);
            }

            return(null);
        }
示例#20
0
        public static void SetText(this Component @this, Pictogram pictogram, object type, float size = 0)
        {
            if (typeof(ToolStripItem).IsAssignableFrom(@this.GetType()))
            {
                if (size == 0)
                {
                    size = (@this as ToolStripItem).Font.Size;
                }

                var text = pictogram.GetText((int)type);

                if ((@this as ToolStripItem).Text == (@this as ToolStripItem).ToolTipText)
                {
                    (@this as ToolStripItem).ToolTipText = (@this as ToolStripItem).Text;
                }

                (@this as ToolStripItem).Text = text;
                (@this as ToolStripItem).Font = new Font(pictogram.FontFamily, size, (@this as ToolStripItem).Font.Style, (@this as ToolStripItem).Font.Unit);
            }
        }
示例#21
0
        private static Recipe CreateRecipeFromTemplate(int id)
        {
            var image = new Image(ImageType.Uri,
                                  "https://upload.wikimedia.org/wikipedia/commons/thumb/3/35/Toast-3.jpg/800px-Toast-3.jpg");

            var ingredient = new Ingredient {
                Text = "Test Ingredient!"
            };
            var pictogram = new Pictogram
            {
                Name        = "Test Pictogram",
                Description = "Pictogram Description!",
                Icon        = image
            };

            return(new Recipe
            {
                Id = id,
                Name = $"Test Recipe {id}",
                Description = "Description sample!",
                EstimatedTime = TimeSpan.FromMinutes(30),

                PreviewImage = image,
                Images = Enumerable.Repeat(image, 5).ToArray(),

                Pictograms = Enumerable.Repeat(pictogram, 3).ToArray(),
                Ingredients = Enumerable.Repeat(ingredient, 5).ToArray(),
                Steps = new List <Step>
                {
                    new TextStep {
                        Text = "Hello World!"
                    },
                    new ImageStep {
                        Image = image
                    }
                }
            });
        }
示例#22
0
        public static void SetIcon(this ImageList @this, Pictogram pictogram, object type, int size = 0, Color?color = null, Brush brush = null)
        {
            if (size == 0)
            {
                size = (@this.ImageSize.Width + @this.ImageSize.Height) / 2;
            }

            if (color == null)
            {
                color = SystemColors.ControlText;
            }

            if (brush == null)
            {
                brush = new SolidBrush(color.Value);
            }

            var image = pictogram.GetImage((int)type, size, brush);

            var hIcon = new Bitmap(image).GetHicon();
            var icon  = Icon.FromHandle(hIcon);

            @this.Images.Add(icon);
        }
示例#23
0
        public static void SetImage(this Control @this, Pictogram pictogram, object type, int size = 0, Color?color = null, Brush brush = null)
        {
            if (size == 0)
            {
                size = (@this.Width + @this.Height) / 2;
            }

            if (color == null)
            {
                color = @this.ForeColor;
            }

            if (brush == null)
            {
                brush = new SolidBrush(color.Value);
            }

            var image = pictogram.GetImage((int)type, size, brush);

            if (typeof(ButtonBase).IsAssignableFrom(@this.GetType()))
            {
                (@this as ButtonBase).Image = image;
            }
            if (typeof(PictureBox).IsAssignableFrom(@this.GetType()))
            {
                (@this as PictureBox).Image = image;
            }
            if (typeof(Panel).IsAssignableFrom(@this.GetType()))
            {
                (@this as Panel).BackgroundImage = image;
            }
            if (typeof(GroupBox).IsAssignableFrom(@this.GetType()))
            {
                (@this as GroupBox).BackgroundImage = image;
            }
        }
示例#24
0
 public EmptyLayout()
 {
     Pictogram = Pictogram.GetInstance <T>();
     InitializeComponent();
 }
示例#25
0
 public Icon(Pictogram glyph, int type)
     : this(glyph.GetTypeface(), type)
 {
 }
示例#26
0
 public Icon(string fontface, int type)
     : this(fontface)
 {
     Text = Pictogram.GetText(type);
 }
示例#27
0
        public static void SetImage(this Component @this, Pictogram pictogram, object type, int size = 0, Color?color = null, Brush brush = null)
        {
            if (typeof(ToolStripItem).IsAssignableFrom(@this.GetType()))
            {
                if (size == 0)
                {
                    size = ((@this as ToolStripItem).Width + (@this as ToolStripItem).Height) / 2;
                }

                if (color == null)
                {
                    color = (@this as ToolStripItem).ForeColor;
                }

                if (brush == null)
                {
                    brush = new SolidBrush(color.Value);
                }

                var image = pictogram.GetImage((int)type, size, brush);

                (@this as ToolStripItem).Image = image;
            }
            else if (typeof(NotifyIcon).IsAssignableFrom(@this.GetType()))
            {
                if (size == 0)
                {
                    size = 16;
                }

                if (color == null)
                {
                    color = SystemColors.ControlText;
                }

                if (brush == null)
                {
                    brush = new SolidBrush(color.Value);
                }

                var image = pictogram.GetImage((int)type, size, brush);
                var hIcon = new Bitmap(image).GetHicon();

                (@this as NotifyIcon).Icon = Icon.FromHandle(hIcon);
            }
            else if (typeof(ImageList).IsAssignableFrom(@this.GetType()))
            {
                if (size == 0)
                {
                    size = ((@this as ImageList).ImageSize.Width + (@this as ImageList).ImageSize.Height) / 2;
                }

                if (color == null)
                {
                    color = SystemColors.ControlText;
                }

                if (brush == null)
                {
                    brush = new SolidBrush(color.Value);
                }

                var image = pictogram.GetImage((int)type, size, brush);

                (@this as ImageList).Images.Add(image);
            }
        }
示例#28
0
        public static void SetText <T>(this Component @this, object type, float size = 0) where T : Pictogram
        {
            T instance = Pictogram.GetInstance <T>();

            SetText(@this, instance, type, size);
        }
示例#29
0
        public static void SetIcon <T>(this NotifyIcon @this, object type, int size = 0, Color?color = null, Brush brush = null) where T : Pictogram
        {
            T instance = Pictogram.GetInstance <T>();

            SetIcon(@this, instance, type, size, color, brush);
        }
示例#30
0
        private static IList <Pictogram> AddSamplePictograms(GirafDbContext context)
        {
            System.Console.WriteLine("Adding pictograms.");
            var pictograms = new Pictogram[]
            {
                new Pictogram("Epik", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image2)),
                new Pictogram("alfabet", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image3)),
                new Pictogram("alle", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image4)),
                new Pictogram("alting", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image5)),
                new Pictogram("antal", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image6)),
                new Pictogram("berøre", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image7)),
                new Pictogram("bogstav", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image8)),
                new Pictogram("delmængde", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image9)),
                new Pictogram("division", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image10)),
                new Pictogram("en", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image11)),
                new Pictogram("fantastisk", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image13)),
                new Pictogram("farve", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image14)),
                new Pictogram("fem", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image15)),
                new Pictogram("femininum", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image16)),
                new Pictogram("figurer", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image17)),
                new Pictogram("fire", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image18)),
                new Pictogram("former", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image19)),
                new Pictogram("fra", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image20)),
                new Pictogram("fredsdue", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image21)),
                new Pictogram("frihed", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image22)),
                new Pictogram("færdig", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image23)),
                new Pictogram("geometriske", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image24)),
                new Pictogram("godt", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image25)),
                new Pictogram("grå", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image26)),
                new Pictogram("gul", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image27)),
                new Pictogram("gylden", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image29)),
                new Pictogram("heldig", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image30)),
                new Pictogram("hunkøn", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image31)),
                new Pictogram("hvid", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image32)),
                new Pictogram("hvilken", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image33)),
                new Pictogram("hørelse", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image34)),
                new Pictogram("intet", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image35)),
                new Pictogram("j", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image36)),
                new Pictogram("komme", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image37)),
                new Pictogram("kvinde", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image38)),
                new Pictogram("langt", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image39)),
                new Pictogram("lilla", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image40)),
                new Pictogram("line", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image41)),
                new Pictogram("lysegrøn", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image42)),
                new Pictogram("lægge", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image43)),
                new Pictogram("maskulin", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image44)),
                new Pictogram("med", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image45)),
                new Pictogram("mere arbejde", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image46)),
                new Pictogram("midterste", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image47)),
                new Pictogram("mindre arbejde", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image48)),
                new Pictogram("multiplikation", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image49)),
                new Pictogram("mørkeblå", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image50)),
                new Pictogram("mørkegrøn", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image51)),
                new Pictogram("nederste", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image52)),
                new Pictogram("nnummer", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image53)),
                new Pictogram("nul", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image54)),
                new Pictogram("numer", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image55)),
                new Pictogram("nuværende", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image56)),
                new Pictogram("nærme", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image57)),
                new Pictogram("også", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image58)),
                new Pictogram("ok", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image59)),
                new Pictogram("omdømme", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image60)),
                new Pictogram("orange", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image61)),
                new Pictogram("ovenfor", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image62)),
                new Pictogram("parantes", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image63)),
                new Pictogram("parentes", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image64)),
                new Pictogram("pege", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image65)),
                new Pictogram("pink", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image66)),
                new Pictogram("q", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image67)),
                new Pictogram("regnestykke", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image68)),
                new Pictogram("regnestykke1", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image69)),
                new Pictogram("respekt", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image70)),
                new Pictogram("rød", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image71)),
                new Pictogram("sammen", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image72)),
                new Pictogram("sejt", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image73)),
                new Pictogram("selv", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image74)),
                new Pictogram("sig", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image75)),
                new Pictogram("simpelt", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image76)),
                new Pictogram("sjovt", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image77)),
                new Pictogram("s**t", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image78)),
                new Pictogram("som", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image79)),
                new Pictogram("sort", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image80)),
                new Pictogram("starte", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image81)),
                new Pictogram("stjerne", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image82)),
                new Pictogram("større end", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image83)),
                new Pictogram("symbol", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image84)),
                new Pictogram("synssans", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image85)),
                new Pictogram("sætte", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image86)),
                new Pictogram("sølv", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image87)),
                new Pictogram("tegn", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image88)),
                new Pictogram("terning", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image89)),
                new Pictogram("tiders", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image90)),
                new Pictogram("cat0", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image91)),
                new Pictogram("cat1", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image92)),
                new Pictogram("cat2", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image93)),
                new Pictogram("cat3", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image94)),
                new Pictogram("cat4", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image95)),
                new Pictogram("cat5", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image96)),
                new Pictogram("cat6", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image97)),
                new Pictogram("cat7", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image98)),
                new Pictogram("cat8", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image99)),
                new Pictogram("cat9", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image100)),
                new Pictogram("cat10", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image101)),
                new Pictogram("cat11", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image102)),
                new Pictogram("cat12", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image103)),
                new Pictogram("cat13", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image104)),
                new Pictogram("cat14", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image105)),
                new Pictogram("cat15", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image106)),
                new Pictogram("cat16", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image107)),
                new Pictogram("cat17", AccessLevel.PUBLIC, Encoding.ASCII.GetBytes(HugeBase64Images.Image108)),
            };

            foreach (var pictogram in pictograms)
            {
                pictogram.LastEdit = DateTime.Now;
                context.Add(pictogram);
            }
            context.SaveChanges();

            return(pictograms);
        }
示例#31
0
 public Icon(Pictogram glyph)
     : this(glyph.GetTypeface())
 {
 }
示例#32
0
        public static void SetImage <T>(this Control @this, object type, int size = 0, Color?color = null, Brush brush = null) where T : Pictogram
        {
            T instance = Pictogram.GetInstance <T>();

            SetImage(@this, instance, type, size, color, brush);
        }