Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Rasika Gayan Gunarathna rasikag

🎯
Focusing
View GitHub Profile
@rasikag
rasikag / examplecomponent.ts
Last active Mar 5, 2019
examplecomponent.ts
View examplecomponent.ts
@Component({
selector: 'app-example-page',
templateUrl: './app-example-page.component.html',
styleUrls: ['./app-example-page.component.css'],
providers: [ ExampleService ]
})
View ngmodule.ts
@NgModule({
providers: [ExampleService]
})
View exampleservice.ts
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ExampleService {
constructor() { }
}
View Product.cs
class Product
{
public string Name { get; private set; }
public decimal Price { get; private set; }
public Product(string name, decimal price)
{
Name = name;
Price = price;
}
View ModeChangesUpdateHub.cs
[HubName("ModeChangesUpdater")]
public class ModeChangesUpdateHub : Hub
{
private readonly CheckMode _checkMode;
public ModeChangesUpdateHub() :
this(CheckMode.Instance)
{
}
View CheckMode.cs
public class CheckMode
{
private readonly static Lazy<CheckMode> _instance
= new Lazy<CheckMode>(() => new CheckMode(
GlobalHost.ConnectionManager.GetHubContext<ModeChangesUpdateHub>().Clients)
);
private IHubConnectionContext<dynamic> Clients { get; set; }
View API_Endpoint.cs
public IHttpActionResult CreateTrigger()
{
logger.Error("start point of create trigger");
try
{
new CheckMode();
}
catch (Exception ex)
{
logger.Error("Message: "+ex.Message + Environment.NewLine + "Stack Trace: "+ ex.StackTrace);
View Error
An error occurred while calling method 'ConfigureServices' on startup class 'Startup'. Consider using IDbContextFactory to override the initialization of the DbContext at design-time. Error: This method could not find a user secret ID because the application's entry assembly is not set. Try using the ".AddUserSecrets(string userSecretsId)" or ".AddUserSecrets<TStartup>()" method instead.
View Menifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rasikag.androidflashlight">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" />
<application
android:allowBackup="true"
View FlashLightBackGroundService
public class FlashLightBackGroundService extends IntentService {
private static Camera mCamera;
private Camera.Parameters mParams;
public FlashLightBackGroundService() {
super("FlashLightBackGroundService");
}
@Override
You can’t perform that action at this time.