/// <summary> /// 创建便签 /// </summary> /// <param name="path">缓存路径</param> /// <param name="imdex"></param> /// <param name="oldNotepad"></param> public static void CreateNotepad(string path, int imdex, WindowNotepad oldNotepad) { if (WindowList.Count >= 15) { MessageBox.Show("便签数据日经达到最大值15个!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning); return; } if (WindowList.Exists(t => t.CacheFileName == path)) { return; } WindowNotepad window = null; WindowSettingsAllM windowSettingsAll = ReadSetings(); string id = Path.GetFileNameWithoutExtension(path); WindowSettingsM settings = windowSettingsAll?.WindowSettingses.Find(t => t.ID == id); if (settings == null) { settings = GetDefaultWindowSettingsM(id); } window = new WindowNotepad(settings); SetTop(window, oldNotepad); window.Show(); WindowList.Add(window); ShowWindowListCount++; WindowListCount++; }
/// <summary> /// 创建便签 /// </summary> /// <param name="path">缓存路径</param> /// <param name="settingses"></param> public static void CreateNotepad(string path, List <WindowSettingsM> settingses) { if (WindowList.Exists(t => t.CacheFileName == path)) { return; } WindowNotepad window = null; string id = Path.GetFileNameWithoutExtension(path); WindowSettingsM settings = settingses.Find(t => t.ID == id); if (settings == null) { settings = GetDefaultWindowSettingsM(id); } window = new WindowNotepad(settings); window.Show(); WindowList.Add(window); ShowWindowListCount++; WindowListCount++; }