bool Execute(string filename) { IList <string> lines = ReusableLists.NextAutoRecycleList <string>(); // cvars AddEntries(lines, ListCvars(), "cvars"); // bindings AddEntries(lines, ListBindings(), "bindings"); // aliases AddEntries(lines, ListAliases(), "aliases"); try { ConfigHelper.WriteConfig(filename, lines); return(true); } catch (Exception e) { if (this.IsManualMode) { PrintError("Can't write config: " + e.Message); } } return(false); }
public static IList <string> Split(string str, int options = 0) { IList <string> list = ReusableLists.NextAutoRecycleList <string>(); Split(str, list, options); return(list); }
public static IList <string> ListVarNames(string prefix = null, CommandListOptions options = CommandListOptions.None) { IList <CVar> cvars = ListVars(ReusableLists.NextAutoRecycleList <CVar>(), prefix, options); string[] names = new string[cvars.Count]; int index = 0; foreach (CVar cvar in cvars) { names[index++] = cvar.Name; } return(names); }
public static IList <CBinding> List(CCommandBindingsFilter filter) { if (filter == null) { throw new NullReferenceException("Filter is null"); } IList <CBinding> list = ReusableLists.NextAutoRecycleList <CBinding>(); for (int i = 0; i < m_bindings.Count; ++i) { if (filter(m_bindings[i])) { list.Add(m_bindings[i]); } } return(list); }
internal static IList <CAliasCommand> ListAliases(string prefix = null, CommandListOptions options = CommandListOptions.None) { return(ListAliases(ReusableLists.NextAutoRecycleList <CAliasCommand>(), prefix, options)); }
internal static IList <CVar> ListVars(ListCommandsFilter <CVarCommand> filter) { return(ListVars(ReusableLists.NextAutoRecycleList <CVar>(), filter)); }
public static IList <CVar> ListVars(string prefix = null, CommandListOptions options = CommandListOptions.None) { return(ListVars(ReusableLists.NextAutoRecycleList <CVar>(), prefix, options)); }