Beispiel #1
0
        private static void GetEncodings(IntPtr info)
        {
            NSJSFunctionCallbackInfo arguments = NSJSFunctionCallbackInfo.From(info);
            var encodings = ENCODING.GetEncodings();

            arguments.SetReturnValue(ArrayAuxiliary.ToArray(arguments.VirtualMachine, encodings));
        }
Beispiel #2
0
        /// <summary>
        /// convert the bytes from ebcdic to ascii. in the case of an unprintable ascii
        /// char, insert the hex value of the ebcdic byte in the output text.
        /// Method is intended for viewing the text value of a byte stream.
        /// </summary>
        /// <param name="Bytes"></param>
        /// <returns></returns>
        public static string EbcdicBytesToPrintableAscii(this byte[] Bytes)
        {
            var sb = new StringBuilder();

            global::System.Text.Encoding encoding =
                global::System.Text.Encoding.GetEncoding(37);
            var text = encoding.GetString(Bytes);

            for (int ix = 0; ix < text.Length; ++ix)
            {
                var ch1 = text[ix];
                if (ch1.IsPrintable())
                {
                    sb.Append(ch1);
                }
                else
                {
                    var b1 = Bytes[ix];
                    var s1 = '/' + b1.ToHex() + ' ';
                    sb.SpaceSeparatorAppend(s1);
                }
            }

            return(sb.ToString());
        }
Beispiel #3
0
 public static NSJSObject New(NSJSVirtualMachine machine, ENCODING encoding)
 {
     lock (g_Locker)
     {
         if (machine == null || encoding == null)
         {
             return(null);
         }
         IDictionary <IntPtr, NSJSObject> dVirtualTables;
         if (!g_EncodingInstanceTable.TryGetValue(encoding.CodePage, out dVirtualTables))
         {
             dVirtualTables = new Dictionary <IntPtr, NSJSObject>();
             g_EncodingInstanceTable.Add(encoding.CodePage, dVirtualTables);
         }
         NSJSObject o;
         if (dVirtualTables.TryGetValue(machine.Isolate, out o))
         {
             return(o);
         }
         if (!g_UninitializedEncoding)
         {
             g_UninitializedEncoding = true;
             g_GetBytesProc          = NSJSPinnedCollection.Pinned <NSJSFunctionCallback>(GetBytes);
             g_GetStringProc         = NSJSPinnedCollection.Pinned <NSJSFunctionCallback>(GetString);
         }
         o = NSJSObject.New(machine);
         o.CrossThreading = true;
         o.Set("GetBytes", g_GetBytesProc);
         o.Set("GetString", g_GetStringProc);
         dVirtualTables.Add(machine.Isolate, o);
         NSJSKeyValueCollection.Set(o, encoding);
         return(o);
     }
 }
Beispiel #4
0
 internal void method_12(string string_0, global::System.IO.MemoryStream memoryStream_0)
 {
     global::System.Text.Encoding utf = global::System.Text.Encoding.UTF8;
     byte[] bytes = utf.GetBytes(string_0);
     this.method_9((short)bytes.Length, memoryStream_0);
     memoryStream_0.Write(bytes, 0, bytes.Length);
 }
Beispiel #5
0
        private static void GetBytes(IntPtr info)
        {
            NSJSFunctionCallbackInfo arguments = NSJSFunctionCallbackInfo.From(info);
            ENCODING encoding = GetEncoding(arguments.This);

            if (encoding == null)
            {
                Throwable.ObjectDisposedException(arguments.VirtualMachine);
            }
            else
            {
                byte[] buffer = null;
                if (arguments.Length > 0)
                {
                    NSJSString s = arguments[0] as NSJSString;
                    if (s != null)
                    {
                        buffer = encoding.GetBytes(s.Value);
                    }
                }
                if (buffer == null)
                {
                    buffer = BufferExtension.EmptryBuffer;
                }
                arguments.SetReturnValue(buffer);
            }
        }
