public List <string> Execute() { IExtensibleLogger logger = GroupEscalationGetterDiagnosticsFrameFactory.Default.CreateLogger(this.groupSession.MailboxGuid, this.groupSession.OrganizationId); IMailboxAssociationPerformanceTracker mailboxAssociationPerformanceTracker = GroupEscalationGetterDiagnosticsFrameFactory.Default.CreatePerformanceTracker(null); List <string> result; using (GroupEscalationGetterDiagnosticsFrameFactory.Default.CreateDiagnosticsFrame("XSO", "EscalationGetter", logger, mailboxAssociationPerformanceTracker)) { StoreBuilder storeBuilder = new StoreBuilder(this.groupSession, XSOFactory.Default, logger, this.groupSession.ClientInfoString); using (IAssociationStore associationStore = storeBuilder.Create(this.group, mailboxAssociationPerformanceTracker)) { IEnumerable <IPropertyBag> associationsByType = associationStore.GetAssociationsByType("IPM.MailboxAssociation.User", MailboxAssociationBaseSchema.ShouldEscalate, EscalationGetter.EscalateProperties); List <string> list = new List <string>(); foreach (IPropertyBag propertyBag in associationsByType) { string text = propertyBag[MailboxAssociationBaseSchema.LegacyDN] as string; if (text != null) { list.Add(text); } else { EscalationGetter.Tracer.TraceError <string>((long)this.GetHashCode(), "EscalationGetter.Execute: Missing LegacyDn for item with Id {0}.", propertyBag[ItemSchema.Id].ToString()); } bool valueOrDefault = associationStore.GetValueOrDefault <bool>(propertyBag, MailboxAssociationBaseSchema.IsAutoSubscribed, false); if (valueOrDefault) { mailboxAssociationPerformanceTracker.IncrementAutoSubscribedMembers(); } } result = list; } } return(result); }
static void Main(string[] args) { var serviceProvider = new BrowserServiceProvider(services => services.AddSingleton( StoreBuilder <SampleClientState> .Create() .WithInitialState( new SampleClientState { CurrentCount = 0, WeatherForecasts = null } ) .WithThunkMiddleWare() .WithSelector("CURRENTCOUNT", (state) => state.CurrentCount) .WithSelector("WEATHERFORECASTS", (state) => state.WeatherForecasts) .WithReducers <Increment>((state, action) => new SampleClientState { CurrentCount = state.CurrentCount + 1, WeatherForecasts = state.WeatherForecasts }) .WithReducers <WeatherForecast[]>((state, action) => new SampleClientState { CurrentCount = state.CurrentCount, WeatherForecasts = action }) .Build() ) ); new BrowserRenderer(serviceProvider).AddComponent <App>("app"); }
public List <string> Execute() { IExtensibleLogger logger = MailboxAssociationDiagnosticsFrameFactory.Default.CreateLogger(this.groupSession.MailboxGuid, this.groupSession.OrganizationId); IMailboxAssociationPerformanceTracker performanceTracker = MailboxAssociationDiagnosticsFrameFactory.Default.CreatePerformanceTracker(null); List <string> result; using (MailboxAssociationDiagnosticsFrameFactory.Default.CreateDiagnosticsFrame("XSO", "PinnersGetter", logger, performanceTracker)) { StoreBuilder storeBuilder = new StoreBuilder(this.groupSession, XSOFactory.Default, logger, this.groupSession.ClientInfoString); using (IAssociationStore associationStore = storeBuilder.Create(this.group, performanceTracker)) { IEnumerable <IPropertyBag> associationsByType = associationStore.GetAssociationsByType("IPM.MailboxAssociation.User", MailboxAssociationBaseSchema.IsPin, PinnersGetter.PinnerProperties); List <string> list = new List <string>(); foreach (IPropertyBag propertyBag in associationsByType) { string text = propertyBag[MailboxAssociationBaseSchema.LegacyDN] as string; if (text != null) { list.Add(text); } else { PinnersGetter.Tracer.TraceError <string>((long)this.GetHashCode(), "PinnersGetter.Execute: Missing LegacyDn for item with Id {0}.", propertyBag[ItemSchema.Id].ToString()); } } result = list; } } return(result); }
public static IFilterAndDispatcher <AppState> Build(PlayerPrefsService playerPrefsService, out IDisposable disposable) { return(StoreBuilder <AppState> .Create(AppState.InitialState) .StartSubReducer(FilterCounterState) // Counter .AddReducer <IncrementAction>(CounterIncrementReducer) .AddReducer <DecrementAction>(CounterDecrementReducer) .EndSubReducer() .StartSubReducer(FilterToDoState) // ToDo .AddReducer <CreateTodoItemAction, PlayerPrefsService>(CreateToDoItemReducer, playerPrefsService) .AddReducer <RemoveTodoItemAction>(RemoveToDoItemReducer) .AddReducer <CompleteTodoItemAction>(CompleteToDoItemReducer) .AddReducer <ClearTodoItemsAction, PlayerPrefsService>(ClearToDoItemsReducer, playerPrefsService) .EndSubReducer() .Build(out disposable)); }
public void Execute(Action <MailboxAssociationFromStore, IAssociationAdaptor, ADUser, IExtensibleLogger> task) { IExtensibleLogger logger = MailboxAssociationDiagnosticsFrameFactory.Default.CreateLogger(this.mailbox.ExchangeGuid, this.mailbox.OrganizationId); IMailboxAssociationPerformanceTracker performanceTracker = MailboxAssociationDiagnosticsFrameFactory.Default.CreatePerformanceTracker(null); using (MailboxAssociationDiagnosticsFrameFactory.Default.CreateDiagnosticsFrame("MailboxAssociationContext.Execute", this.clientInfoString, logger, performanceTracker)) { StoreBuilder storeBuilder = new StoreBuilder(null, XSOFactory.Default, logger, this.clientInfoString); GroupMailboxAccessLayer groupMailboxAccessLayer = new GroupMailboxAccessLayer(this.adSession, storeBuilder, performanceTracker, logger, this.clientInfoString); MailboxLocator mailboxLocator = this.groupMailboxAccessLayerFactory.CreateMasterLocator(); using (IAssociationStore associationStore = storeBuilder.Create(mailboxLocator, groupMailboxAccessLayer.PerformanceTracker)) { BaseAssociationAdaptor associationAdaptor = this.groupMailboxAccessLayerFactory.CreateAssociationAdaptor(mailboxLocator, associationStore); if (this.associationId.AssociationIdType == null) { this.ExecuteForAllAssociations(task, associationAdaptor, logger); } else { this.ExecuteForSingleAssociation(task, associationAdaptor, logger); } } } }