private static void WriteSqlQuery(IEnumerable <SqlQuery> sqlQueries, IAssociativeXmlObject parentAssociativeXmlObject, Type connectionType, string connectionString, bool getSchemaOnly)
        {
            ArrayConstruct    arrayConstruct;
            ObjectConstruct   objectConstruct;
            PropertyConstruct propertyConstructA, propertyConstructB;
            Tokenizer         tokenizer;

            IEnumerable <IDictionary <string, object> > records;
            string commandText_;
            int    count = 0;

            if ((object)sqlQueries == null)
            {
                throw new ArgumentNullException(nameof(sqlQueries));
            }

            if ((object)parentAssociativeXmlObject == null)
            {
                throw new ArgumentNullException(nameof(parentAssociativeXmlObject));
            }

            if ((object)connectionType == null)
            {
                throw new ArgumentNullException(nameof(connectionType));
            }

            if ((object)connectionString == null)
            {
                throw new ArgumentNullException(nameof(connectionString));
            }

            if (SolderFascadeAccessor.DataTypeFascade.IsWhiteSpace(connectionString))
            {
                throw new ArgumentOutOfRangeException(nameof(connectionString));
            }

            tokenizer = new Tokenizer(true);

            foreach (SqlQuery sqlQuery in sqlQueries.OrderBy(c => c.Key).ThenBy(c => c.Order))
            {
                arrayConstruct      = new ArrayConstruct();
                arrayConstruct.Name = sqlQuery.Key;
                parentAssociativeXmlObject.Items.Add(arrayConstruct);

                commandText_ = tokenizer.ExpandTokens(sqlQuery.Text, new DynamicWildcardTokenReplacementStrategy(new object[] { parentAssociativeXmlObject }));

                // one hell of a polyfill ;)
                Func <CommandType, string, IEnumerable <DbParameter>, Action <long>, IEnumerable <__Record> > executeRecordsCallback =
                    (CommandType commandType, string commandText, IEnumerable <DbParameter> dbParameters, Action <long> resultCallback) =>
                {
                    const bool           _schemaOnly       = false;
                    Type                 _connectionType   = connectionType;
                    string               _connectionString = connectionString;
                    const bool           _transactional    = false;
                    const IsolationLevel _isolationLevel   = IsolationLevel.Unspecified;

                    return(SolderFascadeAccessor.AdoNetBufferingFascade.ExecuteRecords(_schemaOnly, _connectionType, _connectionString, _transactional, _isolationLevel, commandType, commandText, dbParameters, resultCallback));
                };

                Func <CommandType, string, IEnumerable <DbParameter>, Action <long>, IEnumerable <__Record> > executeSchemaRecordsCallback =
                    (CommandType commandType, string commandText, IEnumerable <DbParameter> dbParameters, Action <long> resultCallback) =>
                {
                    const bool           _schemaOnly       = true;
                    Type                 _connectionType   = connectionType;
                    string               _connectionString = connectionString;
                    const bool           _transactional    = false;
                    const IsolationLevel _isolationLevel   = IsolationLevel.Unspecified;

                    return(SolderFascadeAccessor.AdoNetBufferingFascade.ExecuteRecords(_schemaOnly, _connectionType, _connectionString, _transactional, _isolationLevel, commandType, commandText, dbParameters, resultCallback));
                };

                Func <string, ParameterDirection, DbType, int, byte, byte, bool, string, object, DbParameter> createParameterCallback =
                    (string sourceColumn, ParameterDirection parameterDirection, DbType parameterDbType, int parameterSize, byte parameterPrecision, byte parameterScale, bool parameterNullable, string parameterName, object parameterValue) =>
                {
                    Type _connectionType = connectionType;

                    return(SolderFascadeAccessor.AdoNetBufferingFascade.CreateParameter(_connectionType, sourceColumn, parameterDirection, parameterDbType, parameterSize, parameterPrecision, parameterScale, parameterNullable, parameterName, parameterValue));
                };

                var unitOfWork = new
                {
                    ExecuteRecords       = executeRecordsCallback,
                    ExecuteSchemaRecords = executeSchemaRecordsCallback,
                    CreateParameter      = createParameterCallback
                };

                // using (null)
                {
                    if (getSchemaOnly)
                    {
                        records = unitOfWork.ExecuteRecords(sqlQuery.Type, commandText_, new DbParameter[] { }, null);
                    }
                    else
                    {
                        records = unitOfWork.ExecuteSchemaRecords(sqlQuery.Type, commandText_, new DbParameter[] { }, null);
                    }

                    records = records.ToArray();                     // force eager load
                }

                propertyConstructA      = new PropertyConstruct();
                propertyConstructA.Name = "RowCount";
                arrayConstruct.Items.Add(propertyConstructA);

                if ((object)records != null)
                {
                    foreach (IDictionary <string, object> record in records)
                    {
                        objectConstruct = new ObjectConstruct();
                        arrayConstruct.Items.Add(objectConstruct);

                        if ((object)record != null)
                        {
                            foreach (KeyValuePair <string, object> keyValuePair in record)
                            {
                                propertyConstructB          = new PropertyConstruct();
                                propertyConstructB.Name     = keyValuePair.Key;
                                propertyConstructB.RawValue = keyValuePair.Value;

                                objectConstruct.Items.Add(propertyConstructB);
                            }
                        }

                        // correlated
                        WriteSqlQuery(sqlQuery.SubQueries, objectConstruct, connectionType, connectionString, getSchemaOnly);

                        count++;
                    }

                    propertyConstructA.RawValue = count;
                }
            }
        }
        protected override object CoreGetSourceObject(string sourceFilePath, IDictionary <string, IList <string> > properties)
        {
            const string      PROP_TOKEN_RECURSIVE = "Recursive";
            const string      PROP_TOKEN_WILDCARD  = "Wildcard";
            ObjectConstruct   objectConstruct00;
            PropertyConstruct propertyConstruct00;
            IList <string>    values;
            bool   recursive = false;
            string recursiveStr;
            string wildcard;

            if ((object)sourceFilePath == null)
            {
                throw new ArgumentNullException(nameof(sourceFilePath));
            }

            if ((object)properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            if (SolderFascadeAccessor.DataTypeFascade.IsWhiteSpace(sourceFilePath))
            {
                throw new ArgumentOutOfRangeException(nameof(sourceFilePath));
            }

            sourceFilePath = Path.GetFullPath(sourceFilePath);

            recursiveStr = null;
            if (properties.TryGetValue(PROP_TOKEN_RECURSIVE, out values))
            {
                if ((object)values != null && values.Count == 1)
                {
                    recursiveStr = values[0];
                    if (!SolderFascadeAccessor.DataTypeFascade.TryParse <bool>(recursiveStr, out recursive))
                    {
                        // do nothing
                    }
                }
            }

            wildcard = null;
            if (properties.TryGetValue(PROP_TOKEN_WILDCARD, out values))
            {
                if ((object)values != null && values.Count == 1)
                {
                    wildcard = values[0];
                }
            }

            objectConstruct00 = new ObjectConstruct();

            propertyConstruct00          = new PropertyConstruct();
            propertyConstruct00.Name     = "SourceFullPath";
            propertyConstruct00.RawValue = sourceFilePath;
            objectConstruct00.Items.Add(propertyConstruct00);

            propertyConstruct00          = new PropertyConstruct();
            propertyConstruct00.Name     = "Recursive";
            propertyConstruct00.RawValue = recursive;
            objectConstruct00.Items.Add(propertyConstruct00);

            propertyConstruct00          = new PropertyConstruct();
            propertyConstruct00.Name     = "Wildcard";
            propertyConstruct00.RawValue = wildcard;
            objectConstruct00.Items.Add(propertyConstruct00);

            EnumerateFileSystem(sourceFilePath, recursive, wildcard, objectConstruct00, sourceFilePath);

            return(objectConstruct00);
        }
Ejemplo n.º 3
0
        private static void EnumSchema(IAssociativeXmlObject parentAssociativeXmlObject, XmlSchemaObjectCollection currentXmlSchemaObjectCollection)
        {
            XmlSchemaElement     xmlSchemaElement;
            XmlSchemaComplexType xmlSchemaComplexType;
            XmlSchemaSequence    xmlSchemaSequence;
            XmlSchemaSimpleType  xmlSchemaSimpleType;
            ArrayConstruct       arrayConstruct00, arrayConstruct01;
            ObjectConstruct      objectConstruct00, objectConstruct01;
            PropertyConstruct    propertyConstruct00, propertyConstruct01;

            if ((object)parentAssociativeXmlObject == null)
            {
                throw new ArgumentNullException(nameof(parentAssociativeXmlObject));
            }

            if ((object)currentXmlSchemaObjectCollection == null)
            {
                throw new ArgumentNullException(nameof(currentXmlSchemaObjectCollection));
            }

            arrayConstruct00      = new ArrayConstruct();
            arrayConstruct00.Name = "XmlSchemaElements";
            parentAssociativeXmlObject.Items.Add(arrayConstruct00);

            foreach (XmlSchemaObject xmlSchemaObject in currentXmlSchemaObjectCollection)
            {
                objectConstruct00 = new ObjectConstruct();
                arrayConstruct00.Items.Add(objectConstruct00);

                xmlSchemaElement = xmlSchemaObject as XmlSchemaElement;

                if ((object)xmlSchemaElement != null)
                {
                    if (SolderFascadeAccessor.DataTypeFascade.IsNullOrWhiteSpace(xmlSchemaElement.Name) &&
                        !SolderFascadeAccessor.DataTypeFascade.IsNullOrWhiteSpace(xmlSchemaElement.RefName.Name))
                    {
                        propertyConstruct00          = new PropertyConstruct();
                        propertyConstruct00.Name     = "XmlSchemaElementIsRef";
                        propertyConstruct00.RawValue = true;
                        objectConstruct00.Items.Add(propertyConstruct00);

                        propertyConstruct00          = new PropertyConstruct();
                        propertyConstruct00.Name     = "XmlSchemaElementLocalName";
                        propertyConstruct00.RawValue = xmlSchemaElement.RefName.Name;
                        objectConstruct00.Items.Add(propertyConstruct00);

                        propertyConstruct00          = new PropertyConstruct();
                        propertyConstruct00.Name     = "XmlSchemaElementNamespace";
                        propertyConstruct00.RawValue = xmlSchemaElement.RefName.Namespace;
                        objectConstruct00.Items.Add(propertyConstruct00);

                        continue;
                    }
                    else
                    {
                        propertyConstruct00          = new PropertyConstruct();
                        propertyConstruct00.Name     = "XmlSchemaElementIsRef";
                        propertyConstruct00.RawValue = false;
                        objectConstruct00.Items.Add(propertyConstruct00);

                        propertyConstruct00          = new PropertyConstruct();
                        propertyConstruct00.Name     = "XmlSchemaElementLocalName";
                        propertyConstruct00.RawValue = xmlSchemaElement.QualifiedName.Name;
                        objectConstruct00.Items.Add(propertyConstruct00);

                        propertyConstruct00          = new PropertyConstruct();
                        propertyConstruct00.Name     = "XmlSchemaElementNamespace";
                        propertyConstruct00.RawValue = xmlSchemaElement.QualifiedName.Namespace;
                        objectConstruct00.Items.Add(propertyConstruct00);

                        xmlSchemaComplexType = xmlSchemaElement.ElementSchemaType as XmlSchemaComplexType;
                        xmlSchemaSimpleType  = xmlSchemaElement.ElementSchemaType as XmlSchemaSimpleType;

                        if ((object)xmlSchemaSimpleType != null)
                        {
                            propertyConstruct00          = new PropertyConstruct();
                            propertyConstruct00.Name     = "XmlSchemaElementSimpleType";
                            propertyConstruct00.RawValue = xmlSchemaSimpleType.Datatype.TypeCode;
                            objectConstruct00.Items.Add(propertyConstruct00);
                        }
                        else if ((object)xmlSchemaComplexType != null)
                        {
                            arrayConstruct01      = new ArrayConstruct();
                            arrayConstruct01.Name = "XmlSchemaAttributes";
                            objectConstruct00.Items.Add(arrayConstruct01);

                            if ((object)xmlSchemaComplexType.Attributes != null)
                            {
                                foreach (XmlSchemaAttribute xmlSchemaAttribute in xmlSchemaComplexType.Attributes)
                                {
                                    objectConstruct01 = new ObjectConstruct();
                                    arrayConstruct01.Items.Add(objectConstruct01);

                                    propertyConstruct01          = new PropertyConstruct();
                                    propertyConstruct01.Name     = "XmlSchemaElementLocalName";
                                    propertyConstruct01.RawValue = xmlSchemaAttribute.QualifiedName.Name;
                                    objectConstruct01.Items.Add(propertyConstruct01);

                                    propertyConstruct01          = new PropertyConstruct();
                                    propertyConstruct01.Name     = "XmlSchemaElementNamespace";
                                    propertyConstruct01.RawValue = xmlSchemaAttribute.QualifiedName.Namespace;
                                    objectConstruct01.Items.Add(propertyConstruct01);

                                    propertyConstruct01          = new PropertyConstruct();
                                    propertyConstruct01.Name     = "XmlSchemaElementNamespace";
                                    propertyConstruct01.RawValue = xmlSchemaAttribute.AttributeSchemaType.TypeCode;
                                    objectConstruct01.Items.Add(propertyConstruct01);
                                }
                            }

                            xmlSchemaSequence = xmlSchemaComplexType.ContentTypeParticle as XmlSchemaSequence;

                            if ((object)xmlSchemaSequence != null)
                            {
                                EnumSchema(objectConstruct00, xmlSchemaSequence.Items);
                            }
                        }
                    }
                }
            }
        }
        private static void EnumerateFileSystem(string directoryPath, bool recursive, string wildcard, AssociativeXmlObject parent, string sourcePath)
        {
            ArrayConstruct    arrayConstruct00;
            PropertyConstruct propertyConstruct00;
            ObjectConstruct   objectConstruct00;

            ArrayConstruct    arrayConstruct01;
            PropertyConstruct propertyConstruct01;
            ObjectConstruct   objectConstruct01;

            string[] directories;
            string[] files;

            if ((object)directoryPath == null)
            {
                throw new ArgumentNullException(nameof(directoryPath));
            }

            if ((object)parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }

            arrayConstruct00      = new ArrayConstruct();
            arrayConstruct00.Name = "Files";
            parent.Items.Add(arrayConstruct00);

            arrayConstruct01      = new ArrayConstruct();
            arrayConstruct01.Name = "Directories";
            parent.Items.Add(arrayConstruct01);

            if (File.Exists(directoryPath))
            {
                files       = new string[] { Path.GetFullPath(directoryPath) };
                directories = null;
            }
            else
            {
                if (SolderFascadeAccessor.DataTypeFascade.IsNullOrWhiteSpace(wildcard))
                {
                    files = Directory.GetFiles(directoryPath);
                }
                else
                {
                    files = Directory.GetFiles(directoryPath, wildcard);
                }

                if (SolderFascadeAccessor.DataTypeFascade.IsNullOrWhiteSpace(wildcard))
                {
                    directories = Directory.GetDirectories(directoryPath);
                }
                else
                {
                    directories = Directory.GetDirectories(directoryPath, wildcard);
                }
            }

            if ((object)files != null)
            {
                foreach (string file in files)
                {
                    FileInfo fileInfo;

                    fileInfo = new FileInfo(file);

                    objectConstruct00 = new ObjectConstruct();
                    arrayConstruct00.Items.Add(objectConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileFullName";
                    propertyConstruct00.RawValue = fileInfo.FullName;
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileFullNameRelativeToSource";
                    propertyConstruct00.RawValue = EvaluateRelativePath2(sourcePath, fileInfo.FullName);
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileCreationTime";
                    propertyConstruct00.RawValue = fileInfo.CreationTime;
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileCreationTimeUtc";
                    propertyConstruct00.RawValue = fileInfo.CreationTimeUtc;
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileExtension";
                    propertyConstruct00.RawValue = fileInfo.Extension;
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileIsReadOnly";
                    propertyConstruct00.RawValue = fileInfo.IsReadOnly;
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileLastAccessTime";
                    propertyConstruct00.RawValue = fileInfo.LastAccessTime;
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileLastAccessTimeUtc";
                    propertyConstruct00.RawValue = fileInfo.LastAccessTimeUtc;
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileLastWriteTime";
                    propertyConstruct00.RawValue = fileInfo.LastWriteTime;
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileLastWriteTimeUtc";
                    propertyConstruct00.RawValue = fileInfo.LastWriteTimeUtc;
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileLength";
                    propertyConstruct00.RawValue = fileInfo.Length;
                    objectConstruct00.Items.Add(propertyConstruct00);

                    propertyConstruct00          = new PropertyConstruct();
                    propertyConstruct00.Name     = "FileName";
                    propertyConstruct00.RawValue = fileInfo.Name;
                    objectConstruct00.Items.Add(propertyConstruct00);
                }
            }

            if ((object)directories != null)
            {
                foreach (string directory in directories)
                {
                    DirectoryInfo directoryInfo;

                    directoryInfo = new DirectoryInfo(directory);

                    objectConstruct01 = new ObjectConstruct();
                    arrayConstruct01.Items.Add(objectConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryFullName";
                    propertyConstruct01.RawValue = directoryInfo.FullName;
                    objectConstruct01.Items.Add(propertyConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryFullNameRelativeToSource";
                    propertyConstruct01.RawValue = EvaluateRelativePath2(sourcePath, directoryInfo.FullName);
                    objectConstruct01.Items.Add(propertyConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryAttributes";
                    propertyConstruct01.RawValue = directoryInfo.Attributes;
                    objectConstruct01.Items.Add(propertyConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryCreationTime";
                    propertyConstruct01.RawValue = directoryInfo.CreationTime;
                    objectConstruct01.Items.Add(propertyConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryCreationTimeUtc";
                    propertyConstruct01.RawValue = directoryInfo.CreationTimeUtc;
                    objectConstruct01.Items.Add(propertyConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryExtension";
                    propertyConstruct01.RawValue = directoryInfo.Extension;
                    objectConstruct01.Items.Add(propertyConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryLastAccessTime";
                    propertyConstruct01.RawValue = directoryInfo.LastAccessTime;
                    objectConstruct01.Items.Add(propertyConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryLastAccessTimeUtc";
                    propertyConstruct01.RawValue = directoryInfo.LastAccessTimeUtc;
                    objectConstruct01.Items.Add(propertyConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryLastWriteTime";
                    propertyConstruct01.RawValue = directoryInfo.LastWriteTime;
                    objectConstruct01.Items.Add(propertyConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryLastWriteTimeUtc";
                    propertyConstruct01.RawValue = directoryInfo.LastWriteTimeUtc;
                    objectConstruct01.Items.Add(propertyConstruct01);

                    propertyConstruct01          = new PropertyConstruct();
                    propertyConstruct01.Name     = "DirectoryName";
                    propertyConstruct01.RawValue = directoryInfo.Name;
                    objectConstruct01.Items.Add(propertyConstruct01);

                    if (recursive)
                    {
                        EnumerateFileSystem(directory, recursive, wildcard, objectConstruct01, sourcePath);
                    }
                }
            }
        }
        protected override object CoreGetSourceObject(string sourceFilePath, IDictionary <string, IList <string> > properties)
        {
            const string PROP_TOKEN_FIRST_RECORD_CONTAINS_COLUMN_HEADINGS = "FirstRecordIsHeader";
            const string PROP_TOKEN_HEADER_NAMES     = "HeaderName";
            const string PROP_TOKEN_FIELD_DELIMITER  = "FieldDelimiter";
            const string PROP_TOKEN_RECORD_DELIMITER = "RecordDelimiter";
            const string PROP_TOKEN_QUOTE_VALUE      = "QuoteValue";

            IList <string> values;
            bool           firstRecordIsHeader;
            string         recordDelimiter;
            string         fieldDelimiter;
            string         quoteValue;

            string[] headerNames;

            ObjectConstruct   objectConstruct00;
            ArrayConstruct    arrayConstruct00;
            ObjectConstruct   objectConstruct01;
            PropertyConstruct propertyConstruct01;

            string line;

            string[] headers = null;

            ObjectConstruct tempOc;

            if ((object)sourceFilePath == null)
            {
                throw new ArgumentNullException(nameof(sourceFilePath));
            }

            if ((object)properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            if (SolderFascadeAccessor.DataTypeFascade.IsWhiteSpace(sourceFilePath))
            {
                throw new ArgumentOutOfRangeException(nameof(sourceFilePath));
            }

            sourceFilePath = Path.GetFullPath(sourceFilePath);

            objectConstruct00 = new ObjectConstruct();

            firstRecordIsHeader = false;
            if (properties.TryGetValue(PROP_TOKEN_FIRST_RECORD_CONTAINS_COLUMN_HEADINGS, out values))
            {
                if ((object)values != null && values.Count == 1)
                {
                    if (!SolderFascadeAccessor.DataTypeFascade.TryParse <bool>(values[0], out firstRecordIsHeader))
                    {
                        firstRecordIsHeader = false;
                    }
                }
            }

            headerNames = null;
            if (properties.TryGetValue(PROP_TOKEN_HEADER_NAMES, out values))
            {
                if ((object)values != null)
                {
                    headerNames = values.ToArray();
                }
            }

            fieldDelimiter = string.Empty;
            if (properties.TryGetValue(PROP_TOKEN_FIELD_DELIMITER, out values))
            {
                if ((object)values != null && values.Count == 1)
                {
                    fieldDelimiter = values[0];
                }
            }

            recordDelimiter = string.Empty;
            if (properties.TryGetValue(PROP_TOKEN_RECORD_DELIMITER, out values))
            {
                if ((object)values != null && values.Count == 1)
                {
                    recordDelimiter = values[0];
                }
            }

            quoteValue = string.Empty;
            if (properties.TryGetValue(PROP_TOKEN_QUOTE_VALUE, out values))
            {
                if ((object)values != null && values.Count == 1)
                {
                    quoteValue = values[0];
                }
            }

            if (!SolderFascadeAccessor.DataTypeFascade.IsNullOrWhiteSpace(fieldDelimiter))
            {
                fieldDelimiter = fieldDelimiter.Replace("\\\\t", "\t");
                fieldDelimiter = fieldDelimiter.Replace("\\\\r", "\r");
                fieldDelimiter = fieldDelimiter.Replace("\\\\n", "\n");
                fieldDelimiter = fieldDelimiter.Replace("\\\"", "\"");
            }

            if (!SolderFascadeAccessor.DataTypeFascade.IsNullOrWhiteSpace(recordDelimiter))
            {
                recordDelimiter = recordDelimiter.Replace("\\\\t", "\t");
                recordDelimiter = recordDelimiter.Replace("\\\\r", "\r");
                recordDelimiter = recordDelimiter.Replace("\\\\n", "\n");
                recordDelimiter = recordDelimiter.Replace("\\\"", "\"");
            }

            if (!SolderFascadeAccessor.DataTypeFascade.IsNullOrWhiteSpace(quoteValue))
            {
                quoteValue = quoteValue.Replace("\\\\t", "\t");
                quoteValue = quoteValue.Replace("\\\\r", "\r");
                quoteValue = quoteValue.Replace("\\\\n", "\n");
                quoteValue = quoteValue.Replace("\\\"", "\"");
            }

            tempOc = objectConstruct01 = new ObjectConstruct();
            objectConstruct01.Name = "DelimitedTextSpec";
            objectConstruct00.Items.Add(objectConstruct01);

            propertyConstruct01 = new PropertyConstruct()
            {
                Name  = "FirstRecordIsHeader",
                Value = firstRecordIsHeader.ToString()
            };
            objectConstruct01.Items.Add(propertyConstruct01);

            propertyConstruct01 = new PropertyConstruct()
            {
                Name  = "RecordDelimiter",
                Value = recordDelimiter
            };
            objectConstruct01.Items.Add(propertyConstruct01);

            propertyConstruct01 = new PropertyConstruct()
            {
                Name  = "FieldDelimiter",
                Value = fieldDelimiter
            };
            objectConstruct01.Items.Add(propertyConstruct01);

            propertyConstruct01 = new PropertyConstruct()
            {
                Name  = "QuoteValue",
                Value = quoteValue
            };
            objectConstruct01.Items.Add(propertyConstruct01);

            using (StreamReader streamReader = File.OpenText(sourceFilePath))
            {
                int i = 0;

                arrayConstruct00      = new ArrayConstruct();
                arrayConstruct00.Name = "Records";
                objectConstruct00.Items.Add(arrayConstruct00);

                while ((line = (streamReader.ReadLine() ?? string.Empty)).Trim() != string.Empty)
                {
                    string[] fields;

                    fields = line.Split(fieldDelimiter.ToCharArray());

                    if (firstRecordIsHeader && i == 0)
                    {
                        headers = fields;
                        i++;
                        continue;
                    }

                    objectConstruct01 = new ObjectConstruct();
                    arrayConstruct00.Items.Add(objectConstruct01);

                    if ((object)fields != null)
                    {
                        int j = 0;

                        foreach (string field in fields)
                        {
                            propertyConstruct01 = new PropertyConstruct();

                            if (firstRecordIsHeader && (object)headers != null)
                            {
                                propertyConstruct01.Name = string.Format("{0}", headers[j++]);
                            }
                            else
                            {
                                propertyConstruct01.Name = string.Format("Field{0}", (j++) + 1);
                            }

                            propertyConstruct01.RawValue = field;
                            objectConstruct01.Items.Add(propertyConstruct01);
                        }
                    }

                    i++;
                }
            }

            return(objectConstruct00);
        }