Beispiel #6
0
        /// <summary>
        /// convert the ebcdic encoded input bytes to a unicode string.
        /// </summary>
        /// <param name="Bytes"></param>
        /// <returns></returns>
        public static string FromEbcdic(this byte[] Bytes)
        {
            global::System.Text.Encoding encoding =
                global::System.Text.Encoding.GetEncoding(37); // 37 = ebcdic
            var chars = encoding.GetChars(Bytes);

            return(new string(chars));
        }
Beispiel #7
0
        public static string EbcdicBytesToString(this byte[] Bytes)
        {
            global::System.Text.Encoding encoding =
                global::System.Text.Encoding.GetEncoding(37);
            var chars = encoding.GetChars(Bytes);

            return(new string(chars));
        }
Beispiel #8
0
        private static void GetString(IntPtr info)
        {
            NSJSFunctionCallbackInfo arguments = NSJSFunctionCallbackInfo.From(info);
            ENCODING encoding = NSJSKeyValueCollection.Get <ENCODING>(arguments.This);

            if (encoding == null)
            {
                Throwable.ObjectDisposedException(arguments.VirtualMachine);
            }
            else
            {
                string s = null;
                if (arguments.Length > 0)
                {
                    NSJSUInt8Array chars = arguments[0] as NSJSUInt8Array;
                    if (chars != null)
                    {
                        byte[] buffer = chars.Buffer;
                        if (buffer != null)
                        {
                            NSJSInt32 index = null;
                            NSJSInt32 len   = null;
                            switch (arguments.Length)
                            {
                            case 2:
                                len = arguments[1] as NSJSInt32;
                                break;

                            case 3:
                                index = arguments[1] as NSJSInt32;
                                len   = arguments[2] as NSJSInt32;
                                break;
                            }
                            int ofs   = index != null ? index.Value : 0;
                            int count = len != null ? len.Value : buffer.Length;
                            if (count < 0)
                            {
                                count = 0;
                            }
                            if (ofs < 0)
                            {
                                ofs = 0;
                            }
                            s = encoding.GetString(buffer, ofs, count);
                        }
                    }
                }
                if (s != null)
                {
                    arguments.SetReturnValue(s);
                }
                else
                {
                    arguments.SetReturnValue(NSJSValue.Undefined(arguments.VirtualMachine));
                }
            }
        }
Beispiel #9
0
        public T FromString(string xml, global::System.Text.Encoding encoding)
        {
            MemoryStream ms = new MemoryStream();

            byte[] buffer = encoding.GetBytes(xml);
            ms.Write(buffer, 0, buffer.Length);
            ms.Position = 0;

            return(Deserialize(ms));
        }
Beispiel #10
0
    internal string method_7(global::System.IO.Stream stream_0)
    {
        ushort num = this.method_3(stream_0);

        byte[] array = new byte[(int)num];
        for (int i = 0; i < (int)num; i++)
        {
            byte b = (byte)stream_0.ReadByte();
            array[i] = b;
        }
        global::System.Text.Encoding utf = global::System.Text.Encoding.UTF8;
        return(utf.GetString(array));
    }
Beispiel #11
0
        private string method_0(global::System.IO.MemoryStream memoryStream_0)
        {
            byte[] array = new byte[2];
            memoryStream_0.Read(array, 0, 2);
            if (global::System.BitConverter.IsLittleEndian)
            {
                global::System.Array.Reverse(array);
            }
            short num = global::System.BitConverter.ToInt16(array, 0);

            byte[] array2 = new byte[(int)num];
            memoryStream_0.Read(array2, 0, (int)num);
            global::System.Text.Encoding utf = global::System.Text.Encoding.UTF8;
            return(utf.GetString(array2));
        }
Beispiel #12
0
        private static void GetEncoding(IntPtr info)
        {
            NSJSFunctionCallbackInfo arguments = NSJSFunctionCallbackInfo.From(info);
            NSJSValue result = null;

            if (arguments.Length > 0)
            {
                NSJSInt32 codepage = arguments[0] as NSJSInt32;
                try
                {
                    if (codepage != null)
                    {
                        result = New(arguments.VirtualMachine, ENCODING.GetEncoding(codepage.Value));
                    }
                    NSJSString name = arguments[0] as NSJSString;
                    if (name != null)
                    {
                        result = New(arguments.VirtualMachine, ENCODING.GetEncoding(name.Value));
                    }
                }
                catch (Exception) { }
            }
            arguments.SetReturnValue(NSJSValue.UndefinedMerge(arguments.VirtualMachine, result));
        }
