public Request PutExtra(string key, dynamic value) { lock (this) { if (key == null) { return(this); } if (Extras == null) { Extras = new Dictionary <string, dynamic>(); } if (Extras.ContainsKey(key)) { Extras[key] = value; } else { Extras.Add(key, value); } return(this); } }
/// <summary> /// 设置此链接的额外信息 /// </summary> /// <param name="key">键值</param> /// <param name="value">额外信息</param> public void PutExtra(string key, dynamic value) { lock (_locker) { if (key != null) { if (Extras == null) { Extras = new Dictionary <string, dynamic>(); } if (Extras.ContainsKey(key)) { Extras[key] = value; } else { Extras.Add(key, value); } } } }
public Recipe(XmlElement node) { Name = node.GetAttribute("Name"); Description = node.GetAttribute("Description"); History = node.GetAttribute("History"); string imageFileName = node.GetAttribute("Image"); if (!string.IsNullOrEmpty(imageFileName)) { imageFileName = $"ms-appx:///Assets/{imageFileName}"; } else { imageFileName = $"ms-appx:///Assets/cocktail-glass.png"; } BitmapImage image = new BitmapImage(); image.UriSource = new Uri(imageFileName); Image = image; foreach (XmlElement n in node.SelectNodes("Ingredient")) { Ingredients.Add(new Ingredient(n)); } foreach (XmlElement n in node.SelectNodes("Dash")) { Dashs.Add(new Dash(n)); } foreach (XmlElement n in node.SelectNodes("Extra")) { Extras.Add(new Extra(n)); } }
public Builder AddExtra(string key, string value) { Extras.Add(key, value); return(this); }
public OperateResult(int code, string message, KeyValuePair <string, object> keyValue) { Code = code; Message = message; Extras.Add(keyValue.Key, keyValue.Value); }
public void AgregarExtras(Extra extra) { Extras.Add(extra); }