Example #1
0
        private void ToJson(Stream stream)
        {
            using (JsonWriter jsonWriter = new JsonWriter(stream))
            {
                jsonWriter.WriteObject();

                jsonWriter.WriteMember("Items");
                jsonWriter.WriteArray();

                jsonWriter.WriteObject();
                LinkExtensions.Serialise(GetLinks(), jsonWriter);

                jsonWriter.WriteMember("TimeTriggered");
                jsonWriter.WriteValue(_WebhookNotification.TimeTriggered);

                jsonWriter.WriteMember("SubscriptionType");
                jsonWriter.WriteValue(_WebhookNotification.SubscriptionType);

                if (_WebhookNotification.ObjectDefinition != null)
                {
                    jsonWriter.WriteMember("Value");
                    ObjectInstance instance = new ObjectInstance(_WebhookNotification.ObjectDefinition, _WebhookNotification.ChangedObject);
                    instance.Links = new List <Link>();
                    instance.Serialise(jsonWriter);
                }

                jsonWriter.WriteEndObject();

                jsonWriter.WriteEndArray();
                jsonWriter.WriteEndObject();
                jsonWriter.Flush();
            }
            stream.Position = 0;
        }
Example #2
0
        private static void WriteExceptionCore(JsonWriter writer, Exception exception, bool includeStackTrace)
        {
            if (!exception.Source.IsNullOrWhiteSpace())
            {
                writer.WritePropertyName("source", () => DynamicJsonConverter.UseCamelCase);
                writer.WriteValue(exception.Source);
            }

            if (!exception.Message.IsNullOrWhiteSpace())
            {
                writer.WritePropertyName("message", () => DynamicJsonConverter.UseCamelCase);
                writer.WriteValue(exception.Message);
            }

            if (exception.StackTrace != null && includeStackTrace)
            {
                writer.WritePropertyName("stack", () => DynamicJsonConverter.UseCamelCase);
                writer.WriteStartArray();
                string[] lines = exception.StackTrace.Split(new[] { StringUtility.NewLine }, StringSplitOptions.RemoveEmptyEntries);
                foreach (string line in lines)
                {
                    writer.WriteValue(line.Trim());
                }
                writer.WriteEndArray();
            }

            if (exception.Data.Count > 0)
            {
                writer.WritePropertyName("data", () => DynamicJsonConverter.UseCamelCase);
                writer.WriteStartObject();
                foreach (DictionaryEntry entry in exception.Data)
                {
                    writer.WritePropertyName(entry.Key.ToString());
                    writer.WriteObject(entry.Value);
                }
                writer.WriteEndObject();
            }

            var properties = exception.GetType().GetRuntimePropertiesExceptOf <Exception>().Where(pi => pi.PropertyType.IsSimple());

            foreach (var property in properties)
            {
                var value = property.GetValue(exception);
                if (value == null)
                {
                    continue;
                }
                writer.WritePropertyName(property.Name, () => DynamicJsonConverter.UseCamelCase);
                writer.WriteObject(value);
            }

            WriteInnerExceptions(writer, exception, includeStackTrace);
        }
        private void SaveDependenciesToFile()
        {
            Dictionary <string, List <string> > dictionary = new Dictionary <string, List <string> >();

            foreach (ListDependencyObject right in (Collection <ListDependencyObject>) this.RightList)
            {
                try
                {
                    dictionary[right.FirstName].Add(right.LastName);
                }
                catch
                {
                    dictionary.Add(right.FirstName, new List <string>());
                    dictionary[right.FirstName].Add(right.LastName);
                }
            }
            if (JsonWriter <Dictionary <string, List <string> > > .WriteObject(dictionary, (string)Paths.ApplicationDependencies))
            {
                Dialogs.DependenciesAdded(DependenciesViewModel.logger);
            }
            else
            {
                Dialogs.DependenciesAddedError(DependenciesViewModel.logger);
            }
        }
