/// <summary> /// Returns argument values to pass to into the data context's constructor, based on a given connection info. /// </summary> /// <param name="cxInfo"> Connection information, as entered by the user. </param> /// <returns> Argument values to pass to into the data context's constructor. </returns> public override object[] GetContextConstructorArguments(IConnectionInfo cxInfo) { var playback = new Playback(); var bondInEtwProperties = new BondInEtwProperties(cxInfo); try { var bondTypemap = new EnvelopeTypeMap(); var typeMaps = TypeFinder .LoadTypeMaps(TypeCache.ResolveCacheDirectory(bondInEtwProperties.ContextName)) .Where(i => i != typeof(EnvelopeTypeMap)) .Select(Activator.CreateInstance) .OfType <ITypeMap <IEnvelope> >() .Concat(new[] { bondTypemap }) .ToArray(); foreach (var file in bondInEtwProperties.Files) { var file1 = file; ((IPlaybackConfiguration)playback).AddInput( () => BinaryEtwObservable.FromFiles(file1), typeMaps); } Thread.SetData(LocalDataStoreSlot, playback); return(new object[] { playback }); } catch (Exception error) { MessageBox.Show(error.Message, "Error compiling generated code."); } return(new object[0]); }
/// <summary> /// Returns argument values to pass to into the data context's constructor, based on a given connection info. /// </summary> /// <param name="cxInfo"> Connection information, as entered by the user. </param> /// <returns> Argument values to pass to into the data context's constructor. </returns> public override object[] GetContextConstructorArguments(IConnectionInfo cxInfo) { var playback = new Playback(); var bondInEtwProperties = new BondInEtwProperties(cxInfo); try { var bondTypemap = new EnvelopeTypeMap(); var typeMaps = TypeFinder .LoadTypeMaps(TypeCache.ResolveCacheDirectory(bondInEtwProperties.ContextName)) .Where(i => i != typeof(EnvelopeTypeMap)) .Select(Activator.CreateInstance) .OfType<ITypeMap<IEnvelope>>() .Concat(new[] { bondTypemap }) .ToArray(); foreach (var file in bondInEtwProperties.Files) { var file1 = file; ((IPlaybackConfiguration)playback).AddInput( () => BinaryEtwObservable.FromFiles(file1), typeMaps); } Thread.SetData(LocalDataStoreSlot, playback); return new object[] { playback }; } catch (Exception error) { MessageBox.Show(error.Message, "Error compiling generated code."); } return new object[0]; }