/// <summary>
        /// Check previous version.
        /// </summary>
        /// <param name="fid">The file identifier.</param>
        /// <param name="previousVersion">The previous version.</param>
        /// <param name="isSucceed">Indicate whether the checking is successful or not.</param>
        public void CheckPreviousVersion(int fid, Microsoft.Modeling.Set<int> previousVersion, out bool isSucceed)
        {
            string streamString = Site.Properties["SmbTestCasePreviousVersion"] as string;
            if (string.IsNullOrEmpty(streamString))
            {
                isSucceed = false;
                return;
            }

            int startIndex = (int)uint.MinValue;
            while (streamString.IndexOf(Semicolon, startIndex) >= uint.MinValue)
            {
                int endIndex = streamString.IndexOf(Semicolon, startIndex);

                string gmtToken = streamString.Substring(startIndex, endIndex - startIndex);
                int gmtIndex = Int32.Parse(gmtToken.Substring(0, gmtToken.IndexOf(Comma)));
                string gmtString = gmtToken.Substring(gmtToken.IndexOf(Comma) + 1);

                if (previousVersion.Contains(gmtIndex))
                {
                    this.gmtTokens.Add(gmtIndex, gmtString);
                }

                startIndex = endIndex + 1;
            }

            isSucceed = true;
        }
Пример #2
0
 public bool MouseInside(Microsoft.Xna.Framework.Rectangle rect)
 {
     return rect.Contains(currentMouseState.X, currentMouseState.Y);
 }
Пример #3
0
 public bool MouseEntered(Microsoft.Xna.Framework.Rectangle rect)
 {
     return !rect.Contains(previousMouseState.X, previousMouseState.Y)
         && rect.Contains(currentMouseState.X, currentMouseState.Y);
 }
Пример #4
0
        /// <summary>
        /// Determines if there is a touch (Moved or Pressed) within
        /// the given rectangle. 
        /// </summary>
        /// <param name="rectangle"></param>
        /// <returns></returns>
        /// <remarks>
        /// Returns the momentary result. Does not keep track of last frame.
        /// </remarks>
        public bool TouchWithin(Microsoft.Xna.Framework.Rectangle rectangle)
        {
            foreach (var location in CurrentTouchCollection)
            {
                if (location.State == TouchLocationState.Pressed || location.State == TouchLocationState.Moved)
                {
                    if (rectangle.Contains(location.Position.ToPoint()))
                        return true;
                }
            }

            return false;
        }