private static Frame findFrame(FrameCollection frames, BaseConstraint findBy)
        {
            foreach (Frame frame in frames)
            {
                if (findBy.Compare(frame))
                {
                    // Return
                    return(frame);
                }
            }

            throw new FrameNotFoundException(findBy.ConstraintToString());
        }
Example #2
0
		private static Frame findFrame(FrameCollection frames, BaseConstraint findBy)
		{
			foreach (Frame frame in frames)
			{
				if (findBy.Compare(frame))
				{
					// Return
					return frame;
				}
			}

			throw new FrameNotFoundException(findBy.ConstraintToString());
		}
Example #3
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++;
            }
        }
 /// <summary>
 /// This constructor will mainly be used by Document.Frame to find
 /// a Frame. A FrameNotFoundException will be thrown if the Frame isn't found.
 /// </summary>
 /// <param name="frames">Collection of frames to find the frame in</param>
 /// <param name="findBy">The <see cref="AttributeConstraint"/> of the Frame to find (Find.ByUrl, Find.ByName and Find.ById are supported)</param>
 public static Frame Find(FrameCollection frames, BaseConstraint findBy)
 {
     return(findFrame(frames, findBy));
 }
Example #5
0
		/// <summary>
		/// This constructor will mainly be used by Document.Frame to find
		/// a Frame. A FrameNotFoundException will be thrown if the Frame isn't found.
		/// </summary>
		/// <param name="frames">Collection of frames to find the frame in</param>
		/// <param name="findBy">The <see cref="AttributeConstraint"/> of the Frame to find (Find.ByUrl, Find.ByName and Find.ById are supported)</param>
		public static Frame Find(FrameCollection frames, BaseConstraint findBy)
		{
			return findFrame(frames, findBy);
		}