├── IpAddressControlDemo ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── App.xaml.cs ├── App.xaml ├── MainWindow.xaml.cs ├── MainWindow.xaml ├── MainWindowViewModel.cs └── IpAddressControlDemo.csproj ├── IpAddressControl ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── BaseViewModel.cs ├── ControlExtensions.cs ├── IPRangeValidationRule.cs ├── IpAddressControl.csproj ├── IpAddressControl.xaml.cs ├── IpAddressControlViewModel.cs └── IpAddressControl.xaml ├── IpAddressControlDemo.sln.DotSettings ├── LICENSE ├── IpAddressControlDemo.sln ├── README.md └── .gitignore /IpAddressControlDemo/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /IpAddressControl/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /IpAddressControlDemo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /IpAddressControlDemo/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace IpAddressControlDemo 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /IpAddressControlDemo/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /IpAddressControlDemo.sln.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | True -------------------------------------------------------------------------------- /IpAddressControl/BaseViewModel.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace IpAddressControl 3 | { 4 | using System.ComponentModel; 5 | using System.Runtime.CompilerServices; 6 | 7 | public class BaseViewModel : INotifyPropertyChanged 8 | { 9 | public event PropertyChangedEventHandler PropertyChanged; 10 | 11 | protected void OnPropertyChanged([CallerMemberName] string propertyName = "") 12 | { 13 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /IpAddressControlDemo/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace IpAddressControlDemo 17 | { 18 | /// 19 | /// Interaction logic for MainWindow.xaml 20 | /// 21 | public partial class MainWindow : Window 22 | { 23 | public MainWindow() 24 | { 25 | InitializeComponent(); 26 | this.DataContext = new MainWindowViewModel(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /IpAddressControl/ControlExtensions.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace IpAddressControl 3 | { 4 | using System.Windows; 5 | 6 | public static class FocusChangeExtension 7 | { 8 | public static bool GetIsFocused(DependencyObject obj) 9 | { 10 | return (bool)obj.GetValue(IsFocusedProperty); 11 | } 12 | 13 | public static void SetIsFocused(DependencyObject obj, bool value) 14 | { 15 | obj.SetValue(IsFocusedProperty, value); 16 | } 17 | 18 | public static readonly DependencyProperty IsFocusedProperty = 19 | DependencyProperty.RegisterAttached( 20 | "IsFocused", typeof(bool), typeof(FocusChangeExtension), 21 | new UIPropertyMetadata(false, OnIsFocusedPropertyChanged)); 22 | 23 | private static void OnIsFocusedPropertyChanged( 24 | DependencyObject d, 25 | DependencyPropertyChangedEventArgs e) 26 | { 27 | var control = (UIElement)d; 28 | if ((bool)e.NewValue) 29 | { 30 | control.Focus(); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Jony Cao 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /IpAddressControlDemo/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /IpAddressControl/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace IpAddressControl.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /IpAddressControlDemo/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace IpAddressControlDemo.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /IpAddressControlDemo/MainWindowViewModel.cs: -------------------------------------------------------------------------------- 1 | using IpAddressControl; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace IpAddressControlDemo 10 | { 11 | public class MainWindowViewModel : BaseViewModel 12 | { 13 | 14 | private IpAddressViewModel _IpAddressViewModel1; 15 | 16 | public IpAddressViewModel IpAddressViewModel1 17 | { 18 | get { return _IpAddressViewModel1; } 19 | set 20 | { 21 | _IpAddressViewModel1 = value; 22 | OnPropertyChanged(); 23 | } 24 | } 25 | 26 | private IpAddressViewModel _IpAddressViewModel2; 27 | 28 | public IpAddressViewModel IpAddressViewModel2 29 | { 30 | get { return _IpAddressViewModel2; } 31 | set 32 | { 33 | _IpAddressViewModel2 = value; 34 | OnPropertyChanged(); 35 | } 36 | } 37 | 38 | public MainWindowViewModel() 39 | { 40 | IpAddressViewModel1 = new IpAddressViewModel(); 41 | IpAddressViewModel2 = new IpAddressViewModel(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /IpAddressControlDemo.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.136 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IpAddressControlDemo", "IpAddressControlDemo\IpAddressControlDemo.csproj", "{11ACA703-6BBE-4171-A3BF-3C657022607F}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IpAddressControl", "IpAddressControl\IpAddressControl.csproj", "{63B37498-3E06-4C60-8AC8-A5759DE4A106}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {11ACA703-6BBE-4171-A3BF-3C657022607F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {11ACA703-6BBE-4171-A3BF-3C657022607F}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {11ACA703-6BBE-4171-A3BF-3C657022607F}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {11ACA703-6BBE-4171-A3BF-3C657022607F}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {63B37498-3E06-4C60-8AC8-A5759DE4A106}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {63B37498-3E06-4C60-8AC8-A5759DE4A106}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {63B37498-3E06-4C60-8AC8-A5759DE4A106}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {63B37498-3E06-4C60-8AC8-A5759DE4A106}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {BBFC3E5A-6BF8-4D1D-B21B-CA51E1AFBCFC} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IpAddressControl 2 | WPF IpAddressControl 3 | 4 | 5 | 6 | # IpAddressControl 使用 7 | IpAddressControl使用需要绑定IpAddressViewModel类 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | ViewModel: 20 | 21 | public class MainWindowViewModel : BaseViewModel 22 | { 23 | 24 | private IpAddressViewModel _IpAddressViewModel1; 25 | 26 | public IpAddressViewModel IpAddressViewModel1 27 | { 28 | get { return _IpAddressViewModel1; } 29 | set 30 | { 31 | _IpAddressViewModel1 = value; 32 | OnPropertyChanged(); 33 | } 34 | } 35 | 36 | private IpAddressViewModel _IpAddressViewModel2; 37 | 38 | public IpAddressViewModel IpAddressViewModel2 39 | { 40 | get { return _IpAddressViewModel2; } 41 | set 42 | { 43 | _IpAddressViewModel2 = value; 44 | OnPropertyChanged(); 45 | } 46 | } 47 | 48 | public MainWindowViewModel() 49 | { 50 | IpAddressViewModel1 = new IpAddressViewModel(); 51 | IpAddressViewModel2 = new IpAddressViewModel(); 52 | } 53 | } 54 | 55 | # 运行效果 56 | ![](https://i.imgur.com/8KiElYQ.gif) 57 | -------------------------------------------------------------------------------- /IpAddressControl/IPRangeValidationRule.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace IpAddressControl 3 | { 4 | using System; 5 | using System.Globalization; 6 | using System.Windows.Controls; 7 | 8 | public class IPRangeValidationRule : ValidationRule 9 | { 10 | private int _min; 11 | private int _max; 12 | 13 | public int Min 14 | { 15 | get { return _min; } 16 | set { _min = value; } 17 | } 18 | 19 | public int Max 20 | { 21 | get { return _max; } 22 | set { _max = value; } 23 | } 24 | 25 | public override ValidationResult Validate(object value, CultureInfo cultureInfo) 26 | { 27 | int val = 0; 28 | var strVal = (string)value; 29 | try 30 | { 31 | if (strVal.Length > 0) 32 | { 33 | if (strVal.EndsWith(".")) 34 | { 35 | return CheckRanges(strVal.Replace(".", "")); 36 | } 37 | 38 | // Allow dot character to move to next box 39 | return CheckRanges(strVal); 40 | } 41 | } 42 | catch (Exception e) 43 | { 44 | return new ValidationResult(false, "Illegal characters or " + e.Message); 45 | } 46 | 47 | if ((val < Min) || (val > Max)) 48 | { 49 | return new ValidationResult(false, 50 | "Please enter the value in the range: " + Min + " - " + Max + "."); 51 | } 52 | else 53 | { 54 | return ValidationResult.ValidResult; 55 | } 56 | } 57 | 58 | private ValidationResult CheckRanges(string strVal) 59 | { 60 | if (int.TryParse(strVal, out var res)) 61 | { 62 | if ((res < Min) || (res > Max)) 63 | { 64 | return new ValidationResult(false, 65 | "Please enter the value in the range: " + Min + " - " + Max + "."); 66 | } 67 | else 68 | { 69 | return ValidationResult.ValidResult; 70 | } 71 | } 72 | else 73 | { 74 | return new ValidationResult(false, "Illegal characters entered"); 75 | } 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /IpAddressControl/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("IpAddressControl")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("IpAddressControl")] 15 | [assembly: AssemblyCopyright("Copyright © Jony 2019")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /IpAddressControlDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("IpAddressControlDemo")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("IpAddressControlDemo")] 15 | [assembly: AssemblyCopyright("Copyright © Jony 2019")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /IpAddressControl/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace IpAddressControl.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IpAddressControl.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /IpAddressControlDemo/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace IpAddressControlDemo.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IpAddressControlDemo.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /IpAddressControl/IpAddressControl.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {63B37498-3E06-4C60-8AC8-A5759DE4A106} 8 | Library 9 | IpAddressControl 10 | IpAddressControl 11 | v4.6.1 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | true 17 | 18 | 19 | AnyCPU 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | AnyCPU 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 4.0 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | IpAddressControl.xaml 61 | 62 | 63 | 64 | 65 | Code 66 | 67 | 68 | True 69 | True 70 | Resources.resx 71 | 72 | 73 | True 74 | Settings.settings 75 | True 76 | 77 | 78 | ResXFileCodeGenerator 79 | Resources.Designer.cs 80 | 81 | 82 | SettingsSingleFileGenerator 83 | Settings.Designer.cs 84 | 85 | 86 | 87 | 88 | MSBuild:Compile 89 | Designer 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /IpAddressControl/IpAddressControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Controls; 4 | using System.Windows.Input; 5 | 6 | namespace IpAddressControl 7 | { 8 | /// 9 | /// Interaction logic for IpAddressControl.xaml 10 | /// 11 | public partial class IpAddressControl : UserControl 12 | { 13 | public IpAddressControl() 14 | { 15 | InitializeComponent(); 16 | DataObject.AddPastingHandler(part1, TextBox_Pasting); 17 | 18 | } 19 | 20 | 21 | private void TextBox_Pasting(object sender, DataObjectPastingEventArgs e) 22 | { 23 | var vm = this.DataContext as IpAddressViewModel; 24 | if (e.DataObject.GetDataPresent(typeof(String))) 25 | { 26 | String pastingText = (String)e.DataObject.GetData(typeof(String)); 27 | vm.SetAddress(pastingText); 28 | part1.Focus(); 29 | e.CancelCommand(); 30 | } 31 | 32 | } 33 | 34 | private void Part4_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) 35 | { 36 | if (e.Key == Key.Back && part4.Text == "") 37 | { 38 | part3.CaretIndex = part3.Text.Length; 39 | part3.Focus(); 40 | } 41 | if (e.Key == Key.Left && part4.CaretIndex == 0) 42 | { 43 | part3.Focus(); 44 | e.Handled = true; 45 | } 46 | 47 | if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control) && e.Key == Key.C) 48 | { 49 | if (part4.SelectionLength == 0) 50 | { 51 | var vm = this.DataContext as IpAddressViewModel; 52 | Clipboard.SetText(vm.AddressText); 53 | } 54 | } 55 | } 56 | 57 | private void Part2_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) 58 | { 59 | if (e.Key == Key.Back && part2.Text == "") 60 | { 61 | part1.CaretIndex = part1.Text.Length; 62 | part1.Focus(); 63 | } 64 | if (e.Key == Key.Right && part2.CaretIndex == part2.Text.Length) 65 | { 66 | part3.Focus(); 67 | e.Handled = true; 68 | } 69 | if (e.Key == Key.Left && part2.CaretIndex == 0) 70 | { 71 | part1.Focus(); 72 | e.Handled = true; 73 | } 74 | 75 | if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control) && e.Key == Key.C) 76 | { 77 | if (part2.SelectionLength == 0) 78 | { 79 | var vm = this.DataContext as IpAddressViewModel; 80 | Clipboard.SetText(vm.AddressText); 81 | } 82 | } 83 | } 84 | 85 | private void Part3_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) 86 | { 87 | if (e.Key == Key.Back && part3.Text == "") 88 | { 89 | part2.CaretIndex = part2.Text.Length; 90 | part2.Focus(); 91 | } 92 | if (e.Key == Key.Right && part3.CaretIndex == part3.Text.Length) 93 | { 94 | part4.Focus(); 95 | e.Handled = true; 96 | } 97 | if (e.Key == Key.Left && part3.CaretIndex == 0) 98 | { 99 | part2.Focus(); 100 | e.Handled = true; 101 | } 102 | 103 | if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control) && e.Key == Key.C) 104 | { 105 | if (part3.SelectionLength == 0) 106 | { 107 | var vm = this.DataContext as IpAddressViewModel; 108 | Clipboard.SetText(vm.AddressText); 109 | } 110 | } 111 | } 112 | 113 | private void Part1_PreviewKeyDown(object sender, KeyEventArgs e) 114 | { 115 | if (e.Key == Key.Right&&part1.CaretIndex == part1.Text.Length) 116 | { 117 | part2.Focus(); 118 | e.Handled = true; 119 | } 120 | if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control) && e.Key == Key.C) 121 | { 122 | if (part1.SelectionLength == 0) 123 | { 124 | var vm = this.DataContext as IpAddressViewModel; 125 | Clipboard.SetText(vm.AddressText); 126 | } 127 | } 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /IpAddressControlDemo/IpAddressControlDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {11ACA703-6BBE-4171-A3BF-3C657022607F} 8 | WinExe 9 | IpAddressControlDemo 10 | IpAddressControlDemo 11 | v4.6.1 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | true 17 | 18 | 19 | AnyCPU 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | AnyCPU 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 4.0 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | MSBuild:Compile 56 | Designer 57 | 58 | 59 | MSBuild:Compile 60 | Designer 61 | 62 | 63 | App.xaml 64 | Code 65 | 66 | 67 | MainWindow.xaml 68 | Code 69 | 70 | 71 | 72 | 73 | 74 | Code 75 | 76 | 77 | True 78 | True 79 | Resources.resx 80 | 81 | 82 | True 83 | Settings.settings 84 | True 85 | 86 | 87 | ResXFileCodeGenerator 88 | Resources.Designer.cs 89 | 90 | 91 | SettingsSingleFileGenerator 92 | Settings.Designer.cs 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | {63b37498-3e06-4c60-8ac8-a5759de4a106} 101 | IpAddressControl 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /IpAddressControl/IpAddressControlViewModel.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace IpAddressControl 3 | { 4 | using System; 5 | 6 | public class IpAddressViewModel : BaseViewModel 7 | { 8 | public event EventHandler AddressChanged; 9 | 10 | public string AddressText 11 | { 12 | get { return $"{Part1??"0"}.{Part2??"0"}.{Part3??"0"}.{Part4??"0"}"; } 13 | } 14 | 15 | private bool isPart1Focused; 16 | 17 | public bool IsPart1Focused 18 | { 19 | get { return isPart1Focused; } 20 | set { isPart1Focused = value; OnPropertyChanged(); } 21 | } 22 | 23 | private string part1; 24 | 25 | public string Part1 26 | { 27 | get { return part1; } 28 | set 29 | { 30 | part1 = value; 31 | SetFocus(true, false, false, false); 32 | 33 | var moveNext = CanMoveNext(ref part1); 34 | 35 | OnPropertyChanged(); 36 | OnPropertyChanged(nameof(AddressText)); 37 | AddressChanged?.Invoke(this, EventArgs.Empty); 38 | 39 | if (moveNext) 40 | { 41 | SetFocus(false, true, false, false); 42 | } 43 | } 44 | } 45 | 46 | private bool isPart2Focused; 47 | 48 | public bool IsPart2Focused 49 | { 50 | get { return isPart2Focused; } 51 | set { isPart2Focused = value; OnPropertyChanged(); } 52 | } 53 | 54 | 55 | private string part2; 56 | 57 | public string Part2 58 | { 59 | get { return part2; } 60 | set 61 | { 62 | part2 = value; 63 | SetFocus(false, true, false, false); 64 | 65 | var moveNext = CanMoveNext(ref part2); 66 | 67 | OnPropertyChanged(); 68 | OnPropertyChanged(nameof(AddressText)); 69 | AddressChanged?.Invoke(this, EventArgs.Empty); 70 | 71 | if (moveNext) 72 | { 73 | SetFocus(false, false, true, false); 74 | } 75 | } 76 | } 77 | 78 | private bool isPart3Focused; 79 | 80 | public bool IsPart3Focused 81 | { 82 | get { return isPart3Focused; } 83 | set { isPart3Focused = value; OnPropertyChanged(); } 84 | } 85 | 86 | private string part3; 87 | 88 | public string Part3 89 | { 90 | get { return part3; } 91 | set 92 | { 93 | part3 = value; 94 | SetFocus(false, false, true, false); 95 | var moveNext = CanMoveNext(ref part3); 96 | 97 | OnPropertyChanged(); 98 | OnPropertyChanged(nameof(AddressText)); 99 | AddressChanged?.Invoke(this, EventArgs.Empty); 100 | 101 | if (moveNext) 102 | { 103 | SetFocus(false, false, false, true); 104 | } 105 | } 106 | } 107 | 108 | private bool isPart4Focused; 109 | 110 | public bool IsPart4Focused 111 | { 112 | get { return isPart4Focused; } 113 | set { isPart4Focused = value; OnPropertyChanged(); } 114 | } 115 | 116 | private string part4; 117 | 118 | public string Part4 119 | { 120 | get { return part4; } 121 | set 122 | { 123 | part4 = value; 124 | SetFocus(false, false, false, true); 125 | var moveNext = CanMoveNext(ref part4); 126 | 127 | OnPropertyChanged(); 128 | OnPropertyChanged(nameof(AddressText)); 129 | AddressChanged?.Invoke(this, EventArgs.Empty); 130 | 131 | } 132 | } 133 | 134 | public void SetAddress(string address) 135 | { 136 | if (string.IsNullOrWhiteSpace(address)) 137 | return; 138 | 139 | var parts = address.Split('.'); 140 | 141 | if (int.TryParse(parts[0], out var num0)) 142 | { 143 | Part1 = num0.ToString(); 144 | } 145 | 146 | if (int.TryParse(parts[1], out var num1)) 147 | { 148 | Part2 = parts[1]; 149 | } 150 | 151 | if (int.TryParse(parts[2], out var num2)) 152 | { 153 | Part3 = parts[2]; 154 | } 155 | 156 | if (int.TryParse(parts[3], out var num3)) 157 | { 158 | Part4 = parts[3]; 159 | } 160 | 161 | } 162 | 163 | private bool CanMoveNext(ref string part) 164 | { 165 | bool moveNext = false; 166 | 167 | if (!string.IsNullOrWhiteSpace(part)) 168 | { 169 | if (part.Length >= 3) 170 | { 171 | moveNext = true; 172 | } 173 | 174 | if (part.EndsWith(".")) 175 | { 176 | moveNext = true; 177 | part = part.Replace(".", ""); 178 | } 179 | } 180 | 181 | return moveNext; 182 | } 183 | 184 | private void SetFocus(bool part1, bool part2, bool part3, bool part4) 185 | { 186 | IsPart1Focused = part1; 187 | IsPart2Focused = part2; 188 | IsPart3Focused = part3; 189 | IsPart4Focused = part4; 190 | } 191 | 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /IpAddressControl/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /IpAddressControlDemo/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /IpAddressControl/IpAddressControl.xaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 22 | 23 | 24 | 25 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 79 | 80 | 81 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 106 | 107 | 108 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 133 | 134 | 135 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | --------------------------------------------------------------------------------