public Database() : base(null, Enums.ObjectType.Database) { AllObjects = new SearchSchemaBase(); _changesOptions = new List<DatabaseChangeStatus>(); Dependencies = new Dependencies(); TablesTypes = new SchemaList<TableType, Database>(this, AllObjects); UserTypes = new SchemaList<UserDataType, Database>(this, AllObjects); XmlSchemas = new SchemaList<XMLSchema, Database>(this, AllObjects); Schemas = new SchemaList<Schema, Database>(this, AllObjects); Procedures = new SchemaList<StoreProcedure, Database>(this, AllObjects); CLRProcedures = new SchemaList<CLRStoreProcedure, Database>(this, AllObjects); CLRFunctions = new SchemaList<CLRFunction, Database>(this, AllObjects); FileGroups = new SchemaList<FileGroup, Database>(this); Rules = new SchemaList<Rule, Database>(this, AllObjects); DDLTriggers = new SchemaList<Trigger, Database>(this, AllObjects); Synonyms = new SchemaList<Synonym, Database>(this, AllObjects); Assemblies = new SchemaList<Assembly, Database>(this, AllObjects); Views = new SchemaList<View, Database>(this, AllObjects); Users = new SchemaList<User, Database>(this, AllObjects); FullText = new SchemaList<FullText, Database>(this, AllObjects); Functions = new SchemaList<Function, Database>(this, AllObjects); PartitionFunctions = new SchemaList<PartitionFunction, Database>(this, AllObjects); PartitionSchemes = new SchemaList<PartitionScheme, Database>(this, AllObjects); Roles = new SchemaList<Role, Database>(this); Tables = new SchemaList<Table, Database>(this, AllObjects); Defaults = new SchemaList<Default, Database>(this, AllObjects); ActionMessage = new SqlAction(this); }
public void SetUp() { _dependencies = new Dependencies(); _dependencies.AddDirect("A", new[] { "B", "C" }); _dependencies.AddDirect("B", new[] { "C", "E" }); _dependencies.AddDirect("C", new[] { "G" }); _dependencies.AddDirect("D", new[] { "A", "F" }); _dependencies.AddDirect("E", new[] { "F" }); _dependencies.AddDirect("F", new[] { "H" }); }
public Constructor() { _mock = new WebServerMockGenerator(); _dependencies = new Dependencies { FileSystem = _mock.FileSystem.Object, EnvironmentSystem = _mock.EnvironmentSystem.Object, ProcessRunner = _mock.ProcessRunner.Object, ServerManagerProvider = _mock.ServerManagerProvider.Object }; }
public MockWebServer(WebServerSettings settings, Dependencies dependencies) { _type = "MockWebServer"; if (dependencies != null) { _fileSystem = dependencies.FileSystem; _environmentSystem = dependencies.EnvironmentSystem; _processRunner = dependencies.ProcessRunner; _serverManagerProvider = dependencies.ServerManagerProvider; } }
public Create() { TestEasyConfig.Instance = new TestEasyConfig((object)null); _mock = new WebServerMockGenerator(); _dependencies = new Dependencies { FileSystem = _mock.FileSystem.Object, EnvironmentSystem = _mock.EnvironmentSystem.Object, ProcessRunner = _mock.ProcessRunner.Object, ServerManagerProvider = _mock.ServerManagerProvider.Object }; }
public void Restore(Dependencies dependencies, IEnumerable<RestoringProject> projects) { PaketErrorPane.Clear(); PaketOutputPane.OutputPane.OutputStringThreadSafe("Restoring packages\r\n"); try { restorer.Restore(dependencies, projects); } finally { PaketOutputPane.OutputPane.OutputStringThreadSafe("Ready\r\n"); } }
public void Restore(Dependencies dependencies, IEnumerable<RestoringProject> projects) { foreach (var project in projects) { try { restorer.Restore(dependencies, new[] { project }); } catch (Exception ex) { PaketErrorPane.ShowError(ex.Message, project.ReferenceFile, "paket-restore.html"); PaketOutputPane.OutputPane.OutputStringThreadSafe(ex.Message + "\r\n"); } } }
public void test_basic() { var dep = new Dependencies(); dep.add_direct("A", new string[] { "B", "C" }); dep.add_direct("B", new string[] { "C", "E" }); dep.add_direct("C", new string[] { "G" }); dep.add_direct("D", new string[] { "A", "F" }); dep.add_direct("E", new string[] { "F" }); dep.add_direct("F", new string[] { "H" }); CollectionAssert.AreEqual(new string[] { "B", "C", "E", "F", "G", "H" }, dep.dependencies_for("A")); CollectionAssert.AreEqual(new string[] { "C", "E", "F", "G", "H" }, dep.dependencies_for("B")); CollectionAssert.AreEqual(new string[] { "G" }, dep.dependencies_for("C")); CollectionAssert.AreEqual(new string[] { "A", "B", "C", "E", "F", "G", "H" }, dep.dependencies_for("D")); CollectionAssert.AreEqual(new string[] { "F", "H" }, dep.dependencies_for("E")); CollectionAssert.AreEqual(new string[] { "H" }, dep.dependencies_for("F")); }
/// <summary> /// Sets up Autofac to work with an MVC3 environment. /// Should be called from Application_Start /// </summary> /// <param name="d">A lambda that takes a container builder that then registers any dependencies within the application</param> /// <returns>The container so that the application can do any resolves necessary within Application_Start</returns> public IContainer RegisterDependencies(Dependencies d) { var builder = new ContainerBuilder(); RegisterWebbyStuff(builder); builder.RegisterModule<AuthModule>(); d(builder); var container = builder.Build(); DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); // Enable the flow forms model metadata provider ModelMetadataProviders.Current = new MetadataProvider(); // Enable the flow forms Validator Provider to fix MVC bug DataAnnotationsModelValidatorProvider.RegisterDefaultValidatableObjectAdapterFactory((m, c) => new CustomValidatableObjectAdapter(m, c)); return container; }
public void Restore(Dependencies dependencies, IEnumerable<RestoringProject> projects) { var projectsList = projects.ToList(); IVsThreadedWaitDialog2 waitDialog; waitDialogFactory.CreateInstance(out waitDialog); waitDialog.StartWaitDialog("Paket", "Restoring packages", null, null, null, 0, false, true); int i = 0; try { foreach (var project in projectsList) { bool canceled; waitDialog.UpdateProgress(string.Format("Restoring packages for {0}", project.ProjectName), null, null, i++, projectsList.Count, false, out canceled); restorer.Restore(dependencies, new[] { project }); } } finally { waitDialog.EndWaitDialog(out i); } }
public void storeDependencies(Dependencies dependencies) { #if !SILVERLIGHT send_storeDependencies(dependencies); recv_storeDependencies(); #else var asyncResult = Begin_storeDependencies(null, null, dependencies); End_storeDependencies(asyncResult); #endif }
/// <summary> /// Constructor /// </summary> public CommandExtension() { Dependencies = new Dependencies(); }
public void SetCollection(PackageCollection collection) { Collection = collection; Dependencies.SetCollection(collection); }
private void setupConfig() { Dependencies.Cache(debugConfig = new FrameworkDebugConfigManager()); Dependencies.Cache(config = new FrameworkConfigManager(Storage)); Dependencies.Cache(Localisation = new LocalisationEngine(config)); activeGCMode = debugConfig.GetBindable <GCLatencyMode>(DebugSetting.ActiveGCMode); activeGCMode.ValueChanged += newMode => { GCSettings.LatencyMode = IsActive ? newMode : GCLatencyMode.Interactive; }; frameSyncMode = config.GetBindable <FrameSync>(FrameworkSetting.FrameSync); frameSyncMode.ValueChanged += newMode => { float refreshRate = DisplayDevice.Default.RefreshRate; // For invalid refresh rates let's assume 60 Hz as it is most common. if (refreshRate <= 0) { refreshRate = 60; } float drawLimiter = refreshRate; float updateLimiter = drawLimiter * 2; setVSyncMode(); switch (newMode) { case FrameSync.VSync: drawLimiter = int.MaxValue; updateLimiter *= 2; break; case FrameSync.Limit2x: drawLimiter *= 2; updateLimiter *= 2; break; case FrameSync.Limit4x: drawLimiter *= 4; updateLimiter *= 4; break; case FrameSync.Limit8x: drawLimiter *= 8; updateLimiter *= 8; break; case FrameSync.Unlimited: drawLimiter = updateLimiter = int.MaxValue; break; } if (DrawThread != null) { DrawThread.ActiveHz = drawLimiter; } if (UpdateThread != null) { UpdateThread.ActiveHz = updateLimiter; } }; ignoredInputHandlers = config.GetBindable <string>(FrameworkSetting.IgnoredInputHandlers); ignoredInputHandlers.ValueChanged += ignoredString => { var configIgnores = ignoredString.Split(' ').Where(s => !string.IsNullOrWhiteSpace(s)); // for now, we always want at least one handler disabled (don't want raw and non-raw mouse at once). bool restoreDefaults = !configIgnores.Any(); if (restoreDefaults) { resetInputHandlers(); ignoredInputHandlers.Value = string.Join(" ", AvailableInputHandlers.Where(h => !h.Enabled).Select(h => h.ToString())); } else { foreach (var handler in AvailableInputHandlers) { var handlerType = handler.ToString(); handler.Enabled.Value = configIgnores.All(ch => ch != handlerType); } } }; cursorSensitivity = config.GetBindable <double>(FrameworkSetting.CursorSensitivity); performanceLogging = config.GetBindable <bool>(FrameworkSetting.PerformanceLogging); performanceLogging.ValueChanged += enabled => threads.ForEach(t => t.Monitor.EnablePerformanceProfiling = enabled); performanceLogging.TriggerChange(); }
/// <summary> /// Constructor /// </summary> public ExtensionConfigBase() { Apply = new Apply(); Dependencies = new Dependencies(); }
/// <summary> /// Constructor /// </summary> public CommandSet() { Dependencies = new Dependencies(); }
private void UpdateDependencies() { Dependencies.Clear(); GetAllDependencies().ToList().ForEach(Dependencies.Add); }
public StoreController(PizzaBoxDbContext context) { _context = context; _storeRepo = Dependencies.CreateStoreRepository(); }
public Game(Dependencies d) { this.dep = d; }
private void load() { Dependencies.Cache(localConfig = new OsuConfigManager(LocalStorage)); }
private void load() { Dependencies.Cache(dialogOverlay); Add(settings); }
public Start(Dependencies d) { dep = d; }
PointBase GetPoint() { return((PointBase)Dependencies.ElementAt(0)); }
public override void Run() { Dependencies.Locate(dependenciesFileName) .Install(false); PaketServices.FileChangedNotifier.NotifyAllPaketAndProjectFilesChangedInSolution(); }
public void send_storeDependencies(Dependencies dependencies) #endif { oprot_.WriteMessageBegin(new TMessage("storeDependencies", TMessageType.Call, seqid_)); storeDependencies_args args = new storeDependencies_args(); args.Dependencies = dependencies; args.Write(oprot_); oprot_.WriteMessageEnd(); #if SILVERLIGHT return oprot_.Transport.BeginFlush(callback, state); #else oprot_.Transport.Flush(); #endif }
public PlatformModule(File providedStoreDir, Config config, DatabaseInfo databaseInfo, GraphDatabaseFacadeFactory.Dependencies externalDependencies) { this.DatabaseInfo = databaseInfo; this.DataSourceManager = new DataSourceManager(config); Dependencies = new Dependencies(); Dependencies.satisfyDependency(databaseInfo); Clock = Dependencies.satisfyDependency(CreateClock()); Life = Dependencies.satisfyDependency(CreateLife()); this.StoreLayout = StoreLayout.of(providedStoreDir); config.AugmentDefaults(GraphDatabaseSettings.neo4j_home, StoreLayout.storeDirectory().Path); this.Config = Dependencies.satisfyDependency(config); FileSystem = Dependencies.satisfyDependency(CreateFileSystemAbstraction()); Life.add(new FileSystemLifecycleAdapter(FileSystem)); // Component monitoring Monitors = externalDependencies.Monitors() == null ? new Monitors() : externalDependencies.Monitors(); Dependencies.satisfyDependency(Monitors); JobScheduler = Life.add(Dependencies.satisfyDependency(CreateJobScheduler())); StartDeferredExecutors(JobScheduler, externalDependencies.DeferredExecutors()); // Cleanup after recovery, used by GBPTree, added to life in NeoStoreDataSource RecoveryCleanupWorkCollector = new GroupingRecoveryCleanupWorkCollector(JobScheduler); Dependencies.satisfyDependency(RecoveryCleanupWorkCollector); // Database system information, used by UDC UsageData = new UsageData(JobScheduler); Dependencies.satisfyDependency(Life.add(UsageData)); // If no logging was passed in from the outside then create logging and register // with this life Logging = Dependencies.satisfyDependency(CreateLogService(externalDependencies.UserLogProvider())); config.Logger = Logging.getInternalLog(typeof(Config)); Life.add(Dependencies.satisfyDependency(new StoreLockerLifecycleAdapter(CreateStoreLocker()))); (new JvmChecker(Logging.getInternalLog(typeof(JvmChecker)), new JvmMetadataRepository())).checkJvmCompatibilityAndIssueWarning(); string desiredImplementationName = config.Get(GraphDatabaseSettings.tracer); Tracers = Dependencies.satisfyDependency(new Tracers(desiredImplementationName, Logging.getInternalLog(typeof(Tracers)), Monitors, JobScheduler, Clock)); Dependencies.satisfyDependency(Tracers.pageCacheTracer); Dependencies.satisfyDependency(FirstImplementor(typeof(LogRotationMonitor), Tracers.transactionTracer, LogRotationMonitor.NULL)); Dependencies.satisfyDependency(FirstImplementor(typeof(CheckPointerMonitor), Tracers.checkPointTracer, CheckPointerMonitor.NULL)); VersionContextSupplier = CreateCursorContextSupplier(config); CollectionsFactorySupplier = CreateCollectionsFactorySupplier(config, Life); Dependencies.satisfyDependency(VersionContextSupplier); PageCache = Dependencies.satisfyDependency(CreatePageCache(FileSystem, config, Logging, Tracers, VersionContextSupplier, JobScheduler)); Life.add(new PageCacheLifecycle(PageCache)); DiagnosticsManager = Life.add(Dependencies.satisfyDependency(new DiagnosticsManager(Logging.getInternalLog(typeof(DiagnosticsManager))))); SystemDiagnostics.registerWith(DiagnosticsManager); Dependencies.satisfyDependency(DataSourceManager); KernelExtensionFactories = externalDependencies.KernelExtensions(); EngineProviders = externalDependencies.ExecutionEngines(); GlobalKernelExtensions = Dependencies.satisfyDependency(new GlobalKernelExtensions(new SimpleKernelContext(StoreLayout.storeDirectory(), databaseInfo, Dependencies), KernelExtensionFactories, Dependencies, KernelExtensionFailureStrategies.fail())); UrlAccessRule = Dependencies.satisfyDependency(URLAccessRules.combined(externalDependencies.UrlAccessRules())); ConnectorPortRegister = new ConnectorPortRegister(); Dependencies.satisfyDependency(ConnectorPortRegister); EventHandlers = new KernelEventHandlers(Logging.getInternalLog(typeof(KernelEventHandlers))); PanicEventGenerator = new DatabasePanicEventGenerator(EventHandlers); PublishPlatformInfo(Dependencies.resolveDependency(typeof(UsageData))); }
public static string GetExplodeMode(this Part part) { return(Dependencies.Get <DamageService>().GetExplodeMode_svc(part)); }
public override void GetSystemDependencies(Dependencies dependencies) { GameDataContainer gameData = dependencies.GetDependency <GameDataContainer>(); }
public static float GetFireFXTimeOut(this Part p) { return(Dependencies.Get <DamageService>().GetFireFXTimeOut(p)); }
public override void GetSystemDependencies(Dependencies dependencies) { }
/// <summary> /// A class to interpret the Xml file and create subsystems /// </summary> /// <param name="SubsystemXmlNode"></param> /// <param name="enableScripting"></param> /// <param name="dependencies"></param> /// <param name="asset"></param> /// <param name="subDic"></param> /// <returns></returns> public static string GetSubsystem(XmlNode SubsystemXmlNode, bool enableScripting, Dependencies dependencies, Asset asset, Dictionary <string, Subsystem> subDic) { string type = SubsystemXmlNode.Attributes["Type"].Value.ToString().ToLower(); string name = Subsystem.parseNameFromXmlNode(SubsystemXmlNode, asset.Name); if (type.Equals("scripted") && enableScripting) { subDic.Add(name, new ScriptedSubsystem(SubsystemXmlNode, dependencies)); } else // not scripted subsystem { if (type.Equals("access")) { subDic.Add(name, new AccessSub(SubsystemXmlNode, asset)); } else if (type.Equals("adcs")) { subDic.Add(name, new ADCS(SubsystemXmlNode, dependencies, asset)); } else if (type.Equals("power")) { subDic.Add(name, new Power(SubsystemXmlNode, dependencies, asset)); } else if (type.Equals("eosensor")) { subDic.Add(name, new EOSensor(SubsystemXmlNode, dependencies, asset)); } else if (type.Equals("ssdr")) { subDic.Add(name, new SSDR(SubsystemXmlNode, dependencies, asset)); } else if (type.Equals("comm")) { subDic.Add(name, new Comm(SubsystemXmlNode, dependencies, asset)); } else if (type.Equals("networked")) { throw new NotImplementedException("Networked Subsystem is a depreciated feature!"); } else { throw new MissingMemberException("Unknown Subsystem Type " + type); } } return(name); // throw new NotSupportedException("Horizon does not recognize the subsystem: " + type); }
public BombCommands(Dependencies d) { this.dep = d; }
public void Restore(Dependencies dependencies, IEnumerable<RestoringProject> projects) { if (!settings.AutoRestore) return; restorer.Restore(dependencies, projects); }
private void load(GameHost host, AudioManager audio) { Dependencies.Cache(rulesets = new RulesetStore(ContextFactory)); Dependencies.Cache(beatmaps = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, audio, Resources, host, Beatmap.Default)); }
public void Restore(Dependencies dependencies, IEnumerable<RestoringProject> project) { dependencies.Restore( FSharpOption<string>.None, ListModule.OfSeq(project.Select(p => p.ReferenceFile))); }
public override void GetSystemDependencies(Dependencies dependencies) { m_spawningQueueSystem = dependencies.GetDependency <SpawningQueueSystem>(); }
public static void ShowAddPackageDialog(string selectedFileName, string projectGuid = null) { Paket.Dependencies dependenciesFile = null; try { dependenciesFile = Dependencies.Locate(selectedFileName); } catch (Exception) { var dir = new System.IO.FileInfo(SolutionExplorerExtensions.GetSolutionFileName()).Directory.FullName; PaketLauncher.LaunchPaket(dir, "init", (send, args) => PaketOutputPane.OutputPane.OutputStringThreadSafe(args.Data + "\n")); dependenciesFile = Dependencies.Locate(selectedFileName); } var secondWindow = new AddPackage(); //Create observable paket trace var paketTraceObs = Observable.Create <Logging.Trace>(observer => { [email protected](x => observer.OnNext(x)); return(Disposable.Create(() => { })); }); Action <NugetResult> addPackageToDependencies = result => { if (projectGuid != null) { var guid = Guid.Parse(projectGuid); DteHelper.ExecuteCommand("File.SaveAll"); SolutionExplorerExtensions.UnloadProject(guid); PaketLauncher.LaunchPaket(SolutionExplorerExtensions.GetPaketDirectory(), "add " + result.PackageName + " --project " + selectedFileName, (send, args) => PaketOutputPane.OutputPane.OutputStringThreadSafe(args.Data + "\n")); SolutionExplorerExtensions.ReloadProject(guid); } else { PaketLauncher.LaunchPaket(SolutionExplorerExtensions.GetPaketDirectory(), "add " + result.PackageName, (send, args) => PaketOutputPane.OutputPane.OutputStringThreadSafe(args.Data + "\n")); } }; Func <string, IObservable <string> > searchNuGet = searchText => Observable.Create <string>(obs => { var disposable = new CancellationDisposable(); dependenciesFile .SearchPackagesByName( searchText, FSharpOption <CancellationToken> .Some(disposable.Token), FSharpOption <int> .None) .Subscribe(obs); return(disposable); }); //TODO: Use interfaces? secondWindow.ViewModel = new AddPackageViewModel(searchNuGet, addPackageToDependencies, paketTraceObs); secondWindow.ShowDialog(); }
public void Configuration(IAppBuilder app) { Dependencies.InitContainer(IoCInitializer.GetContainer(ApplicationType.Service)); AutoMapperConfiguration.Configure(); }
public IAsyncResult Begin_storeDependencies(AsyncCallback callback, object state, Dependencies dependencies) { return send_storeDependencies(callback, state, dependencies); }
public static bool GetFireFX(this Part p) { return(Dependencies.Get <DamageService>().HasFireFX_svc(p)); }
public IAsyncResult send_storeDependencies(AsyncCallback callback, object state, Dependencies dependencies)
public PointPair Line(int index) { return((Dependencies.ElementAt(index) as ILine).Coordinates); }
public void Read (TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.Struct) { Dependencies = new Dependencies(); Dependencies.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }
protected override void InitializeDependencies() { Dependencies.AddRange(programs); }
public static float MaxDamage(this Part p) { return(Dependencies.Get <DamageService>().GetMaxPartDamage_svc(p)); }
/// <summary> /// Returns ideas that have been submitted to the idea forums this adapter applies to. /// </summary> /// <param name="startRowIndex">The row index of the first idea to be returned.</param> /// <param name="maximumRows">The maximum number of ideas to return.</param> public IEnumerable <IIdea> SelectIdeas(int startRowIndex = 0, int maximumRows = -1) { if (startRowIndex < 0) { throw new ArgumentException("Value must be a positive integer.", "startRowIndex"); } if (maximumRows == 0) { return(new IIdea[] { }); } var serviceContext = Dependencies.GetServiceContext(); var security = Dependencies.GetSecurityProvider(); var query = serviceContext.CreateQuery("adx_idea") .Join(serviceContext.CreateQuery("adx_ideaforum"), idea => idea.GetAttributeValue <EntityReference>("adx_ideaforumid").Id, ideaForum => ideaForum.GetAttributeValue <Guid>("adx_ideaforumid"), (idea, ideaForum) => new { Idea = idea, IdeaForum = ideaForum }) .Where(a => a.IdeaForum.GetAttributeValue <EntityReference>("adx_websiteid") == Website) .Where(a => a.Idea.GetAttributeValue <EntityReference>("adx_ideaforumid") != null && a.Idea.GetAttributeValue <OptionSetValue>("statecode") != null && a.Idea.GetAttributeValue <OptionSetValue>("statecode").Value == 0 && a.Idea.GetAttributeValue <bool?>("adx_approved").GetValueOrDefault(false)); query = query.OrderByDescending(a => a.Idea.GetAttributeValue <DateTime?>("adx_date")); if (maximumRows < 0) { var entities = query.Select(a => a.Idea).ToArray() .Where(e => security.TryAssert(serviceContext, e, CrmEntityRight.Read)) .Skip(startRowIndex); return(new IdeaFactory(serviceContext, Dependencies.GetHttpContext(), Dependencies.GetPortalUser()).Create(entities)); } var pagedQuery = query.Select(a => a.Idea); var paginator = new PostFilterPaginator <Entity>( (offset, limit) => pagedQuery.Skip(offset).Take(limit).ToArray(), e => security.TryAssert(serviceContext, e, CrmEntityRight.Read), 2); return(new IdeaFactory(serviceContext, Dependencies.GetHttpContext(), Dependencies.GetPortalUser()).Create(paginator.Select(startRowIndex, maximumRows))); }
/// <summary> /// Constructor /// </summary> /// <param name="id">the optional unique identifier of the command set (defaults to the Type name)</param> public CommandSet(string id) { this.name = id; Dependencies = new Dependencies(); }
/// <summary> /// Adds property dependency to this <see cref="ComponentModel" /> /// </summary> /// <param name="property"> </param> public void AddProperty(PropertySet property) { Properties.Add(property); Dependencies.Add(property.Dependency); }
private void load(IFrameBasedClock framedClock) { beatmapProcessor = Ruleset.CreateBeatmapProcessor(EditorBeatmap.PlayableBeatmap); EditorBeatmap.HitObjectAdded += addHitObject; EditorBeatmap.HitObjectRemoved += removeHitObject; EditorBeatmap.StartTimeChanged += UpdateHitObject; Config = Dependencies.Get <RulesetConfigCache>().GetConfigFor(Ruleset); try { drawableRulesetWrapper = new DrawableEditRulesetWrapper <TObject>(CreateDrawableRuleset(Ruleset, EditorBeatmap.PlayableBeatmap)) { Clock = framedClock, ProcessCustomClock = false }; } catch (Exception e) { Logger.Error(e, "Could not load beatmap sucessfully!"); return; } var layerBelowRuleset = drawableRulesetWrapper.CreatePlayfieldAdjustmentContainer().WithChildren(new Drawable[] { distanceSnapGridContainer = new Container { RelativeSizeAxes = Axes.Both }, new EditorPlayfieldBorder { RelativeSizeAxes = Axes.Both } }); var layerAboveRuleset = drawableRulesetWrapper.CreatePlayfieldAdjustmentContainer().WithChild(blueprintContainer = CreateBlueprintContainer()); layerContainers.Add(layerBelowRuleset); layerContainers.Add(layerAboveRuleset); InternalChild = new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] { new Drawable[] { new FillFlowContainer { Name = "Sidebar", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Right = 10 }, Children = new Drawable[] { new ToolboxGroup { Child = toolboxCollection = new RadioButtonCollection { RelativeSizeAxes = Axes.X } } } }, new Container { Name = "Content", RelativeSizeAxes = Axes.Both, Children = new Drawable[] { layerBelowRuleset, drawableRulesetWrapper, layerAboveRuleset } } }, }, ColumnDimensions = new[] { new Dimension(GridSizeMode.Absolute, 200), } }; toolboxCollection.Items = CompositionTools .Prepend(new SelectTool()) .Select(t => new RadioButton(t.Name, () => toolSelected(t))) .ToList(); setSelectTool(); blueprintContainer.SelectionChanged += selectionChanged; }
protected override void LoadComplete() { base.LoadComplete(); Add(new Drawable[] { new VolumeControlReceptor { RelativeSizeAxes = Axes.Both, ActionRequested = delegate(InputState state) { volume.Adjust(state); } }, mainContent = new Container { RelativeSizeAxes = Axes.Both, }, volume = new VolumeControl(), overlayContent = new Container { RelativeSizeAxes = Axes.Both }, new OnScreenDisplay(), new GlobalHotkeys //exists because UserInputManager is at a level below us. { Handler = globalHotkeyPressed } }); LoadComponentAsync(screenStack = new Loader(), d => { screenStack.ModePushed += screenAdded; screenStack.Exited += screenRemoved; mainContent.Add(screenStack); }); //overlay elements LoadComponentAsync(direct = new DirectOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(social = new SocialOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(chat = new ChatOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(settings = new SettingsOverlay { Depth = -1 }, overlayContent.Add); LoadComponentAsync(musicController = new MusicController { Depth = -2, Position = new Vector2(0, Toolbar.HEIGHT), Anchor = Anchor.TopRight, Origin = Anchor.TopRight, }, overlayContent.Add); LoadComponentAsync(notificationManager = new NotificationManager { Depth = -2, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, }, overlayContent.Add); LoadComponentAsync(dialogOverlay = new DialogOverlay { Depth = -4, }, overlayContent.Add); Logger.NewEntry += entry => { if (entry.Level < LogLevel.Important) { return; } notificationManager.Post(new SimpleNotification { Text = $@"{entry.Level}: {entry.Message}" }); }; Dependencies.Cache(settings); Dependencies.Cache(social); Dependencies.Cache(chat); Dependencies.Cache(musicController); Dependencies.Cache(notificationManager); Dependencies.Cache(dialogOverlay); // ensure both overlays aren't presented at the same time chat.StateChanged += (container, state) => social.State = state == Visibility.Visible ? Visibility.Hidden : social.State; social.StateChanged += (container, state) => chat.State = state == Visibility.Visible ? Visibility.Hidden : chat.State; LoadComponentAsync(Toolbar = new Toolbar { Depth = -3, OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); }, }, overlayContent.Add); settings.StateChanged += delegate { switch (settings.State) { case Visibility.Hidden: intro.MoveToX(0, SettingsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint); break; case Visibility.Visible: intro.MoveToX(SettingsOverlay.SIDEBAR_WIDTH / 2, SettingsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint); break; } }; Cursor.State = Visibility.Hidden; }
private MySQLServerConnection CreateConnection(IDbContextOptions options) => new MySQLServerConnection(Dependencies.With(options));
public PowerManager(int idleTime, Dependencies dependencies) { _idleTime = idleTime; _dependencies = dependencies; }