An alternative to UBB.threads
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
FLocal/IISMainHandler/handlers/response/AvatarsSettingsHandler.cs

37 lines
1.1 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Xml.Linq;
using Web.Core;
using FLocal.Common;
using FLocal.Common.dataobjects;
namespace FLocal.IISHandler.handlers.response {
class AvatarsSettingsHandler : AbstractGetHandler<FLocal.Common.URL.my.Avatars> {
override protected string templateName {
get {
return "AvatarsSettings.xslt";
}
}
override protected IEnumerable<XElement> getSpecificData(WebContext context) {
AvatarsSettings settings = null;
try {
settings = AvatarsSettings.LoadByAccount(context.account);
int accountId = settings.accountId; //just to make sure it is loaded
} catch(NotFoundInDBException) {
}
return new XElement[] {
(settings != null) ? new XElement("avatars", from avatar in settings.avatars select avatar.exportToXml(context)) : null,
(context.account.user.avatarId.HasValue) ? new XElement("currentAvatar", context.account.user.avatar.exportToXml(context)) : null,
};
}
}
}