public static HexEditorOptions TryCreate(HexViewOptionsGroup group, IHexEditorOptionsDefinitionMetadata md) { if (group == null) { throw new ArgumentNullException(nameof(group)); } if (md == null) { throw new ArgumentNullException(nameof(md)); } if (md.SubGroup == null) { return(null); } var subGroup = md.SubGroup; if (subGroup == null) { return(null); } if (md.Guid == null) { return(null); } Guid guid; if (!Guid.TryParse(md.Guid, out guid)) { return(null); } if (md.Name == null) { return(null); } return(new HexEditorOptions(group, subGroup, guid, ResourceHelper.GetString(md.Type.Assembly, md.Name))); }
public static HexEditorOptions TryCreate(HexViewOptionsGroup group, IHexEditorOptionsDefinitionMetadata md) { if (group == null) throw new ArgumentNullException(nameof(group)); if (md == null) throw new ArgumentNullException(nameof(md)); if (md.SubGroup == null) return null; var subGroup = md.SubGroup; if (subGroup == null) return null; if (md.Guid == null) return null; Guid guid; if (!Guid.TryParse(md.Guid, out guid)) return null; if (md.Name == null) return null; return new HexEditorOptions(group, subGroup, guid, ResourceHelper.GetString(md.Type.Assembly, md.Name)); }