public static ExtensibleData Resolve(ResourceReference @ref, Gx.Gedcomx document)
        {
            if (@ref.Resource == null)
            {
                return null;
            }

            return Resolve(@ref.Resource, document);
        }
Exemplo n.º 2
0
        protected internal override void Embed(ExtensibleData conclusion)
        {
            var value = (Conclusion)conclusion;

            this._lang        = this._lang == null ? value._lang : this._lang;
            this._confidence  = this._confidence == null ? value._confidence : this._confidence;
            this._attribution = this._attribution == null ? value._attribution : this._attribution;
            this._analysis    = this._analysis == null ? value._analysis : this._analysis;
            if (value._notes != null)
            {
                this._notes = this._notes == null ? new List <Note>() : this._notes;
                this._notes.AddRange(value._notes);
            }
            if (value._sources != null)
            {
                this._sources = this._sources == null ? new List <SourceReference>() : this._sources;
                this._sources.AddRange(value._sources);
            }
            base.Embed(conclusion);
        }
Exemplo n.º 3
0
        public void TestCreateDiscussionReference()
        {
            var me = tree.ReadCurrentUser();
            var contributor = new ResourceReference("https://familysearch.org/platform/users/agents/" + me.User.TreeUserId).SetResourceId(me.User.TreeUserId);
            var discussion = tree.AddDiscussion(new Discussion()
                                                    .SetTitle("Test title")
                                                    .SetDetails("Test details")
                                                    .SetContributor(contributor)
                                                    .SetCreated(DateTime.Now));
            cleanup.Add(discussion);
            var person = (FamilyTreePersonState)tree.AddPerson(TestBacking.GetCreateMalePerson()).Get();
            cleanup.Add(person);
            var state = person.AddDiscussionReference(discussion);

            Assert.DoesNotThrow(() => state.IfSuccessful());
            Assert.AreEqual(HttpStatusCode.Created, state.Response.StatusCode);
        }
Exemplo n.º 4
0
 /**
  * Build out this source description with a descriptor ref.
  *
  * @param descriptorRef The descriptor ref.
  * @return this.
  */
 public SourceDescription SetDescriptorRef(ResourceReference descriptorRef)
 {
     DescriptorRef = descriptorRef;
     return this;
 }
Exemplo n.º 5
0
 /**
  * Build out this source description with an analyis.
  * @param analysis The analysis.
  * @return this.
  */
 public SourceDescription AddAnalysis(ResourceReference analysis)
 {
     Analysis = analysis;
     return this;
 }
 /**
  * Build out this relationship with a reference to the child.
  *
  * @param child the child.
  * @return this.
  */
 public ChildAndParentsRelationship SetChild(Person child)
 {
     if (child.Id == null)
     {
         throw new ArgumentException("Cannot reference child: no id.");
     }
     Child = new ResourceReference("#" + child.Id);
     return this;
 }
 /**
  * Build out this relationship with a reference to the mother.
  *
  * @param mother the mother.
  * @return this.
  */
 public ChildAndParentsRelationship SetMother(Person mother)
 {
     if (mother.Id == null)
     {
         throw new ArgumentException("Cannot reference mother: no id.");
     }
     Mother = new ResourceReference("#" + mother.Id);
     return this;
 }
 /**
  * Build out this relationship with a reference to the father.
  *
  * @param father the father.
  * @return this.
  */
 public ChildAndParentsRelationship SetFather(ResourceReference father)
 {
     Father = father;
     return this;
 }
Exemplo n.º 9
0
 protected internal override void Embed(ExtensibleData conclusion)
 {
     var value = (Conclusion)conclusion;
     this._lang = this._lang == null ? value._lang : this._lang;
     this._confidence = this._confidence == null ? value._confidence : this._confidence;
     this._attribution = this._attribution == null ? value._attribution : this._attribution;
     this._analysis = this._analysis == null ? value._analysis : this._analysis;
     if (value._notes != null)
     {
         this._notes = this._notes == null ? new List<Note>() : this._notes;
         this._notes.AddRange(value._notes);
     }
     if (value._sources != null)
     {
         this._sources = this._sources == null ? new List<SourceReference>() : this._sources;
         this._sources.AddRange(value._sources);
     }
     base.Embed(conclusion);
 }
Exemplo n.º 10
0
 /**
  * Build this comment by applying a contributor.
  *
  * @param contributor The contributor.
  * @return this.
  */
 public Comment SetContributor(ResourceReference contributor)
 {
     Contributor = contributor;
     return(this);
 }
Exemplo n.º 11
0
 /**
  * Build out this relationship with a reference to person 2.
  *
  * @param person2 person 2.
  * @return this.
  */
 public Relationship SetPerson2(ResourceReference person2)
 {
     Person2 = person2;
     return this;
 }
Exemplo n.º 12
0
 /**
  * Build out this relationship with a reference to person 1.
  * 
  * @param person1 person 1.
  * @return this.
  */
 public Relationship SetPerson1(Person person1)
 {
     if (person1.Id == null)
     {
         throw new ArgumentException("Cannot reference person1: no id.");
     }
     Person1 = new ResourceReference("#" + person1.Id);
     return this;
 }
Exemplo n.º 13
0
 /**
  * Build out this relationship with a reference to person 1.
  * 
  * @param person1 person 1.
  * @return this.
  */
 public Relationship SetPerson1(ResourceReference person1)
 {
     Person1 = person1;
     return this;
 }
Exemplo n.º 14
0
 /**
  * Add a reference to the analysis for this conclusion.
  *
  * @param analysis The analysis.
  * @return this.
  */
 public Conclusion SetAnalysis(ResourceReference analysis)
 {
     Analysis = analysis;
     return this;
 }