Example #4
0
        public void SerializeToWriter(T value, TextWriter writer)
        {
            if (value == null)
            {
                return;
            }
            if (typeof(T) == typeof(string))
            {
                writer.Write(value);
                return;
            }
            if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface)
            {
                if (typeof(T).IsAbstract || typeof(T).IsInterface)
                {
                    JsState.IsWritingDynamic = true;
                }
                JsonSerializer.SerializeToWriter(value, value.GetType(), writer);
                if (typeof(T).IsAbstract || typeof(T).IsInterface)
                {
                    JsState.IsWritingDynamic = false;
                }
                return;
            }

            JsonWriter <T> .WriteObject(writer, value);
        }
        public static void SerializeToWriter <T>(T value, TextWriter writer)
        {
            if (value == null)
            {
                return;
            }
            if (typeof(T) == typeof(string))
            {
                writer.Write(value);
                return;
            }
            var info = typeof(T).GetTypeInfo();

            if (typeof(T) == typeof(object) || info.IsAbstract || info.IsInterface)
            {
                if (info.IsAbstract || info.IsInterface)
                {
                    JsState.IsWritingDynamic = true;
                }
                try
                {
                    SerializeToWriter(value, value.GetType(), writer);
                }
                finally
                {
                    if (info.IsAbstract || info.IsInterface)
                    {
                        JsState.IsWritingDynamic = false;
                    }
                }
                return;
            }

            JsonWriter <T> .WriteObject(writer, value);
        }
Example #6
0
        private void SavePath(System.Windows.Controls.TextBox pathTextBox)
        {
            if (System.Windows.MessageBox.Show("Main window will restart. Be sure there is nothing running in the main window or it will stop.", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) != MessageBoxResult.Yes)
            {
                return;
            }
            if (!File.Exists((string)Paths.ConfigFile))
            {
                using (StreamWriter streamWriter = File.AppendText((string)Paths.ConfigFile))
                    streamWriter.WriteLine("{}");
            }
            this.UserPath = pathTextBox.Text;
            ApplicationConfig applicationConfig = ConfigLoader.Instance.ApplicationConfig;

            applicationConfig.TestLabPath             = this.UserPath;
            applicationConfig.isLoggerLocationVisible = this.isCheckedLocation;
            if (JsonWriter <ApplicationConfig> .WriteObject(applicationConfig, (string)Paths.ConfigFile))
            {
                Dialogs.PathModified(this.UserPath, SettingsViewModel.logger);
                BuildsLoader.TestLabPath = ConfigLoader.Instance.ApplicationConfig.TestLabPath;
            }
            else
            {
                Dialogs.SavePathError(this.UserPath, SettingsViewModel.logger);
            }
            System.Windows.Application.Current.Shutdown();
            System.Windows.Forms.Application.Restart();
        }
Example #7
0
 protected internal override void WriteJson(JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("@set");
     writer.WriteObject(Value);
     writer.WriteEndObject();
 }
        public static void SerializeToStream <T>(T value, Stream stream)
        {
            if (value == null)
            {
                return;
            }
            var info = typeof(T).GetTypeInfo();

            if (typeof(T) == typeof(object) || info.IsAbstract || info.IsInterface)
            {
                if (info.IsAbstract || info.IsInterface)
                {
                    JsState.IsWritingDynamic = true;
                }
                try
                {
                    SerializeToStream(value, value.GetType(), stream);
                }
                finally
                {
                    if (info.IsAbstract || info.IsInterface)
                    {
                        JsState.IsWritingDynamic = false;
                    }
                }
                return;
            }

            var writer = new StreamWriter(stream, UTF8EncodingWithoutBom);

            JsonWriter <T> .WriteObject(writer, value);

            writer.Flush();
        }
        public string SerializeToString(T value)
        {
            if (value == null)
            {
                return(null);
            }
            if (typeof(T) == typeof(string))
            {
                return(value as string);
            }
            if (typeof(T) == typeof(object) || typeof(T).IsAbstract() || typeof(T).IsInterface())
            {
                if (typeof(T).IsAbstract() || typeof(T).IsInterface())
                {
                    JsState.IsWritingDynamic = true;
                }
                var result = JsonSerializer.SerializeToString(value, value.GetType());
                if (typeof(T).IsAbstract() || typeof(T).IsInterface())
                {
                    JsState.IsWritingDynamic = false;
                }
                return(result);
            }

            var sb = new StringBuilder();

            using (var writer = new StringWriter(sb))
            {
                JsonWriter <T> .WriteObject(writer, value);
            }
            return(sb.ToString());
        }
        public static string SerializeToString <T>(T value)
        {
            if (value == null)
            {
                return(null);
            }
            if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface)
            {
                if (typeof(T).IsAbstract || typeof(T).IsInterface)
                {
                    JsState.IsWritingDynamic = true;
                }
                var result = SerializeToString(value, value.GetType());
                if (typeof(T).IsAbstract || typeof(T).IsInterface)
                {
                    JsState.IsWritingDynamic = false;
                }
                return(result);
            }

            var sb = new StringBuilder();

            using (var writer = new StringWriter(sb, CultureInfo.InvariantCulture))
            {
                if (typeof(T) == typeof(string))
                {
                    JsonUtils.WriteString(writer, value as string);
                }
                else
                {
                    JsonWriter <T> .WriteObject(writer, value);
                }
            }
            return(sb.ToString());
        }
