public AuditLogModel(SPNode node) { this.Node = node; this.Site = GetSite(node); // Config other properties. }
private SPSite GetSite(SPNode node) { SPSite result = null; ISPNode temp = node; if (temp.SPObjectType == typeof(SPSite)) { result = temp.SPObject as SPSite; } else { if (temp.Parent != null) { result = GetSite(temp.Parent as SPNode); } } return result; }
public void SetupItem(object target) { this.CurrentNode = (SPNode)target; }