Exemplo n.º 15
0
 /**
  * Build out this place description with a spacial description.
  * @param spatialDescription The spatial description.
  * @return this
  */
 public PlaceDescription SetSpatialDescription(ResourceReference spatialDescription)
 {
     SpatialDescription = spatialDescription;
     return this;
 }
Exemplo n.º 16
0
 /**
  * Build out this place description with a place.
  *
  * @param place The reference to the place.
  * @return this
  */
 public PlaceDescription SetPlace(ResourceReference place)
 {
     Place = place;
     return this;
 }
Exemplo n.º 17
0
 /**
  * Build up this online account with a service homepage.
  *
  * @param serviceHomepage The service homepage.
  * @return this.
  */
 public OnlineAccount SetServiceHomepage(ResourceReference serviceHomepage)
 {
     this.ServiceHomepage = serviceHomepage;
     return(this);
 }
Exemplo n.º 18
0
        /**
         * Add a phone.
         *
         * @param phone The phone to add.
         */
        public void AddPhone(ResourceReference phone)
        {
            if (this._phones == null)
            {
                this._phones = new List<ResourceReference>();
            }

            this._phones.Add(phone);
        }
Exemplo n.º 19
0
 /**
  * Build up this attribution with a contributor.
  *
  * @param contributor The contributor.
  * @return this.
  */
 public Attribution SetContributor(ResourceReference contributor)
 {
     this.Contributor = contributor;
     return(this);
 }
 /**
  * Build out this relationship with a reference to the mother.
  *
  * @param mother the mother.
  * @return this.
  */
 public ChildAndParentsRelationship SetMother(ResourceReference mother)
 {
     Mother = mother;
     return this;
 }
Exemplo n.º 21
0
 /**
  * Build out this discussion by applying a contributor.
  *
  * @param contributor The contributor.
  * @return this.
  */
 public Discussion SetContributor(ResourceReference contributor)
 {
     Contributor = contributor;
     return this;
 }
 /**
  * Build out this relationship with a reference to the child.
  *
  * @param child the child.
  * @return this.
  */
 public ChildAndParentsRelationship SetChild(ResourceReference child)
 {
     Child = child;
     return this;
 }
Exemplo n.º 23
0
 /**
  * Build out this source citation with a template.
  * @param citationTemplate The template.
  * @return this.
  */
 public SourceCitation SetCitationTemplate(ResourceReference citationTemplate)
 {
     CitationTemplate = citationTemplate;
     return this;
 }
Exemplo n.º 24
0
 /**
  * Build out this source description with a mediator.
  * 
  * @param mediator The mediator.
  * @return this.
  */
 public SourceDescription SetMediator(ResourceReference mediator)
 {
     Mediator = mediator;
     return this;
 }
Exemplo n.º 25
0
 /**
  * Build this comment by applying a contributor.
  *
  * @param contributor The contributor.
  * @return this.
  */
 public Comment SetContributor(ResourceReference contributor)
 {
     Contributor = contributor;
     return this;
 }
Exemplo n.º 26
0
 /**
  * Build out this source description with a repository.
  *
  * @param repository The repository.
  * @return this.
  */
 public SourceDescription SetRepository(ResourceReference repository)
 {
     Repository = repository;
     return this;
 }
Exemplo n.º 27
0
 /**
  * Build up this agent with a home page.
  * @param homepage The home page of the agent.
  * @return this.
  */
 public Agent SetHomepage(ResourceReference homepage)
 {
     this.Homepage = homepage;
     return this;
 }
Exemplo n.º 28
0
 /**
  * Build up this attribution with a contributor.
  *
  * @param contributor The contributor.
  * @return this.
  */
 public Attribution SetContributor(ResourceReference contributor)
 {
     this.Contributor = contributor;
     return this;
 }
Exemplo n.º 29
0
 /**
  * Build up this agent with a open id.
  * @param openid The open id of the agent.
  * @return this.
  */
 public Agent SetOpenid(ResourceReference openid)
 {
     this.Openid = openid;
     return this;
 }
Exemplo n.º 30
0
 /**
  * Build out this source description with a descriptor ref.
  *
  * @param descriptorRef The descriptor ref.
  * @return this.
  */
 public SourceDescription SetDescriptorRef(ResourceReference descriptorRef)
 {
     DescriptorRef = descriptorRef;
     return(this);
 }
Exemplo n.º 31
0
 /**
  * Build up this agent with an email address.
  *
  * @param email The email address.
  * @return this.
  */
 public Agent SetEmail(ResourceReference email)
 {
     AddEmail(email);
     return this;
 }
Exemplo n.º 32
0
 /**
  * Build out this place description with a jurisdiction.
  * @param jurisdiction The reference to the jurisdiction.
  * @return this
  */
 public PlaceDescription SetJurisdiction(ResourceReference jurisdiction)
 {
     Jurisdiction = jurisdiction;
     return this;
 }
Exemplo n.º 33
0
 /**
  * Build up this agent with a phone number.
  * @param phone The phone number.
  * @return this.
  */
 public Agent SetPhone(ResourceReference phone)
 {
     AddPhone(phone);
     return this;
 }
Exemplo n.º 34
0
 /**
  * Build up this event role with a person.
  * @param person The person.
  * @return this.
  */
 public EventRole SetPerson(ResourceReference person)
 {
     Person = person;
     return this;
 }
Exemplo n.º 35
0
        /**
         * Add an email.
         *
         * @param email The email.
         */
        public void AddEmail(ResourceReference email)
        {
            if (this._emails == null)
            {
                this._emails = new List<ResourceReference>();
            }

            this._emails.Add(email);
        }