Beispiel #1
0
        public void Clear()
        {
            LogText = "Cleared";

            try
            {
                RegisterEvent(ValuePattern.ValueProperty);
                if (ReadOnly)
                {
                    throw new ProdOperationException("Text Control is Read Only");
                }

                if (ValuePatternHelper.SetValue(UIAElement, "") == 0)
                {
                    return;
                }


                if (NativeWindowHandle != IntPtr.Zero)
                {
                    NativeTextProds.ClearTextNative(NativeWindowHandle);
                    return;
                }

                /* If it doesn't have one, send keys, then */
                //TODO: convert ValuePatternHelper.SendKeysSetText(UIAElement, string.Empty);
            }
            catch (ProdOperationException err)
            {
                throw;
            }
        }