Example #11
0
 public static void SerializeToStream <T>(T value, Stream stream)
 {
     using (var writer = new StreamWriter(stream, UTF8EncodingWithoutBom))
     {
         JsonWriter <T> .WriteObject(writer, value);
     }
 }
Example #12
0
        public string SerializeToString(T value)
        {
            if (value == null)
            {
                return(null);
            }
            if (typeof(T) == typeof(string))
            {
                return(value as string);
            }
            if (typeof(T) == typeof(object) || typeof(T).IsAbstract || typeof(T).IsInterface)
            {
                if (typeof(T).IsAbstract || typeof(T).IsInterface)
                {
                    JsState.IsWritingDynamic = true;
                }
                var result = JsonSerializer.SerializeToString(value, value.GetType());
                if (typeof(T).IsAbstract || typeof(T).IsInterface)
                {
                    JsState.IsWritingDynamic = false;
                }
                return(result);
            }

            var writer = StringWriterManager.Allocate();

            JsonWriter <T> .WriteObject(writer, value);

            return(StringWriterManager.ReturnAndFree(writer));
        }
Example #13
0
        protected internal override void WriteJson(JsonWriter writer)
        {
            var props = UnescapedObject.With(
                "id", Id,
                "class", Class,
                "database", Database
                );

            writer.WriteObject("@ref", props);
        }
Example #14
0
        private void AddJsonProperties(JsonWriter writer, PropertyInfo[] properties, bool inArray)
        {
            writer.WriteObject();
            foreach (PropertyInfo property in properties)
            {
                if (IsValidProperty(property))
                {
                    string jsonPropertyType = GetPropertyTypeName(property.PropertyType, TDataExchangeFormat.Json);

                    if (!inArray)
                    {
                        writer.WriteMember(property.Name);
                        writer.WriteObject();
                    }

                    writer.WriteMember("type");
                    writer.WriteValue(jsonPropertyType);

                    if (jsonPropertyType.Equals("object") || jsonPropertyType.Equals("array"))
                    {
                        bool inArray2 = false;
                        if (jsonPropertyType.Equals("object"))
                        {
                            writer.WriteMember("properties");
                            inArray2 = false;
                        }
                        else
                        {
                            writer.WriteMember("items");
                            inArray2 = true;
                        }

                        AddJsonProperties(writer, property.PropertyType.GetProperties(), inArray2);
                    }
                    if (!inArray)
                    {
                        writer.WriteEndObject();
                    }
                }
            }
            writer.WriteEndObject();
        }
    /// <summary>
    /// 序列化战场
    /// </summary>
    /// <param name="jsonWriter"></param>
    public void Serialize(JsonWriter jsonWriter)
    {
        if (battleMap != null)
        {
            jsonWriter.WriteObject("battleMap", battleMap);
        }

        if (allBattleUnits != null)
        {
            jsonWriter.WriteList("battleUnits", allBattleUnits);
        }
    }
Example #16
0
        public void SerializeToWriter(T value, TextWriter writer)
        {
            if (value == null)
            {
                return;
            }
            if (typeof(T) == typeof(string))
            {
                writer.Write(value);
                return;
            }

            JsonWriter <T> .WriteObject(writer, value);
        }
Example #17
0
        public string SerializeToString(T value)
        {
            if (value == null)
            {
                return(null);
            }
            if (typeof(T) == typeof(string))
            {
                return(value as string);
            }

            var sb = new StringBuilder(4096);

            using (var writer = new StringWriter(sb))
            {
                JsonWriter <T> .WriteObject(writer, value);
            }
            return(sb.ToString());
        }
