示例#1
0
        // Token: 0x060011DE RID: 4574 RVA: 0x00044F60 File Offset: 0x00043160
        public T GetResponseShape <T>(string shapeName, T clientResponseShape, IFeaturesManager featuresManager = null) where T : ResponseShape
        {
            if (string.IsNullOrEmpty(shapeName))
            {
                return(clientResponseShape);
            }
            WellKnownShapeName key;
            ResponseShape      responseShape;

            if (!Enum.TryParse <WellKnownShapeName>(shapeName, out key) || !this.responseShapesMap.TryGetValue(key, out responseShape))
            {
                return(clientResponseShape);
            }
            if (clientResponseShape == null)
            {
                return((T)((object)responseShape));
            }
            OwaResponseShapeResolver.AddFlightedProperties(clientResponseShape, responseShape, featuresManager);
            return(this.MergeResponseShapes <T>(clientResponseShape, (T)((object)responseShape)));
        }
        private static PropertyDefinition[] GetSubscriptionProperties(IFeaturesManager featuresManager)
        {
            string            text = WellKnownShapeName.MailListItem.ToString();
            ItemResponseShape itemResponseShape = new ItemResponseShape();

            itemResponseShape.BaseShape = ShapeEnum.IdOnly;
            ItemResponseShape responseShape = Global.ResponseShapeResolver.GetResponseShape <ItemResponseShape>(text, itemResponseShape, featuresManager);

            if (responseShape == null)
            {
                ExTraceGlobals.NotificationsCallTracer.TraceError <string>((long)text.GetHashCode(), "[MessageItemRowNotificationHandler.GetSubscriptionProperties] Unable to resolve shapeName: {0} with features manager", text);
                return(MessageItemRowNotificationHandler.defaultSubscriptionProperties);
            }
            Shape[] shapes = new Shape[]
            {
                ItemShape.CreateShape(),
                    MessageShape.CreateShape(),
                    TaskShape.CreateShape()
            };
            return(RowNotificationHandler.GetPropertyDefinitionsForResponseShape(shapes, responseShape, new PropertyDefinition[0]));
        }
