public void TestCreateOk() { var config = new ProfileConfiguration <IProfiler>(); // ReSharper disable once UnusedVariable var sink = new ProfileManager(config); }
protected override void RegisterTypes(IUnityContainer container) { base.RegisterTypes(container); var config = new ProfileConfiguration <MyProfiler> { EventsToProfile = new HashSet <ProfileEvent> { ProfileEvent.ActionInvocation, ProfileEvent.PropertySet, ProfileEvent.Created, ProfileEvent.Deleted, ProfileEvent.Deleting, ProfileEvent.Loaded, ProfileEvent.Loading, ProfileEvent.Persisted, ProfileEvent.Persisting, ProfileEvent.Updated, ProfileEvent.Updating } }; container.RegisterInstance <IProfileConfiguration>(config, (new ContainerControlledLifetimeManager())); container.RegisterType <IFacetDecorator, ProfileManager>("ProfileManager", new ContainerControlledLifetimeManager()); var reflectorConfig = new ReflectorConfiguration(new[] { typeof(Foo), typeof(QueryableList <Foo>) }, new[] { typeof(SimpleRepository <Foo>) }, new[] { typeof(Foo).Namespace }); container.RegisterInstance <IReflectorConfiguration>(reflectorConfig, new ContainerControlledLifetimeManager()); }
internal ProfileConfiguration GetProfile(string profileName) { ProfileConfiguration expr = _formatterProfiles.GetOrAdd(profileName, name => new ProfileConfiguration()); return(expr); }
public static int Main(string[] arguments) { #if FEATURE_PROFILING var configuration = ProfileConfiguration.Parse(arguments); Console.WriteLine("Running Profiling with the following:"); Console.WriteLine($"- SdkPath: {SdkPath}"); Console.WriteLine($"- OutputPath: {OutputPath}"); Console.WriteLine($"- Classes: [{(configuration.ClassNames.Any() ? string.Join(",", configuration.ClassNames) : "*All*")}]"); using (var cluster = new ProfilingCluster()) { foreach (var profilingFactory in CreateProfilingFactory(cluster)) { profilingFactory.Run(configuration); profilingFactory.RunAsync(configuration).Wait(); } } return(0); #else Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Tests.exe is not built with Profiling support"); Console.ResetColor(); return(2); #endif }
public void ImportSettings() { var config = Configuration.Load(); if (config.Contains(ConfigurationName)) { MessageBox.Show("Failed to import settings. A configuration named '" + ConfigurationName + "' already exists. Please rename it and try again.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } var profileConfig = new ProfileConfiguration(); profileConfig.Name = ConfigurationName; foreach (var connectionString in ConnectionStringList) { profileConfig.AddConnectionString(connectionString.Key, connectionString.Value, connectionString.Provider); } foreach (var setting in AppSettingsList) { profileConfig.AddAppSetting(setting.Key, setting.Value); } config.AddConfiguration(profileConfig); config.Save(); _events.GetEvent <ImportSettingsCompleteEvent>().Publish(ConfigurationName); }
protected override void Seed(HealthTrackerContext context) { TenantConfiguration.Seed(context); RoleConfiguration.Seed(context); UserConfiguration.Seed(context); AccountConfiguration.Seed(context); ProfileConfiguration.Seed(context); }
public void ProfileConfiguration_UnitTest_Connection() { ProfileConfiguration target = ProfileConfiguration.Instance; string val = "EcfSqlConnection"; // TODO: Assign to an appropriate value for the property Assert.AreEqual(val, target.Connection.ConnectionStringName, "Mediachase.Commerce.Profile.ProfileConfiguration.Connection was not set correctly" + "."); }
void OnRepeatSessionActivated(object o, EventArgs args) { Gtk.Action action = o as Gtk.Action; int idx = Int32.Parse(action.Name.Substring(13)); ProfileConfiguration config = history.Configs [idx]; StartProfile(config); }
public void ProfileConfiguration_UnitTest_MappedTypes() { ProfileConfiguration target = ProfileConfiguration.Instance; string val = "Mediachase.Commerce.Profile.CustomerAddress,Mediachase.Commerce"; Assert.AreEqual(val, target.MappedTypes.CustomerAddress.Name, "Mediachase.Commerce.Profile.ProfileConfiguration.MappedTypes was not set correctly."); }
public void ProfileConfiguration_UnitTest_MetaClasses() { ProfileConfiguration target = ProfileConfiguration.Instance; string val = "CustomerAddressEx"; Assert.AreEqual(val, target.MetaClasses.CustomerAddressClass.Name, "Mediachase.Commerce.Profile.ProfileConfiguration.MetaClasses was not set correctl" + "y."); }
public void ProfileConfiguration_UnitTest_AutoConfigure() { ProfileConfiguration target = ProfileConfiguration.Instance;; Assert.AreNotEqual(false, target.AutoConfigure, "Mediachase.Commerce.Profile.ProfileConfiguration.AutoConfigure was not set correc" + "tly."); Assert.AreEqual(true, target.AutoConfigure, "Mediachase.Commerce.Profile.ProfileConfiguration.AutoConfigure was not set correc" + "tly."); }
protected override void Seed(BacklogContext context) { TenantConfiguration.Seed(context); RoleConfiguration.Seed(context); UserConfiguration.Seed(context); TaskStatusConfiguration.Seed(context); ProfileConfiguration.Seed(context); TileConfiguration.Seed(context); }
public void Begin(string device, bool enableErrorCorrection) { try { Profile profile = null; ProfileConfiguration config = ServiceManager.MediaProfileManager.GetActiveProfileConfiguration("cd-importing"); if (config != null) { profile = config.Profile; } else { profile = ServiceManager.MediaProfileManager.GetProfileForMimeType("audio/vorbis") ?? ServiceManager.MediaProfileManager.GetProfileForMimeType("audio/flac"); if (profile != null) { Log.InformationFormat("Using default/fallback encoding profile: {0}", profile.Name); ProfileConfiguration.SaveActiveProfile(profile, "cd-importing"); } } if (profile != null) { encoder_pipeline = profile.Pipeline.GetProcessById("gstreamer"); output_extension = profile.OutputFileExtension; } if (String.IsNullOrEmpty(encoder_pipeline)) { throw new ApplicationException(); } Hyena.Log.InformationFormat("Ripping using encoder profile `{0}' with pipeline: {1}", profile.Name, encoder_pipeline); } catch (Exception e) { throw new ApplicationException(Catalog.GetString("Could not find an encoder for ripping."), e); } try { int paranoia_mode = enableErrorCorrection ? 255 : 0; handle = new HandleRef(this, br_new(device, paranoia_mode, encoder_pipeline)); progress_handler = new RipperProgressHandler(OnNativeProgress); br_set_progress_callback(handle, progress_handler); mimetype_handler = new RipperMimeTypeHandler(OnNativeMimeType); br_set_mimetype_callback(handle, mimetype_handler); finished_handler = new RipperFinishedHandler(OnNativeFinished); br_set_finished_callback(handle, finished_handler); error_handler = new RipperErrorHandler(OnNativeError); br_set_error_callback(handle, error_handler); } catch (Exception e) { throw new ApplicationException(Catalog.GetString("Could not create CD ripping driver."), e); } }
public TranscodeContext (TrackInfo track, SafeUri out_uri, ProfileConfiguration config, TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler, TranscodeErrorHandler errorHandler) { Track = track; OutUri = out_uri; Config = config; Handler = handler; CancelledHandler = cancelledHandler; ErrorHandler = errorHandler; }
public TranscodeContext(TrackInfo track, SafeUri out_uri, ProfileConfiguration config, TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler, TranscodeErrorHandler errorHandler) { Track = track; OutUri = out_uri; Config = config; Handler = handler; CancelledHandler = cancelledHandler; ErrorHandler = errorHandler; }
public UserAppService( IHttpContextAccessor contextAccessor, IMessageBus bus, IMapper mapper, IRepository <User> userRepository, ProfileConfiguration profileConfig) : base(contextAccessor, bus, mapper) { this.mapper = mapper; this.userRepository = userRepository; this.profileConfig = profileConfig; }
public ProfileComboBoxConfigurable(MediaProfileManager manager, string configurationId, Box parent) { HBox editor = new HBox(); configuration_id = configurationId; combo = new ProfileComboBox(manager); combo.Show(); button = new ProfileConfigureButton(configurationId); button.ComboBox = combo; button.Show(); editor.Spacing = 5; editor.PackStart(combo, true, true, 0); editor.PackStart(button, false, false, 0); editor.Show(); ProfileConfiguration config = manager.GetActiveProfileConfiguration(configurationId); if (config != null) { Combo.SetActiveProfile(config.Profile); } description = new DescriptionLabel(delegate { var profile = Combo.ActiveProfile; return(profile != null ? profile.Description : ""); }); Combo.Changed += delegate { if (Combo.ActiveProfile != null) { Hyena.Log.DebugFormat("Setting active encoding profile: {0} (saved to {1})", Combo.ActiveProfile.Name, configurationId); ProfileConfiguration.SaveActiveProfile(Combo.ActiveProfile, configurationId); description.Update(); } }; Combo.StateChanged += delegate { if (Combo.State == StateType.Insensitive && description.Parent != null) { ((Container)parent ?? this).Remove(description); } else if (description.Parent == null) { description.PackInto(parent ?? this, parent != null); } }; Spacing = 5; PackStart(editor, true, true, 0); description.PackInto(parent ?? this, parent != null); }
public ProfileInformationDataModel(ProfileConfiguration profileConfiguration) { Id = profileConfiguration.ProfileId; Name = profileConfiguration.Name; Order = profileConfiguration.Order; IsActive = profileConfiguration.Profile != null; IsSuspended = profileConfiguration.IsSuspended; IsBeingEdited = profileConfiguration.IsBeingEdited; IsMissingModule = profileConfiguration.IsMissingModule; HasActivationCondition = profileConfiguration.ActivationCondition != null; ActivationConditionMet = profileConfiguration.ActivationConditionMet; }
public ProfileConfigViewModel(ProfileConfiguration config) { _config = config; AppSettings.AddingNew += (sender, e) => { e.NewObject = new KeyValueViewModel(); }; AppSettings.ListChanged += (sender, e) => { if (e.ListChangedType == ListChangedType.ItemAdded) { } }; }
public void GetProfileConfigurations(Guid profileId, [FormField] bool suspend) { ProfileConfiguration profileConfiguration = _profileService.ProfileConfigurations.FirstOrDefault(p => p.ProfileId == profileId); if (profileConfiguration == null) { throw HttpException.NotFound("Profile configuration not found."); } profileConfiguration.IsSuspended = suspend; _profileService.SaveProfileCategory(profileConfiguration.Category); }
public ProfileConfigurationModel(ProfileConfiguration profileConfiguration) { Id = profileConfiguration.ProfileId; Name = profileConfiguration.Name; Order = profileConfiguration.Order; IsActive = profileConfiguration.Profile != null; IsSuspended = profileConfiguration.IsSuspended; IsBeingEdited = profileConfiguration.IsBeingEdited; IsMissingModule = profileConfiguration.IsMissingModule; HasActivationCondition = profileConfiguration.ActivationCondition != null; ActivationConditionMet = profileConfiguration.ActivationConditionMet; Category = new ProfileCategoryModel(profileConfiguration.Category); }
public static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Must specify at least one argument: TestAssemblyPath, Profile or Benchmark "); } var arguments = args.Skip(1).ToArray(); if (args[0].Equals("Profile", StringComparison.OrdinalIgnoreCase)) { #if FEATURE_PROFILING var configuration = ProfileConfiguration.Parse(arguments); Console.WriteLine("Running Profiling with the following:"); Console.WriteLine($"- SdkPath: {SdkPath}"); Console.WriteLine($"- OutputPath: {OutputPath}"); Console.WriteLine($"- Classes: [{(configuration.ClassNames.Any() ? string.Join(",", configuration.ClassNames) : "*All*")}]"); using (var cluster = new ProfilingCluster()) { foreach (var profilingFactory in CreateProfilingFactory(cluster)) { profilingFactory.Run(configuration); profilingFactory.RunAsync(configuration).Wait(); } } #else Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Tests.exe is not built with Profiling support"); Console.ResetColor(); Environment.Exit(9); #endif } else if (args[0].Equals("Benchmark", StringComparison.OrdinalIgnoreCase)) { Console.WriteLine("Running Benchmarking."); if (args.Count() > 1 && args[1].Equals("non-interactive", StringComparison.OrdinalIgnoreCase)) { Console.WriteLine("Running in Non-Interactive mode."); foreach (var benchmarkType in GetBenchmarkTypes()) { BenchmarkRunner.Run(benchmarkType); } return; } Console.WriteLine("Running in Interactive mode."); var benchmarkSwitcher = new BenchmarkSwitcher(GetBenchmarkTypes()); benchmarkSwitcher.Run(arguments); } }
public void ConfigureContainer(ContainerBuilder builder) { // Configuration Keys var profileConfig = new ProfileConfiguration(); Configuration.GetSection("Profile").Bind(profileConfig); builder.RegisterInstance(profileConfig).AsSelf(); // IoC Container Module Registration builder.RegisterModule(new IoCModuleApplicationService()); builder.RegisterModule(new IoCModuleInfrastructure()); builder.RegisterModule(new IoCAutoMapperModule()); }
public void TranscodeTrack(TrackInfo track, SafeUri outputUri, ProfileConfiguration config) { if (IsTranscoding) { throw new ApplicationException("Transcoder is busy"); } Log.DebugFormat("Transcoding {0} to {1}", track.Uri, outputUri); output_uri = outputUri; error_message = null; current_track = track; Transcode(config.Profile.Pipeline.GetProcessById("gstreamer")); }
public void Enqueue(TrackInfo track, SafeUri out_uri, ProfileConfiguration config, TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler, TranscodeErrorHandler errorHandler) { bool start = false; lock (queue) { start = (queue.Count == 0 && !transcoding); queue.Enqueue(new TranscodeContext(track, out_uri, config, handler, cancelledHandler, errorHandler)); UserJob.Total++; } if (start) { ProcessQueue(); } }
public async Task LoadFromSourceAsync() { try { using var configFile = new StreamReader(new FileStream(_filePath, FileMode.OpenOrCreate)); var jsonString = await configFile.ReadToEndAsync(); _configuration = JsonConvert.DeserializeObject <ProfileConfiguration>(jsonString); } catch (Exception e) { Logger.Error(e, "Unable to open file {path}", _filePath); throw; } }
public void AddDefaultProfile() { if (Profiles.Count > 0) { return; } if (activeProfile != null) { Profiles.Add(activeProfile); } else { ActiveProfile = ProfileConfiguration.CreateDefaultProfile(); Profiles.Add(ActiveProfile); } }
void StartProfile(ProfileConfiguration config) { ProfileView view = new ProfileView(); view.Show(); View = view; logging_enabled_action.Visible = true; logging_enabled_action.Active = config.StartEnabled; proc = new ProfilerProcess(config); proc.Paused += delegate { Refresh(view); }; proc.Exited += delegate { Refresh(view); logging_enabled_action.Visible = false; }; proc.Start(); log_info = new LogInfo(proc.LogFile, config.ToString()); history.LogFiles.Prepend(log_info); history.Configs.Prepend(config); }
void UpdateRepeatSessions(object o, EventArgs args) { for (int i = 0; i < max_history_count; i++) { Gtk.Action action = group.GetAction("RepeatSession" + i); if (i < history.Configs.Count) { ProfileConfiguration config = history.Configs [i]; action.Label = "_" + i + ": " + config.ToString(); action.Visible = true; } else { action.Visible = false; } } }
private void BindProfile(ProfileConfiguration cfg) { if (cfg == null) { return; } cfg.RightTrigger.Trigger = Program.Simulator.Controller.RightTrigger; cfg.LeftTrigger.Trigger = Program.Simulator.Controller.LeftTrigger; cfg.RightThumb.Thumb = Program.Simulator.Controller.RightThumb; cfg.LeftThumb.Thumb = Program.Simulator.Controller.LeftThumb; cfg.RightTrigger.Bind( () => cfgTrgRightEnabled.Checked, (a) => cfgTrgRightEnabled.Checked = a, () => cfgTrgRightVal.Value, (a) => cfgTrgRightVal.Value = a ); cfg.LeftTrigger.Bind( () => cfgTrgLeftEnabled.Checked, (a) => cfgTrgLeftEnabled.Checked = a, () => cfgTrgLeftVal.Value, (a) => cfgTrgLeftVal.Value = a ); cfg.RightThumb.Bind( () => cfgDZRightX.Value, (a) => cfgDZRightX.Value = a, () => cfgDZRightY.Value, (a) => cfgDZRightY.Value = a ); cfg.LeftThumb.Bind( () => cfgDZLeftX.Value, (a) => cfgDZLeftX.Value = a, () => cfgDZLeftY.Value, (a) => cfgDZLeftY.Value = a ); cfg.BindCursorSpeed( () => cfgCursorSpeed.Value, (a) => cfgCursorSpeed.Value = a ); cfgBtnA.Config = cfg.Buttons[(int)SmartController.GamepadButtons.A]; cfgBtnB.Config = cfg.Buttons[(int)SmartController.GamepadButtons.B]; cfgBtnX.Config = cfg.Buttons[(int)SmartController.GamepadButtons.X]; cfgBtnY.Config = cfg.Buttons[(int)SmartController.GamepadButtons.Y]; cfgBtnBack.Config = cfg.Buttons[(int)SmartController.GamepadButtons.Back]; cfgBtnStart.Config = cfg.Buttons[(int)SmartController.GamepadButtons.Start]; cfgBtnRT.Config = cfg.Buttons[(int)SmartController.GamepadButtons.RightThumb]; cfgBtnLT.Config = cfg.Buttons[(int)SmartController.GamepadButtons.LeftThumb]; cfgBtnRS.Config = cfg.Buttons[(int)SmartController.GamepadButtons.RightShoulder]; cfgBtnLS.Config = cfg.Buttons[(int)SmartController.GamepadButtons.LeftShoulder]; cfgBtnDPUp.Config = cfg.Buttons[(int)SmartController.GamepadButtons.DPadUp]; cfgBtnDPDown.Config = cfg.Buttons[(int)SmartController.GamepadButtons.DPadDown]; cfgBtnDPLeft.Config = cfg.Buttons[(int)SmartController.GamepadButtons.DPadLeft]; cfgBtnDPRight.Config = cfg.Buttons[(int)SmartController.GamepadButtons.DPadRight]; }
public void Begin(string device, bool enableErrorCorrection) { try { this.device = device; this.paranoia_mode = enableErrorCorrection ? 255 : 0; Profile profile = null; ProfileConfiguration config = ServiceManager.MediaProfileManager.GetActiveProfileConfiguration("cd-importing"); if (config != null) { profile = config.Profile; } else { profile = ServiceManager.MediaProfileManager.GetProfileForMimeType("audio/vorbis") ?? ServiceManager.MediaProfileManager.GetProfileForMimeType("audio/flac"); if (profile != null) { Log.InformationFormat("Using default/fallback encoding profile: {0}", profile.Name); ProfileConfiguration.SaveActiveProfile(profile, "cd-importing"); } } if (profile != null) { encoder_pipeline = profile.Pipeline.GetProcessById("gstreamer"); output_extension = profile.OutputFileExtension; } if (String.IsNullOrEmpty(encoder_pipeline)) { throw new ApplicationException(); } timer = new System.Timers.Timer(); timer.Interval = 200; timer.AutoReset = true; timer.Elapsed += OnTick; Hyena.Log.InformationFormat("Ripping using encoder profile `{0}' with pipeline: {1}", profile.Name, encoder_pipeline); } catch (Exception e) { throw new ApplicationException(Catalog.GetString("Could not find an encoder for ripping."), e); } }
public void TranscodeTrack (TrackInfo track, SafeUri outputUri, ProfileConfiguration config) { if(IsTranscoding) { throw new ApplicationException("Transcoder is busy"); } Log.DebugFormat ("Transcoding {0} to {1}", track.Uri, outputUri); output_uri = outputUri; error_message = null; current_track = track; Transcode (config.Profile.Pipeline.GetProcessById("gstreamer")); }
public virtual StartChannelListener init(System.String uri, ProfileConfiguration config) { return this; }
public void SetConfiguration(ProfileConfiguration configuration) { this.configuration = configuration; foreach(KeyValuePair<string, string> variable in configuration) { pipeline[variable.Key] = variable.Value; } }
/// <summary> init sets the criteria for which an TLS connection is made when /// a TLS channel is started for a profile. It should only be /// called once. For the properties, the initiator is defined as /// the peer who starts the channel for the TLS profile, the /// listener is the peer that receives the the channel start /// request, irregardless of which actually started the session.<p> /// Each subclass that encapsulates an implementation has its own /// properties as to what it needs to initialise. See the individual /// implementations for their properties. /// /// </summary> /// <param name="uri">used to start a channel with TLS protection /// </param> /// <param name="config">used to specify the parameters for sessions protected /// by this profile's version of TLS. In other words, if you want another /// set of paramters, you must either recall this method or create another /// instance of a <code>TLSProfile</code>. /// </param> public abstract StartChannelListener init(System.String uri, ProfileConfiguration config);
public void TranscodeTrack(TrackInfo track, SafeUri outputUri, ProfileConfiguration config) { if(IsTranscoding) { throw new ApplicationException("Transcoder is busy"); } Log.DebugFormat ("Transcoding {0} to {1}", track.Uri, outputUri); SafeUri inputUri = track.Uri; managed_output_uri = outputUri; IntPtr input_uri = GLib.Marshaller.StringToPtrGStrdup(inputUri.AbsoluteUri); IntPtr output_uri = GLib.Marshaller.StringToPtrGStrdup(outputUri.AbsoluteUri); error_message = null; current_track = track; gst_transcoder_transcode(handle, input_uri, output_uri, config.Profile.Pipeline.GetProcessById("gstreamer")); GLib.Marshaller.Free(input_uri); GLib.Marshaller.Free(output_uri); }
/// <summary> Method init is used to construct various static data /// used in the SASL OTP profile. /// </summary> public virtual StartChannelListener init(System.String uri, ProfileConfiguration config) { md5 = new MD5(); sha1 = new SHA1(); authenticators = new System.Collections.Hashtable(); if (instance_Renamed_Field == null) { instance_Renamed_Field = this; algorithms = new System.Collections.Hashtable(); SupportClass.PutElement(algorithms, MD5.AlgorithmName, md5); SupportClass.PutElement(algorithms, SHA1.AlgorithmName, sha1); userDatabase = new UserDatabasePool(); } return this; }
public void Enqueue (TrackInfo track, ProfileConfiguration config, TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler, TranscodeErrorHandler errorHandler) { Enqueue (track, GetTempUriFor (config.Profile.OutputFileExtension), config, handler, cancelledHandler, errorHandler); }
public void Enqueue (TrackInfo track, SafeUri out_uri, ProfileConfiguration config, TrackTranscodedHandler handler, TranscodeCancelledHandler cancelledHandler, TranscodeErrorHandler errorHandler) { bool start = false; lock (queue) { start = (queue.Count == 0 && !transcoding); queue.Enqueue (new TranscodeContext (track, out_uri, config, handler, cancelledHandler, errorHandler)); UserJob.Total++; } if (start) ProcessQueue (); }