private void OnEnableCopy(AutoExecItem item) { //disable this device for the cloned entry KeeAutoExecExt.SetDeviceEnabled(item, KeeAutoExecExt.ThisDeviceId, false); //remember the original device settings ProtectedString ifDeviceOrig = item.Entry.Strings.GetSafe(KeeAutoExecExt._ifDevice); //reset device settings so only the current device is enabled item.Entry.Strings.Set(KeeAutoExecExt._ifDevice, new ProtectedString(false, "")); KeeAutoExecExt.SetDeviceEnabled(item, KeeAutoExecExt.ThisDeviceId, true); //now clone var newEntry = item.Entry.CloneDeep(); //reset device settings item.Entry.Strings.Set(KeeAutoExecExt._ifDevice, ifDeviceOrig); newEntry.SetUuid(new PwUuid(true), true); // Create new UUID string strTitle = newEntry.Strings.ReadSafe(PwDefs.TitleField); newEntry.Strings.Set(PwDefs.TitleField, new ProtectedString(false, strTitle + " (" + Android.OS.Build.Model + ")")); var addTask = new AddEntry(this, App.Kp2a, newEntry, item.Entry.ParentGroup, new ActionOnFinish(this, (success, message, activity) => ((ConfigureChildDatabasesActivity)activity).Update())); ProgressTask pt = new ProgressTask(App.Kp2a, this, addTask); pt.Run(); }
private void OnEnable(AutoExecItem item) { KeeAutoExecExt.SetDeviceEnabled(item, KeeAutoExecExt.ThisDeviceId, true); Save(item); }