public ConnectionItem(ConnectionManager connectionManager)
            {
                ArgumentVerifier.CheckObjectArgument(connectionManager, "connectionManager");

                this.name = connectionManager.Name;
                this.connectionManager = connectionManager;
            }
Ejemplo n.º 2
0
        public ComponentBufferService(PipelineBuffer mainBuffer, PipelineBuffer errorBuffer)
        {
            ArgumentVerifier.CheckObjectArgument(mainBuffer, "mainBuffer");

            this.mainBuffer  = mainBuffer;
            this.errorBuffer = errorBuffer;
        }
        public FileReader(string fileName, Encoding encoding)
        {
            ArgumentVerifier.CheckObjectArgument(encoding, "encoding");

            this.OpenStream(fileName);
            reader = new BinaryReader(stream, encoding);

            this.SkipBOM();
        }
        public BufferSink(IComponentBufferService bufferService, IDTSOutput100 output, bool treatEmptyStringAsNull)
        {
            ArgumentVerifier.CheckObjectArgument(bufferService, "bufferService");
            ArgumentVerifier.CheckObjectArgument(output, "output");

            this.bufferService          = bufferService;
            this.output                 = output;
            this.treatEmptyStringAsNull = treatEmptyStringAsNull;
        }
        public void Initialize(IDTSComponentMetaData100 dtsComponentMetadata, IServiceProvider serviceProvider)
        {
            ArgumentVerifier.CheckObjectArgument(dtsComponentMetadata, "componentMetadata");
            ArgumentVerifier.CheckObjectArgument(serviceProvider, "serviceProvider");

            this.componentMetadata = dtsComponentMetadata;
            this.serviceProvider   = serviceProvider;

            this.connService = this.serviceProvider.GetService(typeof(Microsoft.SqlServer.Dts.Runtime.Design.IDtsConnectionService)) as Microsoft.SqlServer.Dts.Runtime.Design.IDtsConnectionService;
        }
Ejemplo n.º 6
0
        public void SkipHeaderRows(IFileReader reader)
        {
            ArgumentVerifier.CheckObjectArgument(reader, "reader");

            if (this.headerRowsToSkip > 0 && !string.IsNullOrEmpty(this.headerRowDelimiter))
            {
                FieldParser headerRowFieldParser = FieldParser.BuildParserWithSingleDelimiter(this.headerRowDelimiter);

                for (int i = 0; i < this.headerRowsToSkip; i++)
                {
                    headerRowFieldParser.ParseNext(reader);
                    if (reader.IsEOF)
                    {
                        break;
                    }
                }
            }
        }
        public void ParseNextRow(IFileReader reader, RowData rowData)
        {
            ArgumentVerifier.CheckObjectArgument(reader, "reader");

            if (rowData != null)
            {
                rowData.ResetRowData();
            }
            this.fieldParser.ResetParsingState();

            if (this.singleColumn)
            {
                fieldParser.ParseNext(reader, rowData);
                if (rowData != null)
                {
                    string columnData = fieldParser.CurrentText;
                    if (!reader.IsEOF || !string.IsNullOrEmpty(columnData))
                    {
                        rowData.AddColumnData(fieldParser.CurrentText);
                    }
                }
            }
            else
            {
                while (!reader.IsEOF && !this.fieldParser.RowDelimiterMatch)
                {
                    this.fieldParser.ParseNext(reader, rowData);

                    if (rowData != null)
                    {
                        string columnData = fieldParser.CurrentText;
                        if (!reader.IsEOF || rowData.ColumnCount > 0 || !string.IsNullOrEmpty(columnData))
                        {
                            if (MaxColumnNumber == rowData.ColumnCount)
                            {
                                throw new RowColumnNumberOverflow();
                            }
                            // Add data if this is not the last and empty row.
                            rowData.AddColumnData(fieldParser.CurrentText);
                        }
                    }
                }
            }
        }
        public ParsingResult ProcessCharacter(IParsingContext context, char nextChar)
        {
            ArgumentVerifier.CheckObjectArgument(context, "context");

            foreach (IParsingState parsingState in nextStates)
            {
                ParsingResult result = parsingState.ProcessCharacter(context, nextChar);
                if (result != ParsingResult.Miss)
                {
                    if (context.CurrentState == this)
                    {
                        // If the current state has not changed in the ProcessCharacter call,
                        // we should change it now.
                        context.CurrentState = parsingState;
                    }
                    return(result);
                }
            }

            context.Append(nextChar);
            return(ParsingResult.Match);
        }
        public ParsingResult ProcessCharacter(IParsingContext context, char nextChar)
        {
            ArgumentVerifier.CheckObjectArgument(context, "context");

            return(ProcessCharacterImpl(context, nextChar));
        }
        public void AddNextState(IParsingState parsingState)
        {
            ArgumentVerifier.CheckObjectArgument(parsingState, "parsingState");

            nextStates.Add(parsingState);
        }