Ejemplo n.º 1
0
 public static Query GetQueryIsToastNotificationEnabled()
 {
     if (_cacheQueryIsToastNotificationEnabled == null)
     {
         _cacheQueryIsToastNotificationEnabled = new Query()
                                                 .JoinSuccessors(EnableToastNotification.GetRoleIndividual(), Condition.WhereIsEmpty(EnableToastNotification.GetQueryIsDisabled())
                                                                 )
         ;
     }
     return(_cacheQueryIsToastNotificationEnabled);
 }
Ejemplo n.º 2
0
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                EnableToastNotification newFact = new EnableToastNotification(memento);

                // Create a memory stream from the memento data.
                using (MemoryStream data = new MemoryStream(memento.Data))
                {
                    using (BinaryReader output = new BinaryReader(data))
                    {
                        newFact._unique = (Guid)_fieldSerializerByType[typeof(Guid)].ReadData(output);
                    }
                }

                return(newFact);
            }
Ejemplo n.º 3
0
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                EnableToastNotification newFact = new EnableToastNotification(memento);

                // Create a memory stream from the memento data.
                using (MemoryStream data = new MemoryStream(memento.Data))
                {
                    using (BinaryReader output = new BinaryReader(data))
                    {
                        newFact._unique = (Guid)_fieldSerializerByType[typeof(Guid)].ReadData(output);
                    }
                }

                return newFact;
            }
Ejemplo n.º 4
0
 public void RegisterAllFactTypes(Community community, IDictionary <Type, IFieldSerializer> fieldSerializerByType)
 {
     community.AddType(
         Individual._correspondenceFactType,
         new Individual.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         Individual._correspondenceFactType
     }));
     community.AddQuery(
         Individual._correspondenceFactType,
         Individual.GetQueryMessageBoards().QueryDefinition);
     community.AddQuery(
         Individual._correspondenceFactType,
         Individual.GetQueryShares().QueryDefinition);
     community.AddQuery(
         Individual._correspondenceFactType,
         Individual.GetQueryIsToastNotificationEnabled().QueryDefinition);
     community.AddType(
         Share._correspondenceFactType,
         new Share.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         Share._correspondenceFactType
     }));
     community.AddQuery(
         Share._correspondenceFactType,
         Share.GetQueryIsDeleted().QueryDefinition);
     community.AddUnpublisher(
         Share.GetRoleIndividual(),
         Condition.WhereIsEmpty(Share.GetQueryIsDeleted())
         );
     community.AddType(
         ShareDelete._correspondenceFactType,
         new ShareDelete.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         ShareDelete._correspondenceFactType
     }));
     community.AddType(
         MessageBoard._correspondenceFactType,
         new MessageBoard.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         MessageBoard._correspondenceFactType
     }));
     community.AddQuery(
         MessageBoard._correspondenceFactType,
         MessageBoard.GetQueryMessages().QueryDefinition);
     community.AddType(
         Domain._correspondenceFactType,
         new Domain.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         Domain._correspondenceFactType
     }));
     community.AddType(
         Message._correspondenceFactType,
         new Message.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         Message._correspondenceFactType
     }));
     community.AddType(
         EnableToastNotification._correspondenceFactType,
         new EnableToastNotification.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         EnableToastNotification._correspondenceFactType
     }));
     community.AddQuery(
         EnableToastNotification._correspondenceFactType,
         EnableToastNotification.GetQueryIsDisabled().QueryDefinition);
     community.AddType(
         DisableToastNotification._correspondenceFactType,
         new DisableToastNotification.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         DisableToastNotification._correspondenceFactType
     }));
 }
Ejemplo n.º 5
0
 public CorrespondenceFact GetNullInstance()
 {
     return(EnableToastNotification.GetNullInstance());
 }
Ejemplo n.º 6
0
            public void WriteFactData(CorrespondenceFact obj, BinaryWriter output)
            {
                EnableToastNotification fact = (EnableToastNotification)obj;

                _fieldSerializerByType[typeof(Guid)].WriteData(output, fact._unique);
            }