本文整理汇总了C#中ISerializer.Serializer方法的典型用法代码示例。如果您正苦于以下问题:C# ISerializer.Serializer方法的具体用法?C# ISerializer.Serializer怎么用?C# ISerializer.Serializer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISerializer
的用法示例。
在下文中一共展示了ISerializer.Serializer方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RefreshCache
internal string RefreshCache(string fullName, ISerializer serializer)
{
if (PermissionValidate.Instance.CheckChangePermission())
{
List<Arch.CFramework.RefreshResult> refreshResults = CacheRefreshManager.Instance.Refresh(fullName);
ResultCollection resultCollection = new ResultCollection();
resultCollection.Results = new List<RefreshResult>();
foreach (var item in refreshResults)
{
resultCollection.Results.Add(new RefreshResult() { IsSuccessful = item.IsSuccessful, Message = item.Message, FullName = CacheRefreshManager.Instance.GetFullName(item.Source) });
}
return serializer.Serializer(resultCollection, Encoding.UTF8);
}
else
{
var msg = new Result();
msg.IsSuccess = false;
msg.Message = "Sorry,执行刷新失败,您没有执行权限。";
return msg.Read(serializer);
}
}
示例2: DoDefault
private string DoDefault(ISerializer serializer)
{
if (serializer.GetType() == typeof(HTMLSerializer))
{
return DoComponetsContent(ContextHelper.GetCategory(AppConst.Components), serializer);
}
else
{
return serializer.Serializer(MenusContainer.Current.GetMenus(), Encoding.UTF8);
}
}
示例3: ListView
internal string ListView(ISerializer serializer)
{
return serializer.Serializer(BuildCollections(), Encoding.UTF8);
}
示例4: DoComponetsContent
/// <summary>
/// 处理Components
/// </summary>
/// <param name="name"></param>
/// <param name="serializer"></param>
/// <returns></returns>
private string DoComponetsContent(string name, ISerializer serializer)
{
if (name.Length == 0)
{
return serializer.Serializer(ComponentManager.Current.GetCollection(), Encoding.UTF8);
}
else
{
var reader = ComponentManager.Current.GetComponent(name);
if (reader != null)
{
return reader.Read(serializer);
}
}
return "Not found action : " + name;
}
示例5: DoLocalLog
/// <summary>
/// 处理LocalLog
/// </summary>
/// <param name="name"></param>
/// <param name="serializer"></param>
/// <returns></returns>
private string DoLocalLog(string name, ISerializer serializer)
{
if (name.Length == 0)
{
return serializer.Serializer(LocalLogManager.Current.GetCategories(), Encoding.UTF8);
}
else
{
return LocalLogManager.Current.GetLogContent(name, serializer);
}
}
示例6: DoValidationContent
private string DoValidationContent(string name, ISerializer serializer)
{
if (name.Length == 0)
{
return serializer.Serializer(ValidatorManager.Current.GetValidatorCollection(), Encoding.UTF8);
}
else
{
var reader = ValidatorManager.Current.GetValidator(name);
if (reader != null)
{
return reader.Read(serializer);
}
}
return "Not found action : " + name;
}
示例7: GetLogContent
public string GetLogContent(string name, ISerializer serializer)
{
var file = GetPaths(name);
if (File.Exists(file))
{
var tname = ContextHelper.GetLastResource();
return Download(tname, name);
}
else
{
return serializer.Serializer(GetLogFileOrDics(name), Encoding.UTF8);
}
}
示例8: GetFeatureContingencies
internal string GetFeatureContingencies(ISerializer serializer)
{
if (serializer is HTMLSerializer)
{
return serializer.Serializer(Collections(), Encoding.UTF8);
}
else
{
FCCollection fcCollection = new FCCollection();
fcCollection.FCList = fcInfos.Values.ToList();
return serializer.Serializer(fcCollection, Encoding.UTF8);
}
}