Beispiel #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:LFNet.Common.IO.StringEncodedWriter" /> class.
 /// </summary>
 /// <param name="encoding">The <see cref="T:System.Text.Encoding" /> in which the output is written.</param>
 /// <param name="sb">The StringBuilder to write to.</param>
 public StringEncodedWriter(global::System.Text.Encoding encoding, StringBuilder sb) : this(encoding, sb, CultureInfo.CurrentCulture)
 {
 }
Beispiel #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:LFNet.Common.IO.StringEncodedWriter" /> class.
 /// </summary>
 /// <param name="encoding">The <see cref="T:System.Text.Encoding" /> in which the output is written.</param>
 /// <param name="formatProvider">An <see cref="T:System.IFormatProvider" /> object that controls formatting.</param>
 public StringEncodedWriter(global::System.Text.Encoding encoding, IFormatProvider formatProvider) : this(encoding, new StringBuilder(), formatProvider)
 {
 }
 internal static object CreatePrivate(global::System.IO.Stream requestStream, global::System.Security.Cryptography.HashAlgorithm hashAlgorithm, long contentLength, global::System.Text.Encoding encoding, string multipartBoundary, global::Memba.FileUpload.UploadData uploadData)
 {
     object[] args = new object[] {
         requestStream,
         hashAlgorithm,
         contentLength,
         encoding,
         multipartBoundary,
         uploadData
     };
     Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject priv_obj = new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject("Memba.FileUpload.XP", "Memba.FileUpload.RequestFilter", new System.Type[] {
         typeof(global::System.IO.Stream),
         typeof(global::System.Security.Cryptography.HashAlgorithm),
         typeof(long),
         typeof(global::System.Text.Encoding),
         typeof(string),
         typeof(global::Memba.FileUpload.UploadData)
     }, args);
     return(priv_obj.Target);
 }
        private global::System.IO.MemoryStream InternalSaveDiagram(DslModeling::SerializationResult serializationResult, DslDiagrams::Diagram diagram, string diagramFileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
        {
            #region Check Parameters
            global::System.Diagnostics.Debug.Assert(serializationResult != null);
            global::System.Diagnostics.Debug.Assert(diagram != null);
            global::System.Diagnostics.Debug.Assert(!serializationResult.Failed);
            #endregion

            global::System.IO.MemoryStream newFileContent = new global::System.IO.MemoryStream();
            var directory = this.GetDirectory(diagram.Store);
            DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, diagramFileName, serializationResult);
            this.InitializeSerializationContext(diagram.Partition, serializationContext, false);
            // MonikerResolver shouldn't be required in Save operation, so not calling SetupMonikerResolver() here.
            serializationContext.WriteOptionalPropertiesWithDefaultValue = writeOptionalPropertiesWithDefaultValue;
            global::System.Xml.XmlWriterSettings settings = EFModelSerializationHelper.Instance.CreateXmlWriterSettings(serializationContext, true, encoding);
            var diagramSerializer = GetSerializer(diagram);

            using (global::System.Xml.XmlWriter writer = global::System.Xml.XmlWriter.Create(newFileContent, settings))
            {
                //this.WriteRootElement(serializationContext, diagram, writer);
                // Carry out the normal serialization.
                this.WriteRootElement(serializationContext, diagramSerializer, diagram, writer);
            }

            return(newFileContent);
        }
        internal virtual void SaveDiagrams(DslModeling::SerializationResult serializationResult, DslDiagrams::Diagram[] diagrams, string diagramsFileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
        {
            #region Check Parameters
            if (serializationResult == null)
            {
                throw new global::System.ArgumentNullException("serializationResult");
            }
            if (diagrams == null)
            {
                throw new global::System.ArgumentNullException("diagrams");
            }
            if (string.IsNullOrEmpty(diagramsFileName))
            {
                throw new global::System.ArgumentNullException("diagramsFileName");
            }
            #endregion

            if (serializationResult.Failed)
            {
                return;
            }

            var memoryStreamDictionary = new Dictionary <global::System.IO.MemoryStream, string>();
            foreach (var diagram in diagrams)
            {
                // HACK : Add validation rule on Diagram Name (!string.IsNullOrEmpty && Unique )
                if (string.IsNullOrEmpty(diagram.Name))
                {
                    throw new ArgumentException("Each diagram must have a name", "diagrams");
                }
                memoryStreamDictionary.Add(this.InternalSaveDiagram(serializationResult, diagram, diagramsFileName, encoding, writeOptionalPropertiesWithDefaultValue), diagram.Name);
                if (serializationResult.Failed)
                {
                    memoryStreamDictionary.Keys.ToList <global::System.IO.MemoryStream>().ForEach(memoryStream => memoryStream.Close());
                    return;
                }
            }
            WriteDiagramFile(diagramsFileName, memoryStreamDictionary);
        }
Beispiel #18
0
        /// <summary>
        /// Creates and returns the settings used when writing a file.
        /// </summary>
        /// <param name="serializationContext">The current serialization context instance.</param>
        /// <param name="isDiagram">Indicates whether a diagram or model file is currently being serialized.</param>
        /// <param name="encoding">The encoding to use when writing the file.</param>
        internal virtual global::System.Xml.XmlWriterSettings CreateXmlWriterSettings(DslModeling::SerializationContext serializationContext, bool isDiagram, global::System.Text.Encoding encoding)
        {
            global::System.Xml.XmlWriterSettings settings = new global::System.Xml.XmlWriterSettings();
            settings.Indent   = true;
            settings.Encoding = encoding;

            return(settings);
        }
Beispiel #19
0
 void IFile.WriteAllText(string path, string contents, global::System.Text.Encoding encoding)
 {
     throw new NotImplementedException();
 }
Beispiel #20
0
 string IFile.ReadAllText(string path, global::System.Text.Encoding encoding)
 {
     throw new NotImplementedException();
 }
        public override void SaveModel(DslModeling::SerializationResult serializationResult, MetaModel modelRoot, string fileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
        {
            base.SaveModel(serializationResult, modelRoot, fileName, encoding, writeOptionalPropertiesWithDefaultValue);

            System.IO.FileInfo info = new System.IO.FileInfo(fileName);
            string fileNameDiagram = info.DirectoryName + "\\" + info.Name.Remove(info.Name.Length - info.Extension.Length, info.Extension.Length) + DiagramExtension;

            // save view information
            using (global::System.IO.MemoryStream newFileContent = new global::System.IO.MemoryStream())
            {
                DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(modelRoot.Store);

                DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, fileName, serializationResult);
                this.InitializeSerializationContext(modelRoot.Partition, serializationContext, false);
                // MonikerResolver shouldn't be required in Save operation, so not calling SetupMonikerResolver() here.
                serializationContext.WriteOptionalPropertiesWithDefaultValue = writeOptionalPropertiesWithDefaultValue;
                global::System.Xml.XmlWriterSettings settings = LanguageDSLSerializationHelper.Instance.CreateXmlWriterSettings(serializationContext, false, encoding);
                using (global::System.Xml.XmlWriter writer = global::System.Xml.XmlWriter.Create(newFileContent, settings))
                {
                    ViewSerializer serializer = directory.GetSerializer(View.DomainClassId) as ViewSerializer;
                    serializer.Write(serializationContext, modelRoot.View, writer);
                }

                if (!serializationResult.Failed && newFileContent != null)
                {	// Only write the content if there's no error encountered during serialization.
                    using (global::System.IO.FileStream fileStream = new global::System.IO.FileStream(fileNameDiagram, global::System.IO.FileMode.Create, global::System.IO.FileAccess.Write, global::System.IO.FileShare.None))
                    {
                        using (global::System.IO.BinaryWriter writer = new global::System.IO.BinaryWriter(fileStream, encoding))
                        {
                            writer.Write(newFileContent.ToArray());
                        }
                    }
                }
            }
        }
Beispiel #22
0
        private MemoryStream InternalSaveModel2(DslModeling::SerializationResult serializationResult, PatternModelSchema modelRoot, string fileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
        {
            #region Check Parameters
            global::System.Diagnostics.Debug.Assert(serializationResult != null);
            global::System.Diagnostics.Debug.Assert(modelRoot != null);
            global::System.Diagnostics.Debug.Assert(!serializationResult.Failed);
            #endregion

            serializationResult.Encoding = encoding;

            DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(modelRoot.Store);


            global::System.IO.MemoryStream newFileContent = new global::System.IO.MemoryStream();

            DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, fileName, serializationResult);
            this.InitializeSerializationContext(modelRoot.Partition, serializationContext, false);
            // MonikerResolver shouldn't be required in Save operation, so not calling SetupMonikerResolver() here.
            serializationContext.WriteOptionalPropertiesWithDefaultValue = writeOptionalPropertiesWithDefaultValue;
            global::System.Xml.XmlWriterSettings settings = PatternModelSerializationHelper.Instance.CreateXmlWriterSettings(serializationContext, false, encoding);
            using (global::System.Xml.XmlWriter writer = global::System.Xml.XmlWriter.Create(newFileContent, settings))
            {
                this.WriteRootElement(serializationContext, modelRoot, writer);
            }

            return(newFileContent);
        }
Beispiel #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:LFNet.Common.IO.StringEncodedWriter" /> class.
 /// </summary>
 /// <param name="encoding">The <see cref="T:System.Text.Encoding" /> in which the output is written.</param>
 /// <param name="sb">The StringBuilder to write to.</param>
 /// <param name="formatProvider">An <see cref="T:System.IFormatProvider" /> object that controls formatting.</param>
 public StringEncodedWriter(global::System.Text.Encoding encoding, StringBuilder sb, IFormatProvider formatProvider) : base(sb, formatProvider)
 {
     this._encoding = encoding;
 }
        public virtual void SaveModelAndDiagrams(DslModeling::SerializationResult serializationResult, ModelRoot modelRoot, string modelFileName, DslDiagrams::Diagram[] diagrams, string diagramsFileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
        {
            #region Check Parameters
            if (serializationResult == null)
            {
                throw new global::System.ArgumentNullException("serializationResult");
            }
            if (string.IsNullOrEmpty(modelFileName))
            {
                throw new global::System.ArgumentNullException("modelFileName");
            }
            if (diagrams == null)
            {
                throw new global::System.ArgumentNullException("diagrams");
            }
            if (string.IsNullOrEmpty(diagramsFileName))
            {
                throw new global::System.ArgumentNullException("diagramsFileName");
            }
            #endregion

            if (serializationResult.Failed)
            {
                return;
            }

            // Save the model file first
            var modelFileContent = this.InternalSaveModel(serializationResult, modelRoot, modelFileName, encoding, writeOptionalPropertiesWithDefaultValue);
            if (serializationResult.Failed)
            {
                modelFileContent.Close();
                return;
            }

            var memoryStreamDictionary = new Dictionary <global::System.IO.MemoryStream, string>();
            foreach (var diagram in diagrams)
            {
                if (string.IsNullOrEmpty(diagram.Name))
                {
                    throw new ArgumentException("Each diagram must have a name", "diagrams");
                }
                memoryStreamDictionary.Add(this.InternalSaveDiagram(serializationResult, diagram, diagramsFileName, encoding, writeOptionalPropertiesWithDefaultValue), diagram.Name);
                if (serializationResult.Failed)
                {
                    modelFileContent.Close();
                    memoryStreamDictionary.Keys.ToList <global::System.IO.MemoryStream>().ForEach(memoryStream => memoryStream.Close());
                    return;
                }
            }

            // Only write the contents if there's no error encountered during serialization.
            if (modelFileContent != null)
            {
                using (global::System.IO.FileStream fileStream = new global::System.IO.FileStream(modelFileName, global::System.IO.FileMode.Create, global::System.IO.FileAccess.Write, global::System.IO.FileShare.None))
                {
                    using (global::System.IO.BinaryWriter writer = new global::System.IO.BinaryWriter(fileStream, encoding))
                    {
                        writer.Write(modelFileContent.ToArray());
                    }
                }
            }

            WriteDiagramFile(diagramsFileName, memoryStreamDictionary);
        }
Beispiel #25
0
 /// <summary>
 /// 結合したデータを変換して文字列として返す
 /// </summary>
 /// <example>
 /// string s = builder.Convert(Encoding.GetEncoding("Shift_JIS"));
 /// </example>
 /// <param name="CodePage"></param>
 /// <returns></returns>
 public string Convert(global::System.Text.Encoding codePage)
 {
     return(codePage.GetString(ListHelper <byte> .ConvertToArray(data)));
 }
        /// <summary>
        /// Saves the diagram.
        /// </summary>
        /// <typeparam name="TModel">The type of the model.</typeparam>
        /// <param name="serializationResult">The serialization result.</param>
        /// <param name="modelRoot">The model root.</param>
        /// <param name="modelFileName">Name of the model file.</param>
        /// <param name="diagram">The diagram.</param>
        /// <param name="diagramFileName">Name of the diagram file.</param>
        /// <param name="encoding">The encoding.</param>
        /// <param name="writeOptionalPropertiesWithDefaultValue">if set to <c>true</c> [write optional properties with default value].</param>
        public void SaveDiagram <TModel>(DslModeling::SerializationResult serializationResult, TModel modelRoot, string modelFileName, ComponentModelDiagram diagram, string diagramFileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
            where TModel : ModelElement
        {
            if (serializationResult.Failed)
            {
                return;
            }

            // MonikerResolver shouldn't be required in Save operation, so not calling SetupMonikerResolver() here.

            using (global::System.IO.MemoryStream diagramFileContent = new global::System.IO.MemoryStream())
            {
                DslModeling::DomainClassXmlSerializer diagramSerializer = this.Directory.GetSerializer(diagram.GetDomainClass().Id);
                global::System.Diagnostics.Debug.Assert(diagramSerializer != null, "Cannot find serializer for " + diagram.GetDomainClass().Name + "!");
                if (diagramSerializer != null)
                {
                    DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(this.Directory, diagramFileName, serializationResult);
                    serializationContext.WriteOptionalPropertiesWithDefaultValue = writeOptionalPropertiesWithDefaultValue;
                    global::System.Xml.XmlWriterSettings settings = new global::System.Xml.XmlWriterSettings();
                    settings.Indent   = true;
                    settings.Encoding = encoding;
                    using (global::System.IO.StreamWriter streamWriter = new global::System.IO.StreamWriter(diagramFileContent, encoding))
                    {
                        using (global::System.Xml.XmlWriter writer = global::System.Xml.XmlWriter.Create(streamWriter, settings))
                        {
                            diagramSerializer.WriteRootElement(serializationContext, diagram, writer);
                        }
                    }
                }
                if (!serializationResult.Failed)
                {       // Only write the contents if there's no error encountered during serialization.
                    if (diagramFileContent != null)
                    {
                        IVsQueryEditQuerySave2 scc = ServiceLocator.Instance.GetService <IVsQueryEditQuerySave2>(typeof(SVsQueryEditQuerySave));
                        if (scc != null)
                        {
                            uint result;
                            if (scc.QuerySaveFile(diagramFileName, 0, null, out result) != (int)tagVSQuerySaveResult.QSR_SaveOK)
                            {
                                return;
                            }
                        }
                        using (global::System.IO.FileStream fileStream = new global::System.IO.FileStream(diagramFileName, global::System.IO.FileMode.Create, global::System.IO.FileAccess.Write, global::System.IO.FileShare.None))
                        {
                            using (global::System.IO.BinaryWriter writer = new global::System.IO.BinaryWriter(fileStream, encoding))
                            {
                                writer.Write(diagramFileContent.ToArray());
                            }
                        }
                    }
                }
            }
        }