This file contains hidden or 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.Collections.Generic; | |
using System.Diagnostics.Contracts; | |
using System.Web.Http.Dependencies; | |
using Ninject; | |
using Ninject.Syntax; | |
public class NinjectDependencyScope : IDependencyScope | |
{ | |
private IResolutionRoot resolver; |
This file contains hidden or 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
// source code orginaly from http://www.dotnettips.info/post/1244/ | |
/* | |
Use as extension method: | |
var date1 = DateTime.Now.ToPesianDateString("yyyy/MM/dd"); | |
var date2 = DateTime.Now.ToPeianDateString("dddd, dd MMMM,yyyy"); | |
//Output: | |
//1391/12/13 | |
//یکشنبه, 13 اسفند,1391 |
This file contains hidden or 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
#pragma warning disable 0618 | |
using System; | |
using System.Text; | |
using System.Runtime.InteropServices; | |
using System.Security.Permissions; | |
[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] | |
namespace System.Windows.Forms | |
{ | |
public class MessageBoxManager |
This file contains hidden or 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
class AStar | |
{ | |
private static bool InBounds(int x, int y, bool[,] map) | |
{ | |
if (x >= 0 && y >= 0 && y < map.GetLength(0) && x < map.GetLength(1)) | |
return true; | |
return false; | |
} |
This file contains hidden or 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
class Node : IComparable<Node> | |
{ | |
public int H | |
{ | |
get | |
{ | |
return Math.Abs(X - TargetNode.Position.X) + | |
Math.Abs(Y - TargetNode.Position.Y); | |
} | |
} |
This file contains hidden or 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
<Themes> | |
<Theme Name="Ninja" GUID="{18d95dec-1d05-4e75-b38a-b107a53d5fc4}"> | |
<Category Name="Autos" GUID="{a7ee6bee-d0aa-4b2f-ad9d-748276a725f6}"> | |
<Color Name="ChangedText"> | |
<Foreground Type="CT_RAW" Source="FFF7A1A1" /> | |
</Color> | |
</Category> | |
<Category Name="Cider" GUID="{92d153ee-57d7-431f-a739-0931ca3f7f70}"> | |
<Color Name="ToolWindow"> | |
<Background Type="CT_RAW" Source="FF252526" /> |
This file contains hidden or 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 dbo.[UDF_Gregorian_To_Persian] (@date datetime) | |
Returns nvarchar(50) | |
as | |
Begin | |
Declare @depoch as bigint | |
Declare @cycle as bigint | |
Declare @cyear as bigint | |
Declare @ycycle as bigint | |
Declare @aux1 as bigint | |
Declare @aux2 as bigint |
This file contains hidden or 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
<#@ template language="C#" debug="false" hostspecific="false" #> | |
<#@ output extension=".txt" #> | |
<#@ assembly name="System" #> | |
<#@ assembly name="System.Core" #> | |
<#@ assembly name="System.Data.Entity" #> | |
<#@ assembly name="EnvDTE" #> | |
<#@ include file="t4toolbox.tt" #> | |
<#@ import namespace="EnvDTE" #> | |
<#@ import namespace="System" #> | |
<#@ import namespace="System.Collections" #> |
This file contains hidden or 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
ResourceDictionary | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | |
<Style TargetType="Ribbon"> | |
<Setter Property="Background" Value="White"/> | |
<Setter Property="Foreground" Value="Black"/> | |
<Setter Property="BorderBrush" Value="{x:Null}"/> | |
<!-- TODO Template | |
OlderNewer