public bool AddInteropValue(string name, bool value, string owner) { name = name.ToLower().Trim(); if (!RemoveInteropValue(name, owner)) { return(false); } InteropValue opValue = new InteropValue(); opValue.owner = owner; opValue.value = String.Format("{0:D}", value); opValue.valueType = InteropValueType.BOOL; knownInterops.Add(name, opValue); TestFlightUtil.UpdatePartConfigs(this.part); return(true); }
public void ClearInteropValues(string owner) { List <String> keysToDelete = new List <string>(); foreach (string key in knownInterops.Keys) { if (knownInterops[key].owner == owner) { keysToDelete.Add(key); } } if (keysToDelete.Count > 0) { foreach (string key in keysToDelete) { knownInterops.Remove(key); } } TestFlightUtil.UpdatePartConfigs(this.part); }
public bool AddInteropValue(string name, string value, string owner) { name = name.ToLower().Trim(); if (!RemoveInteropValue(name, owner)) { return(false); } InteropValue opValue = new InteropValue(); opValue.owner = owner; opValue.value = value; opValue.valueType = InteropValueType.STRING; knownInterops.Add(name, opValue); Log(String.Format("Added new interop, {0} = {1}, for {2}", name, value, owner)); TestFlightUtil.UpdatePartConfigs(this.part); return(true); }
public bool RemoveInteropValue(string name, string owner) { name = name.ToLower().Trim(); if (knownInterops == null) { knownInterops = new Dictionary <string, InteropValue>(); } if (!knownInterops.ContainsKey(name)) { return(true); } InteropValue opValue = knownInterops[name]; if (opValue.owner != owner) { return(false); } knownInterops.Remove(name); TestFlightUtil.UpdatePartConfigs(this.part); return(true); }