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
void Main() | |
{ | |
using(var db = Db4oClientServer.OpenClient("localhost",8732,"debug-user","debug-password")) | |
{ | |
var objects = (from MyEntity e in db | |
where e.Address == "337 Main St." | |
select e); | |
objects.Dump(); | |
} | |
} |
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
<Query Kind="Program"> | |
<Reference>C:\zproj\project\libs\Db4objects.Db4o.dll</Reference> | |
<Reference>C:\zproj\project\libs\Db4objects.Db4o.CS.dll</Reference> | |
<Reference>C:\zproj\project\libs\Db4objects.Db4o.Linq.dll</Reference> | |
<Reference>C:\zproj\project\arcadefinder.Entities\bin\Debug\project.Entities.dll</Reference> | |
<Namespace>project.Entities</Namespace> | |
<Namespace>Db4objects.Db4o</Namespace> | |
<Namespace>Db4objects.Db4o.Linq</Namespace> | |
<Namespace>Db4objects.Db4o.CS</Namespace> | |
</Query> |
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
void tr_LongClick(object sender, Android.Views.View.LongClickEventArgs e) | |
{ | |
longClickOptions = new IList<char>[] {"Edit".ToCharArray(), "Delete".ToCharArray()}; | |
var dialogBuilder = new AlertDialog.Builder(this); | |
dialogBuilder.SetTitle("Options"); | |
dialogBuilder.SetItems(longClickOptions, tr_LongClick_Options); | |
dialogBuilder.Create().Show(); | |
} | |
private void tr_LongClick_Options(object sender, DialogClickEventArgs 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
private void addPortfolioButton_Click(object sender, EventArgs e) | |
{ | |
var intent = new Intent(); | |
intent.SetClassName(this, AddPortfolioActivity.ClassName); | |
StartActivityForResult(intent, 0); | |
} |
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
private void saveButton_Click(object sender, EventArgs e) | |
{ | |
var portfolioName = FindViewById<EditText>(Resource.id.portfolioName); | |
_repo.SavePortfolio(new Portfolio() {Name = portfolioName.Text.ToString()}); | |
Toast.MakeText(this, "You saved: " + portfolioName.Text, ToastLength.Short).Show(); | |
var intent = new Intent(); | |
SetResult(Result.Ok, intent); |
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
private void listView_ItemClick(object sender, ItemEventArgs e) | |
{ | |
var intent = new Intent(); | |
intent.SetClassName(this, PortfolioActivity.ClassName); | |
intent.PutExtra(PortfolioActivity.Extra_PortfolioID, _portfolios[e.Position].ID ?? -1); | |
StartActivityForResult(intent, 0); | |
} |
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
private void RefreshData() | |
{ | |
var t = new Thread(() => | |
{ | |
var tickers = _svc.GetDetailedItems(_portfolioId, GetStockItems()); | |
RunOnUiThread(() => | |
{ | |
if (tickers.Any()) | |
{ |
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
[TestFixture] | |
public class DynamicTest | |
{ | |
[Test] | |
public void DynamicTestMethod() | |
{ | |
dynamic result = GetRating(); | |
Assert.AreEqual(result.Count, 10); | |
Assert.AreEqual(result.Sum, 50); | |
} |
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 Android.Util; | |
using PostSharp.Aspects; | |
namespace MonoStockPortfolio | |
{ | |
public class LogMeAttribute : OnMethodBoundaryAspect | |
{ | |
public override void OnExit(MethodExecutionArgs args) | |
{ | |
Log.W("PostSharp", "Hello from the OnMethodBoundaryAspect for the '" + args.Method.Name + "' method!"); |
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 WhateverActivity : Activity | |
{ | |
// ... other methods omitted | |
[LogMe] | |
private void RefreshList() | |
{ | |
// do stuff to refresh the list | |
} | |
} |
OlderNewer