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 class BooleanToObjectConverter : BindableObject, IValueConverter | |
{ | |
public static readonly BindableProperty TrueObjectProperty = BindableProperty.Create<BooleanToObjectConverter, Object>(x => x.TrueObject, null); | |
public static readonly BindableProperty FalseObjectProperty = BindableProperty.Create<BooleanToObjectConverter, Object>(x => x.FalseObject, null); | |
public object FalseObject | |
{ | |
get { return GetValue(FalseObjectProperty); } | |
set { SetValue(FalseObjectProperty, value); } | |
} |
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" ?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="Redirect old-domain to new-domain" stopProcessing="true"> | |
<match url=".*" /> | |
<action type="Redirect" url="http://<<appdomain>>/{R:0}" redirectType="Permanent" /> | |
</rule> | |
</rules> |
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
enum Channel : byte | |
{ | |
UnknownChannel = 0, | |
Email = 1, | |
CallCenter = 2, | |
BrokerHelpDesk = 3, | |
BrokerPortal = 4 | |
} |
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
CREATE TRIGGER address_versioning_trigger | |
BEFORE UPDATE OR DELETE ON location.address | |
FOR EACH ROW EXECUTE PROCEDURE address_trigger_function(); |
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
create function address_trigger_function() | |
returns trigger as $$ | |
BEGIN | |
insert into logging_address_address (address_id, type, street1, street2, street3, street4, city, po_box_code, phone_number, date_created, operation) | |
values (old.address_id, old.type, old.street1,old.street2,old.street3,old.street4,old.city,old.po_box_code,old.phone_number, old.date_created,TG_OP); | |
RETURN NEW; | |
end; | |
$$ LANGUAGE plpgsql; |
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
create table logging_address | |
( | |
like address EXCLUDING CONSTRAINTS, | |
operation char(10) not null, | |
date_operated timestamp with time zone not null default current_timestamp | |
); |
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
create table address | |
( | |
address_id integer not null, | |
type varchar(100), | |
street1 varchar(120) not null, | |
street2 varchar(120), | |
street3 varchar(120), | |
street4 varchar(120), | |
city varchar(80), | |
po_box_code varchar(20) not 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
file(GLOB PROTOBUF_DEFINITION_FILES "*.proto") | |
set(PROTOBUF_INPUT_DIRECTORY "${PROJECT_SOURCE_DIR}") | |
set(PROTOBUF_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Models/Proto/") | |
foreach(file ${PROTOBUF_DEFINITION_FILES}) | |
set(PROTOBUF_ARGUMENTS "protoc --proto_path=\"${PROTOBUF_INPUT_DIRECTORY}\" --cpp_out=\"${PROTOBUF_OUTPUT_DIRECTORY}\" \"${file}\"") | |
execute_process(COMMAND ${PROTOBUF_OUTPUT_DIRECTORY} | |
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} | |
RESULT_VARIABLE PROTOBUF_RESULT | |
OUTPUT_VARIABLE PROTOBUF_OUTPUT_VARIABLE) | |
endforeach() |
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
// Copyright (c) Microsoft. All rights reserved. | |
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | |
// From the microsoft samples here https://github.com/Azure/azure-iot-sdk-csharp/blob/master/device/samples/DeviceClientFileUploadSample/Program.cs | |
using System; | |
using System.IO; | |
using System.Threading.Tasks; | |
namespace Microsoft.Azure.Devices.Client.Samples | |
{ |
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 class ClassGenerator | |
{ | |
private readonly ModuleBuilder _moduleBuilder; | |
public ClassGenerator() | |
{ | |
var an = new AssemblyName("DynamicProtoAssembly"); | |
AssemblyBuilder assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(an,AssemblyBuilderAccess.Run); | |
_moduleBuilder = assemblyBuilder.DefineDynamicModule("DynamicProtoModule"); |
NewerOlder