Example #18
0
        private string GenerateJsonSchema()
        {
            List <string> required = new List <string>();
            MemoryStream  stream   = new MemoryStream();
            JsonWriter    writer   = new JsonWriter(stream);

            writer.WriteObject();

            writer.WriteMember("$schema");
            writer.WriteValue("http://json-schema.org/draft-04/schema");

            writer.WriteMember("title");
            writer.WriteValue(Object.Name);

            writer.WriteMember("type");
            writer.WriteValue("object");

            writer.WriteMember("properties");

            AddJsonProperties(writer, Object.GetProperties(), false);

            if (required.Count > 0)
            {
                writer.WriteMember("required");
                writer.WriteArray();
                foreach (string requirement in required)
                {
                    writer.WriteValue(requirement);
                }
                writer.WriteEndArray();
            }

            writer.WriteEndObject();

            writer.Flush();
            stream.Position = 0;

            string unformattedJsonBody = new StreamReader(stream).ReadToEnd();
            object parsedJson          = JsonConvert.DeserializeObject(unformattedJsonBody);

            return(JsonConvert.SerializeObject(parsedJson, Newtonsoft.Json.Formatting.Indented));
        }
Example #19
0
 public void Serialise(JsonWriter writer)
 {
     writer.WriteObject();
     if (Links != null)
     {
         Links.Serialise(writer);
     }
     if (!string.IsNullOrEmpty(_Resource.InstanceID))
     {
         writer.WriteMember("InstanceID");
         writer.WriteValue(_Resource.InstanceID);
     }
     foreach (Model.PropertyDefinition propertyMetadata in ObjectDefinition.Properties)
     {
         Model.Property property = _Resource.GetProperty(propertyMetadata.PropertyID);
         if (property != null)
         {
             if (propertyMetadata.IsCollection)
             {
                 if ((property.Values != null) && (property.Values.Count > 0))
                 {
                     writer.WriteMember(propertyMetadata.SerialisationName);
                     writer.WriteArray();
                     foreach (Model.PropertyValue item in property.Values)
                     {
                         Serialise(writer, propertyMetadata.DataType, item);
                     }
                     writer.WriteEndArray();
                 }
             }
             else
             {
                 writer.WriteMember(propertyMetadata.SerialisationName);
                 Serialise(writer, propertyMetadata.DataType, property.Value);
             }
         }
     }
     writer.WriteEndObject();
 }
Example #20
0
        public string SerializeToString(T value)
        {
            if (value == null)
            {
                return(null);
            }
            if (typeof(T) == typeof(string))
            {
                return(value as string);
            }
            var info = typeof(T).GetTypeInfo();

            if (typeof(T) == typeof(object) || info.IsAbstract || info.IsInterface)
            {
                if (info.IsAbstract || info.IsInterface)
                {
                    JsState.IsWritingDynamic = true;
                }
                try
                {
                    return(JsonSerializer.SerializeToString(value, value.GetType()));
                }
                finally
                {
                    if (info.IsAbstract || info.IsInterface)
                    {
                        JsState.IsWritingDynamic = false;
                    }
                }
            }

            var sb = new StringBuilder();

            using (var writer = new StringWriter(sb))
            {
                JsonWriter <T> .WriteObject(writer, value);
            }
            return(sb.ToString());
        }
        public static string SerializeToString <T>(T value)
        {
            if (value == null)
            {
                return(null);
            }

            var sb = new StringBuilder(4096);

            using (var writer = new StringWriter(sb, CultureInfo.InvariantCulture))
            {
                if (typeof(T) == typeof(string))
                {
                    JsonUtils.WriteString(writer, value as string);
                }
                else
                {
                    JsonWriter <T> .WriteObject(writer, value);
                }
            }
            return(sb.ToString());
        }
Example #22
0
        private void ToJson(Stream stream)
        {
            JsonWriter writer = new JsonWriter(stream);

            writer.WriteObject();
            _Instances.Links.Serialise(writer);
            _Instances.PageInfo.Serialise(writer);

            writer.WriteMember("Items");
            writer.WriteArray();
            if (_Instances.Items != null)
            {
                foreach (ObjectInstance instance in _Instances.Items)
                {
                    instance.Serialise(writer);
                }
            }
            writer.WriteEndArray();
            writer.WriteEndObject();
            writer.Flush();

            stream.Position = 0;
        }
