This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NamedList : List<T> | |
| { | |
| public string Name { get; set; } | |
| public NamedList(string name, IEnumerable<T> items) : base(items) | |
| { | |
| Name = name; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Messenger e' il Messenger del CommunityToolkit | |
| // CommandManager | |
| public partial class CommandManager : ObservableRecipient | |
| { | |
| private Stack<IStoryCommand> _undoStack = new Stack<IStoryCommand>(); | |
| private Stack<IStoryCommand> _redoStack = new Stack<IStoryCommand>(); | |
| public void ExecuteCommand(IStoryCommand command) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GO | |
| DBCC CHECKIDENT ('NomeTabella', RESEED, N); -- N è il valore massimo dell'ultimo ID. Il prossimo record avrà ID = N+1 | |
| GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using AutoMapper; | |
| using Dapper; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Data; | |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| namespace YourNamespace | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Extensions.DependencyInjection; | |
| public static IServiceCollection UseBaseServices(this IServiceCollection services) | |
| { | |
| services.AddSingleton<BaseService>(); | |
| return services; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static string GetUnique(IEnumerable<string> strings, string text, string separator) | |
| { | |
| string chk = text; | |
| int suffix = 1; | |
| while (strings.Contains(chk)) | |
| { | |
| suffix++; | |
| chk = $"{text}{separator}{suffix}"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <DataGridTextColumn | |
| Width="50" | |
| MinWidth="50" | |
| Binding="{Binding PropertyName}"> | |
| <DataGridTextColumn.HeaderStyle> | |
| <Style TargetType="DataGridColumnHeader"> | |
| <Setter Property="HorizontalContentAlignment" Value="Center" /> | |
| </Style> | |
| </DataGridTextColumn.HeaderStyle> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static bool WinUseDarkTheme() | |
| { | |
| try | |
| { | |
| var theme = (int?)Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme", -1); | |
| var response = theme == 0 ? true: false; | |
| return response; | |
| } | |
| catch (Exception) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void OpenFile() | |
| { | |
| if(string.IsNullOrEmpty(FilePath)) return; | |
| var extension = Path.GetExtension(FilePath); | |
| bool isExcel = extension == ".xlsx" ^ extension == ".xls"; | |
| if (!isExcel) return; | |
| try | |
| { | |
| using Process process= new Process(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [TestClass] | |
| public class TestClass1 | |
| { | |
| [TestMethod] | |
| public void TestClause() | |
| { | |
| //Arrange | |
| string sql = @"SELECT src.id FROM Walls src"; | |
| // Act |
NewerOlder