I use this way to copy records in two settings:
private static void CopyTo(ES3Settings source, ES3Settings target)
{
var keys = ES3.GetKeys(source);
for (var index = keys.Length - 1; index >= 0; index--)
{
var key = keys[index];
var value = ES3.Load(key, source);
if (null == value)
{
continue;
}
ES3.Save(key, value, target);
}
}
but, I don't think it is a good way.
and, if I need to override, the best way is?
What is the best way to copy records in two different ES3Settings
Re: What is the best way to copy records in two different ES3Settings
Hi there,
If you're just wanting to be able to copy a file, you can use the ES3.CopyFile method.
All the best,
Joel
If you're just wanting to be able to copy a file, you can use the ES3.CopyFile method.
All the best,
Joel
Re: What is the best way to copy records in two different ES3Settings
The location of the two ES3Settings is different.
Re: What is the best way to copy records in two different ES3Settings
Hi there,
The ES3.CopyFile method also accepts two different settings, in the same way as your method.
All the best,
Joel
The ES3.CopyFile method also accepts two different settings, in the same way as your method.
All the best,
Joel
Re: What is the best way to copy records in two different ES3Settings
en...i just want to find the best way to copy data in two different location. And the method "ES3.CopyFile" is forbidden:
if (oldSettings.location != newSettings.location)
throw new InvalidOperationException("Cannot copy file from " + oldSettings.location + " to " + newSettings.location + ". Location must be the same for both source and destination.");
at ES3.cs line 903
if (oldSettings.location != newSettings.location)
throw new InvalidOperationException("Cannot copy file from " + oldSettings.location + " to " + newSettings.location + ". Location must be the same for both source and destination.");
at ES3.cs line 903
Re: What is the best way to copy records in two different ES3Settings
Apologies, I misunderstood your comment as meaning you were saving from two different paths.
In your case you can simply do the following:
All the best,
Joel
In your case you can simply do the following:
Code: Select all
ES3.SaveRaw( ES3.LoadRawBytes(oldSettings), newSettings );
Joel
Re: What is the best way to copy records in two different ES3Settings
This is what i want. Thanks.