private static LogRowFormatter CreateLogRowForFirstLine(string executingUser, byte[] cookie, NameValueCollection parameters, string responseIdentity)
        {
            string cookieInBase = (cookie == null) ? null : Convert.ToBase64String(cookie);
            string parameters2  = (parameters == null) ? null : BackSyncAuditLog.ToParametersString(parameters);

            return(BackSyncAuditLog.CreateLogRow(executingUser, cookieInBase, parameters2, responseIdentity, null, null, null, null, null, null));
        }
        private static LogRowFormatter CreateLogRowForSyncObject(string responseIdentity, object syncObject, string objectInXml)
        {
            string objectId = null;
            string sourceId = null;
            string targetId = null;
            string contextId;

            if (syncObject is DirectoryObject)
            {
                DirectoryObject directoryObject = (DirectoryObject)syncObject;
                objectId  = directoryObject.ObjectId;
                contextId = directoryObject.ContextId;
            }
            else if (syncObject is DirectoryObjectError)
            {
                DirectoryObjectError directoryObjectError = (DirectoryObjectError)syncObject;
                objectId  = directoryObjectError.ObjectId;
                contextId = directoryObjectError.ContextId;
            }
            else
            {
                if (!(syncObject is DirectoryLink))
                {
                    throw new NotSupportedException("Don't know how to extract IDs for new type: " + syncObject.GetType().Name);
                }
                DirectoryLink directoryLink = (DirectoryLink)syncObject;
                contextId = directoryLink.ContextId;
                sourceId  = directoryLink.SourceId;
                targetId  = directoryLink.TargetId;
            }
            return(BackSyncAuditLog.CreateLogRow(null, null, null, responseIdentity, objectId, contextId, sourceId, targetId, objectInXml, null));
        }
 private static LogRowFormatter CreateLogRowForError(string responseIdentity, SyncObject syncObject, Exception e)
 {
     return(BackSyncAuditLog.CreateLogRow(null, null, null, responseIdentity, syncObject.ObjectId, syncObject.ContextId, null, null, null, e.Message));
 }