diff --git a/src/System.Design/src/System.Design.Forwards.cs b/src/System.Design/src/System.Design.Forwards.cs index d28abe1ae5a..992434dd33a 100644 --- a/src/System.Design/src/System.Design.Forwards.cs +++ b/src/System.Design/src/System.Design.Forwards.cs @@ -7,6 +7,7 @@ [assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.DataMemberFieldConverter))] [assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.ImageCollectionEditor))] [assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.ImageIndexEditor))] +[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.LinkAreaEditor))] [assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.ListControlStringCollectionEditor))] [assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.ListViewGroupCollectionEditor))] [assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.ListViewItemCollectionEditor))] diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/LinkAreaEditor.resx b/src/System.Windows.Forms.Design.Editors/src/Resources/LinkAreaEditor.resx new file mode 100644 index 00000000000..6934714081c --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/LinkAreaEditor.resx @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + NoControl + + + + 12, 10 + + + 320, 13 + + + + 0 + + + Select a &range of text to make your link: + + + caption + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + Top, Bottom, Left, Right + + + 12, 26 + + + True + + + 320, 111 + + + 1 + + + textBox1 + + + sampleEdit + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Left, Right + + + True + + + NoControl + + + 3, 3 + + + 76, 23 + + + 2 + + + OK + + + okButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + okCancelTableLayoutPanel + + + 0 + + + Left, Right + + + True + + + NoControl + + + 85, 3 + + + 76, 23 + + + 3 + + + Cancel + + + cancelButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + okCancelTableLayoutPanel + + + 1 + + + Bottom, Right + + + True + + + 177, 142 + + + 154, 29 + + + 4 + + + okCancelTableLayoutPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="okButton" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancelButton" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50" /><Rows Styles="AutoSize,0,AutoSize,0" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 344, 178 + + + 352, 212 + + + CenterParent + + + LinkArea Editor + + + LinkAreaEditor + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/SR.resx b/src/System.Windows.Forms.Design.Editors/src/Resources/SR.resx index 6b66c1e5aea..9ca5de59907 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/SR.resx +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/SR.resx @@ -1,4 +1,4 @@ - + @@ -195,10 +195,22 @@ Press Ctrl+Enter to accept Text. Top Right + + Cancel + + + LinkArea Editor + + + Select a &range of text to make your link: + + + OK + Icon files Select the path to the folder that will initially be selected in the FolderBrowserDialog. - \ No newline at end of file + diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.cs.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.cs.xlf new file mode 100644 index 00000000000..47d5a744add --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.cs.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.de.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.de.xlf new file mode 100644 index 00000000000..55fa924d68d --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.de.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.es.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.es.xlf new file mode 100644 index 00000000000..8ce609c1d23 --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.es.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.fr.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.fr.xlf new file mode 100644 index 00000000000..786bb677dae --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.fr.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.it.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.it.xlf new file mode 100644 index 00000000000..2da4ccd6564 --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.it.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.ja.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.ja.xlf new file mode 100644 index 00000000000..c54ac0ebc74 --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.ja.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.ko.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.ko.xlf new file mode 100644 index 00000000000..ab889819a84 --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.ko.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.pl.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.pl.xlf new file mode 100644 index 00000000000..ba2faa1c466 --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.pl.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.pt-BR.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.pt-BR.xlf new file mode 100644 index 00000000000..9ad5964034c --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.pt-BR.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.ru.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.ru.xlf new file mode 100644 index 00000000000..195a9402e1c --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.ru.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.tr.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.tr.xlf new file mode 100644 index 00000000000..fbc79e11ff4 --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.tr.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.zh-Hans.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.zh-Hans.xlf new file mode 100644 index 00000000000..9fa4fc5effc --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.zh-Hans.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.zh-Hant.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.zh-Hant.xlf new file mode 100644 index 00000000000..1b8ca685d47 --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/LinkAreaEditor.zh-Hant.xlf @@ -0,0 +1,32 @@ + + + + + + LinkArea Editor + LinkArea Editor + + + + Cancel + Cancel + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + + + textBox1 + textBox1 + + + + + \ No newline at end of file diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.cs.xlf index aed4a01c3c9..407e132ee3d 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.cs.xlf @@ -187,6 +187,26 @@ Editor kolekce Images + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.de.xlf index aa7565ce636..9d6f1908458 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.de.xlf @@ -187,6 +187,26 @@ Bildsammlungs-Editor + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.es.xlf index eee6bde2c54..83d6178d64e 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.es.xlf @@ -187,6 +187,26 @@ Editor de la colección Imágenes + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.fr.xlf index 7d44270bd92..dddad273489 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.fr.xlf @@ -187,6 +187,26 @@ Éditeur de collections Images + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.it.xlf index 60513b1eea0..2d413931b2a 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.it.xlf @@ -187,6 +187,26 @@ Editor della raccolta Images + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ja.xlf index 4edbe6ae1ea..b6439f72367 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ja.xlf @@ -187,6 +187,26 @@ イメージ コレクション エディター + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ko.xlf index bea5f944e22..c3b7321be00 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ko.xlf @@ -187,6 +187,26 @@ 이미지 컬렉션 편집기 + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.pl.xlf index 6a6c3f95337..746e896812f 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.pl.xlf @@ -187,6 +187,26 @@ Edytor kolekcji obrazów + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.pt-BR.xlf index 0b588e6a81c..274694ea10e 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.pt-BR.xlf @@ -187,6 +187,26 @@ Editor de Coleção de Imagens + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ru.xlf index bf04210ecbf..855138bcf53 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.ru.xlf @@ -187,6 +187,26 @@ Редактор коллекции изображений + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.tr.xlf index 39b1181a04f..664d935252f 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.tr.xlf @@ -187,6 +187,26 @@ Görüntüler Koleksiyonu Düzenleyicisi + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.zh-Hans.xlf index 8be2b417ba3..917bb6e1a80 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.zh-Hans.xlf @@ -187,6 +187,26 @@ 图像集合编辑器 + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.zh-Hant.xlf index 2e1ab64cb27..01df7a78794 100644 --- a/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms.Design.Editors/src/Resources/xlf/SR.zh-Hant.xlf @@ -187,6 +187,26 @@ 影像集合編輯器 + + Cancel + Cancel + + + + LinkArea Editor + LinkArea Editor + + + + Select a &range of text to make your link: + Select a &range of text to make your link: + + + + OK + OK + + ListViewSubItem ListViewSubItem diff --git a/src/System.Windows.Forms.Design.Editors/src/System.Windows.Forms.Design.Editors.csproj b/src/System.Windows.Forms.Design.Editors/src/System.Windows.Forms.Design.Editors.csproj index 39b91288e25..1d50e61d7a6 100644 --- a/src/System.Windows.Forms.Design.Editors/src/System.Windows.Forms.Design.Editors.csproj +++ b/src/System.Windows.Forms.Design.Editors/src/System.Windows.Forms.Design.Editors.csproj @@ -32,6 +32,9 @@ System.Windows.Forms.Design + + System.Windows.Forms.Design + @@ -87,4 +90,12 @@ + + + True + True + LinkAreaEditor.resx + + + diff --git a/src/System.Windows.Forms.Design.Editors/src/System/Windows/Forms/Design/LinkAreaEditor.cs b/src/System.Windows.Forms.Design.Editors/src/System/Windows/Forms/Design/LinkAreaEditor.cs new file mode 100644 index 00000000000..1dccdba75bb --- /dev/null +++ b/src/System.Windows.Forms.Design.Editors/src/System/Windows/Forms/Design/LinkAreaEditor.cs @@ -0,0 +1,250 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.ComponentModel; +using System.ComponentModel.Design; +using System.Drawing.Design; + +namespace System.Windows.Forms.Design +{ + /// + /// Provides an editor that can be used to visually select and configure the link area of a link + /// label. + /// + internal class LinkAreaEditor : UITypeEditor + { + private LinkAreaUI _linkAreaUI; + + /// + /// Edits the given object value using the editor style provided by + /// GetEditorStyle. + /// + public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) + { + if (provider == null) + { + return value; + } + + IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); + if (edSvc == null) + { + return value; + } + + if (_linkAreaUI == null) + { + IHelpService helpService = (IHelpService)provider.GetService(typeof(IHelpService)); + + // child modal dialog -launching in System Aware mode + _linkAreaUI = DpiHelper.CreateInstanceInSystemAwareContext(() => new LinkAreaUI(this, helpService)); + } + + string text = string.Empty; + PropertyDescriptor prop = null; + + if (context != null && context.Instance != null) + { + prop = TypeDescriptor.GetProperties(context.Instance)["Text"]; + if (prop != null && prop.PropertyType == typeof(string)) + { + text = (string)prop.GetValue(context.Instance); + } + } + + string originalText = text; + _linkAreaUI.SampleText = text; + _linkAreaUI.Start(edSvc, value); + + if (edSvc.ShowDialog(_linkAreaUI) == DialogResult.OK) + { + value = _linkAreaUI.Value; + + text = _linkAreaUI.SampleText; + if (!originalText.Equals(text) && prop != null && prop.PropertyType == typeof(string)) + { + prop.SetValue(context.Instance, text); + } + } + + _linkAreaUI.End(); + + return value; + } + + /// + /// Gets the editing style of the Edit method. + /// + public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) + => UITypeEditorEditStyle.Modal; + + /// + /// Dialog box for the link area. + /// + internal class LinkAreaUI : Form + { + private Label _caption = new Label(); + private TextBox _sampleEdit = new TextBox(); + private Button _okButton = new Button(); + private Button _cancelButton = new Button(); + private TableLayoutPanel _okCancelTableLayoutPanel; + private readonly LinkAreaEditor _editor; + private IWindowsFormsEditorService _edSvc; + private readonly IHelpService _helpService = null; + + public LinkAreaUI(LinkAreaEditor editor, IHelpService helpService) + { + _editor = editor; + _helpService = helpService; + InitializeComponent(); + } + + public string SampleText + { + get + { + return _sampleEdit.Text; + } + set + { + _sampleEdit.Text = value; + UpdateSelection(); + } + } + + public object Value { get; private set; } + + public void End() + { + _edSvc = null; + Value = null; + } + + private void InitializeComponent() + { + ComponentResourceManager resources = new ComponentResourceManager(typeof(LinkAreaEditor)); + _caption = new Label(); + _sampleEdit = new TextBox(); + _okButton = new Button(); + _cancelButton = new Button(); + _okCancelTableLayoutPanel = new TableLayoutPanel(); + _okCancelTableLayoutPanel.SuspendLayout(); + SuspendLayout(); + _okButton.Click += new EventHandler(okButton_click); + // + // caption + // + resources.ApplyResources(_caption, "caption"); + _caption.Margin = new Padding(3, 1, 3, 0); + _caption.Name = "caption"; + // + // sampleEdit + // + resources.ApplyResources(_sampleEdit, "sampleEdit"); + _sampleEdit.Margin = new Padding(3, 2, 3, 3); + _sampleEdit.Name = "sampleEdit"; + _sampleEdit.HideSelection = false; + _sampleEdit.ScrollBars = ScrollBars.Vertical; + // + // okButton + // + resources.ApplyResources(_okButton, "okButton"); + _okButton.DialogResult = DialogResult.OK; + _okButton.Margin = new Padding(0, 0, 2, 0); + _okButton.Name = "okButton"; + // + // cancelButton + // + resources.ApplyResources(_cancelButton, "cancelButton"); + _cancelButton.DialogResult = DialogResult.Cancel; + _cancelButton.Margin = new Padding(3, 0, 0, 0); + _cancelButton.Name = "cancelButton"; + // + // okCancelTableLayoutPanel + // + resources.ApplyResources(_okCancelTableLayoutPanel, "okCancelTableLayoutPanel"); + _okCancelTableLayoutPanel.ColumnCount = 2; + _okCancelTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); + _okCancelTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); + _okCancelTableLayoutPanel.Controls.Add(_okButton, 0, 0); + _okCancelTableLayoutPanel.Controls.Add(_cancelButton, 1, 0); + _okCancelTableLayoutPanel.Margin = new Padding(3, 1, 3, 3); + _okCancelTableLayoutPanel.Name = "okCancelTableLayoutPanel"; + _okCancelTableLayoutPanel.RowCount = 1; + _okCancelTableLayoutPanel.RowStyles.Add(new RowStyle()); + _okCancelTableLayoutPanel.RowStyles.Add(new RowStyle()); + // + // LinkAreaEditor + // + resources.ApplyResources(this, "$this"); + AutoScaleMode = AutoScaleMode.Font; + CancelButton = _cancelButton; + Controls.Add(_okCancelTableLayoutPanel); + Controls.Add(_sampleEdit); + Controls.Add(_caption); + HelpButton = true; + MaximizeBox = false; + MinimizeBox = false; + Name = "LinkAreaEditor"; + ShowIcon = false; + ShowInTaskbar = false; + HelpButtonClicked += new CancelEventHandler(LinkAreaEditor_HelpButtonClicked); + _okCancelTableLayoutPanel.ResumeLayout(false); + _okCancelTableLayoutPanel.PerformLayout(); + ResumeLayout(false); + PerformLayout(); + } + + private void okButton_click(object sender, EventArgs e) + { + Value = new LinkArea(_sampleEdit.SelectionStart, _sampleEdit.SelectionLength); + } + + private string HelpTopic => "net.ComponentModel.LinkAreaEditor"; + + /// + /// Called when the help button is clicked. + /// + private void ShowHelp() + => _helpService?.ShowHelpFromKeyword(HelpTopic); + + private void LinkAreaEditor_HelpButtonClicked(object sender, CancelEventArgs e) + { + e.Cancel = true; + ShowHelp(); + } + + public void Start(IWindowsFormsEditorService edSvc, object value) + { + _edSvc = edSvc; + Value = value; + UpdateSelection(); + ActiveControl = _sampleEdit; + } + + private void UpdateSelection() + { + if (!(Value is LinkArea)) + { + return; + } + + LinkArea pt = (LinkArea)Value; + try + { + _sampleEdit.SelectionStart = pt.Start; + _sampleEdit.SelectionLength = pt.Length; + } + catch (Exception ex) + { + if (ClientUtils.IsCriticalException(ex)) + { + throw; + } + } + } + } + } +} +