コード例 #1
0
        private void Publish(IAdvController controller, Login login)
        {
            try
            {
                if (!controller.DoLogin(login))
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                _logWriter.LogAction("Ошибка входа на сайт " + Environment.NewLine + ex);
                return;
            }

            foreach (var adv in _items)
            {
                try
                {
                    controller.Post(adv);
                }
                catch (Exception ex)
                {
                    _logWriter.LogAction("Ошибка публикации " + Environment.NewLine + ex);
                }
            }
            _logWriter.LogAction(string.Format("Публикация на {0} закончена.", controller.MainUrl));
            SystemSounds.Asterisk.Play();
        }
コード例 #2
0
ファイル: Utils.cs プロジェクト: pusp/o2platform
		/// <summary>
		/// Dumps the element ids.
		/// </summary>
		/// <param name="document">The document.</param>
		/// <param name="logWriter">The log writer.</param>
		public static void DumpElements(Document document, ILogWriter logWriter)
		{
			logWriter.LogAction("Dump:");
			IHTMLElementCollection elements = elementCollection(document);
			foreach (IHTMLElement e in elements)
			{
				logWriter.LogAction("id = " + e.id);
			}
		}
コード例 #3
0
        /// <summary>
        /// Dumps the element ids.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <param name="logWriter">The log writer.</param>
        public static void DumpElements(Document document, ILogWriter logWriter)
        {
            logWriter.LogAction("Dump:");
            IHTMLElementCollection elements = elementCollection(document);

            foreach (IHTMLElement e in elements)
            {
                logWriter.LogAction("id = " + e.id);
            }
        }
コード例 #4
0
ファイル: Utils.cs プロジェクト: pusp/o2platform
		/// <summary>
		/// Dumps the elements with HTML source.
		/// </summary>
		/// <param name="document">The document.</param>
		/// <param name="logWriter">The log writer.</param>
		public static void DumpElementsWithHtmlSource(Document document, ILogWriter logWriter)
		{
			logWriter.LogAction("Dump:==================================================");
			IHTMLElementCollection elements = elementCollection(document);
			foreach (IHTMLElement e in elements)
			{
				logWriter.LogAction("------------------------- " + e.id);
				logWriter.LogAction(e.outerHTML);
			}
		}
コード例 #5
0
        /// <summary>
        /// Dumps the elements with HTML source.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <param name="logWriter">The log writer.</param>
        public static void DumpElementsWithHtmlSource(Document document, ILogWriter logWriter)
        {
            logWriter.LogAction("Dump:==================================================");
            IHTMLElementCollection elements = elementCollection(document);

            foreach (IHTMLElement e in elements)
            {
                logWriter.LogAction("------------------------- " + e.id);
                logWriter.LogAction(e.outerHTML);
            }
        }
コード例 #6
0
        /// <summary>
        /// Dumps frame info.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <param name="logWriter">The log writer.</param>
        public static void DumpFrames(Document document, ILogWriter logWriter)
        {
            FrameCollection frames = document.Frames;

            logWriter.LogAction("There are " + frames.Length.ToString() + " Frames");

            int index = 0;

            foreach (Frame frame in frames)
            {
                logWriter.LogAction("Frame index: " + index.ToString());
                logWriter.LogAction(" name: " + frame.Name);
                logWriter.LogAction(" scr: " + frame.Url);

                index++;
            }
        }
コード例 #7
0
ファイル: Utils.cs プロジェクト: pusp/o2platform
		/// <summary>
		/// Dumps frame info.
		/// </summary>
		/// <param name="document">The document.</param>
		/// <param name="logWriter">The log writer.</param>
		public static void DumpFrames(Document document, ILogWriter logWriter)
		{
			FrameCollection frames = document.Frames;

			logWriter.LogAction("There are " + frames.Length.ToString() + " Frames");

			int index = 0;
			foreach (Frame frame in frames)
			{
				logWriter.LogAction("Frame index: " + index.ToString());
				logWriter.LogAction(" name: " + frame.Name);
				logWriter.LogAction(" scr: " + frame.Url);

				index++;
			}
		}