Skip to content

Instantly share code, notes, and snippets.

View prashantvc's full-sized avatar
:octocat:
Working

Prashant Cholachagudda prashantvc

:octocat:
Working
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace LinguisticTagger
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
void PrintNetworkInfo(){
using (var wifi = (WifiManager)GetSystemService (Context.WifiService)) {
using (var dhcp = wifi.DhcpInfo) {
var gateway = dhcp.Gateway;
var ip = dhcp.IpAddress;
Console.WriteLine (Formatter.FormatIpAddress (gateway));
Console.WriteLine (Formatter.FormatIpAddress (ip));
}
}
using Android.App;
using Android.Content;
using Android.Widget;
using Android.OS;
using Android.Text;
using Android.Graphics.Drawables;
namespace TextviweWithImage
{
[Activity (Label = "TextviweWithImage", MainLauncher = true)]
Task<int> ShowModalAletViewAsync (string title, string message, params string[] buttons)
{
var alertView = new UIAlertView (title, message, null, null, buttons);
alertView.Show ();
var tsc = new TaskCompletionSource<int> ();
alertView.Clicked += (sender, buttonArgs) => {
Console.WriteLine ("User clicked on {0}", buttonArgs.ButtonIndex);
tsc.TrySetResult(buttonArgs.ButtonIndex);
};
int ShowModalAletView (string title, string message, params string[] buttons)
{
int clicked = -1;
var alertView = new UIAlertView (title, message, null, null, buttons);
alertView.Show ();
bool done = false;
alertView.Clicked += (sender, buttonArgs) => {
Console.WriteLine ("User clicked on {0}", buttonArgs.ButtonIndex);
clicked = buttonArgs.ButtonIndex;
};
using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.Threading.Tasks;
namespace BasicTable {
public class TableSource : UITableViewSource {
protected string[] tableItems;
protected string cellIdentifier = "TableCell";
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
namespace LinqMtd
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
using System;
using MonoMac.Foundation;
using MonoMac.AppKit;
namespace PopOverSample
{
public partial class MainWindowController : NSWindowController
{
#region Constructors
// Called when created from unmanaged code
using System;
using MonoTouch.Dialog;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace DVC_Test_JanGundorf
{
public class AddressElement : StyledMultilineElement, IElementSizing
{
public AddressElement (string caption, string value, UITableViewCellStyle style) : base (
var items = new[] { 1, 2, 3, 4, 5, 2 };
Func<int, bool> predicate = delegate(int i)
{
Console.WriteLine(i);
return i == 2;
};
//Prints: 1 2
items.Where(predicate).FirstOrDefault();