public CSharpDecompilerSettingsTab(DecompilerSettings decompilerSettings) { this._global_decompilerSettings = decompilerSettings; this.decompilerSettings = decompilerSettings.Clone(); var defObjs = typeof(DecompilationObject).GetEnumValues().Cast <DecompilationObject>().ToArray(); this.decompilationObjectVMs = new DecompilationObjectVM[defObjs.Length]; for (int i = 0; i < defObjs.Length; i++) { this.decompilationObjectVMs[i] = new DecompilationObjectVM(defObjs[i], ToString(defObjs[i])); } this.decompilationObjectVMs2 = this.decompilationObjectVMs.ToArray(); this.DecompilationObject0 = this.decompilationObjectVMs.First(a => a.Object == decompilerSettings.DecompilationObject0); this.DecompilationObject1 = this.decompilationObjectVMs.First(a => a.Object == decompilerSettings.DecompilationObject1); this.DecompilationObject2 = this.decompilationObjectVMs.First(a => a.Object == decompilerSettings.DecompilationObject2); this.DecompilationObject3 = this.decompilationObjectVMs.First(a => a.Object == decompilerSettings.DecompilationObject3); this.DecompilationObject4 = this.decompilationObjectVMs.First(a => a.Object == decompilerSettings.DecompilationObject4); }
void SetDecompilationObject(int index, DecompilationObjectVM newValue) { Debug.Assert(newValue != null); if (newValue == null) { throw new ArgumentNullException(); } if (decompilationObjectVMs[index] == newValue) { return; } int otherIndex = Array.IndexOf(decompilationObjectVMs, newValue); Debug.Assert(otherIndex >= 0); if (otherIndex >= 0) { decompilationObjectVMs[otherIndex] = decompilationObjectVMs[index]; decompilationObjectVMs[index] = newValue; OnPropertyChanged(string.Format("DecompilationObject{0}", otherIndex)); } OnPropertyChanged(string.Format("DecompilationObject{0}", index)); }
void SetDecompilationObject(int index, DecompilationObjectVM newValue) { Debug.Assert(newValue != null); if (newValue == null) throw new ArgumentNullException(); if (decompilationObjectVMs[index] == newValue) return; int otherIndex = Array.IndexOf(decompilationObjectVMs, newValue); Debug.Assert(otherIndex >= 0); if (otherIndex >= 0) { decompilationObjectVMs[otherIndex] = decompilationObjectVMs[index]; decompilationObjectVMs[index] = newValue; OnPropertyChanged(string.Format("DecompilationObject{0}", otherIndex)); } OnPropertyChanged(string.Format("DecompilationObject{0}", index)); }
public CSharpDecompilerSettingsTab(DecompilerSettings decompilerSettings) { this._global_decompilerSettings = decompilerSettings; this.decompilerSettings = decompilerSettings.Clone(); var defObjs = typeof(DecompilationObject).GetEnumValues().Cast<DecompilationObject>().ToArray(); this.decompilationObjectVMs = new DecompilationObjectVM[defObjs.Length]; for (int i = 0; i < defObjs.Length; i++) this.decompilationObjectVMs[i] = new DecompilationObjectVM(defObjs[i], ToString(defObjs[i])); this.decompilationObjectVMs2 = this.decompilationObjectVMs.ToArray(); this.DecompilationObject0 = this.decompilationObjectVMs.First(a => a.Object == decompilerSettings.DecompilationObject0); this.DecompilationObject1 = this.decompilationObjectVMs.First(a => a.Object == decompilerSettings.DecompilationObject1); this.DecompilationObject2 = this.decompilationObjectVMs.First(a => a.Object == decompilerSettings.DecompilationObject2); this.DecompilationObject3 = this.decompilationObjectVMs.First(a => a.Object == decompilerSettings.DecompilationObject3); this.DecompilationObject4 = this.decompilationObjectVMs.First(a => a.Object == decompilerSettings.DecompilationObject4); }