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 TapAction : Behavior<FrameworkElement> | |
{ | |
public string EventAfterStoryboard | |
{ | |
get { return (string)GetValue(EventAfterStoryboardProperty); } | |
set { SetValue(EventAfterStoryboardProperty, 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
static void Main(string[] args) | |
{ | |
int storage = 19; //10011 | |
int a = 1; //1 | |
int b = 2; //10 | |
int c = 4; //100 | |
int d = 8;//1000 | |
int e = 16;//10000 | |
Console.WriteLine("--------------------------------"); | |
Console.WriteLine("Check for the value 19 - 10011"); |
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 async static Task CreateSleepStoryboard(int ms) | |
{ | |
Storyboard sb = new Storyboard(); | |
sb.Duration = TimeSpan.FromMilliseconds(ms); | |
await sb.BeginAsync(); | |
} |
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 string GetDeviceInfo() | |
{ | |
string returnvalue = string.Empty; | |
try | |
{ | |
returnvalue = string.Format("manufacturer {0}, name {1}, firmware {2}, hardware {3}", | |
DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceName, DeviceStatus.DeviceFirmwareVersion, DeviceStatus.DeviceHardwareVersion); | |
} | |
catch |
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 ResolutionHelper | |
{ | |
public static Uri GetScaledImageUri(String imageName) | |
{ | |
int scaleFactor = (int)Application.Current.Host.Content.ScaleFactor; | |
switch (scaleFactor) | |
{ | |
case 100: return new Uri(imageName + "_wvga.png", UriKind.RelativeOrAbsolute); | |
case 150: return new Uri(imageName + "_720p.png", UriKind.RelativeOrAbsolute); | |
case 160: return new Uri(imageName + "_wxga.png", UriKind.RelativeOrAbsolute); |
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 Storyboard CreateOpacityStoryboard(FrameworkElement element) | |
{ | |
Storyboard sb = new Storyboard(); | |
DoubleAnimation opacityAnimation = new DoubleAnimation(); | |
opacityAnimation.From = 0; | |
opacityAnimation.To = 1; | |
opacityAnimation.Duration = TimeSpan.FromMilliseconds(300); | |
Storyboard.SetTarget(opacityAnimation, element); |
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
static SoundEffectInstance sei; | |
public async static Task PlaySound(string soundPath, bool delay = true) | |
{ | |
Stream waveFileStream = TitleContainer.OpenStream(soundPath); | |
SoundEffect se = SoundEffect.FromStream(waveFileStream); | |
sei = se.CreateInstance(); | |
FrameworkDispatcher.Update(); | |
sei.Play(); | |
if (delay) | |
await Task.Delay(se.Duration); |
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 List<int> GetRandomNumbersAroundCorrectOne(int correctOne, int margin, int count) | |
{ | |
List<int> results = new List<int>(); | |
for (int i = 0; i < count; i++) | |
{ | |
//get the prosimo | |
int prosimo = 1;// ((NextRandom(1, 3) % 2) == 0) ? 1 : -1; | |
int number; | |
if (prosimo == 1) | |
{ |
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
myObjects.Select((v, i) => new {myObject = v, index = i}).First(predicate).index; |
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 api = { | |
"post": function (req, res, next) { | |
var sqlstring = 'UPDATE Highscore SET score=@score,playername=@playername WHERE id=@id'; | |
var query= {sql:sqlstring, | |
parameters:[ | |
{name:'score',value:req.body.score}, | |
{name:'playername',value:req.body.playername}, | |
{name:'id',value:req.body.id}]}; |
OlderNewer