Skip to content

Instantly share code, notes, and snippets.

View jakesays-old's full-sized avatar

Big Jake jakesays-old

View GitHub Profile
//externally exposed data object
public partial class Person
{
public string FirstName { get; private set; }
public string LastName { get; private set; }
}
public partial class Person
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ParseHex
{
void Main()
{
// var y = new string('A', 536_870_912);
var y = "AB4C98";
var x = ParseHexString(y);
x.Dump();
}
byte[] ParseHexString(string hex)
public static void SetFieldValue(MessageWrapper message, string fieldName, object fieldValue)
{
if (message != null)
{
if (message.FixMessage != null)
{
QFReflector.SetFieldValue(message.FixMessage, fieldName, fieldValue);
}
else
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace Std.BasicTypes
{
[Serializable]
public class PropertyTrackingManager : INotifyPropertyChanged
{
private object _eventSender;
@jakesays-old
jakesays-old / SignalRangeModel.cs
Created December 9, 2017 04:24
Backing store example
using System.ComponentModel;
using Money.Common.Contracts.Configuration;
using Std.BasicTypes;
//ReSharper disable ImpureMethodCallOnReadonlyValueField
namespace Money.Tools.ModelEditors.Models
{
public class SignalRangeModel : INotifyPropertyChanged
{
products.AddRange(from row in sheet.GetRowEnumerator()
.AsEnumerable<HSSFRow>()
.SkipUntil(r => r.Cells[0].StringCellValue == "Clearing")
let clearingSymbol = row.Cells[clearingCell].StringCellValue
let globexSymbol = row.Cells[globexCell].StringCellValue
let floorSymbol = row.Cells[floorCell].StringCellValue
let clearportSymbol = row.Cells[clearportCell].StringCellValue
let productName = row.Cells[productNameCell].StringCellValue
let specUrl = row.Cells[productNameCell].Hyperlink?.Address
let @group = row.Cells[groupCell].StringCellValue
using System;
using System.IO;
namespace Std.Utility.Xml
{
/// <summary>
/// Simple class to support reading multiple files of xml fragments
/// as though they were a single file (or a single file that is an XML fragment).
/// Useful with XLinq.
/// </summary>
using System;
using System.Runtime.CompilerServices;
namespace Std.BasicTypes
{
[Serializable]
public struct TrackedBackingStore<TStoreType>
{
private TStoreType _value;
private readonly PropertyTrackingManager _manager;
public static List<string> SelectFolders(IHostWindow hostWindow, SelectFolderOptions options)
{
Arguments.RequireNotNull(hostWindow, nameof(hostWindow));
Arguments.RequireNotNull(options, nameof(options));
Arguments.RequireNotNullOrEmpty(options.Title, nameof(options.Title));
var dlg = new CommonOpenFileDialog
{
EnsureReadOnly = options.EnsureReadOnly,
IsFolderPicker = true,