public UIElement GetUIElement(CompletionSet itemToRender, ICompletionSession context, UIElementType elementType) { var orderedProviders = Orderer.Order(UnOrderedCompletionSetUIElementProviders); foreach (var presenterProviderExport in orderedProviders) { foreach (var contentType in presenterProviderExport.Metadata.ContentTypes) { if (VSGeneroPackage.Instance.ContentType.IsOfType(contentType)) { if (presenterProviderExport.Value.GetType() == typeof(CompletionUIElementProvider)) { // don't forward to ourselves... continue; } var res = presenterProviderExport.Value.GetUIElement(itemToRender, context, elementType); if (res != null) { if (_isPreSp1) { return(res); } return(new CompletionControl(res, context)); } } } } return(null); }
CompletionBroker(Lazy <IIntellisenseSessionStackMapService> intellisenseSessionStackMapService, Lazy <IIntellisensePresenterFactoryService> intellisensePresenterFactoryService, Lazy <ICurrentLineSpaceReservationService> currentLineSpaceReservationService, [ImportMany] IEnumerable <Lazy <ICompletionSourceProvider, IOrderableContentTypeMetadata> > completionSourceProviders) { this.intellisenseSessionStackMapService = intellisenseSessionStackMapService; this.intellisensePresenterFactoryService = intellisensePresenterFactoryService; this.currentLineSpaceReservationService = currentLineSpaceReservationService; this.completionSourceProviders = Orderer.Order(completionSourceProviders).ToArray(); }
/** * Just for testing remove all peers and orderers and add them back. * * @param client * @param channel */ public static void TestRemovingAddingPeersOrderers(HFClient client, Channel channel) { Dictionary <Peer, PeerOptions> perm = new Dictionary <Peer, PeerOptions>(); Assert.IsTrue(channel.IsInitialized); Assert.IsFalse(channel.IsShutdown); Thread.Sleep(1500); // time needed let channel get config block channel.Peers.ToList().ForEach(peer => { perm[peer] = channel.GetPeersOptions(peer); channel.RemovePeer(peer); }); perm.Keys.ToList().ForEach(peer => { PeerOptions value = perm[peer]; Peer newPeer = client.NewPeer(peer.Name, peer.Url, peer.Properties); channel.AddPeer(newPeer, value); }); List <Orderer> removedOrders = new List <Orderer>(); foreach (Orderer orderer in channel.Orderers.ToList()) { channel.RemoveOrderer(orderer); removedOrders.Add(orderer); } removedOrders.ForEach(orderer => { Orderer newOrderer = client.NewOrderer(orderer.Name, orderer.Url, orderer.Properties); channel.AddOrderer(newOrderer); }); }
CompletionBroker(IImageManager imageManager, Lazy <IIntellisenseSessionStackMapService> intellisenseSessionStackMapService, Lazy <ICompletionTextElementProviderService> completionTextElementProviderService, [ImportMany] IEnumerable <Lazy <ICompletionSourceProvider, IOrderableContentTypeMetadata> > completionSourceProviders) { this.imageManager = imageManager; this.intellisenseSessionStackMapService = intellisenseSessionStackMapService; this.completionTextElementProviderService = completionTextElementProviderService; this.completionSourceProviders = Orderer.Order(completionSourceProviders).ToArray(); }
public static IEnumerable <Lazy <TComponent, TMetadata> > ImportMany(ICompositionService compositionService) { var importer = new ManyImporter(); compositionService.SatisfyImportsOnce(importer); return(Orderer.Order(importer.Imports)); }
GlyphTextMarkerService(IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService, [ImportMany] IEnumerable <Lazy <IGlyphTextMarkerMouseProcessorProvider, IGlyphTextMarkerMouseProcessorProviderMetadata> > glyphTextMarkerMouseProcessorProviders) { ViewTagAggregatorFactoryService = viewTagAggregatorFactoryService; EditorFormatMapService = editorFormatMapService; glyphTextMarkers = new HashSet <IGlyphTextMarkerImpl>(); GlyphTextMarkerMouseProcessorProviders = Orderer.Order(glyphTextMarkerMouseProcessorProviders).ToArray(); }
public HostFactory( IVim vim, IVsEditorAdaptersFactoryService adaptersFactory, IDisplayWindowBrokerFactoryService displayWindowBrokerFactoryService, ITextManager textManager, IVsAdapter adapter, IVimProtectedOperations protectedOperations, IVimBufferCoordinatorFactory bufferCoordinatorFactory, IKeyUtil keyUtil, IEditorToSettingsSynchronizer editorToSettingSynchronizer, [ImportMany] IEnumerable <Lazy <ICommandTargetFactory, IOrderable> > commandTargetFactoryList) { _vim = vim; _displayWindowBrokerFactoryServcie = displayWindowBrokerFactoryService; _adaptersFactory = adaptersFactory; _textManager = textManager; _adapter = adapter; _protectedOperations = protectedOperations; _bufferCoordinatorFactory = bufferCoordinatorFactory; _keyUtil = keyUtil; _editorToSettingSynchronizer = editorToSettingSynchronizer; _commandTargetFactoryList = Orderer.Order(commandTargetFactoryList).Select(x => x.Value).ToReadOnlyCollection(); #if DEBUG VimTrace.TraceSwitch.Level = TraceLevel.Info; #endif }
public override BundleResponse GenerateBundleResponse(BundleContext context) { if (context == null) { throw new ArgumentNullException("context"); } if (!BundleTable.EnableOptimizations) { return(new BundleResponse(string.Empty, new List <BundleFile>())); } var bundleFiles = EnumerateFiles(context); var ignoredFiles = context.BundleCollection.IgnoreList.FilterIgnoredFiles(context, bundleFiles); var files = Orderer.OrderFiles(context, ignoredFiles).ToList(); if (string.IsNullOrWhiteSpace(_options.WorkingDir)) { _options.WorkingDir = "/"; } var compiler = new TemplateCompiler(_options); var virtualFiles = files.Select(f => f.VirtualFile).ToArray(); var result = compiler.Compile(virtualFiles); return(ApplyTransforms(context, result, files)); }
public Summary( string title, ImmutableArray <BenchmarkReport> reports, HostEnvironmentInfo hostEnvironmentInfo, string resultsDirectoryPath, string logFilePath, TimeSpan totalTime, CultureInfo cultureInfo, ImmutableArray <ValidationError> validationErrors) { Title = title; ResultsDirectoryPath = resultsDirectoryPath; LogFilePath = logFilePath; HostEnvironmentInfo = hostEnvironmentInfo; TotalTime = totalTime; ValidationErrors = validationErrors; ReportMap = reports.ToImmutableDictionary(report => report.BenchmarkCase, report => report); DisplayPrecisionManager = new DisplayPrecisionManager(this); Orderer = GetConfiguredOrdererOrDefaultOne(reports.Select(report => report.BenchmarkCase.Config)); BenchmarksCases = Orderer.GetSummaryOrder(reports.Select(report => report.BenchmarkCase).ToImmutableArray(), this).ToImmutableArray(); // we sort it first Reports = BenchmarksCases.Select(b => ReportMap[b]).ToImmutableArray(); // we use sorted collection to re-create reports list BaseliningStrategy = BaseliningStrategy.Create(BenchmarksCases); Style = GetConfiguredSummaryStyleOrNull(BenchmarksCases)?.WithCultureInfo(cultureInfo); Table = GetTable(Style); AllRuntimes = BuildAllRuntimes(HostEnvironmentInfo, Reports); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as DiagnosticOrder; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Orderer != null) { dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopy(); } if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (Reason != null) { dest.Reason = new List <Hl7.Fhir.Model.CodeableConcept>(Reason.DeepCopy()); } if (SupportingInformation != null) { dest.SupportingInformation = new List <Hl7.Fhir.Model.ResourceReference>(SupportingInformation.DeepCopy()); } if (Specimen != null) { dest.Specimen = new List <Hl7.Fhir.Model.ResourceReference>(Specimen.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.DiagnosticOrder.DiagnosticOrderStatus>)StatusElement.DeepCopy(); } if (PriorityElement != null) { dest.PriorityElement = (Code <Hl7.Fhir.Model.DiagnosticOrderPriority>)PriorityElement.DeepCopy(); } if (Event != null) { dest.Event = new List <Hl7.Fhir.Model.DiagnosticOrder.EventComponent>(Event.DeepCopy()); } if (Item != null) { dest.Item = new List <Hl7.Fhir.Model.DiagnosticOrder.ItemComponent>(Item.DeepCopy()); } if (Note != null) { dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy()); } return(dest); }
EditorFormatDefinitionService([ImportMany] IEnumerable <Lazy <EditorFormatDefinition, IEditorFormatMetadata> > editorFormatDefinitions, [ImportMany] IEnumerable <Lazy <EditorFormatDefinition, IClassificationFormatMetadata> > classificationFormatDefinitions) { EditorFormatDefinitions = editorFormatDefinitions.Where(a => Filter(a.Metadata.Name)).ToArray(); ClassificationFormatDefinitions = Orderer.Order(classificationFormatDefinitions).Where(a => Filter(((IEditorFormatMetadata)a.Metadata).Name)).ToArray(); toLazy = new Dictionary <string, Lazy <EditorFormatDefinition, IEditorFormatMetadata> >(StringComparer.OrdinalIgnoreCase); foreach (var e in EditorFormatDefinitions) { var name = e.Metadata.Name; if (toLazy.TryGetValue(name, out var lz)) { if (e.Metadata.Priority > lz.Metadata.Priority) { toLazy[name] = e; } else { Debug.Assert(e.Metadata.Priority < lz.Metadata.Priority); } } else { toLazy.Add(name, e); } } }
public ActionResult DeleteConfirmed(int id) { Orderer orderer = db.Orderers.Find(id); db.Orderers.Remove(orderer); db.SaveChanges(); return(RedirectToAction("Index")); }
public DocumentMarkMarginProvider(IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, [ImportMany] IEnumerable <Lazy <IGlyphFactoryProvider, IGlyphMetadata> > glyphFactoryProviders) { _viewTagAggregatorFactoryService = viewTagAggregatorFactoryService; // only get _our_ glyph factory _glyphFactoryProviders = Orderer.Order(glyphFactoryProviders) .Where(_ => _.Metadata.Name == PredefinedCodestreamNames.DocumentMarkGlyphFactoryProvider).ToArray(); }
internal OrderByEnumerator(ref TInnerEnumerator inner, ref TComparer comparer) { Inner = inner; Comparer = comparer; Current = default(TItem); ToYield = 0; Orderer = default(Orderer <TItem, TKey, TInnerEnumerator, TComparer>); }
GlyphMarginProvider(IMenuService menuService, IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService, [ImportMany] IEnumerable <Lazy <IGlyphMouseProcessorProvider, IGlyphMouseProcessorProviderMetadata> > glyphMouseProcessorProviders, [ImportMany] IEnumerable <Lazy <IGlyphFactoryProvider, IGlyphMetadata> > glyphFactoryProviders, IMarginContextMenuService marginContextMenuHandlerProviderService) { this.menuService = menuService; this.viewTagAggregatorFactoryService = viewTagAggregatorFactoryService; this.editorFormatMapService = editorFormatMapService; this.glyphMouseProcessorProviders = Orderer.Order(glyphMouseProcessorProviders).ToArray(); this.glyphFactoryProviders = Orderer.Order(glyphFactoryProviders).ToArray(); this.marginContextMenuHandlerProviderService = marginContextMenuHandlerProviderService; }
SignatureHelpBroker(Lazy <IIntellisenseSessionStackMapService> intellisenseSessionStackMapService, [ImportMany] IEnumerable <Lazy <ISignatureHelpSourceProvider, IOrderableContentTypeMetadata> > signatureHelpSourceProviders, ITextBufferFactoryService textBufferFactoryService, IContentTypeRegistryService contentTypeRegistryService, IClassifierAggregatorService classifierAggregatorService, IClassificationFormatMapService classificationFormatMapService) { this.intellisenseSessionStackMapService = intellisenseSessionStackMapService; this.signatureHelpSourceProviders = Orderer.Order(signatureHelpSourceProviders).ToArray(); this.textBufferFactoryService = textBufferFactoryService; this.contentTypeRegistryService = contentTypeRegistryService; this.classifierAggregatorService = classifierAggregatorService; this.classificationFormatMapService = classificationFormatMapService; }
GlyphTextMarkerService(IModuleIdProvider moduleIdProvider, IThemeService themeService, IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService, [ImportMany] IEnumerable <Lazy <IGlyphTextMarkerMouseProcessorProvider, IGlyphTextMarkerMouseProcessorProviderMetadata> > glyphTextMarkerMouseProcessorProviders) { this.moduleIdProvider = moduleIdProvider; ThemeService = themeService; ViewTagAggregatorFactoryService = viewTagAggregatorFactoryService; EditorFormatMapService = editorFormatMapService; this.glyphTextMarkers = new HashSet <IGlyphTextMarkerImpl>(); this.GlyphTextMarkerMouseProcessorProviders = Orderer.Order(glyphTextMarkerMouseProcessorProviders).ToArray(); }
public ActionResult Edit([Bind(Include = "Id,Name,PhoneNo,College,Password,Username,Role")] Orderer orderer) { if (ModelState.IsValid) { db.Entry(orderer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Login", "AuthAuth")); } return(View(orderer)); }
public void TestChannelAddOrder() { Channel testChannel = new Channel(CHANNEL_NAME, hfclient); Orderer orderer = hfclient.NewOrderer("testorder", "grpc://localhost:7051"); testChannel.AddOrderer(orderer); Assert.AreEqual(testChannel.Orderers.Count, 1); Assert.AreEqual(testChannel.Orderers.First(), orderer); }
public void TestGoodMockUser() { HFClient client = HFClient.Create(); client.CryptoSuite = Factory.Instance.GetCryptoSuite(); client.UserContext = TestUtils.TestUtils.GetMockUser(USER_NAME, USER_MSP_ID); Orderer orderer = hfclient.NewOrderer("justMockme", "grpc://localhost:99"); // test mock should work. Assert.IsNotNull(orderer); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as DiagnosticOrder; if (dest != null) { base.CopyTo(dest); if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Orderer != null) { dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopy(); } if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (ClinicalNotesElement != null) { dest.ClinicalNotesElement = (Hl7.Fhir.Model.FhirString)ClinicalNotesElement.DeepCopy(); } if (Specimen != null) { dest.Specimen = new List <Hl7.Fhir.Model.ResourceReference>(Specimen.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.DiagnosticOrder.DiagnosticOrderStatus>)StatusElement.DeepCopy(); } if (PriorityElement != null) { dest.PriorityElement = (Code <Hl7.Fhir.Model.DiagnosticOrder.DiagnosticOrderPriority>)PriorityElement.DeepCopy(); } if (Event != null) { dest.Event = new List <Hl7.Fhir.Model.DiagnosticOrder.DiagnosticOrderEventComponent>(Event.DeepCopy()); } if (Item != null) { dest.Item = new List <Hl7.Fhir.Model.DiagnosticOrder.DiagnosticOrderItemComponent>(Item.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public TextViewMouseProcessorCollection(IWpfTextView wpfTextView, Lazy <IMouseProcessorProvider, IOrderableContentTypeAndTextViewRoleMetadata>[] mouseProcessorProviders, IEditorOperationsFactoryService editorOperationsFactoryService) { this.wpfTextView = wpfTextView; this.dsWpfTextView = wpfTextView as IDsWpfTextViewImpl; this.mouseProcessorProviders = Orderer.Order(mouseProcessorProviders).ToArray(); this.editorOperationsFactoryService = editorOperationsFactoryService; this.allowEventDelegate = AllowMouseEvent; wpfTextView.Closed += WpfTextView_Closed; wpfTextView.TextDataModel.ContentTypeChanged += TextDataModel_ContentTypeChanged; Reinitialize(); }
private void EnsureInitialized() { if (TextBufferToViewData == null) { TextBufferToViewData = new Dictionary <ITextBuffer, TextViewData>(); Shell.Terminating += OnTerminateApp; TextBufferListeners = Orderer.Order(TextBufferListeners); _bufferToOriginalContentType = new Dictionary <ITextBuffer, IContentType>(); } }
public ActionResult Create([Bind(Include = "Id,Name,PhoneNo,College,Password,Username,Role")] Orderer orderer) { if (ModelState.IsValid) { db.Orderers.Add(orderer); db.SaveChanges(); return(RedirectToAction("Login", "AuthAuth")); } return(View(orderer)); }
public void TestNewOrderer() { try { Orderer orderer = hfclient.NewOrderer("xx", "grpc://localhost:5005"); Assert.IsTrue(orderer != null); } catch (System.Exception e) { Assert.Fail($"Unexpected Exception {e.Message}"); } }
public void TestSendNullTransactionThrowsException() { try { orderer = hfclient.NewOrderer(ORDERER_NAME, "grpc://localhost:5151"); } catch (ArgumentException e) { Assert.Fail("Failed to create new orderer: " + e); } orderer.SendTransaction(null); Assert.Fail("Transaction should not be null."); }
// GET: Orderers/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Orderer orderer = db.Orderers.Find(id); if (orderer == null) { return(HttpNotFound()); } return(View(orderer)); }
public NuGetProjectFactory( [ImportMany(typeof(IProjectSystemProvider))] IEnumerable <Lazy <IProjectSystemProvider, IOrderable> > providers) { if (providers == null) { throw new ArgumentNullException(nameof(providers)); } _providers = Orderer .Order(providers) .Select(p => p.Value) .ToArray(); }
public OrderDetails GetOrderDetails(int orderId) { if (UserHelper.IsAuthorize(new List <int> { (int)UserType.SuperAdmin, (int)UserType.Admin, (int)UserType.Client })) { OrderDetails result = new OrderDetails(); List <OrderPositionsOrderInfo> listOfOrderPositions = new List <OrderPositionsOrderInfo>(); Orderer orderer = new Orderer(); try { List <Orders_Positions> ordersPositionsFromDB = _context.Orders_Positions.Where(o => o.Deleted_At == null && o.Order_id == orderId).OrderBy(o => o.Name).ToList(); Order orderFromDB = _context.Orders.FirstOrDefault(o => o.Id == orderId); orderer.Name = orderFromDB.Name; orderer.PrefixVat_Id = orderFromDB.PrefixVat_Id; orderer.VAT_Id = orderFromDB.VAT_Id; orderer.Address = orderFromDB.Address; orderer.Email = orderFromDB.Email; foreach (var orderPosition in ordersPositionsFromDB) { OrderPositionsOrderInfo toAdd = new OrderPositionsOrderInfo(); toAdd.Id = orderPosition.Id; toAdd.Name = orderPosition.Name; toAdd.Amount = orderPosition.Amount; toAdd.Weight_Gross = orderPosition.Weight_Gross; listOfOrderPositions.Add(toAdd); } result.Id = orderFromDB.Id; result.Num_of_Positions = orderFromDB.Num_of_Positions; result.Order_Number = orderFromDB.Order_Number; result.Pickup_PIN = orderFromDB.Pickup_PIN; result.ETA = orderFromDB.ETA == null ? string.Empty : orderFromDB.ETA.Value.ToString("dd-MM-yyyy"); result.Orderer = orderer; result.Terminal = orderFromDB.Terminal; result.ReturnTerminal = orderFromDB.ReturnTerminal; result.ListOfOrderPositions = listOfOrderPositions; return(result); } catch (Exception ex) { throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } } else { throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "User don't have acces to this method")); } }
EditorFormatDefinitionService([ImportMany] IEnumerable <Lazy <EditorFormatDefinition, IEditorFormatMetadata> > editorFormatDefinitions, [ImportMany] IEnumerable <Lazy <EditorFormatDefinition, IClassificationFormatMetadata> > classificationFormatDefinitions) { EditorFormatDefinitions = editorFormatDefinitions.Where(a => Filter(a.Metadata.Name)).ToArray(); ClassificationFormatDefinitions = Orderer.Order(classificationFormatDefinitions).Where(a => Filter(((IEditorFormatMetadata)a.Metadata).Name)).ToArray(); toLazy = new Dictionary <string, Lazy <EditorFormatDefinition, IEditorFormatMetadata> >(StringComparer.OrdinalIgnoreCase); foreach (var e in EditorFormatDefinitions) { var name = e.Metadata.Name; if (!toLazy.ContainsKey(name)) { toLazy.Add(name, e); } } }