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
//folder is virtual path | |
private void LoadAssemblies(string folder) | |
{ | |
try | |
{ | |
var directory = new DirectoryInfo(HostingEnvironment.MapPath(folder)); | |
var binFiles = directory.GetFiles("*.dll", SearchOption.AllDirectories).ToList(); | |
if (binFiles.Count == 0) | |
{ | |
logger.Warn("no dlls found!"); |
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 RestSharpJsonSerializer : ISerializer | |
{ | |
private static JsonSerializerSettings jsonSettings = new JsonSerializerSettings | |
{ | |
NullValueHandling = NullValueHandling.Ignore, | |
DefaultValueHandling = DefaultValueHandling.Ignore | |
}; | |
public RestSharpJsonSerializer() | |
{ |
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 RestSharpJsonDeserializer : IDeserializer | |
{ | |
private static JsonSerializerSettings jsonSettings = new JsonSerializerSettings | |
{ | |
NullValueHandling = NullValueHandling.Ignore, | |
DefaultValueHandling = DefaultValueHandling.Ignore | |
}; | |
public string DateFormat { get; set; } |
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
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var assembly = Assembly.LoadFile(AppDomain.CurrentDomain.BaseDirectory+ "ConsoleApplication2.exe"); | |
var types = assembly.GetTypes(); | |
var interfaces = types.Where(t => t.IsInterface); | |
var implemetions = types.Where(t => !t.IsInterface && !t.IsAbstract); |
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
try | |
{ | |
string source = "1.png"; | |
WebClient client = new WebClient(); | |
NetworkCredential nc = new NetworkCredential("test", "test"); | |
Uri addy = new Uri(@"\\192.168.57.182\Upload\" + source); | |
client.Credentials = nc; | |
byte[] arrReturn = client.UploadFile(addy, "1.png"); | |
} | |
catch (Exception e) |
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 FileService : IFileService.IFileService | |
{ | |
private readonly string ftpUserName; | |
private readonly string ftpPassword; | |
private readonly string ftpRootPath; | |
public ILogger Logger { get; set; } | |
public FileService(string user, string password, string server) | |
{ | |
this.ftpUserName = user; |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Windows.Security.Cryptography; | |
using Windows.Security.Cryptography.Core; | |
using Windows.Storage; |
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
using Microsoft.Phone.Controls; | |
using System; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Controls.Primitives; | |
using System.Diagnostics; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Ocell.Controls |
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 AutofacExtensions | |
{ | |
/// <summary> | |
/// Special autowiring mode that also scans Resolve parameters while wiring properties | |
/// </summary> | |
public static IRegistrationBuilder<TLimit, TActivatorData, TRegistrationStyle> PropertiesAutowiredWithParameters<TLimit, TActivatorData, TRegistrationStyle>(this IRegistrationBuilder<TLimit, TActivatorData, TRegistrationStyle> rb) | |
{ | |
AutowiringPropertyInjectorWithParameters injector = new AutowiringPropertyInjectorWithParameters(); | |
rb.RegistrationData.ActivatingHandlers.Add(delegate(object s, ActivatingEventArgs<object> e) |
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 MvcApplication : HttpApplication | |
{ | |
public MvcApplication() | |
{ } | |
void Application_Error(object sender, EventArgs e) | |
{ | |
var httpContext = ((MvcApplication)sender).Context; | |
var exception = Server.GetLastError(); | |
OlderNewer