public MainWindow() { InitializeComponent(); DataSource = DataSources.Get(); DataSource.api.TextToLogEvent += new TextToLogEventHandler(textToLogEvent); DataSource.api.ErrorToLogEvent += new TextToLogEventHandler(errorToLogEvent); /* // We did not separate contract from implementation. // Therefor service and contract are the same in this example. Type serviceType = typeof(AuthenticateService); ServiceHost host = new ServiceHost(serviceType, new Uri[] { new Uri("http://dekkee.com:10/") }); // Add behavior for our MEX endpoint ServiceMetadataBehavior behavior = new ServiceMetadataBehavior(); behavior.HttpGetEnabled = true; host.Description.Behaviors.Add(behavior); host.AddServiceEndpoint(typeof(IAuthenticate), new BasicHttpBinding(), "AuthenticateService"); host.AddServiceEndpoint(typeof(IMetadataExchange), new BasicHttpBinding(), "MEX"); host.Open();*/ printTextToLog("Service is ready."); }
public static DataSources Get() { if (instance == null) instance = new DataSources(); return instance; }