示例#3
0
        public MainForm(
            [NotNull] IConsoleArgs consoleArgs,
            [NotNull] CombinedLogsUserControl combinedLogsUserControl,
            [NotNull] MainMenuUserControl mainMenuUserControl,
            [NotNull] IFeaturesManager featuresManager,
            [NotNull] INewsViewModelFactory newsViewModelFactory,
            [NotNull] ITelemetry telemetry)
        {
            if (consoleArgs == null)
            {
                throw new ArgumentNullException(nameof(consoleArgs));
            }
            if (combinedLogsUserControl == null)
            {
                throw new ArgumentNullException(nameof(combinedLogsUserControl));
            }
            if (mainMenuUserControl == null)
            {
                throw new ArgumentNullException(nameof(mainMenuUserControl));
            }
            if (featuresManager == null)
            {
                throw new ArgumentNullException(nameof(featuresManager));
            }
            if (newsViewModelFactory == null)
            {
                throw new ArgumentNullException(nameof(newsViewModelFactory));
            }
            if (telemetry == null)
            {
                throw new ArgumentNullException(nameof(telemetry));
            }
            this.combinedLogsUserControl = combinedLogsUserControl;
            this.mainMenuUserControl     = mainMenuUserControl;
            this.featuresManager         = featuresManager;
            this.telemetry = telemetry;

            InitializeComponent();
        }
 protected MessageItemRowNotificationHandler(string subscriptionId, SubscriptionParameters parameters, StoreObjectId folderId, IMailboxContext userContext, Guid mailboxGuid, RowNotifier notifier, IFeaturesManager featuresManager = null) : base(subscriptionId, parameters, folderId, userContext, mailboxGuid, notifier, false)
 {
     this.mailboxId = new MailboxId(mailboxGuid);
     this.subscriptionProperties = MessageItemRowNotificationHandler.GetSubscriptionProperties(featuresManager);
 }
        // Token: 0x06000D62 RID: 3426 RVA: 0x000325E4 File Offset: 0x000307E4
        private static PropertyDefinition[] GetSubscriptionProperties(string requestedConversationShapeName, IFeaturesManager featuresManager)
        {
            if (string.IsNullOrEmpty(requestedConversationShapeName))
            {
                requestedConversationShapeName = WellKnownShapeName.ConversationUberListView.ToString();
            }
            ConversationResponseShape clientResponseShape = new ConversationResponseShape(ShapeEnum.IdOnly, new PropertyPath[0]);
            ConversationResponseShape responseShape       = Global.ResponseShapeResolver.GetResponseShape <ConversationResponseShape>(requestedConversationShapeName, clientResponseShape, featuresManager);

            if (responseShape == null)
            {
                ExTraceGlobals.NotificationsCallTracer.TraceError <string>((long)requestedConversationShapeName.GetHashCode(), "[ConversationRowNotificationHandler.GetSubscriptionProperties] Unable to resolve requestedConversationShapeName: {0}", requestedConversationShapeName);
                return(ConversationRowNotificationHandler.defaultConversationViewQuerySubscriptionProperties);
            }
            Shape[] shapes = new Shape[]
            {
                ConversationShape.CreateShape()
            };
            PropertyDefinition[] specialConversationProperties = ConversationRowNotificationHandler.GetSpecialConversationProperties(responseShape);
            return(RowNotificationHandler.GetPropertyDefinitionsForResponseShape(shapes, responseShape, specialConversationProperties));
        }
 // Token: 0x06000D5D RID: 3421 RVA: 0x00032494 File Offset: 0x00030694
 public ConversationRowNotificationHandler(string subscriptionId, SubscriptionParameters parameters, StoreObjectId folderId, IMailboxContext userContext, Guid mailboxGuid, ExTimeZone timeZone, bool remoteSubscription, IFeaturesManager featuresManager) : base(subscriptionId, parameters, folderId, userContext, mailboxGuid, timeZone, remoteSubscription)
 {
     this.conversationViewQuerySubscriptionProperties = ConversationRowNotificationHandler.GetSubscriptionProperties(parameters.ConversationShapeName, featuresManager);
     SimulatedWebRequestContext.Execute(userContext, "ConversationNotificationDraftFolderId", delegate(MailboxSession mailboxSession, IRecipientSession adSession, RequestDetailsLogger logger)
     {
         this.draftFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.Drafts);
     });
 }
示例#7
0
        // Token: 0x060011DF RID: 4575 RVA: 0x00044FBC File Offset: 0x000431BC
        private static void AddFlightedProperties(ResponseShape clientShape, ResponseShape namedShape, IFeaturesManager featuresManager)
        {
            if (namedShape.FlightedProperties == null || featuresManager == null)
            {
                return;
            }
            HashSet <PropertyPath> hashSet = new HashSet <PropertyPath>();

            foreach (string text in namedShape.FlightedProperties.Keys)
            {
                if (featuresManager.IsFeatureSupported(text))
                {
                    hashSet.UnionWith(namedShape.FlightedProperties[text]);
                }
            }
            if (hashSet.Any <PropertyPath>())
            {
                if (clientShape.AdditionalProperties != null)
                {
                    hashSet.UnionWith(clientShape.AdditionalProperties);
                }
                clientShape.AdditionalProperties = hashSet.ToArray <PropertyPath>();
            }
        }
示例#8
0
 public MainForm(IFeaturesManager features)
 {
     _features = features;
     InitializeComponent();
 }
示例#9
0
 public RequestScopedFeaturesStateSnapshot(IFeaturesManager manager)
 {
     _featuresState = manager.GetAllConfiguredFeatures()
                      .ToDictionary(x => x.Name, x => x.IsEnabled);
 }
示例#10
0
 public FeatureController(IFeaturesManager featuresManager)
 {
     _featuresManager = featuresManager;
 }