public static XDocument ToXML(this SocketOutlet Socket) { var _XDocument = new XDocument(); return(_XDocument); }
public static JObject ToJSON(this SocketOutlet SocketOutlet, Boolean IncludeParentIds = true) => JSONObject.Create( new JProperty("Plug", SocketOutlet.Plug.ToString()), SocketOutlet.CableAttached.HasValue ? new JProperty("CableAttached", SocketOutlet.CableAttached.ToString()) : null, SocketOutlet.CableLength > 0 ? new JProperty("CableLength", SocketOutlet.CableLength.ToString()) : null );
public static JProperty ToJSON(this SocketOutlet SocketOutlet, String JPropertyKey) { #region Initial checks if (SocketOutlet == null) { throw new ArgumentNullException(nameof(SocketOutlet), "The given socket outlet must not be null!"); } if (JPropertyKey.IsNullOrEmpty()) { throw new ArgumentNullException(nameof(JPropertyKey), "The given json property key must not be null or empty!"); } #endregion return(new JProperty(JPropertyKey, SocketOutlet.ToJSON())); }