Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Editor/Completion/XmlImageIds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ namespace MonoDevelop.Xml.Editor.Completion
{
public static class XmlImages
{
// Warning: the order of these static fields is important,
// declare in the order they depend on one another.
// If this Guid is at the end, the other fields will read the empty value before it gets initialized
static readonly Guid KnownImagesGuid = KnownImageIds.ImageCatalogGuid;
static ImageElement CreateElement(int id) => new ImageElement(new ImageId(KnownImagesGuid, id));

public static readonly ImageElement Element = CreateElement (KnownImageIds.XMLElement);
public static readonly ImageElement Attribute = CreateElement (KnownImageIds.XMLAttribute);
public static readonly ImageElement AttributeValue = CreateElement (KnownImageIds.Constant);
Expand All @@ -19,8 +25,5 @@ public static class XmlImages
public static readonly ImageElement Prolog = CreateElement (KnownImageIds.XMLProcessInstructionTag);
public static readonly ImageElement Entity = Prolog;
public static ImageElement ClosingTag = Element;

static readonly Guid KnownImagesGuid = KnownImageIds.ImageCatalogGuid;
static ImageElement CreateElement (int id) => new ImageElement (new ImageId (KnownImagesGuid, id));
}
}