/// <summary> /// Return a XML representation of this object. /// </summary> /// <param name="XName">An alternative XML element name [default: "OCPPv1_6_CS:idTagInfo"]</param> public XElement ToXML(XName XName = null) => new XElement(XName ?? OCPPNS.OCPPv1_6_CS + "sampledValue", new XElement(OCPPNS.OCPPv1_6_CS + "value", Value), Context.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "context", XML_IO.AsText(Context.Value)) : null, Format.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "format", XML_IO.AsText(Format.Value)) : null, Measurand.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "measurand", XML_IO.AsText(Measurand.Value)) : null, Phase.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "phase", XML_IO.AsText(Phase.Value)) : null, Location.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "location", XML_IO.AsText(Location.Value)) : null, Unit.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "unit", XML_IO.AsText(Unit.Value)) : null );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "resetRequest", new XElement(OCPPNS.OCPPv1_6_CP + "type", XML_IO.AsText(Type)) );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "setChargingProfileResponse", new XElement(OCPPNS.OCPPv1_6_CP + "status", XML_IO.AsText(Status)) );
public GraphDS_RESTClient(String myHost, String myUsername, String myPassword, uint myPort = 9975U) { setHost(myHost); _Username = myUsername; _Password = myPassword; _Port = myPort; _Credentials = new NetworkCredential(myUsername, myPassword); _GQLUri = getHost() + ":" + _Port.ToString() + _GQLPATTERN; _Parser = new XML_IO(); //workaround to communicate with graphds server running on mono Assembly curSection = Assembly.GetAssembly(typeof(System.Net.Configuration.SettingsSection)); if (curSection != null) { Type setting = curSection.GetType("System.Net.Configuration.SettingsSectionInternal"); if (setting != null) { var instance = setting.InvokeMember("Section", BindingFlags.Static | BindingFlags.GetProperty | BindingFlags.NonPublic, null, null, new object[] { }); if (instance != null) { FieldInfo unsafeParsing = setting.GetField("useUnsafeHeaderParsing", BindingFlags.NonPublic | BindingFlags.Instance); if (unsafeParsing != null) { unsafeParsing.SetValue(instance, true); } } } } }
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "sendLocalListResponse", new XElement(OCPPNS.OCPPv1_6_CP + "status", XML_IO.AsText(Status)) );
/// <summary> /// Return a XML representation of this object. /// </summary> /// <param name="XName">An alternative XML element name [default: "OCPPv1_6_CP:chargingProfile"]</param> public XElement ToXML(XName XName = null) => new XElement(XName ?? OCPPNS.OCPPv1_6_CP + "chargingProfile", new XElement(OCPPNS.OCPPv1_6_CP + "chargingProfileId", ChargingProfileId.ToString()), TransactionId != null ? new XElement(OCPPNS.OCPPv1_6_CP + "transactionId", TransactionId.ToString()) : null, new XElement(OCPPNS.OCPPv1_6_CP + "stackLevel", StackLevel), new XElement(OCPPNS.OCPPv1_6_CP + "chargingProfilePurpose", XML_IO.AsText(ChargingProfilePurpose)), new XElement(OCPPNS.OCPPv1_6_CP + "chargingProfileKind", XML_IO.AsText(ChargingProfileKind)), ValidFrom.HasValue ? new XElement(OCPPNS.OCPPv1_6_CP + "validFrom", ValidFrom.Value.ToIso8601()) : null, ValidTo.HasValue ? new XElement(OCPPNS.OCPPv1_6_CP + "validTo", ValidTo.Value.ToIso8601()) : null, RecurrencyKind.HasValue ? new XElement(OCPPNS.OCPPv1_6_CP + "recurrencyKind", XML_IO.AsText(RecurrencyKind.Value)) : null, new XElement(OCPPNS.OCPPv1_6_CP + "chargingSchedule", ChargingSchedule.ToXML()) );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "triggerMessageResponse", new XElement(OCPPNS.OCPPv1_6_CP + "status", XML_IO.AsText(Status)) );
private bool readSettings(string path) { AR_Settings read = XML_IO.Read(path, typeof(AR_Settings)) as AR_Settings; if (read == null) { return(false); } settings = read; if (settings.BmMain != null) { scrolledDoubleBuffer1.DataWidth = settings.BmMain.Width; scrolledDoubleBuffer1.DataHeight = settings.BmMain.Height; } else { scrolledDoubleBuffer1.DataWidth = 1000; scrolledDoubleBuffer1.DataHeight = 1000; } filter.Bitmap = settings.BmPic; settings.Path = path; return(true); }
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CS + "statusNotificationRequest", new XElement(OCPPNS.OCPPv1_6_CS + "connectorId", ConnectorId.ToString()), new XElement(OCPPNS.OCPPv1_6_CS + "status", XML_IO.AsText(Status)), new XElement(OCPPNS.OCPPv1_6_CS + "errorCode", XML_IO.AsText(ErrorCode)), Info.IsNotNullOrEmpty() ? new XElement(OCPPNS.OCPPv1_6_CS + "info", Info) : null, StatusTimestamp.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "timestamp", StatusTimestamp.Value.ToIso8601()) : null, VendorId.IsNotNullOrEmpty() ? new XElement(OCPPNS.OCPPv1_6_CS + "vendorId", VendorId) : null, VendorErrorCode.IsNotNullOrEmpty() ? new XElement(OCPPNS.OCPPv1_6_CS + "vendorErrorCode", VendorErrorCode) : null );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "changeAvailabilityRequest", new XElement(OCPPNS.OCPPv1_6_CP + "connectorId", ConnectorId.ToString()), new XElement(OCPPNS.OCPPv1_6_CP + "type", XML_IO.AsText(Type)) );
private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (settings.Path == null) { saveAsToolStripMenuItem_Click(sender, e); return; } XML_IO.Write(settings.Path, settings); XML_IO.Write(lastFile, settings); }
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CS + "bootNotificationResponse", new XElement(OCPPNS.OCPPv1_6_CS + "status", XML_IO.AsText(Status)), new XElement(OCPPNS.OCPPv1_6_CS + "currentTime", CurrentTime.ToIso8601()), new XElement(OCPPNS.OCPPv1_6_CS + "interval", Interval.TotalSeconds) );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "triggerMessageRequest", new XElement(OCPPNS.OCPPv1_6_CP + "requestedMessage", XML_IO.AsText(RequestedMessage)), ConnectorId.HasValue ? new XElement(OCPPNS.OCPPv1_6_CP + "connectorId", ConnectorId.ToString()) : null );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "dataTransferResponse", new XElement(OCPPNS.OCPPv1_6_CP + "status", XML_IO.AsText(Status)), Data.IsNullOrEmpty() ? new XElement(OCPPNS.OCPPv1_6_CP + "data", Data) : null );
public void LoadTrees() { PreComputerForLoadingTrees(); foreach (var treeModel in TreeModels) { treeModel.Clear(); XML_IO.Open("maize.xml", treeModel); } SceneInitForLoadingTrees(); ChartInitForLoadingTrees(); }
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { string path = IERSInterface.FileFieldAndBrowser.PopupSaveFileDialog("Save", this, _recentSettings, "XML|*.xml", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); if (path == null) { return; } settings.Path = path; XML_IO.Write(path, settings); XML_IO.Write(lastFile, settings); }
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "sendLocalListRequest", new XElement(OCPPNS.OCPPv1_6_CP + "listVersion", ListVersion), LocalAuthorizationList.IsNeitherNullNorEmpty() ? LocalAuthorizationList.Select(item => item.ToXML(OCPPNS.OCPPv1_6_CP + "localAuthorizationList")) : null, new XElement(OCPPNS.OCPPv1_6_CP + "updateType", XML_IO.AsText(UpdateType)) );
/// <summary> /// Return a XML representation of this object. /// </summary> /// <param name="XName">An alternative XML element name [default: "OCPPv1_6_CS:idTagInfo"]</param> public XElement ToXML(XName XName = null) => new XElement(XName ?? OCPPNS.OCPPv1_6_CS + "idTagInfo", new XElement(OCPPNS.OCPPv1_6_CS + "connectorStandard", XML_IO.AsText(Status)), ExpiryDate.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "expiryDate", ExpiryDate.Value.ToIso8601()) : null, ParentIdTag.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "parentIdTag", ParentIdTag.Value.ToString()) : null );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CS + "authorizeResponse", new XElement(OCPPNS.OCPPv1_6_CS + "idTagInfo", new XElement(OCPPNS.OCPPv1_6_CS + "status", XML_IO.AsText(IdTagInfo.Status)), IdTagInfo.ExpiryDate.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "expiryDate", IdTagInfo.ExpiryDate.Value.ToIso8601()) : null, IdTagInfo.ParentIdTag != null ? new XElement(OCPPNS.OCPPv1_6_CS + "parentIdTag", IdTagInfo.ParentIdTag.Value) : null ) );
void AddApplyButton() { GUILayout.BeginHorizontal(); GUILayout.Label(""); //为使按钮靠左,添加不显示的Label if (GUILayout.Button("Save", GUILayout.Width(50f), GUILayout.Height(20f))) { XML_IO.Save("maize.xml", Name, InitStep, MaxStep, LRule, BranchTexturePath, GlobalVariables, Meshes); } if (GUILayout.Button("Apply", GUILayout.Width(50f), GUILayout.Height(20f))) { XML_IO.Save("maize.xml", Name, InitStep, MaxStep, LRule, BranchTexturePath, GlobalVariables, Meshes); GameObject.Find("BuildButton").GetComponent <BuildButton>().Click(); } GUILayout.EndHorizontal(); }
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "getCompositeScheduleResponse", new XElement(OCPPNS.OCPPv1_6_CP + "status", XML_IO.AsText(Status)), ConnectorId != null ? new XElement(OCPPNS.OCPPv1_6_CP + "connectorId", ConnectorId.ToString()) : null, ScheduleStart.HasValue ? new XElement(OCPPNS.OCPPv1_6_CP + "scheduleStart", ScheduleStart.Value.ToIso8601()) : null, ChargingSchedule != null ? ChargingSchedule.ToXML() : null );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "clearChargingProfileRequest", ChargingProfileId != null ? new XElement(OCPPNS.OCPPv1_6_CP + "id", ChargingProfileId.ToString()) : null, ConnectorId != null ? new XElement(OCPPNS.OCPPv1_6_CP + "connectorId", ConnectorId.ToString()) : null, ChargingProfilePurpose.HasValue ? new XElement(OCPPNS.OCPPv1_6_CP + "chargingProfilePurpose", XML_IO.AsText(ChargingProfilePurpose.Value)) : null, StackLevel.HasValue ? new XElement(OCPPNS.OCPPv1_6_CP + "stackLevel", StackLevel.Value) : null );
/// <summary> /// Return a XML representation of this object. /// </summary> /// <param name="XName">An alternative XML element name [default: "OCPPv1_6_CP:chargingSchedule"]</param> public XElement ToXML(XName XName = null) => new XElement(XName ?? OCPPNS.OCPPv1_6_CP + "chargingSchedule", Duration.HasValue ? new XElement(OCPPNS.OCPPv1_6_CP + "duration", Duration.Value) : null, StartSchedule.HasValue ? new XElement(OCPPNS.OCPPv1_6_CP + "startSchedule", StartSchedule.Value.ToIso8601()) : null, new XElement(OCPPNS.OCPPv1_6_CP + "chargingRateUnit", XML_IO.AsText(ChargingRateUnit)), ChargingSchedulePeriods.Select(value => value.ToXML()), Duration.HasValue ? new XElement(OCPPNS.OCPPv1_6_CP + "minChargingRate", MinChargingRate.Value.ToString("0.#")) : null );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CS + "stopTransactionRequest", new XElement(OCPPNS.OCPPv1_6_CS + "transactionId", TransactionId), IdTag.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "idTag", IdTag.Value) : null, new XElement(OCPPNS.OCPPv1_6_CS + "timestamp", Timestamp.ToIso8601()), new XElement(OCPPNS.OCPPv1_6_CS + "meterStop", MeterStop), Reason.HasValue ? new XElement(OCPPNS.OCPPv1_6_CS + "reason", XML_IO.AsText(Reason.Value)) : null, TransactionData.Any() ? TransactionData.Select(data => data.ToXML(OCPPNS.OCPPv1_6_CS + "transactionData")) : null );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "changeConfigurationResponse", new XElement(OCPPNS.OCPPv1_6_CP + "status", XML_IO.AsText(Status)) );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "changeAvailabilityResponse", new XElement(OCPPNS.OCPPv1_6_CP + "status", XML_IO.AsText(Status)) );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CS + "diagnosticsStatusNotificationRequest", new XElement(OCPPNS.OCPPv1_6_CS + "status", XML_IO.AsText(Status)) );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "remoteStartTransactionResponse", new XElement(OCPPNS.OCPPv1_6_CP + "status", XML_IO.AsText(Status)) );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "clearCacheResponse", new XElement(OCPPNS.OCPPv1_6_CP + "status", XML_IO.AsText(Status)) );
/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(OCPPNS.OCPPv1_6_CP + "reserveNowResponse", new XElement(OCPPNS.OCPPv1_6_CP + "status", XML_IO.AsText(Status)) );