public void Import(JsonGestureIntentStore from, bool replace = false) { if (from == null) { return; } if (replace) { GlobalApp.GestureIntents.Clear(); GlobalApp.IsGesturingEnabled = from.GlobalApp.IsGesturingEnabled; Apps.Clear(); HotCornerCommands = from.HotCornerCommands; } else { for (var i = 0; i < from.HotCornerCommands.Length; i++) { if (from.HotCornerCommands[i] != null) { HotCornerCommands[i] = from.HotCornerCommands[i]; } } } GlobalApp.ImportGestures(from.GlobalApp); foreach (var kv in from.Apps) { ExeApp appInSelf; //如果应用程序已经在列表中,则合并手势 if (TryGetExeApp(kv.Key.ToLower(), out appInSelf)) { appInSelf.ImportGestures(kv.Value); appInSelf.IsGesturingEnabled = appInSelf.IsGesturingEnabled && kv.Value.IsGesturingEnabled; } else//否则将app添加到列表中 { Add(kv.Value); } } }