本文整理汇总了C#中System.ComponentModel.MaskedTextProvider.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# MaskedTextProvider.Clone方法的具体用法?C# MaskedTextProvider.Clone怎么用?C# MaskedTextProvider.Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ComponentModel.MaskedTextProvider
的用法示例。
在下文中一共展示了MaskedTextProvider.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlaceChar
private bool PlaceChar( MaskedTextProvider provider, char ch, int startPosition, int length, bool overwrite, out int caretPosition )
{
if( this.ShouldQueryAutoCompleteMask( provider.Clone() as MaskedTextProvider, ch, startPosition ) )
{
AutoCompletingMaskEventArgs e = new AutoCompletingMaskEventArgs(
m_maskedTextProvider.Clone() as MaskedTextProvider,
startPosition,
length,
ch.ToString() );
this.OnAutoCompletingMask( e );
if( ( !e.Cancel ) && ( e.AutoCompleteStartPosition > -1 ) )
{
caretPosition = startPosition;
// AutoComplete the block.
for( int i = 0; i < e.AutoCompleteText.Length; i++ )
{
if( !this.PlaceCharCore( provider, e.AutoCompleteText[ i ], e.AutoCompleteStartPosition + i, 0, true, out caretPosition ) )
return false;
}
caretPosition = e.AutoCompleteStartPosition + e.AutoCompleteText.Length;
return true;
}
}
return this.PlaceCharCore( provider, ch, startPosition, length, overwrite, out caretPosition );
}
示例2: CloneTest
public void CloneTest ()
{
MaskedTextProvider mtp;
MaskedTextProvider mtp2;
int counter = 0;
mtp = new MaskedTextProvider ("mask");
mtp2 = (MaskedTextProvider)mtp.Clone ();
Assert.AreEqual (mtp.Mask, mtp2.Mask, "#" + (counter++).ToString ());
AssertProperties (mtp2, "CloneTest", counter++, mtp.AllowPromptAsInput, mtp.AsciiOnly, mtp.AssignedEditPositionCount, mtp.AvailableEditPositionCount, mtp.Culture, mtp.EditPositionCount, mtp.IncludeLiterals, mtp.IncludePrompt, mtp.IsPassword, mtp.LastAssignedPosition, mtp.Length, mtp.Mask, mtp.MaskCompleted, mtp.MaskFull, mtp.PasswordChar, mtp.PromptChar, mtp.ResetOnPrompt, mtp.ResetOnSpace, mtp.SkipLiterals, mtp.ToString (), mtp.ToString (true), mtp.ToString (false), mtp.ToString (true, true), mtp.ToString (true, false), mtp.ToString (false, true), mtp.ToString (false, false));
}