void Verify() { var properties = new MemberSpecification <PropertyInfo>(AllowPrivateSetters.Default); var specification = new MetadataSpecification(properties, DefaultMetadataSpecification.Field); var extensions = new DefaultExtensions(specification, DeclaredMemberNames.Default, DefaultMemberOrder.Default).ToArray(); var container = new ConfigurationContainer(extensions).Create().ForTesting(); var subject = new PrivateSettablePropertySubject("Hello World!"); container.Cycle(subject).ShouldBeEquivalentTo(subject); }
void Verify() { var properties = new MemberSpecification <PropertyInfo>(AllowPrivateSetters.Default); var specification = new MetadataSpecification(properties, DefaultMetadataSpecification.Field); var extensions = new DefaultExtensions(specification, DeclaredMemberNames.Default, DefaultMemberOrder.Default).ToArray(); var support = new ConfigurationContainer(extensions).ForTesting(); var instance = new Dto(); instance.Names.Add("Hello"); instance.Names.Add("World"); support.Cycle(instance).Should().BeEquivalentTo(instance); }
private void GetExtensionsFromSettings(string name, IList <string> defaultExtensions) { DefaultExtensions.Clear(); Extensions.Clear(); if (defaultExtensions != null) { DefaultExtensions.AddRange(defaultExtensions); Extensions.AddRange(defaultExtensions); } if (!string.IsNullOrEmpty(name)) { string addKey = "Add" + CultureInfo.InvariantCulture.TextInfo.ToTitleCase(name) + "Extensions"; string remKey = "Rem" + CultureInfo.InvariantCulture.TextInfo.ToTitleCase(name) + "Extensions"; if (GrepSettings.Instance.ContainsKey(addKey)) { string csv = GrepSettings.Instance.Get <string>(addKey).Trim(); if (!string.IsNullOrWhiteSpace(csv)) { foreach (string extension in csv.Split(',')) { var ext = extension.Trim().ToLower(); Extensions.Add(ext); } } } if (GrepSettings.Instance.ContainsKey(remKey)) { string csv = GrepSettings.Instance.Get <string>(remKey).Trim(); if (!string.IsNullOrWhiteSpace(csv)) { foreach (string extension in csv.Split(',')) { var ext = extension.Trim().ToLower(); if (Extensions.Contains(ext)) { Extensions.Remove(ext); } } } } } }
protected override void Process() { Console.WriteLine("Update default extensions file"); DefaultExtensions.Update(SkipIanaMimeTypes); Console.WriteLine("Updating completed"); }
internal DocumentFileExtensionRequiredEventArgs(string language) { Language = DefaultExtensions.ContainsKey(language) ? language : CSharp; FileExtension = DefaultExtensions[Language]; }
public IActionResult ReadDatabaseTypes() { var data = DefaultExtensions.GetEnumDictionary <Databases>(); return(Json(data)); }
private void Register(string path, IConfiguration configuration, string groupId, string externalId) { string fileName = Path.GetFullPath(path + @"bin\symadmin.bat"); DefaultExtensions.ProcessStart(fileName, $"--engine {configuration.EngineName} open-registration {groupId} {externalId}"); }
private static bool SupportsExtension(string path) { string extension = Path.GetExtension(path); return(!string.IsNullOrEmpty(extension) && DefaultExtensions.Contains(extension.TrimStart('.'))); }
public static void CreateTables(string path, IConfiguration configuration) { string fileName = Path.GetFullPath(path + @"bin\symadmin.bat"); DefaultExtensions.ProcessStart(fileName, $"--engine {configuration.EngineName} create-sym-tables"); }
public static void RunOnlyOnce(string path, string syncUrlPort) { string fileName = Path.GetFullPath(path + @"bin\sym.bat"); DefaultExtensions.ProcessStart(fileName, $"--port {syncUrlPort} --server"); }
public static void UninstallService(string path) { string fileName = Path.GetFullPath(path + @"bin\sym_service.bat"); DefaultExtensions.ProcessStart(fileName, "uninstall"); }