public GlDoc CreateNewDoc() { GlDoc new_doc = new GlDoc(this); AllDocsByGuid.Add(new_doc.DocUID, new_doc); return(new_doc); }
public void RemoveDoc(string property_name, GlDoc doc_to_remove) { if (PropertyType(property_name) != ValueType.DOCUMENT) { return; } RemoveActualString(property_name, doc_to_remove.DocUID.ToString()); }
public void AppendDoc(string property_name, GlDoc new_value) { if (!EnsureDataType(property_name, ValueType.DOCUMENT)) { return; } AppendActualString(property_name, new_value.DocUID.ToString()); }
public void SetDoc(string property_name, GlDoc new_value) { if (!EnsureDataType(property_name, ValueType.DOCUMENT)) { return; } _DocNodeRef.Set(new_value.DocUID.ToString(), property_name, VALUE_SUBSCRIPT); }
// indicates whether any OTHER documents contain a reference to this // document in a property value (either simple or complex) public GlDoc IsReferenced() { foreach (GlDoc loop_doc in _ParentDocSet.AllDocs) { if (loop_doc == this) { continue; // don't bother with self references } foreach (string propname in loop_doc.PropertyNames()) { if (loop_doc.PropertyType(propname) != ValueType.DOCUMENT) { continue; } List <GlDoc> docrefs = loop_doc.GetDocs(propname); if (docrefs == null) { GlDoc docval = loop_doc.GetDoc(propname); if (docval == this) { return(loop_doc); } } else { foreach (GlDoc refdoc in loop_doc.GetDocs(propname)) { if (refdoc == this) { return(loop_doc); } } } } } return(null); }
internal void MarkDocAsDeleted(GlDoc doomed_doc) { AllDocsByGuid.Remove(doomed_doc.DocUID); }