Skip to content

Instantly share code, notes, and snippets.

View appcoreopc's full-sized avatar

jeremy woo appcoreopc

  • New Zealand
View GitHub Profile
string applicationFolderPath = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "mydb.db");
if (!Directory.Exists(applicationFolderPath))
Directory.CreateDirectory(applicationFolderPath);
var platform = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid();
string databaseFileName = Path.Combine(applicationFolderPath, "mydb.db");
var coreData = new CoreDataProvider(databaseFileName, platform);
string applicationFolderPath = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "mydb.db");
if (!Directory.Exists (applicationFolderPath))
Directory.CreateDirectory(applicationFolderPath);
var platform = new SQLite.Net.Platform.XamarinIOS.SQLitePlatformIOS();
string databaseFileName = Path.Combine(applicationFolderPath, "mydb.db");
var coreData = new CoreDataProvider(databaseFileName, platform);
public class AddCustomerInterfacing : Java.Lang.Object, Java.Lang.IRunnable
{
private Context context;
private Activity _activity;
public const int RQS_PICK_CONTACT = 1;
public AddCustomerInterfacing(Context context, Activity activity)
{
this.context = context;
_activity = activity;
var car = function() {
this.wheel = true;
this.seats = true;
}
var ferrarri = function() {
this.carType = "fast car";
}
// inherits
// define our simple function with this.salary abd this tax.
function getSalary(name, deduction) {
var takeHomeAmount = this.salary - (this.tax + deduction);
console.log(name + " gets a monthly salary of :" + takeHomeAmount)
}
// next we are going create object with matching properties and bind to getSalary() method
// note that our object matches properties with function defined above.
// In the getSalary example, we bind an object and provide 1st argument = "jessica"
var jessica_partial_calculation = getSalary.bind(jessica, "jessica"); // here we bind and provide the first "argument".
// after some processing .....
// now we will provide the next argument //
jessica_partial_calculation(100); // output : jessica gets a monthly salary of :2800
var myControl = {
get getControlName()
{
return "weird control";
}
}
myControl.getControlName // returns "weird control" executed without ()
<android.support.v4.view.ViewPager
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class below).
public static class PlaceholderFragment extends Fragment {
/**
* The fragment argument representing the section number for this
* fragment.
*/
private static final String ARG_SECTION_NUMBER = "section_number";
/**
* Returns a new instance of this fragment for the given section
* number.