/// <summary> /// Check clone against This /// </summary> /// <param name="clone"></param> /// <returns>True if the clone is identical but not a shallow copy</returns> internal bool CheckClone(DeviceTuningParameter clone) { bool ret = true; // object vars first ret &= (this.m_nodetext == clone.m_nodetext); // immutable string - shallow copy is OK ret &= (this.m_action == clone.m_action); // immutable string - shallow copy is OK ret &= (this.m_cmdCtrl == clone.m_cmdCtrl); // immutable string - shallow copy is OK ret &= (this.m_class == clone.m_class); // immutable string - shallow copy is OK ret &= (this.m_devInstanceNo == clone.m_devInstanceNo); ret &= (this.m_option == clone.m_option); ret &= (this.m_deviceName == clone.m_deviceName); ret &= (this.m_isStrafe == clone.m_isStrafe); ret &= (this.m_expEnabled == clone.m_expEnabled); ret &= (this.m_exponent == clone.m_exponent); ret &= (this.m_ptsEnabled == clone.m_ptsEnabled); ret &= (this.m_PtsIn == clone.m_PtsIn); ret &= (this.m_PtsOut == clone.m_PtsOut); ret &= (this.m_invertEnabled == clone.m_invertEnabled); ret &= (this.m_deviceRef == clone.m_deviceRef); // check m_deviceoptionRef // --> NO check as this is assigned and used only while editing the Options return(ret); }
public void ResetDynamicItems() { foreach (KeyValuePair <string, DeviceTuningParameter> kv in m_tuning) { DeviceTuningParameter item = kv.Value; if (item != null) { item.ResetDynamicItems( ); } } }
/// <summary> /// Returns a DevTuning item from the sought parameter /// as the device is not given it looks for the first one that implements it /// Note: this prefers devices that are listed early (usually a gamepad is before the joysticks) /// </summary> /// <param name="option">The tuning parameter</param> /// <returns>The sought item or null if not found</returns> public DeviceTuningParameter FirstTuningItem(string option) { foreach (KeyValuePair <string, OptionTree> kv in this) { DeviceTuningParameter item = kv.Value.TuningItem(option); if ((item != null) && !string.IsNullOrEmpty(item.NodeText)) { return(item); } } // not found in any device return(null); }