Sublime inserted tabs - fixed

This commit is contained in:
cygon 2024-07-27 08:56:29 +02:00
parent 8647769256
commit 54cab3a63f

View File

@ -52,17 +52,17 @@ replicate all the data of a class - any private field and hidden state.
```csharp ```csharp
class Example { class Example {
public Example(Example child = null) { public Example(Example child = null) {
Child = child; Child = child;
} }
public Example Child { get; private set; } public Example Child { get; private set; }
} }
class Test { class Test {
public static void CloneSomething() { public static void CloneSomething() {
var test = new Example(new Example()); var test = new Example(new Example());
var reflectionCloner = new ReflectionCloner(); var reflectionCloner = new ReflectionCloner();
var clone = reflectionCloner.DeepFieldClone(test); var clone = reflectionCloner.DeepFieldClone(test);
// Clone is now a complete copy of test, including the child object // Clone is now a complete copy of test, including the child object
} }
@ -100,18 +100,18 @@ void saveSettingsToIni() {
saveSettings(iniStore); saveSettings(iniStore);
using(var writer = new StreamWriteR("awesome-app.ini")) { using(var writer = new StreamWriteR("awesome-app.ini")) {
iniStore.Save(writer); iniStore.Save(writer);
writer.Flush() writer.Flush()
} }
} }
void saveSettingsToRegistry() { void saveSettingsToRegistry() {
using( using(
var registryStore = new WindowsRegistryStore( var registryStore = new WindowsRegistryStore(
RegistryHive.HKCU, "AwesomeApplication" RegistryHive.HKCU, "AwesomeApplication"
) )
) { ) {
saveSettings(registryStore); saveSettings(registryStore);
} }
} }
``` ```
@ -131,13 +131,13 @@ more pleasant to use:
class CreateUserViewModel : Observable { class CreateUserViewModel : Observable {
public string FirstName { public string FirstName {
get { return this.firstName; } get { return this.firstName; }
set { set {
if(value != this.firstName) { if(value != this.firstName) {
this.firstName = value; this.firstName = value;
OnPropertyChanged(nameof(FirstName)); OnPropertyChanged(nameof(FirstName));
} }
} }
} }
private string firstName; private string firstName;
@ -153,7 +153,7 @@ CreateUserViewModel ViewModel { get; set; }
void onPropertyChanged(object sender, PropertyChangedEventArgs arguments) { void onPropertyChanged(object sender, PropertyChangedEventArgs arguments) {
if(arguments.AreAffecting(nameof(ViewModel.FirstName))) { if(arguments.AreAffecting(nameof(ViewModel.FirstName))) {
this.firstNameLine.Text = ViewModel.FirstName; this.firstNameLine.Text = ViewModel.FirstName;
} }
} }
``` ```