public static FirefoxProfile GetFirefoxProfile(FirefoxProfileCmdletBase cmdlet) { FirefoxProfile profile = null; var listOfParameters = new System.Collections.Generic.List <Autofac.Core.Parameter>(); var profileDirectory = ((NewSeFirefoxProfileCommand)cmdlet).ProfileDirectoryPath; bool deleteSourceOnClean = ((NewSeFirefoxProfileCommand)cmdlet).DeleteSource; if (!string.IsNullOrEmpty(profileDirectory)) { listOfParameters.Add( new NamedParameter( "profileDirectory", profileDirectory)); if (deleteSourceOnClean) { listOfParameters.Add( new NamedParameter( "deleteSourceOnClean", deleteSourceOnClean)); profile = Container.ResolveNamed <FirefoxProfile>( FirefoxProfileConstructorOptions.FfWithPathAndBool.ToString(), listOfParameters); } else { profile = Container.ResolveNamed <FirefoxProfile>( FirefoxProfileConstructorOptions.FfWithPath.ToString(), listOfParameters); } } else { profile = Container.ResolveNamed <FirefoxProfile>( FirefoxProfileConstructorOptions.FfBare.ToString()); } return(profile); }
public static FirefoxProfile GetFirefoxProfile(FirefoxProfileCmdletBase cmdlet) { FirefoxProfile profile = null; System.Collections.Generic.List<Autofac.Core.Parameter> listOfParameters = new System.Collections.Generic.List<Autofac.Core.Parameter>(); string profileDirectory = ((NewSeFirefoxProfileCommand)cmdlet).ProfileDirectoryPath; bool deleteSourceOnClean = ((NewSeFirefoxProfileCommand)cmdlet).DeleteSource; if (null != profileDirectory && string.Empty != profileDirectory) { listOfParameters.Add( new NamedParameter( "profileDirectory", profileDirectory)); if (deleteSourceOnClean) { listOfParameters.Add( new NamedParameter( "deleteSourceOnClean", deleteSourceOnClean)); profile = Container.ResolveNamed<FirefoxProfile>( FirefoxProfileConstructorOptions.ff_with_path_and_bool.ToString(), listOfParameters); } else { profile = Container.ResolveNamed<FirefoxProfile>( FirefoxProfileConstructorOptions.ff_with_path.ToString(), listOfParameters); } } else { profile = Container.ResolveNamed<FirefoxProfile>( FirefoxProfileConstructorOptions.ff_bare.ToString()); } return profile; }
public static FirefoxProfile GetFirefoxProfile(FirefoxProfileCmdletBase cmdlet) { FirefoxProfile profile = null; var listOfParameters = new System.Collections.Generic.List<Autofac.Core.Parameter>(); var profileDirectory = ((NewSeFirefoxProfileCommand)cmdlet).ProfileDirectoryPath; bool deleteSourceOnClean = ((NewSeFirefoxProfileCommand)cmdlet).DeleteSource; if (!string.IsNullOrEmpty(profileDirectory)) { listOfParameters.Add( new NamedParameter( "profileDirectory", profileDirectory)); if (deleteSourceOnClean) { listOfParameters.Add( new NamedParameter( "deleteSourceOnClean", deleteSourceOnClean)); profile = Container.ResolveNamed<FirefoxProfile>( FirefoxProfileConstructorOptions.FfWithPathAndBool.ToString(), listOfParameters); } else { profile = Container.ResolveNamed<FirefoxProfile>( FirefoxProfileConstructorOptions.FfWithPath.ToString(), listOfParameters); } } else { profile = Container.ResolveNamed<FirefoxProfile>( FirefoxProfileConstructorOptions.FfBare.ToString()); } return profile; }