Exemplo n.º 1
0
 private void Item_Select(object sender, RoutedEventArgs e)
 {
     try {
         if (!((sender as TreeView)?.SelectedItem is FileSystemNode item))
         {
             return;
         }
         GridOperator.DisplayDirectory(item);
         if (CreateNewFile)
         {
             FileFullPathInput.Text = item.FullPath;
         }
     }
     catch (Exception ex) {
         AppendErrorDelegate?.Invoke(ex.Message, ex);
     }
 }
 public GetNeighboursGridShould()
 {
     _gridOperator = new GridOperator();
 }
Exemplo n.º 3
0
        public static JObject ToJSON(this GridOperator GridOperator,
                                     Boolean Embedded = false,
                                     Boolean ExpandChargingRoamingNetworkId = false,
                                     Boolean ExpandChargingPoolIds          = false,
                                     Boolean ExpandChargingStationIds       = false,
                                     Boolean ExpandEVSEIds = false)

        => GridOperator != null
                   ? JSONObject.Create(

            new JProperty("id", GridOperator.Id.ToString()),

            Embedded
            ?null
            : ExpandChargingRoamingNetworkId
            ?new JProperty("roamingNetwork", GridOperator.RoamingNetwork.ToJSON())
            : new JProperty("roamingNetworkId", GridOperator.RoamingNetwork.Id.ToString()),

            new JProperty("name", GridOperator.Name.ToJSON()),
            new JProperty("description", GridOperator.Description.ToJSON()),

            // Address
            // LogoURI
            // API - RobotKeys, Endpoints, DNS SRV
            // MainKeys

            GridOperator.Logo.IsNotNullOrEmpty()
            ?new JProperty("logos", JSONArray.Create(
                               JSONObject.Create(
                                   new JProperty("uri", GridOperator.Logo),
                                   new JProperty("description", I18NString.Empty.ToJSON())
                                   )
                               ))
            : null,

            GridOperator.Homepage.IsNotNullOrEmpty()
            ?new JProperty("homepage", GridOperator.Homepage)
            : null,

            GridOperator.HotlinePhoneNumber.IsNotNullOrEmpty()
            ?new JProperty("hotline", GridOperator.HotlinePhoneNumber)
            : null,

            GridOperator.DataLicenses.Any()
            ?new JProperty("dataLicenses", new JArray(GridOperator.DataLicenses.Select(license => license.ToJSON())))
            : null

            //new JProperty("chargingPools",         ExpandChargingPoolIds
            //                                           ? new JArray(GridOperator.ChargingPools.     ToJSON(Embedded: true))
            //                                           : new JArray(GridOperator.ChargingPoolIds.   Select(id => id.ToString()))),

            //new JProperty("chargingStations",      ExpandChargingStationIds
            //                                           ? new JArray(GridOperator.ChargingStations.  ToJSON(Embedded: true))
            //                                           : new JArray(GridOperator.ChargingStationIds.Select(id => id.ToString()))),

            //new JProperty("evses",                 ExpandEVSEIds
            //                                           ? new JArray(GridOperator.EVSEs.             ToJSON(Embedded: true))
            //                                           : new JArray(GridOperator.EVSEIds.           Select(id => id.ToString())))

            )
                   : null;
Exemplo n.º 4
0
        public static JProperty ToJSON(this GridOperator GridOperator, String JPropertyKey)

        => GridOperator != null
                   ? new JProperty(JPropertyKey, GridOperator.ToJSON())
                   : null;
 public GetAliveNeighboursCountShould()
 {
     _gridOperator = new GridOperator();
 }
Exemplo n.º 6
0
 public IsAliveShould()
 {
     _gridOperator = new GridOperator();
 }