?? keyfield.cs
字號:
using SDP;
using System;
/// <summary>
/// A Key represents the k= field contained within either a MediaDescription or a SessionDescription.
/// </summary>
public class KeyField : Field
{
private string method;
/// <summary>
/// Gets the method of encryption to use. See <see cref="EncryptionMethods"/>
/// </summary>
public string Method
{
get { return this.method; }
}
/// <summary>
/// Determines whether or not a key is present.
/// </summary>
public bool HasKey
{
get { return !String.IsNullOrEmpty(this.method); }
}
private string key;
/// <summary>
/// Gets the encryption key, if there is one.
/// </summary>
public string Key
{
get { return this.key; }
}
/// <summary>
/// Creates a new KeyField.
/// </summary>
/// <param name="value">The value portion of the field.</param>
public KeyField(string value)
: base("k=" + value)
{
string val = base.Value;
string[] parts = val.Split(':');
this.method = parts[0];
if (parts.Length > 1) this.key = parts[1];
}
/// <summary>
/// Creates a new KeyField.
/// </summary>
/// <param name="method">The encryption method.</param>
/// <param name="key">The key.</param>
public KeyField(string method, string key) : this(method + (String.IsNullOrEmpty(key) ? "" : ":" + key)) { }
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -