/// <summary> /// Deserializes xml markup from file into an Resource object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output Resource object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out Resource obj, out Exception exception) { exception = null; obj = default(Resource); try { obj = LoadFromFile(fileName); return true; } catch (Exception ex) { exception = ex; return false; } }
public static bool LoadFromFile(string fileName, out Resource obj) { Exception exception; return LoadFromFile(fileName, out obj, out exception); }
public static bool Deserialize(string input, out Resource obj) { Exception exception; return Deserialize(input, out obj, out exception); }
/// <summary> /// Deserializes workflow markup into an Resource object /// </summary> /// <param name="input">string workflow markup to deserialize</param> /// <param name="obj">Output Resource object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string input, out Resource obj, out Exception exception) { exception = null; obj = default(Resource); try { obj = Deserialize(input); return true; } catch (Exception ex) { exception = ex; return false; } }
private bool IsMappedToResourcePort(String sourceName, Resource resource, Port resourcePort) { bool isChecked = false; String nodeName = String.Format(GetResourcePortMapPath(), resource.name, resourcePort.name); List<Mapping> mappings = GetCapabilityMapping(); if (mappings != null) { foreach (Mapping map in mappings) { bool sourceFound = false; foreach (Network net in map.Map) { foreach (NetworkNode node in net.Node) { if (!sourceFound) sourceFound = sourceName.Equals(node.Path.Value.Trim()); isChecked = sourceFound && nodeName.Equals(node.Path.Value.Trim()); if (isChecked) break; } if (isChecked) break; } if (isChecked) break; } } return isChecked; }
private void SetListItemCheckState(Resource resource, Port port, ListViewItem lvi) { if (sourcePort != null) { lvi.Checked = (sourcePort.MappedPorts.ContainsKey(resource.name + "." + port.name)); } }
private void SetListItemCheckState(Resource resource, Port port, ListViewItem lvi) { }