Beispiel #1
0
        public void AutomaticAddToRowCollectionMenager_ClipboardSource(string regexSpliterColumn, string regexSpliterRow)
        {
            int counter = 0;

            string[] lineList = TextParser.SplitRow(System.Windows.Forms.Clipboard.GetText(), regexSpliterRow);

            if (System.Windows.Forms.Clipboard.ContainsText())
            {
                foreach (string line in lineList)
                {
                    rowCollectionMenager.AddRow(new ObjectRow(null, TextParser.SplitRow(line, regexSpliterColumn)));
                    if ((counter++ % 1000) == 0)
                    {
                        System.Windows.Forms.Application.DoEvents();
                    }
                }
            }
        }
Beispiel #2
0
        public void ParseXML(string requestURL)
        {
            ArrayList list = new ArrayList();

            string[]      columns;
            XmlTextReader reader = null;

            try
            {
                reader = new XmlTextReader(requestURL);
                while (reader.Read())
                {
                    if (reader.NodeType == XmlNodeType.Element && reader.Depth >= this.startDepth)
                    {
                        if (reader.HasAttributes)
                        {
                            columns = new string[reader.AttributeCount];
                            columns = GetAllAttribites(ref reader);
                            if (reader.Depth > list.Count)
                            {
                                do
                                {
                                    list.Add(null);
                                } while (list.Count <= reader.Depth);
                            }
                            list.Insert(reader.Depth, columns);
                            rowCollectionMenager.AddRow(new ObjectRow(null, MargeArrays(list, reader.Depth)));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ModuleLog.Write(ex, this, "ParseXML", ModuleLog.LogType.ERROR);
            }
            finally
            {
                reader.Close();
            }
        }