From 2a1a092dd79ce6c475cbef843e8752b97d1244c3 Mon Sep 17 00:00:00 2001 From: Nebuleux_cp Date: Fri, 16 Mar 2012 15:45:18 +0000 Subject: [PATCH] Remove the TokenizedTextBox component from the release 1.6.0. --- .../Samples.Modules.Text/Views/HomeView.xaml | 8 +- .../Views/HomeView.xaml.cs | 41 -- .../WPFToolkit.Extended/Themes/Generic.xaml | 1 - .../TokenizedTextBox/Images/delete8.png | Bin 312 -> 0 bytes .../TokenizedTextBox/Implementation/Token.cs | 54 --- .../Implementation/TokenItem.cs | 44 -- .../Implementation/TokenizedTextBox.cs | 392 ------------------ .../TokenizedTextBoxCommands.cs | 35 -- .../TokenizedTextBox/Themes/Generic.xaml | 78 ---- .../WPFToolkit.Extended.csproj | 11 - .../WPFToolkit.Extended/Themes/Generic.xaml | 1 - .../TokenizedTextBox/Images/delete8.png | Bin 312 -> 0 bytes .../TokenizedTextBox/Themes/Generic.xaml | 78 ---- .../WPFToolkit.Extended.csproj | 19 - 14 files changed, 1 insertion(+), 761 deletions(-) delete mode 100644 Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Images/delete8.png delete mode 100644 Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/Token.cs delete mode 100644 Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenItem.cs delete mode 100644 Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBox.cs delete mode 100644 Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBoxCommands.cs delete mode 100644 Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Themes/Generic.xaml delete mode 100644 Release/v1.6.0/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/TokenizedTextBox/Images/delete8.png delete mode 100644 Release/v1.6.0/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/TokenizedTextBox/Themes/Generic.xaml diff --git a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml index a8f764f1..05a2cfdf 100644 --- a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml +++ b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml @@ -23,12 +23,6 @@ xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" Title="Text Controls"> - + diff --git a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml.cs b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml.cs index d2145440..ab1a092e 100644 --- a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml.cs +++ b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml.cs @@ -16,8 +16,6 @@ Visit http://xceed.com and follow @datagrid on Twitter. **********************************************************************/ -using System; -using System.Collections.Generic; using Microsoft.Practices.Prism.Regions; using Samples.Infrastructure.Controls; @@ -32,45 +30,6 @@ namespace Samples.Modules.Text.Views public HomeView() { InitializeComponent(); - - _textBox.Text = "1;2;"; //is of object ids - _textBox.ItemsSource = new List() - { - new Email() { Id = 1, FirstName = "John", LastName = "Doe", EmailAddress = "john@test.com" }, - new Email() { Id = 2, FirstName = "Jane", LastName = "Doe", EmailAddress = "jane@test.com" }, - }; - } - - public class Email - { - public int Id - { - get; - set; - } - public string FirstName - { - get; - set; - } - public string LastName - { - get; - set; - } - public string EmailAddress - { - get; - set; - } - - public string FullName - { - get - { - return String.Format( "{0}, {1}", LastName, FirstName ); - } - } } } } diff --git a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml index e324c5ea..5c2b5400 100644 --- a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml +++ b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml @@ -47,7 +47,6 @@ - diff --git a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Images/delete8.png b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Images/delete8.png deleted file mode 100644 index 153a6c82b2e399c65bf056261c4ba5f10aa8d1c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 312 zcmV-80muG{P)pF>PbXFR2Y>_j87{>VH`%!?_HRTm=eB$OgExQvXIZANmndbn!BNf zx>o7AB!>NEKjGy^2(}mL79r83y{&2H^PP z`|A@kLlViBWJA}3Ff1sJWBkc!Iy$@9*)CFkeG`B?ySP#mRmltvk?HqraUpN5Z7H^j z>-EFw$uZ73{PC - { - var run = inline as Run; - return ( run != null && run.Text.EndsWith( inputText ) ); - } ) as Run; - - if( matchedRun != null ) // Found a Run that matched the inputText - { - var tokenContainer = CreateTokenContainer( token ); - para.Inlines.InsertBefore( matchedRun, tokenContainer ); - - // Remove only if the Text in the Run is the same as inputText, else split up - if( matchedRun.Text == inputText ) - { - para.Inlines.Remove( matchedRun ); - } - else // Split up - { - var index = matchedRun.Text.IndexOf( inputText ) + inputText.Length; - var tailEnd = new Run( matchedRun.Text.Substring( index ) ); - para.Inlines.InsertAfter( matchedRun, tailEnd ); - para.Inlines.Remove( matchedRun ); - } - - //now append the Text with the token key - SetTextInternal( Text + token.TokenKey ); - } - - _surpressTextChangedEvent = false; - } - - private InlineUIContainer CreateTokenContainer( Token token ) - { - return new InlineUIContainer( CreateTokenItem( token ) ) - { - BaselineAlignment = BaselineAlignment.Center - }; - } - - private TokenItem CreateTokenItem( Token token ) - { - object item = token.Item; - - var tokenItem = new TokenItem() - { - TokenKey = token.TokenKey, - Content = item, - ContentTemplate = TokenTemplate - }; - - if( TokenTemplate == null ) - { - //if no template was supplied let's try to get a value from the object using the DisplayMemberPath - if( !String.IsNullOrEmpty( DisplayMemberPath ) ) - { - var property = item.GetType().GetProperty( DisplayMemberPath ); - if( property != null ) - { - var value = property.GetValue( item, null ); - if( value != null ) - tokenItem.Content = value; - } - } - } - - return tokenItem; - } - - private void DeleteToken( object sender, ExecutedRoutedEventArgs e ) - { - var para = _rtb.CaretPosition.Paragraph; - - Inline inlineToRemove = para.Inlines.Where( inline => inline is InlineUIContainer && ( ( inline as InlineUIContainer ).Child as TokenItem ).TokenKey.Equals( e.Parameter ) ).FirstOrDefault(); - - if( inlineToRemove != null ) - para.Inlines.Remove( inlineToRemove ); - - //update Text to remove delimited value - SetTextInternal( Text.Replace( e.Parameter.ToString(), "" ) ); - } - - private void SetTextInternal( string text ) - { - _surpressTextChanged = true; - Text = text; - _surpressTextChanged = false; - } - - #endregion //Methods - } -} \ No newline at end of file diff --git a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBoxCommands.cs b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBoxCommands.cs deleted file mode 100644 index 494eac55..00000000 --- a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Implementation/TokenizedTextBoxCommands.cs +++ /dev/null @@ -1,35 +0,0 @@ -/************************************************************************ - - Extended WPF Toolkit - - Copyright (C) 2010-2012 Xceed Software Inc. - - This program is provided to you under the terms of the Microsoft Reciprocal - License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license - - This program can be provided to you by Xceed Software Inc. under a - proprietary commercial license agreement for use in non-Open Source - projects. The commercial version of Extended WPF Toolkit also includes - priority technical support, commercial updates, and many additional - useful WPF controls if you license Xceed Business Suite for WPF. - - Visit http://xceed.com and follow @datagrid on Twitter. - - **********************************************************************/ -using System.Windows.Input; - -namespace Microsoft.Windows.Controls -{ - public static class TokenizedTextBoxCommands - { - private static RoutedCommand _deleteCommand = new RoutedCommand(); - - public static RoutedCommand Delete - { - get - { - return _deleteCommand; - } - } - } -} diff --git a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Themes/Generic.xaml b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Themes/Generic.xaml deleted file mode 100644 index aee352a4..00000000 --- a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/TokenizedTextBox/Themes/Generic.xaml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj index ad4a0ecb..b63bfde1 100644 --- a/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj +++ b/Release/v1.6.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj @@ -187,10 +187,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - Designer MSBuild:Compile @@ -327,10 +323,6 @@ - - - - @@ -416,9 +408,6 @@ - - - - - - - - - - \ No newline at end of file diff --git a/Release/v1.6.0/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj b/Release/v1.6.0/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj index 7ba744f8..3791f62a 100644 --- a/Release/v1.6.0/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj +++ b/Release/v1.6.0/ExtendedWPFToolkitSolution_35/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj @@ -209,10 +209,6 @@ MSBuild:Compile Designer - - Designer - MSBuild:Compile - MSBuild:Compile Designer @@ -550,18 +546,6 @@ TimePicker\Implementation\TimePicker.cs - - TokenizedTextBox\Implementation\Token.cs - - - TokenizedTextBox\Implementation\TokenItem.cs - - - TokenizedTextBox\Implementation\TokenizedTextBox.cs - - - TokenizedTextBox\Implementation\TokenizedTextBoxCommands.cs - VisualStates.cs @@ -664,9 +648,6 @@ - - -