private void LoadCommands()
{
lock (ThreadLock)
{
for (int i = 0; i < flCommands.Controls.Count; i++)
{
flCommands.Controls.RemoveAt(i);
i--;
}
foreach (objectsCommand oc in RemoteCommands)
{
var b = new Button
{
Tag = oc.id,
AutoSize = true,
UseVisualStyleBackColor = true,
Text = oc.name.StartsWith("cmd_") ? LocRm.GetString(oc.name) : oc.name,
Width = 110
};
b.Click += BClick;
flCommands.Controls.Add(b);
}
}
}