This file contains 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
if (entity.GetType() != typeof(LogAuditoriaEntity) && (entity is AuditableEntity)) | |
{ | |
try | |
{ | |
var logAuditoria = new LogAuditoriaEntity | |
{ | |
NomeTabela = ObterNomeTabela(persister), | |
TipoOperacao = operacao, | |
TxtComando = ObterComandoSql(session), | |
ForeignId = id.ToString() |
This file contains 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 System; | |
using System.Data; | |
using NHibernate; | |
using NHibernate.SqlTypes; | |
using NHibernate.UserTypes; | |
namespace Framework.DataAccess.NHibernate.UserTypes | |
{ | |
[Serializable] | |
public class SimNaoType : IUserType |
This file contains 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 void CopyProperties(object from, object to) | |
{ | |
foreach (var p in ((object)from).GetType().GetProperties()) | |
{ | |
var toProperty = to.GetType().GetProperty(p.Name); | |
var fromValue = p.GetValue(from, null); | |
if (toProperty.PropertyType.IsValueType) | |
{ | |
var convertedValue = Convert.ChangeType(fromValue, toProperty.PropertyType); | |
toProperty.SetValue(to, convertedValue, null); |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<Header> | |
<Title>Stopwatch</Title> | |
<Author>Jonathas Piazzarollo Costa</Author> | |
<Shortcut>stopwatch</Shortcut> | |
<Description>Surrounds code with Stopwatch.</Description> | |
<SnippetTypes> | |
<SnippetType>SurroundsWith</SnippetType> | |
</SnippetTypes> |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<Header> | |
<Title>Rules Property</Title> | |
<Author>Jonathas Piazzarollo Costa</Author> | |
<Shortcut>rulesproperty</Shortcut> | |
<Description>Creates a Rules property.</Description> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> |
This file contains 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
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Test case</Title> | |
<Shortcut>testcase</Shortcut> | |
<Description>Test case method</Description> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> |
This file contains 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
var engine = new ScriptEngine(); | |
new[] { | |
"System", | |
"System.Core" | |
}.ToList().ForEach(assembly => engine.AddReference(assembly)); | |
new[] { | |
"System", | |
"System.Linq" |
This file contains 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 class LinqExtensions | |
{ | |
public static IEnumerable<T> AsHierarchy<T>(this IEnumerable<T> collection, | |
Func<T, T> parentSelector, Expression<Func<T, IEnumerable<T>>> childrenSelector, T root = default(T)) | |
{ | |
var items = collection.Where(x => parentSelector(x).Equals(root)).Safe(); | |
foreach (var item in items) | |
{ | |
var childrenProperty = (childrenSelector.Body as MemberExpression).Member as PropertyInfo; |
This file contains 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
extern int MonthsToLimitZone = 8; | |
extern double volume = 0.01; | |
extern double spaceBetweenOrders = 0.001; | |
extern int MagicNumber = 1234567890; | |
extern double profitInCurrency = 0.01; | |
extern double stopLossOrderLimit = 5.0; | |
double lowestDay, highestDay; | |
double beginOfSellZone, endOfSellZone; | |
double beginOfBuyZone, endOfBuyZone; |
This file contains 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
extern int BarCount = 100; | |
extern int MagicNumber = 123456789; | |
extern double InitialVolume = 0.01; | |
extern int SlipPage = 3; | |
extern int MaxOrders = 40; | |
extern double MinimumDistanceForNewOrder = 70; | |
extern bool AutoConfig = false; | |
double lowest, highest; | |
double buyVolume, sellVolume; |