/// <summary> /// Registers the editor of type <typeparamref name = "TEditor" /> using the <see cref = "FileEditorDescriptor.EditorKeyName" />. /// </summary> /// <typeparam name = "TEditor">The editor type (e.g. "BasicXmlEditor").</typeparam> /// <param name = "fileEditorDescriptor">The file extension descriiptor for this type.</param> public void RegisterEditor<TEditor>(FileEditorDescriptor fileEditorDescriptor) where TEditor : IEditor { RegisterComponent<IEditor, TEditor>(fileEditorDescriptor.EditorKeyName); // push the ext reg into the resolver.... IFileEditorResolver resolver = Resolve<IFileEditorResolver>(); resolver.Register(fileEditorDescriptor); }
/// <summary> /// Registers the specified file editor descriptor. /// It is recommended to use the <see cref = "IApplicationServices.RegisterEditor{TEditor}" /> method to /// set up the container correctly. /// </summary> /// <param name = "fileEditorDescriptor">The file editor descriptor.</param> public void Register(FileEditorDescriptor fileEditorDescriptor) { _fileEditorDescriptors.Add(fileEditorDescriptor); if (fileEditorDescriptor.Extensions == null || fileEditorDescriptor.Extensions.Length == 0) { _extentionMap.Add("*", fileEditorDescriptor); } else { // create a map of all ext to editors foreach (string extention in fileEditorDescriptor.Extensions) { _extentionMap.Add(extention, fileEditorDescriptor); } } }