Example #23
0
        private void SaveBlockChain()
        {
            string blockChainFile = string.Format(BlockChainFile, _currentFile);

            if (File.Exists(blockChainFile))
            {
                File.Delete(blockChainFile);
            }
            FrmMainBlockChain blockChain = new FrmMainBlockChain
            {
                BlockChain = _nullCoin,
                Miner      = txtMinerName.Text,
            };
            string strBlockChain = JsonWriter.WriteObject(blockChain, indent: true);

            File.WriteAllText(blockChainFile, strBlockChain);

            string blockChainLock = string.Format(BlockChainLock, _currentFile);

            if (File.Exists(blockChainLock))
            {
                File.Delete(blockChainLock);
            }
        }
Example #24
0
        protected override void WriteJsonInternal(JsonWriter jw, string mode)
        {
            mode = mode ?? "";
            base.WriteJsonInternal(jw, mode);
            jw.WriteProperty("onform", OnForm, true);
            jw.WriteProperty("onquery", OnQuery, true);
            jw.WriteProperty("toolview", ToolView, true);
            if (!mode.Contains("noagents"))
            {
                jw.OpenProperty("agents");
                jw.OpenArray();
                foreach (var agentDefinition in Agents)
                {
                    jw.WriteObject(agentDefinition, mode);
                }

                jw.CloseArray();
                jw.CloseProperty();
            }
            if (!mode.Contains("noparams"))
            {
                jw.WriteProperty("parameters", Parameters.Select(_ => _.Value as object).ToArray());
            }
        }
Example #25
0
 public void Serialise(JsonWriter writer)
 {
     writer.WriteObject();
     if (Links != null)
     {
         Links.Serialise(writer);
     }
     if (!string.IsNullOrEmpty(_Resource.InstanceID))
     {
         writer.WriteMember("InstanceID");
         writer.WriteValue(_Resource.InstanceID);
     }
     foreach (Model.PropertyDefinition propertyMetadata in ObjectDefinition.Properties)
     {
         Model.Property property = _Resource.GetProperty(propertyMetadata.PropertyID);
         if (property != null)
         {
             if (propertyMetadata.IsCollection)
             {
                 if ((property.Values != null) && (property.Values.Count > 0))
                 {
                     writer.WriteMember(propertyMetadata.SerialisationName);
                     writer.WriteArray();
                     foreach (Model.PropertyValue item in property.Values)
                     {
                         Serialise(writer, propertyMetadata.DataType, item);
                     }
                     writer.WriteEndArray();
                 }
             }
             else
             {
                 writer.WriteMember(propertyMetadata.SerialisationName);
                 Serialise(writer, propertyMetadata.DataType, property.Value);
             }
         }
     }
     writer.WriteEndObject();
 }
        private void ToJson(Stream stream)
        {
            using (JsonWriter jsonWriter = new JsonWriter(stream))
            {
                jsonWriter.WriteObject();

                jsonWriter.WriteMember("Items");
                jsonWriter.WriteArray();

                jsonWriter.WriteObject();
                LinkExtensions.Serialise(GetLinks(), jsonWriter);

                jsonWriter.WriteMember("TimeTriggered");
                jsonWriter.WriteValue(_WebhookNotification.TimeTriggered);

                jsonWriter.WriteMember("SubscriptionType");
                jsonWriter.WriteValue(_WebhookNotification.SubscriptionType);

                if (_WebhookNotification.ObjectDefinition != null)
                {
                    jsonWriter.WriteMember("Value");
                    ObjectInstance instance = new ObjectInstance(_WebhookNotification.ObjectDefinition, _WebhookNotification.ChangedObject);
                    instance.Links = new List<Link>();
                    instance.Serialise(jsonWriter);
                }

                jsonWriter.WriteEndObject();

                jsonWriter.WriteEndArray();
                jsonWriter.WriteEndObject();
                jsonWriter.Flush();
            }
            stream.Position = 0;
        }
