📄 sipccseqheader.cs
字号:
namespace Imps.Base.Sipc
{
using System;
public class SipcCSeqHeader : SipcHeader
{
private string _method;
private int _number;
public SipcCSeqHeader() : base("Q")
{
this._method = string.Empty;
}
public SipcCSeqHeader(string value) : base("Q", value)
{
this._method = string.Empty;
}
public SipcCSeqHeader(int number, string method) : base("Q")
{
this._method = string.Empty;
this._number = number;
this.Method = method;
}
public bool Equals(SipcCSeqHeader header)
{
if (this.Number == header.Number)
{
return (this.Method == header.Method);
}
return false;
}
public override bool Equals(object obj)
{
if (obj is SipcCSeqHeader)
{
return this.Equals((SipcCSeqHeader) obj);
}
return false;
}
public override void Parse(string value)
{
base.Value = value;
string[] textArray = value.Split(new char[] { ' ' });
if (textArray.Length >= 2)
{
this._number = int.Parse(textArray[0]);
this._method = textArray[1].Trim().ToUpper();
}
}
public override string ToString()
{
return string.Format("{0}: {1} {2}", "Q", this._number, this._method);
}
public string Method
{
get
{
return this._method;
}
set
{
this._method = (value == null) ? string.Empty : value.Trim();
}
}
public int Number
{
get
{
return this._number;
}
set
{
this._number = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -