protected override bool InternalExecute()
        {
            UserContext userContext = UserContextManager.GetUserContext(CallContext.Current.HttpContext, CallContext.Current.EffectiveCaller, true);

            new ConfigurationContext(userContext);
            MailboxSession mailboxIdentityMailboxSession            = base.CallContext.SessionCache.GetMailboxIdentityMailboxSession();
            UserConfigurationPropertyDefinition propertyDefinition  = UserOptionPropertySchema.Instance.GetPropertyDefinition(UserConfigurationPropertyId.ShowSenderOnTopInListView);
            UserConfigurationPropertyDefinition propertyDefinition2 = UserOptionPropertySchema.Instance.GetPropertyDefinition(UserConfigurationPropertyId.ShowPreviewTextInListView);
            UserConfigurationPropertyDefinition propertyDefinition3 = UserOptionPropertySchema.Instance.GetPropertyDefinition(UserConfigurationPropertyId.ConversationSortOrder);
            UserConfigurationPropertyDefinition propertyDefinition4 = UserOptionPropertySchema.Instance.GetPropertyDefinition(UserConfigurationPropertyId.HideDeletedItems);
            UserConfigurationPropertyDefinition propertyDefinition5 = UserOptionPropertySchema.Instance.GetPropertyDefinition(UserConfigurationPropertyId.GlobalReadingPanePosition);
            UserConfigurationPropertyDefinition propertyDefinition6 = UserOptionPropertySchema.Instance.GetPropertyDefinition(UserConfigurationPropertyId.ShowReadingPaneOnFirstLoad);

            new UserOptionsType
            {
                ShowSenderOnTopInListView  = this.newSettings.ShowSenderOnTopInListView,
                ShowPreviewTextInListView  = this.newSettings.ShowPreviewTextInListView,
                ConversationSortOrder      = this.newSettings.ConversationSortOrder,
                HideDeletedItems           = this.newSettings.HideDeletedItems,
                GlobalReadingPanePosition  = this.newSettings.GlobalReadingPanePosition,
                ShowReadingPaneOnFirstLoad = this.newSettings.ShowFirstMessageOnSignIn
            }.Commit(mailboxIdentityMailboxSession, new UserConfigurationPropertyDefinition[]
            {
                propertyDefinition,
                propertyDefinition2,
                propertyDefinition3,
                propertyDefinition4,
                propertyDefinition5,
                propertyDefinition6
            });
            InferenceSettingsType.UpdateUserPreferenceFlag(mailboxIdentityMailboxSession, userContext, this.newSettings.ShowInferenceUiElements);
            return(true);
        }
 internal static void UpdateUserPreferenceFlag(MailboxSession mailboxSession, UserContext userContext, bool enable)
 {
     if (userContext.FeaturesManager.ClientServerSettings.FolderBasedClutter.Enabled)
     {
         InferenceSettingsType.UpdateClutterClassificationEnabled(mailboxSession, userContext.FeaturesManager.ConfigurationSnapshot, enable);
         return;
     }
     if (InferenceSettingsType.GetFeatureSupportedState(mailboxSession, userContext))
     {
         new InferenceSettingsType
         {
             IsClutterUIEnabled = new bool?(enable)
         }.Commit(mailboxSession, new UserConfigurationPropertyDefinition[]
         {
             InferenceSettingsPropertySchema.Instance.GetPropertyDefinition(UserConfigurationPropertyId.IsClutterUIEnabled)
         });
     }
 }
Beispiel #3
0
        private void ReadInferenceSettings(MailboxSession mailboxSession, UserContext userContext, OwaUserConfiguration owaUserConfiguration)
        {
            owaUserConfiguration.ApplicationSettings.InferenceEnabled &= ActivityLogHelper.IsActivityLoggingEnabled(false);
            if (userContext.FeaturesManager.ClientServerSettings.FolderBasedClutter.Enabled)
            {
                InferenceSettingsType.ReadFolderBasedClutterSettings(mailboxSession, userContext.FeaturesManager.ConfigurationSnapshot, owaUserConfiguration);
                return;
            }
            bool featureSupportedState = InferenceSettingsType.GetFeatureSupportedState(mailboxSession, userContext);

            owaUserConfiguration.SegmentationSettings.PredictedActions = featureSupportedState;
            if (featureSupportedState)
            {
                InferenceSettingsType inferenceSettingsType = new InferenceSettingsType();
                inferenceSettingsType.LoadAll(mailboxSession);
                if (inferenceSettingsType.TryMigrateUserOptionsValue(mailboxSession, owaUserConfiguration.UserOptions))
                {
                    ExTraceGlobals.CoreTracer.TraceDebug((long)this.GetHashCode(), "Migrated inference flags from Owa.Settings to Inference.Settings configuration in GetOwaUserConfiguration.");
                }
                owaUserConfiguration.UserOptions.ShowInferenceUiElements = inferenceSettingsType.IsClutterUIEnabled.GetValueOrDefault(false);
            }
        }