Esempio n. 1
0
        /// <summary>
        /// Common ctor helper
        /// </summary>
        /// <param name="identifier">identifier</param>
        /// <param name="isButton">isButton</param>
        private void Initialize(Guid identifier, bool isButton)
        {
            //
            // validate isButton for known guids
            //
            if (StylusPointPropertyIds.IsKnownButton(identifier))
            {
                if (!isButton)
                {
                    //error, this is a known button
                    throw new ArgumentException(SR.Get(SRID.InvalidIsButtonForId), "isButton");
                }
            }
            else
            {
                if (StylusPointPropertyIds.IsKnownId(identifier) && isButton)
                {
                    //error, this is a known guid that is NOT a button
                    throw new ArgumentException(SR.Get(SRID.InvalidIsButtonForId2), "isButton");
                }
            }

            _id       = identifier;
            _isButton = isButton;
        }
Esempio n. 2
0
 /// <summary>
 /// Returns a human readable string representation
 /// </summary>
 public override string ToString()
 {
     return("{Id=" +
            StylusPointPropertyIds.GetStringRepresentation(_id) +
            ", IsButton=" +
            _isButton.ToString(CultureInfo.InvariantCulture) +
            "}");
 }