Skip to content
Snippets Groups Projects
Commit 0e1d4a7c authored by svatal's avatar svatal
Browse files

fixed generator not to prefix native types

parent 8203b745
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ namespace MasterDevs.ChromeDevTools.Protocol.Chrome.Overlay ...@@ -14,7 +14,7 @@ namespace MasterDevs.ChromeDevTools.Protocol.Chrome.Overlay
/// <summary> /// <summary>
/// Gets or sets Quad to highlight /// Gets or sets Quad to highlight
/// </summary> /// </summary>
public DOM.double[] Quad { get; set; } public double[] Quad { get; set; }
/// <summary> /// <summary>
/// Gets or sets The highlight fill color (default: transparent). /// Gets or sets The highlight fill color (default: transparent).
/// </summary> /// </summary>
......
using Newtonsoft.Json; using System;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.IO; using System.IO;
...@@ -139,7 +137,10 @@ namespace MasterDevs.ChromeDevTools.ProtocolGenerator ...@@ -139,7 +137,10 @@ namespace MasterDevs.ChromeDevTools.ProtocolGenerator
{ {
itemsType = items.TypeReference; itemsType = items.TypeReference;
} }
domainDictionary[type.Name] = domain + "." + itemsType + "[]"; if (IsGeneratedNativeType(itemsType))
domainDictionary[type.Name] = itemsType + "[]";
else
domainDictionary[type.Name] = domain + "." + itemsType + "[]";
} }
private static void WriteProtocolClasses(DirectoryInfo directory, string ns, string domainName, IEnumerable<Type> types, IEnumerable<Command> commands, IEnumerable<Event> events) private static void WriteProtocolClasses(DirectoryInfo directory, string ns, string domainName, IEnumerable<Type> types, IEnumerable<Command> commands, IEnumerable<Event> events)
...@@ -481,6 +482,20 @@ namespace MasterDevs.ChromeDevTools.ProtocolGenerator ...@@ -481,6 +482,20 @@ namespace MasterDevs.ChromeDevTools.ProtocolGenerator
} }
} }
private static bool IsGeneratedNativeType(string propertyType)
{
switch (propertyType)
{
case "double":
case "long":
case "bool":
case "object":
return true;
default:
return false;
}
}
private static string GeneratePropertyName(string propertyName) private static string GeneratePropertyName(string propertyName)
{ {
return ToCamelCase(propertyName); return ToCamelCase(propertyName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment