internal PackageSettings(Package package) { if (package == null) { throw new ArgumentNullException("package"); } this.package = package; if (package.FullPath == null) { profile = SettingsGroup.CreateSettingsProfile(false); } else { var path = Path.Combine(package.FullPath.GetFullDirectory(), package.FullPath.GetFileName() + SettingsExtension); try { profile = SettingsGroup.LoadSettingsProfile(path, false); } catch (Exception e) { e.Ignore(); } if (profile == null) { profile = SettingsGroup.CreateSettingsProfile(false); } } }