/* ==================================================================================== Event handlers */
protected void _btnCheck_Click(object sender, EventArgs e)
{
var syncAD2Portal = new SyncAD2Portal();
var syncInfo = syncAD2Portal.GetSyncInfo(_tbLdapPath.Text);
string syncInfoStr;
if (!syncInfo.SyncTreeFound) {
syncInfoStr = "Configured SyncTree could not be found for this path. Check the <a href='/Explore.html#/Root/System/SystemPlugins/Tools/DirectoryServices/AD2PortalConfig.xml' target='_blank'>configuration</a>!";
}
else
{
syncInfoStr = string.Format("Configured synctree: ({0}, {1}) -> ({2}) (<a href='/Explore.html#/Root/System/SystemPlugins/Tools/DirectoryServices/AD2PortalConfig.xml' target='_blank'>configuration</a>)<br/>Target portal path: <a href='/Explore.html#{3}' target='_blank'>{3}</a><br/>{4}<br/>{5}",
syncInfo.SyncTreeADIPAddress,
syncInfo.SyncTreeADPath,
syncInfo.SyncTreePortalPath,
syncInfo.TargetPortalPath,
syncInfo.PortalNodeExists ? "Target path exists" : "Target path does not exist",
syncInfo.PortalParentExists ? "Target parent path exists" : "Target parent path does not exist"
);
}
this.Controls.Add(new Literal { Text = "<hr/><strong>Results:</strong><br/>" });
this.Controls.Add(new Literal { Text = syncInfoStr });
}