int DictViewFactory::NextUID()
{
  static const char *last_uid_key = "LastUID";
  int uid = reg.GetRegKey("", last_uid_key, 100000) + 1;
  reg.SetRegKey("", last_uid_key, uid);
  return uid;
}
void DictViewFactory::EnumDictViews(DictViewFactoryEnumProc client, void* client_context)
{
  FarString key, name;
  for (FarRegistry::KeyIterator i(reg.EnumKeys("")); i.NextKey(key);) {
    name = reg.GetRegStr(key.c_str(), dict_view_name_key, "");
    if (!name.IsEmpty())
      client(prefix+key, name, client_context);
  }
}
void DictViewFactory::DeleteDictView(const FarString &id)
{
  FarString n_id = id.Mid(prefix_length);
  if (!n_id.IsEmpty())
    reg.DeleteRegKey("", n_id.c_str());
}
void DictViewFactory::DeleteDictView(const FarString &name)
{
  FarString id(GetDictViewIdStr(name));
  if (!id.IsEmpty())
    reg.DeleteRegKey("", id.c_str());
}