I have currently 2 file types I can import. I have an interface of type IImportFileAction. Then I have 2 classes that inherit this interface named ImportGPX and ImportTCX. Import GPX imports a .gpx file a开发者_开发知识库nd ImportTCX imports a .tcx file. I pass the filename in the constructor of these two classes. How would I initialize StructureMap so that if the files extention is gpx the GetInstance will return the ImportGPX and vice versa for TCX?
Take a look at Jeremy's post on conditional object construction. Afterwards you may find this SO question useful as an example.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论