Example #27
0
        public void WriteAsJson(TextWriter output, string mode, ISerializationAnnotator annotator, bool pretty = false, int level = 0)
        {
            var jw = new JsonWriter(output, pretty: pretty, level: level);

            jw.OpenObject();
            if (0 != Meta.Count)
            {
                jw.WriteProperty("meta", Meta);
            }
            if (null == Parent && null != Collectors && 0 != Collectors.Length)
            {
                jw.WriteProperty("collectors", Collectors.OfType <ICollector>().Select(
                                     c => new
                {
                    key       = c.Key,
                    name      = c.Name ?? c.Key,
                    shortname = c.ShortName ?? c.Name ?? c.Key,
                    group     = c.Group,
                    condition = c.Condition
                }.jsonify()).ToArray());
            }
            if (null == Parent && null != Routs && 0 != Routs.Length)
            {
                jw.WriteProperty("routs", Routs.Select(
                                     c =>
                                     new
                {
                    key       = c.Key ?? "nokey",
                    name      = c.Name ?? c.Key,
                    shortname = c.ShortName ?? c.Name ?? c.Key,
                    level     = c.Level,
                    parent    = null == c.Parent ? "" : c.Parent.Key,
                }.jsonify()).ToArray());
            }
            jw.WriteProperty("id", Id);
            jw.WriteProperty("isbucket", IsBucket);
            if (null != RouteKey)
            {
                jw.WriteProperty("key", RouteKey.Key);
                jw.WriteProperty("name", RouteKey.Name);
                jw.WriteProperty("sortkey", RouteKey.SortKey);
                jw.WriteProperty("comment", RouteKey.Comment);
            }
            jw.OpenProperty("values");
            jw.OpenArray();
            foreach (var value in Values)
            {
                jw.WriteObject(new { key = value.Key, value = value.Value });
            }
            jw.CloseArray();
            jw.CloseProperty();


            if (null != _children && 0 != _children.Count)
            {
                jw.OpenProperty("aggs");
                jw.OpenArray();
                foreach (var node in Children)
                {
                    jw.WriteObject(node.Value);
                }
                jw.CloseArray();
                jw.CloseProperty();
            }
            jw.CloseObject();
        }
Example #28
0
 private string GetData()
 {
     return(JsonWriter.WriteObject(Transactions));
 }
Example #29
0
        public void WriteAsJson(TextWriter output, string mode, ISerializationAnnotator annotator, bool pretty = false, int level = 0)
        {
            var writer = new JsonWriter(output, pretty: pretty, level: level);

            writer.OpenObject();
            writer.WriteProperty("total", Total, true);
            writer.WriteProperty("offset", OffSet, true);
            writer.WriteProperty("size", Size, true);
            writer.WriteProperty("count", Count, true);

            writer.WriteProperty("page", Page, true);
            writer.WriteProperty("pagecount", PageCount, true);
            writer.WriteProperty("islastpage", IsLastPage, true);

            writer.WriteProperty("nochange", NoChange, true);
            writer.WriteProperty("hash", Hash, true);
            writer.WriteProperty("timestamp", Timestamp, true);
            writer.WriteProperty("status", Status, true);

            writer.WriteProperty("ok", Ok);
            writer.WriteProperty("message", Message, true);
            if (null != Error)
            {
                writer.OpenProperty("error");
                writer.OpenObject();
                writer.WriteProperty("type", Error.GetType().Name);
                writer.WriteProperty("message", Error.Message);
                writer.WriteProperty("stack", Error.StackTrace);
                writer.CloseObject();
                writer.CloseProperty();
            }

            if (null != DebugInfo && 0 != DebugInfo.Count)
            {
                writer.WriteProperty("debug", DebugInfo);
            }
            if (null != Custom && 0 != Custom.Count)
            {
                writer.WriteProperty("custom", Custom);
            }

            var mainitems = GetMainItems();

            if (null != mainitems)
            {
                writer.OpenProperty("items");
                writer.OpenArray();
                foreach (var item in mainitems)
                {
                    writer.WriteObject(item, mode);
                }
                writer.CloseArray();
                writer.CloseProperty();
                var native = GetNative();
                if (null != native)
                {
                    writer.OpenProperty("native");
                    writer.OpenArray();
                    foreach (var item in native)
                    {
                        writer.WriteObject(item, mode);
                    }
                    writer.CloseArray();
                    writer.CloseProperty();
                }
            }
            writer.CloseObject();
        }
Example #30
0
 protected internal override void WriteJson(JsonWriter writer)
 {
     writer.WriteObject("@bytes", ToUrlSafeBase64(Value));
 }
Example #31
0
 protected internal override void WriteJson(JsonWriter writer) =>
 writer.WriteObject(Values);
Example #32
0
 protected internal override void WriteJson(JsonWriter writer)
 {
     writer.WriteObject("@date", Value.ToIso(DateFormat));
 }