public void Setup() { _dependencies = new KarassDependencies(); _frameFactory = new FrameFactory(_dependencies); _mockFramesFactory = new MockFramesFactory(_frameFactory); }
/// <summary> /// Creates a new instance of <see cref="Manifest"/>. /// </summary> /// <param name="dependencies">The host provided dependencies.</param> public Manifest(IDependencies dependencies) { _libraries = new List <ILibraryInstallationState>(); _dependencies = dependencies; _hostInteraction = dependencies?.GetHostInteractions(); }
public ExactTargetClient(IDependencies dependencies) { _dependencies = dependencies; }
public SubscriptionPageController(IDependencies dependencies) { _dependencies = dependencies; }
public EmailDCDController(IDependencies dependencies) { _ = dependencies; }
public KarassFrameDummy(IDependencies dependencies) : base(dependencies) { }
public ServiceBusWaitAndCheckTests() { _d = GetService <IDependencies <Test> >(); }
// private readonly TelemetryClient telemetry; public ApiRequestHandler(IDependencies dependencies) { this.Session = dependencies.Session; this.Mediator = dependencies.Mediator; // this.telemetry = dependencies.TelemetryClient; }
protected override IEnumerable <JsonCompletionEntry> GetEntries(JsonCompletionContext context) { var member = context.ContextNode as MemberNode; if (member == null || member.UnquotedNameText != ManifestConstants.Library) { yield break; } var parent = member.Parent as ObjectNode; if (!JsonHelpers.TryGetInstallationState(parent, out ILibraryInstallationState state)) { yield break; } IDependencies dependencies = _dependenciesFactory.FromConfigFile(ConfigFilePath); IProvider provider = dependencies.GetProvider(state.ProviderId); ILibraryCatalog catalog = provider?.GetCatalog(); if (catalog == null) { yield break; } // member.Value is null when there is no value yet, e.g. when typing a space at "library":| // where | represents caret position. In this case, set caretPosition to "1" to short circuit execution of this function // and return no entries (member.UnquotedValueText will be empty string in that case). int caretPosition = member.Value != null ? context.Session.TextView.Caret.Position.BufferPosition - member.Value.Start - 1 : 1; if (caretPosition > member.UnquotedValueText.Length) { yield break; } Task <CompletionSet> task = catalog.GetLibraryCompletionSetAsync(member.UnquotedValueText, caretPosition); int count = 0; if (!context.Session.Properties.ContainsProperty(CompletionController.RetriggerCompletion)) { context.Session.Properties.AddProperty(CompletionController.RetriggerCompletion, true); } if (task.IsCompleted) { CompletionSet completionSet = task.Result; if (completionSet.Completions != null) { List <JsonCompletionEntry> results = GetCompletionList(member, context, completionSet, count); foreach (JsonCompletionEntry completionEntry in results) { yield return(completionEntry); } } } else { yield return(new SimpleCompletionEntry(Resources.Text.Loading, string.Empty, KnownMonikers.Loading, context.Session)); _ = task.ContinueWith((t) => { if (!t.IsCanceled || !t.IsFaulted) { if (!context.Session.IsDismissed) { CompletionSet completionSet = t.Result; if (completionSet.Completions != null) { List <JsonCompletionEntry> results = GetCompletionList(member, context, completionSet, count); UpdateListEntriesSync(context, results); } } } }, TaskScheduler.Default); } }
public SpecialCharacterMapper(IDependencies dependencies) { _dependencies = dependencies; }
public Handler(IDependencies dependencies) : base(dependencies) { }
public HomeAssistantMasterPageViewModel(IDependencies dependencies) : base(dependencies) { }
private IDictionary<string, IDependency> ReadDependencies(IDependencies dependencies) { return ReadDependencies(dependencies, 16); }
/// <summary> /// Validates <see cref="ILibraryInstallationState"/> /// </summary> /// <param name="state">The <see cref="ILibraryInstallationState"/> to validate.</param> /// <param name="dependencies">The <see cref="IDependencies"/> used to validate <see cref="ILibraryInstallationState"/></param> /// <returns><see cref="ILibraryOperationResult"/> with the result of the validation</returns> public static async Task <ILibraryOperationResult> IsValidAsync(this ILibraryInstallationState state, IDependencies dependencies) { if (state == null) { return(LibraryOperationResult.FromError(PredefinedErrors.UnknownError())); } if (string.IsNullOrEmpty(state.ProviderId)) { return(LibraryOperationResult.FromError(PredefinedErrors.ProviderIsUndefined())); } IProvider provider = dependencies.GetProvider(state.ProviderId); if (provider == null) { return(LibraryOperationResult.FromError(PredefinedErrors.ProviderUnknown(state.ProviderId))); } return(await IsValidAsync(state, provider).ConfigureAwait(false)); }
public PxmXmlHelper(IDependencies dependencies) { _dependencies = dependencies; }
private IDictionary<string, IDependency> ReadDependencies(IDependencies dependencies, int expectedCount) { Assert.AreEqual(expectedCount, dependencies.Count, "Dependency count mismatch."); var retrieved = new Dictionary<string, IDependency>(); foreach (var dependency in dependencies) { retrieved[dependency.Name] = dependency; } return retrieved; }
public TokenToHtml(IDependencies dependencies) { _dependencies = dependencies; }
public IssuesService(IDependencies dependencies) { _dependencies = dependencies; }
public DealService(IDependencies dependencies) { _ = dependencies; }
public SitecoreUrlWrapper(IDependencies dependencies) { _dependencies = dependencies; ContextDatabase = Sitecore.Context.ContentDatabase ?? Sitecore.Context.Database; }
public EmailAuthorController(IDependencies dependencies) { _ = dependencies; }
public ReleaseInventoryWhenSalesOrderCancelled(IDependencies dependencies) : base(dependencies) { }
public AddIssueController(IDependencies dependencies) { _dependencies = dependencies; }
/// <summary> /// Validates the values of each Library property and returns a collection of ILibraryOperationResult for each of them /// </summary> /// <param name="libraries"></param> /// <param name="dependencies"></param> /// <param name="cancellationToken"></param> /// <returns></returns> private static async Task <IEnumerable <ILibraryOperationResult> > ValidatePropertiesAsync(IEnumerable <ILibraryInstallationState> libraries, IDependencies dependencies, CancellationToken cancellationToken) { var validationStatus = new List <ILibraryOperationResult>(); foreach (ILibraryInstallationState library in libraries) { cancellationToken.ThrowIfCancellationRequested(); ILibraryOperationResult result = await library.IsValidAsync(dependencies).ConfigureAwait(false); if (!result.Success) { validationStatus.Add(result); } else { validationStatus.Add(LibraryOperationResult.FromSuccess(library)); } } return(validationStatus); }
public AdminMasterPageViewModel(IDependencies dependencies) : base(dependencies) { }
public SimpleKarassFrame(Func <string, bool> method, IDependencies dependencies) : base(dependencies) { _simpleMethod = method; }
public FeaturedArticleViewModel(IDependencies dependencies) { _dependencies = dependencies; }
protected override IEnumerable <JsonCompletionEntry> GetEntries(JsonCompletionContext context) { MemberNode member = context.ContextNode.FindType <MemberNode>(); if (member == null || member.UnquotedNameText != "files") { yield break; } var parent = member.Parent as ObjectNode; if (!JsonHelpers.TryGetInstallationState(parent, out ILibraryInstallationState state)) { yield break; } if (string.IsNullOrEmpty(state.Name)) { yield break; } IDependencies dependencies = _dependenciesFactory.FromConfigFile(ConfigFilePath); IProvider provider = dependencies.GetProvider(state.ProviderId); ILibraryCatalog catalog = provider?.GetCatalog(); if (catalog == null) { yield break; } Task <ILibrary> task = catalog.GetLibraryAsync(state.Name, state.Version, CancellationToken.None); FrameworkElement presenter = GetPresenter(context); IEnumerable <string> usedFiles = GetUsedFiles(context); if (task.IsCompleted) { if (!(task.Result is ILibrary library)) { yield break; } foreach (string file in library.Files.Keys) { if (!usedFiles.Contains(file)) { ImageSource glyph = WpfUtil.GetIconForFile(presenter, file, out bool isThemeIcon); yield return(new SimpleCompletionEntry(file, glyph, context.Session)); } } } else { yield return(new SimpleCompletionEntry(Resources.Text.Loading, string.Empty, KnownMonikers.Loading, context.Session)); _ = task.ContinueWith(async(t) => { await VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); if (!(t.Result is ILibrary library)) { return; } if (!context.Session.IsDismissed) { var results = new List <JsonCompletionEntry>(); foreach (string file in library.Files.Keys) { if (!usedFiles.Contains(file)) { ImageSource glyph = WpfUtil.GetIconForFile(presenter, file, out bool isThemeIcon); results.Add(new SimpleCompletionEntry(file, glyph, context.Session)); } } UpdateListEntriesSync(context, results); } }, TaskScheduler.Default); } }
public HomeController(IDependencies <HomeController> dependencies) { CheckIsNotNull(nameof(dependencies), dependencies); _d = dependencies; }
public MockFramesFactory(IFrameFactory frameFactory) { _frameFactory = frameFactory; _dependencies = frameFactory.Dependencies; }
public SavedSearchOptOutViewModel(IDependencies dependencies) { _dependencies = dependencies; }
public KarassFramesStub(List <FrameRequest[]> frames, IDependencies dependencies, IFrameFactory framesFactory) : base( new List <List <Action> >(), new List <List <Action> >(), frames) { }
private void CheckEmptyDependenciesNotNull(IDependencies dependencies) { Assert.IsNotNull(dependencies, "Dependencies should not be null."); Assert.AreEqual(0, dependencies.Count, "Should not be any dependencies."); }