Taylohtio/AlertManager/SPSolutions.SharePoint.Aler.../SPSolutions.SharePoint/SPSolutions.SharePoint.Alerts/SPUserAlertAssociationConta...

43 lines
829 B
C#

using Microsoft.SharePoint;
using System;
namespace SPSolutions.SharePoint.Alerts
{
public class SPUserAlertAssociationContainer : SPAlertAssociationContainer
{
private SPUser m_spUser;
public override string AssociationTitle
{
get
{
if (this.m_spUser == null)
{
return string.Empty;
}
return string.Format("{0} : {1}", this.m_spUser.LoginName, string.IsNullOrEmpty(this.m_spUser.Name) ? "Unknown" : this.m_spUser.Name);
}
}
public override string Id
{
get
{
string result = string.Empty;
if (this.m_spUser != null)
{
try
{
result = Convert.ToString(this.m_spUser.ID);
}
catch (ArgumentException)
{
}
}
return result;
}
}
public SPUserAlertAssociationContainer(SPUser spUser)
{
this.m_spUser = spUser;
}
}
}