public async Task InitializeViewAttachedAsync(IExplorerViewModel evm) { evm.RootModels = RootModels; //Initializers.Add(ExplorerInitializers.StartupDirectory(RootModels.FirstOrDefault())); //Initializers.EnsureOneStartupDirectoryOnly(); if (!Initializers.Any(i => i is StartupDirInitializer)) { var firstDir = RootModels.FirstOrDefault(); if (firstDir != null) { await evm.GoAsync(firstDir); } } await Initializers.InitalizeAsync(evm); }
public override string ToString(int indent) { StringBuilder builder = new StringBuilder(); builder.Indent(indent).AppendLine("InitializerList:"); builder.Indent(indent + 1).AppendFormat("Element type: {0}", ElementType.FullName).AppendLine(); builder.Indent(indent + 1).AppendLine("Dimensions:"); builder.Indent(indent + 2).AppendLine(String.Join(", ", Dimensions)); builder.Indent(indent + 1).AppendLine("Values:"); if (Initializers.Any()) { foreach (var exp in Initializers) { builder.AppendLine(exp.ToString(indent + 2)); } } else { builder.Indent(indent + 2).AppendLine("Empty"); } return(builder.ToString()); }
/// <summary> /// Test end monitoring flag /// </summary> public void Execute() { if (Initializers != null && Initializers.Any()) { foreach (var init in Initializers) { init.Initialize(); } } //Task.Run(async () => //{ // var tmp = await Task.Run(() => Trigger()); // if (Crawlers != null && Crawlers.Any()) // { // Crawlers.AsParallel().ForAll(c => // { // try // { // c.Gather(); // } // finally // { // c.Dispose(); // } // }); // } // Finalizer.AsParallel().ForAll(c => c.ToString()); // IsFinished = true; //}); if (Injectors != null && Injectors.Any()) { Injectors.ForEach(i => i.Inject()); } }