public int AddTaxonomyGuidToWss(object site, TermInstance term, bool isKeywordField) { if (site == null || site == Undefined.Value || site == Null.Value) { throw new JavaScriptException(this.Engine, "Error", "A Site instance or url must be supplied as the first argument."); } if (term == null) { throw new JavaScriptException(this.Engine, "Error", "A term instance must be supplied as the second argument."); } SPSite spSite; var dispose = false; if (site is SPSiteInstance) { spSite = (site as SPSiteInstance).Site; } else { spSite = new SPSite(TypeConverter.ToString(site), SPBaristaContext.Current.Site.UserToken); dispose = true; } try { var result = -1; var taxonomyFieldType = typeof(TaxonomyField); var miAddTaxonomyGuidToWss = taxonomyFieldType.GetMethod("AddTaxonomyGuidToWss", BindingFlags.NonPublic | BindingFlags.Static, null, new[] { typeof(SPSite), typeof(Term), typeof(bool) }, null ); if (miAddTaxonomyGuidToWss != null) { result = (int)miAddTaxonomyGuidToWss.Invoke(null, new object[] { spSite, term.Term, isKeywordField }); } return(result); } finally { if (dispose) { spSite.Dispose(); } } }
public TermInstance ReuseTerm(TermInstance term, bool reuseBranch) { var reusedTerm = m_termSet.ReuseTerm(term.Term, reuseBranch); return(new TermInstance(Engine.Object.InstancePrototype, reusedTerm)); }
public void ReassignSourceTerm(TermInstance reusedTerm) { m_term.ReassignSourceTerm(reusedTerm.m_term); }
public void Move(TermInstance newParentTerm) { m_term.Move(newParentTerm.m_term); }
public TermInstance Merge(TermInstance term) { var mergedTerm = m_term.Merge(term.m_term); return(new TermInstance(Engine.Object.InstancePrototype, mergedTerm)); }
public bool GetIsDescendantOf(TermInstance term) { return(m_term.GetIsDescendantOf(term.m_term)); }