예제 #1
0
        /// <summary>
        /// このクラスでの実行すること。
        /// </summary>
        /// <param name="runChildren"></param>
        public override void Run(bool runChildren)
        {
            string filename = this.GetFileName();

            if (string.IsNullOrEmpty(filename))
            {
                ReportManage.ErrEmptyPropertyName(this, nameof(FileName));
                return;
            }
            try
            {
                var r = ReadLine();
                r.Wait();
                int i       = 0;
                var topline = r.Result.First();
                columnNameDic = new Dictionary <string, int>();
                foreach (var item in topline.Split('\t'))
                {
                    columnNameDic.Add(item, i);
                    i++;
                }
                var lines = r.Result.Skip(1);
                if (skip > 0)
                {
                    lines = lines.Skip(skip);
                }
                base.RunChildrenForArray(runChildren, lines);
            }

            catch (Exception ex)
            {
                ReportManage.ErrReport(this, FileName + "を開くのに失敗しました" + ex.Message);
            }
        }
예제 #2
0
        public override void Run(bool runChildren)
        {
            string filename = FileName.Convert(this);

            if (string.IsNullOrEmpty(filename))
            {
                filename = GetText();
            }
            if (string.IsNullOrEmpty(filename))
            {
                ReportManage.ErrEmptyPropertyName(this, nameof(FileName));
                return;
            }
            try
            {
                var t = Read().WaitResult();
                SetText(t);
            }
            catch (Exception ex)
            {
                ReportManage.ErrReport(this, filename + "を開くのに失敗しました" + ex.Message);
                return;
            }

            base.Run(runChildren);
        }
예제 #3
0
        public override void Run(bool runChildren)
        {
            string filename = this.GetFileName();

            if (string.IsNullOrEmpty(filename))
            {
                ReportManage.ErrEmptyPropertyName(this, nameof(FileName));
                return;
            }
            var r = ReadLine();

            r.Wait();
            RunChildrenForArray(runChildren, r.Result.Skip(Skip));
        }
예제 #4
0
        /// <summary>
        /// このクラスでの実行すること。
        /// </summary>
        /// <param name="runChildren"></param>
        public override void Run(bool runChildren)
        {
            if (Folder == null)
            {
                ReportManage.ErrEmptyPropertyName(this, nameof(Folder));
                return;
            }
            Folder.Parent = this;
            var client = this.GetAncestorRawler().OfType <WebClient>().DefaultIfEmpty(new WebClient()).FirstOrDefault();

            string url = Url;

            if (string.IsNullOrEmpty(url))
            {
                url = GetText();
            }
            var    page    = this.GetUpperRawler <Page>();
            string referer = string.Empty;

            if (page != null)
            {
                referer = page.GetCurrentUrl();
            }

            var data = client.HttpGetByte(url, referer);

            data.Wait();
            string fileName = string.Empty;

            if (string.IsNullOrEmpty(SaveName) == false)
            {
                fileName = SaveName.Convert(this);
            }
            else
            {
                fileName = System.IO.Path.GetFileNameWithoutExtension(url);
            }
            string ex = System.IO.Path.GetExtension(url);

            if (ex.Split('?').Length > 0)
            {
                ex = ex.Split('?').First();
            }

            Folder?.WriteFile(fileName + ex, data.Result);

            SetText(fileName + ex);

            base.Run(runChildren);
        }
예제 #5
0
        /// <summary>
        /// このクラスでの実行すること。
        /// </summary>
        /// <param name="runChildren"></param>
        public override void Run(bool runChildren)
        {
            ReportManage.ErrEmptyPropertyName(this, nameof(Path));
            string path = Path.Convert(this);

            try
            {
                var p      = PCLStorage.PortablePath.Combine(new string[] { PCLStorage.FileSystem.Current.LocalStorage.Path, path });
                var folder = PCLStorage.FileSystem.Current.GetFolderFromPathAsync(p);

                folder.Wait();
                Rawler.IO.IoState.CurrentFolder = folder.Result;
            }
            catch (Exception e)
            {
                ReportManage.ErrReport(this, e.Message);
            }

            base.Run(runChildren);
        }