public static void Cleanup() { MacroCollection macros = Macros.Current.Macros; for (int index = macros.Count - 1; index >= 0; --index) { if (macros[index].Actions.Count == 0) { macros.RemoveAt(index); } } }
public void Update() { ArrayList dataStore = Engine.GetDataStore(); foreach (Gump gump in this.m_Children.ToArray()) { GMacroKeyButton gmacroKeyButton = gump as GMacroKeyButton; if (gmacroKeyButton != null && gmacroKeyButton.Macro != null) { dataStore.Add((object)gmacroKeyButton); } } bool flag1 = (this.m_Mods & MacroModifiers.All) != MacroModifiers.None; bool flag2 = (this.m_Mods & MacroModifiers.Ctrl) != MacroModifiers.None; bool flag3 = (this.m_Mods & MacroModifiers.Alt) != MacroModifiers.None; bool flag4 = (this.m_Mods & MacroModifiers.Shift) != MacroModifiers.None; MacroCollection list = Macros.List; for (int index = 0; index < list.Count; ++index) { Macro mc = list[index]; if (flag1 || mc.Control == flag2 && mc.Alt == flag3 && mc.Shift == flag4) { object button = this.GetButton(mc.Key); if (button is GMacroKeyButton[]) { foreach (GMacroKeyButton btn in (GMacroKeyButton[])button) { this.SetMacro(dataStore, btn, mc); } } else if (button is GMacroKeyButton) { this.SetMacro(dataStore, (GMacroKeyButton)button, mc); } } } for (int index = 0; index < dataStore.Count; ++index) { ((GMacroKeyButton)dataStore[index]).Macro = (object)null; } Engine.ReleaseDataStore(dataStore); }
internal MacroCollectionEnumerator(MacroCollection collection) { this._index = -1; this._collection = collection; }
public MacroSet() { this.macros = new MacroCollection(); }