コード例 #1
0
 public static Query GetQueryIsCurrent()
 {
     if (_cacheQueryIsCurrent == null)
     {
         _cacheQueryIsCurrent = new Query()
                                .JoinSuccessors(Individual__name.GetRolePrior())
         ;
     }
     return(_cacheQueryIsCurrent);
 }
コード例 #2
0
 public static Query GetQueryName()
 {
     if (_cacheQueryName == null)
     {
         _cacheQueryName = new Query()
                           .JoinSuccessors(Individual__name.GetRoleIndividual(), Condition.WhereIsEmpty(Individual__name.GetQueryIsCurrent())
                                           )
         ;
     }
     return(_cacheQueryName);
 }
コード例 #3
0
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                Individual__name newFact = new Individual__name(memento);

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

                return(newFact);
            }
コード例 #4
0
 public Individual__name Ensure()
 {
     if (_loadedTask != null)
     {
         ManualResetEvent loaded = new ManualResetEvent(false);
         Individual__name fact   = null;
         _loadedTask.ContinueWith(delegate(Task <CorrespondenceFact> t)
         {
             fact = (Individual__name)t.Result;
             loaded.Set();
         });
         loaded.WaitOne();
         return(fact);
     }
     else
     {
         return(this);
     }
 }
コード例 #5
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.GetQueryName().QueryDefinition);
     community.AddQuery(
         Individual._correspondenceFactType,
         Individual.GetQueryTunes().QueryDefinition);
     community.AddType(
         Individual__name._correspondenceFactType,
         new Individual__name.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         Individual__name._correspondenceFactType
     }));
     community.AddQuery(
         Individual__name._correspondenceFactType,
         Individual__name.GetQueryIsCurrent().QueryDefinition);
     community.AddType(
         Tune._correspondenceFactType,
         new Tune.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         Tune._correspondenceFactType
     }));
     community.AddQuery(
         Tune._correspondenceFactType,
         Tune.GetQueryIndividuals().QueryDefinition);
     community.AddType(
         Like._correspondenceFactType,
         new Like.CorrespondenceFactFactory(fieldSerializerByType),
         new FactMetadata(new List <CorrespondenceFactType> {
         Like._correspondenceFactType
     }));
 }
コード例 #6
0
 public CorrespondenceFact GetNullInstance()
 {
     return(Individual__name.GetNullInstance());
 }
コード例 #7
0
 public CorrespondenceFact GetUnloadedInstance()
 {
     return(Individual__name.GetUnloadedInstance());
 }
コード例 #8
0
            public void WriteFactData(CorrespondenceFact obj, BinaryWriter output)
            {
                Individual__name fact = (Individual__name)obj;

                _fieldSerializerByType[typeof(string)].WriteData(output, fact._value);
            }