Skip to content

Instantly share code, notes, and snippets.

View Yecats's full-sized avatar

Stacey Haffner Yecats

View GitHub Profile
@Yecats
Yecats / netnamedpipebindingsample.cs
Created August 2, 2016 16:50
NetNamedPipeBinding Sample
<configuration>
<appSettings>
<add key="wcf:useBestMatchNamedPipeUri" value="true" />
</appSettings>
</configuration>
@Yecats
Yecats / datacontractjsonserializersample.cs
Created August 2, 2016 16:51
DataContractJsonSerializer Sample
<runtime>
<AppContextSwitchOverrides value="Switch.System.Runtime.Serialization.DoNotUseTimeZoneInfo=false" />
</runtime>
@Yecats
Yecats / transportsecuritycngsample.xml
Last active August 2, 2016 19:30
Transport Security CNG Sample
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version=".NETFramework,Version=v4.6.2"/>
</startup>
</configuration>
@Yecats
Yecats / transportsecuritycngsample2.xml
Last active August 2, 2016 19:30
Transport Security Sample 2
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version=".NETFramework,Version=v4.5.2"/>
</startup>
<runtime>
<AppContextSwitchOverrides value="Switch.System.ServiceModel.DisableCngCertificates=false" />
</runtime>
</configuration>
@Yecats
Yecats / transportsecuritycngsample3.cs
Created August 2, 2016 16:55
Transport Security CNG Sample 3
private const string DisableCngCertificates = @"Switch.System.ServiceModel.DisableCngCertificates";
AppContext.SetSwitch(DisableCngCertificates, false);
@Yecats
Yecats / operationcontextcurrentasyncsample.cs
Created August 2, 2016 16:57
OperationContext.Current Async Sample
public async Task InvokeCallbackWithDelay(int delay)
{
int threadId1 = Thread.CurrentThread.ManagedThreadId;
OperationContext.Current.GetCallbackChannel<IServiceCallback>().TheCallback("One");
await Task.Delay(delay);
int threadId2 = Thread.CurrentThread.ManagedThreadId;
OperationContext.Current.GetCallbackChannel<IServiceCallback>().TheCallback("Two");
}
@Yecats
Yecats / wpfgroupsortingsample1.xaml
Last active August 2, 2016 19:30
WPF Group Sorting Sample 1
<GroupDescriptions>
<PropertyGroupDescription
PropertyName=”Age”
CustomSort=
”{x:Static PropertyGroupDescription.CompareNamesAscending}”/>
</PropertyGroupDescription>
</GroupDescriptions>
<SortDescriptions>
<SortDescription PropertyName=”LastName”/>
@Yecats
Yecats / wpfgroupsortingsample2.xaml
Last active August 2, 2016 19:30
WPF Group Sorting Sample 2
<GroupDescriptions>
<PropertyGroupDescription PropertyName=”Age”/>
</GroupDescriptions>
<SortDescriptions>
<SortDescription PropertyName=”Age”/>
<SortDescription PropertyName=”LastName”/>
</SortDescriptions>
/// <summary>
/// This is a Monobehavior callback that happens when the player enters a collider that is set to type "trigger"
/// </summary>
private void OnTriggerEnter(Collider other)
{
// Check the object that collided and store a reference if the player is what entered the zone.
//The Player game object needs to have the Tag set to "Player" for this check to work.
if (other.gameObject.tag.Equals("Player"))
{
_objectToLookAt = other.transform;
public class GeneralInteraction : MonoBehaviour
{
private Transform _objectToLookAt = null;
private bool _isRotating = false;
private Quaternion _defaultRotation;
public void Start()
{
//Store the default rotation of the NPC in case it is rotated towards the player object later.
_defaultRotation = transform.rotation;