Exemple #1
0
        private static Frame findFrame(FrameCollection frames, Attribute findBy)
        {
            foreach (Frame frame in frames)
            {
                if (findBy.Compare(frame))
                {
                    // Return
                    return(frame);
                }
            }

            throw new FrameNotFoundException(findBy.AttributeName, findBy.Value);
        }
Exemple #2
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="Attribute"/> of the Frame to find (Find.ByUrl, Find.ByName and Find.ById are supported)</param>
 public static Frame Find(FrameCollection frames, Attribute findBy)
 {
     return findFrame(frames, findBy);
 }
Exemple #3
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="Attribute"/> of the Frame to find (Find.ByUrl, Find.ByName and Find.ById are supported)</param>
 public static Frame Find(FrameCollection frames, Attribute findBy)
 {
     return(findFrame(frames, findBy));
 }
Exemple #4
0
        private static Frame findFrame(FrameCollection frames, Attribute findBy)
        {
            foreach (Frame frame in frames)
              {
            if (findBy.Compare(frame))
            {
              // Return
              return frame;
            }
              }

              throw new FrameNotFoundException(findBy.AttributeName, findBy.Value);
        }