Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View saramgsilva's full-sized avatar

Sara Silva saramgsilva

View GitHub Profile
@saramgsilva
saramgsilva / FileExporter
Created December 19, 2014 21:46
A file exporter based in a list of items but not matter which type.
/// <summary>
/// Define the Export File.
/// </summary>
public static class Export
{
/// <summary>
/// Exporters the list of items that can include the specified include header line.
/// </summary>
/// <typeparam name="T">The generic type.</typeparam>
/// <param name="includeHeaderLine">If set to <c>true</c> [include header line].</param>
@saramgsilva
saramgsilva / ConvertByteArryToBitmap
Created October 29, 2014 21:07
[C#] How to convert byte[] to bitmap
/// <summary>
/// Converts to bitmap.
/// </summary>
/// <param name="imagesSource">The images source.</param>
/// <returns>The bitmap.</returns>
private static Bitmap ConvertToBitmap(byte[] imagesSource)
{
var imageConverter = new ImageConverter();
var image = (Image)imageConverter.ConvertFrom(imagesSource);
return new Bitmap(image);
@saramgsilva
saramgsilva / ConvertByteArrayToWriteableBitmap
Created October 29, 2014 21:06
[Windows Phone] How to convert byte array to WriteableBitmap
/// <summary>
/// Converts the specified image.
/// </summary>
/// <param name="image">The image.</param>
/// <returns>The WriteableBitmap</returns>
public static WriteableBitmap ConvertToWriteableBitmap(byte[] image)
{
var bitmapImage = new BitmapImage();
var memoryStream = new MemoryStream(image);
bitmapImage.SetSource(memoryStream);
@saramgsilva
saramgsilva / ConvertByteArrayToBitmapImage
Created October 29, 2014 21:03
[Windows Phone] How to convert byte array to BitmapImage
/// <summary>
/// Converts to bitmap image.
/// </summary>
/// <param name="image">The image.</param>
/// <returns>the bitmap image</returns>
public static BitmapImage ConvertToBitmapImage(byte[] image)
{
var bitmapImage = new BitmapImage();
var memoryStream = new MemoryStream(image);
bitmapImage.SetSource(memoryStream);
@saramgsilva
saramgsilva / PowerShellForHyper-V
Created October 26, 2014 22:21
PowerShell commands for enable/disable the Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
Note: Run PowerShell as Admin
@saramgsilva
saramgsilva / MSBuildSampleUsingBatFile
Created October 26, 2014 14:25
bat for compile a snl in release mode
@echo off
cls
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe "C:\DevApps\GitHub\Forks\XForms-Toolkit\src\Xamarin.Forms.Labs\Xamarin.Forms.Labs.sln" /p:configuration=release
pause
@saramgsilva
saramgsilva / XCopySample
Created October 26, 2014 14:22
Post Build event for copy output to another folder
md "$(SolutionDir)\bin\$(ProjectName)"
xcopy "$(TargetDir)." "$(SolutionDir)\bin\$(ProjectName)" /E /Y /C