本文整理汇总了C#中IProperties.ToHeaders方法的典型用法代码示例。如果您正苦于以下问题:C# IProperties.ToHeaders方法的具体用法?C# IProperties.ToHeaders怎么用?C# IProperties.ToHeaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProperties
的用法示例。
在下文中一共展示了IProperties.ToHeaders方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Get
public static HttpExtend.HttpHeader Get(string appName, IProperties properties)
{
HttpExtend.HttpHeader command = new HttpExtend.HttpHeader();
command.Action = COMMAND_GET + " " + appName;
command.Properties = properties.ToHeaders();
return command;
}
示例2: Register
public IProperties Register(IProperties properties)
{
lock (mGroups)
{
TestProperties tp = new TestProperties();
tp.FromHeaders(properties.ToHeaders());
Group group = mGroups.Find(e => e.Name == tp.Group);
if (group == null)
{
group = new Group();
group.Name = tp.Group;
group.Nodes = new List<Node>();
group.Nodes.Add(new Node { Name = tp.Node, Host = tp.Host, Port = tp.Port, LastTrackTime=DateTime.Now });
mGroups.Add(group);
}
else
{
Node node = group.Nodes.Find(n => n.Name== tp.Node );
if(node !=null)
node.LastTrackTime = DateTime.Now;
else
group.Nodes.Add(new Node { Name = tp.Node, Host = tp.Host, Port = tp.Port, LastTrackTime = DateTime.Now });
}
return new Properties();
}
}
示例3: GetResponse
public static HttpExtend.HttpHeader GetResponse(IProperties properties)
{
HttpExtend.HttpHeader command = new HttpExtend.HttpHeader();
command.Properties = properties.ToHeaders();
return command;
}
示例4: GetInfo
public TrackerInfo GetInfo(IProperties properties)
{
TrackerInfo result = new TrackerInfo();
result.TypeName = "Beetle.Tracker.TestImpl.Group,Beetle.Tracker.TestImpl";
TestProperties tp = new TestProperties();
tp.FromHeaders(properties.ToHeaders());
Group group = mGroups.Find(e => e.Name == tp.Group);
if (group == null)
return null;
result.Data= Formater.ToStringValue(group);
return result;
}