Added MT.D walkthrough examples

This commit is contained in:
Mike Bluestein 2012-08-01 17:03:10 -04:00
Родитель f31d0dcccc
Коммит 9d562fa807
34 изменённых файлов: 1000 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
namespace MTDJsonDemo
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
UIWindow _window;
UINavigationController _nav;
DialogViewController _rootVC;
RootElement _rootElement;
UIBarButtonItem _addButton;
int n = 0;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
_window = new UIWindow (UIScreen.MainScreen.Bounds);
_rootElement = new RootElement ("Json Example"){
new Section ("Demo Json"){
JsonElement.FromFile ("sample.json"),
new JsonElement ("Load from url", "http://localhost/sample.json")
},
new Section ("Tasks Sample")
};
_rootVC = new DialogViewController (_rootElement);
_nav = new UINavigationController (_rootVC);
_addButton = new UIBarButtonItem (UIBarButtonSystemItem.Add);
_rootVC.NavigationItem.RightBarButtonItem = _addButton;
_addButton.Clicked += (sender, e) => {
++n;
var task = new Task{Name = "task " + n, DueDate = DateTime.Now};
var taskElement = JsonElement.FromFile ("task.json");
taskElement.Caption = task.Name;
var description = taskElement ["task-description"] as EntryElement;
if (description != null) {
description.Caption = task.Name;
description.Value = task.Description;
}
var duedate = taskElement ["task-duedate"] as DateElement;
if (duedate != null) {
duedate.DateValue = task.DueDate;
}
_rootElement [1].Add (taskElement);
};
_window.RootViewController = _nav;
_window.MakeKeyAndVisible ();
return true;
}
}
}

17
MTDJsonDemo/Info.plist Normal file
Просмотреть файл

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{CEBCEAD4-1FBD-41B0-82A0-1694E9978AFE}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>MTDJsonDemo</RootNamespace>
<AssemblyName>MTDJsonDemo</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchDebug>true</MtouchDebug>
<MtouchProfiling>true</MtouchProfiling>
<MtouchLink>None</MtouchLink>
<MtouchI18n />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<MtouchProfiling>true</MtouchProfiling>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="MonoTouch.Dialog-1" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="Task.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Content Include="sample.json" />
<Content Include="background.png" />
<Content Include="caltemplate.png" />
<Content Include="favorite.png" />
<Content Include="favorited.png" />
<Content Include="jakub-calendar.png" />
<Content Include="task.json" />
</ItemGroup>
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Policies>
<TextStylePolicy FileWidth="120" TabWidth="4" inheritsSet="Mono" inheritsScope="text/plain" scope="text/x-csharp" />
<CSharpFormattingPolicy inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
<TextStylePolicy FileWidth="120" TabWidth="4" inheritsSet="Mono" inheritsScope="text/plain" scope="text/plain" />
<TextStylePolicy FileWidth="120" TabWidth="4" inheritsSet="Mono" inheritsScope="text/plain" scope="application/json" />
</Policies>
</Properties>
</MonoDevelop>
</ProjectExtensions>
</Project>

Просмотреть файл

@ -0,0 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTDJsonDemo", "MTDJsonDemo.csproj", "{CEBCEAD4-1FBD-41B0-82A0-1694E9978AFE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhoneSimulator = Release|iPhoneSimulator
Debug|iPhone = Debug|iPhone
Release|iPhone = Release|iPhone
AdHoc|iPhoneSimulator = AdHoc|iPhoneSimulator
AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
AdHoc|iPhone = AdHoc|iPhone
AppStore|iPhone = AppStore|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CEBCEAD4-1FBD-41B0-82A0-1694E9978AFE}.Debug|iPhone.ActiveCfg = Debug|iPhone
{CEBCEAD4-1FBD-41B0-82A0-1694E9978AFE}.Debug|iPhone.Build.0 = Debug|iPhone
{CEBCEAD4-1FBD-41B0-82A0-1694E9978AFE}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{CEBCEAD4-1FBD-41B0-82A0-1694E9978AFE}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{CEBCEAD4-1FBD-41B0-82A0-1694E9978AFE}.Release|iPhone.ActiveCfg = Release|iPhone
{CEBCEAD4-1FBD-41B0-82A0-1694E9978AFE}.Release|iPhone.Build.0 = Release|iPhone
{CEBCEAD4-1FBD-41B0-82A0-1694E9978AFE}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{CEBCEAD4-1FBD-41B0-82A0-1694E9978AFE}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = MTDJsonDemo.csproj
EndGlobalSection
EndGlobal

20
MTDJsonDemo/Main.cs Normal file
Просмотреть файл

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace MTDJsonDemo
{
public class Application
{
// This is the main entry point of the application.
static void Main (string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
}
}

7
MTDJsonDemo/Metadata.xml Normal file
Просмотреть файл

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleMetadata>
<ID>5dbad834-4427-4ed1-831c-a5642b384f24</ID>
<IsFullApplication>false</IsFullApplication>
<Level>Beginning</Level>
<Tags>User Interface</Tags>
</SampleMetadata>

4
MTDJsonDemo/README.md Normal file
Просмотреть файл

@ -0,0 +1,4 @@
MonoTouch.Dialog JSON Walkthrough
=================================
This sample demonstrates how to use the JSON API with MonoTouch.Dialog

Двоичные данные
MTDJsonDemo/Screenshots/MTDJsonDemo.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 130 KiB

17
MTDJsonDemo/Task.cs Normal file
Просмотреть файл

@ -0,0 +1,17 @@
using System;
namespace MTDJsonDemo
{
public class Task
{
public Task ()
{
}
public string Name { get; set; }
public string Description { get; set; }
public DateTime DueDate { get; set; }
}
}

Двоичные данные
MTDJsonDemo/background.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 117 KiB

Двоичные данные
MTDJsonDemo/caltemplate.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 566 B

Двоичные данные
MTDJsonDemo/favorite.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 573 B

Двоичные данные
MTDJsonDemo/favorited.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 793 B

Двоичные данные
MTDJsonDemo/jakub-calendar.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 912 B

262
MTDJsonDemo/sample.json Executable file
Просмотреть файл

@ -0,0 +1,262 @@
{
"title": "Load from local file",
"sections": [
{
"header": "Nested Elements",
"id": "section-1",
"elements": [
{
"type": "root",
"title": "home",
"sections": [
{
"header": "Nested view!",
"elements": [
{
"type": "boolean",
"caption": "Just a boolean",
"id": "first-boolean",
"value": false
},
{
"type": "string",
"caption": "Welcome to the nested controller"
}
]
}
]
}, {
"type": "root",
"title": "Favorite Fruit",
"radioselected": "2",
"sections": [
{
"header": "Select your favorite",
"elements": [
{
"type": "radio",
"caption": "Apple"
},
{
"type": "radio",
"caption": "Banana"
},
{
"type": "radio",
"caption": "Coconut"
},
{
"type": "radio",
"caption": "Watermelon"
}
]
}, {
"header": "Multiple radios"
}
]
}, {
"type": "root",
"title": "Summary counts",
"group": "counter",
"sections": [
{
"header": "Using checkboxes",
"elements": [
{
"type": "checkbox",
"caption": "English",
"value": true,
"group": "counter"
},
{
"type": "checkbox",
"caption": "French",
"value": false,
"group": "counter"
},
{
"type": "checkbox",
"caption": "Spanish",
"value": true,
"group": "counter"
}
]
},
{
"header": "Using booleans",
"elements": [
{
"type": "bool",
"caption": "Portuguese",
"value": true,
"group": "counter"
},
{
"type": "bool",
"caption": "German",
"value": false,
"group": "counter"
}
]
},
{
"header": "Mixing them",
"elements": [
{
"type": "checkbox",
"caption": "Italian",
"value": false,
"group": "counter"
},
{
"type": "bool",
"caption": "Dutch",
"value": false,
"group": "counter"
}
]
}
]
}
]
},
{
"header": "Booleans",
"footer": "Slider or image-based",
"elements": [
{
"type" : "boolean",
"caption" : "Demo of a Boolean",
"value" : true
}, {
"type": "boolean",
"caption" : "Boolean using images",
"value" : false,
"on" : "favorite.png",
"off" : "~/favorited.png"
}
]
}, {
"header": "Entries",
"elements" : [
{
"type": "entry",
"caption": "Username",
"value": "",
"placeholder": "Your account username"
}, {
"type": "password",
"caption": "Password",
"value": "",
"placeholder": "You password"
}, {
"type": "entry",
"caption": "Zip Code",
"value": "01010",
"placeholder": "your zip code",
"keyboard": "numbers"
}, {
"type": "entry",
"return-key": "route",
"caption": "Entry with 'route'",
"placeholder": "captialization all + no corrections",
"capitalization": "all",
"autocorrect": "no"
}
]
}, {
"header": "Strings",
"elements": [
{
"type": "string",
"caption": "Plain label"
}, {
"type": "string",
"caption": "Plain label with value: ",
"value": "Value"
}, {
"type": "string",
"caption": "Styled label with subtitles",
"style": "subtitle",
"value": "This is a subtitle"
}, {
"type": "string",
"caption": "Styled label",
"style": "value2",
"value": "Like the addressbook"
}, {
"type": "string",
"caption": "Tapping on this cell invokes a C# method",
"ontap": "Sample.AppDelegate.JsonCallback"
}, {
"type": "string",
"caption": "the background color is set",
"background": "#f0f"
}, {
"type": "string",
"caption": "Background color set from a URI",
"background": "http://www.google.com/images/logos/ps_logo2.png"
}, {
"type": "string",
"caption": "To render multi-line strings, set both the 'lines' value to a positive value and the 'line-break' mode to 'word-wrap' for example",
"lines": "5",
"linebreak": "word-wrap"
}, {
"type": "string",
"caption": "Show a checkmark",
"accessory": "checkmark"
}, {
"type": "string",
"caption": "Show a detail disclosure",
"accessory": "detail-disclosure"
}, {
"type": "string",
"caption": "Show a disclosure indicator",
"accessory": "disclosure-indicator"
}, {
"type": "string",
"caption": "Using a custom font: Chalkduster 20",
"font": "Chalkduster-20",
"linebreak": "word-wrap",
"lines": "0"
}, {
"type": "string",
"style": "subtitle",
"caption": "Styled main and subtitle font",
"font": "Chalkduster-12",
"textcolor": "#d88",
"value": "Subtitle with font Gurmunkhi MN",
"detailfont": "Gurmukhi MN-12",
"detailcolor": "#8d8"
}
]
}, {
"header": "Dates and Times",
"elements": [
{
"type": "datetime",
"caption": "Date and Time",
"value": "Sat, 01 Nov 2008 19:35:00 GMT"
}, {
"type": "date",
"caption": "Date",
"value": "10/10"
}, {
"type": "time",
"caption": "Time",
"value": "11:23"
}
]
}, {
"header": "Web View",
"elements": [
{
"type": "html",
"caption": "Miguel's blog",
"url": "http://tirania.org/blog"
}
]
}
]
}

20
MTDJsonDemo/task.json Executable file
Просмотреть файл

@ -0,0 +1,20 @@
{
"title": "Task",
"sections": [
{
"elements" : [
{
"id" : "task-description",
"type": "entry",
"placeholder": "Enter task description"
},
{
"id" : "task-duedate",
"type": "date",
"caption": "Due Date",
"value": "00:00"
}
]
}
]
}

Просмотреть файл

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
namespace MTDReflectionWalkthrough
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
UIWindow window;
UINavigationController nav;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
var expense = new Expense ();
var bctx = new BindingContext (null, expense, "Create a task");
var dvc = new DialogViewController (bctx.Root);
nav = new UINavigationController(dvc);
window.RootViewController = nav;
window.MakeKeyAndVisible ();
return true;
}
}
}

Просмотреть файл

@ -0,0 +1,30 @@
using System;
using MonoTouch.Dialog;
namespace MTDReflectionWalkthrough
{
public enum Category
{
Travel,
Lodging,
Books
}
public class Expense
{
[Section("Expense Entry")]
[Entry("Enter expense name")]
public string Name;
[Section("Expense Details")]
[Caption("Description")]
[Entry]
public string Details;
[Checkbox]
public bool IsApproved = true;
[Caption("Category")]
public Category ExpenseCategory;
}
}

Просмотреть файл

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D718F82C-1F49-4C44-ABC0-C82B9A34C020}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>MTDReflectionWalkthrough</RootNamespace>
<AssemblyName>MTDReflectionWalkthrough</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchDebug>true</MtouchDebug>
<MtouchProfiling>true</MtouchProfiling>
<MtouchLink>None</MtouchLink>
<MtouchI18n />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<MtouchProfiling>true</MtouchProfiling>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="MonoTouch.Dialog-1" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="Expense.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Policies>
<TextStylePolicy FileWidth="120" TabWidth="4" inheritsSet="Mono" inheritsScope="text/plain" scope="text/x-csharp" />
<CSharpFormattingPolicy inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
<TextStylePolicy FileWidth="120" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/plain" />
</Policies>
</Properties>
</MonoDevelop>
</ProjectExtensions>
</Project>

Просмотреть файл

@ -0,0 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTDReflectionWalkthrough", "MTDReflectionWalkthrough.csproj", "{D718F82C-1F49-4C44-ABC0-C82B9A34C020}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhoneSimulator = Release|iPhoneSimulator
Debug|iPhone = Debug|iPhone
Release|iPhone = Release|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D718F82C-1F49-4C44-ABC0-C82B9A34C020}.Debug|iPhone.ActiveCfg = Debug|iPhone
{D718F82C-1F49-4C44-ABC0-C82B9A34C020}.Debug|iPhone.Build.0 = Debug|iPhone
{D718F82C-1F49-4C44-ABC0-C82B9A34C020}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{D718F82C-1F49-4C44-ABC0-C82B9A34C020}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{D718F82C-1F49-4C44-ABC0-C82B9A34C020}.Release|iPhone.ActiveCfg = Release|iPhone
{D718F82C-1F49-4C44-ABC0-C82B9A34C020}.Release|iPhone.Build.0 = Release|iPhone
{D718F82C-1F49-4C44-ABC0-C82B9A34C020}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{D718F82C-1F49-4C44-ABC0-C82B9A34C020}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = MTDReflectionWalkthrough.csproj
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace MTDReflectionWalkthrough
{
public class Application
{
// This is the main entry point of the application.
static void Main (string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleMetadata>
<ID>cd0c2a5f-ee97-464d-86e3-5ca6a14c6e2a</ID>
<IsFullApplication>false</IsFullApplication>
<Level>Beginning</Level>
<Tags>User Interface</Tags>
</SampleMetadata>

Просмотреть файл

@ -0,0 +1,4 @@
MonoTouch.Dialog Reflection API Walkthrough
===========================================
This sample demonstrates how to use the Reflection API with MonTouch.Dialog

Двоичные данные
MTDReflectionWalkthrough/Screenshots/MTDReflectionWalkthrough.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 103 KiB

Просмотреть файл

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
namespace MTDWalkthrough
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
UIWindow _window;
UINavigationController _nav;
DialogViewController _rootVC;
RootElement _rootElement;
UIBarButtonItem _addButton;
int n = 0;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
_window = new UIWindow (UIScreen.MainScreen.Bounds);
_rootElement = new RootElement ("To Do List"){
new Section ()
};
_rootVC = new DialogViewController (_rootElement);
_nav = new UINavigationController (_rootVC);
_addButton = new UIBarButtonItem (UIBarButtonSystemItem.Add);
_rootVC.NavigationItem.RightBarButtonItem = _addButton;
_addButton.Clicked += (sender, e) => {
++n;
var task = new Task{Name = "task " + n, DueDate = DateTime.Now};
var element = new EntryElement (task.Name, "Enter task description", task.Description);
var taskElement = new RootElement (task.Name){
new Section () {
element
},
new Section () {
new DateElement ("Due Date", task.DueDate)
},
new Section ("Demo Retrieving Element Value") {
new StringElement ("Output Task Description",
delegate { Console.WriteLine (element.Value); })
}
};
_rootElement [0].Add (taskElement);
};
_window.RootViewController = _nav;
_window.MakeKeyAndVisible ();
return true;
}
}
}

12
MTDWalkthrough/Info.plist Normal file
Просмотреть файл

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{668E9122-90F7-4F6A-A9A2-553BE8267165}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>MTDWalkthrough</RootNamespace>
<AssemblyName>MTDWalkthrough</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchDebug>true</MtouchDebug>
<MtouchProfiling>true</MtouchProfiling>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<MtouchProfiling>true</MtouchProfiling>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="MonoTouch.Dialog-1" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="Task.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Policies>
<TextStylePolicy FileWidth="120" TabWidth="4" inheritsSet="Mono" inheritsScope="text/plain" scope="text/x-csharp" />
<CSharpFormattingPolicy inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
</Policies>
</Properties>
</MonoDevelop>
</ProjectExtensions>
</Project>

Просмотреть файл

@ -0,0 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTDWalkthrough", "MTDWalkthrough.csproj", "{668E9122-90F7-4F6A-A9A2-553BE8267165}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhoneSimulator = Release|iPhoneSimulator
Debug|iPhone = Debug|iPhone
Release|iPhone = Release|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{668E9122-90F7-4F6A-A9A2-553BE8267165}.Debug|iPhone.ActiveCfg = Debug|iPhone
{668E9122-90F7-4F6A-A9A2-553BE8267165}.Debug|iPhone.Build.0 = Debug|iPhone
{668E9122-90F7-4F6A-A9A2-553BE8267165}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{668E9122-90F7-4F6A-A9A2-553BE8267165}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{668E9122-90F7-4F6A-A9A2-553BE8267165}.Release|iPhone.ActiveCfg = Release|iPhone
{668E9122-90F7-4F6A-A9A2-553BE8267165}.Release|iPhone.Build.0 = Release|iPhone
{668E9122-90F7-4F6A-A9A2-553BE8267165}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{668E9122-90F7-4F6A-A9A2-553BE8267165}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = MTDWalkthrough.csproj
EndGlobalSection
EndGlobal

20
MTDWalkthrough/Main.cs Normal file
Просмотреть файл

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace MTDWalkthrough
{
public class Application
{
// This is the main entry point of the application.
static void Main (string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleMetadata>
<ID>314473fd-beae-4bc0-9a5d-16fe128b755f</ID>
<IsFullApplication>false</IsFullApplication>
<Level>Beginning</Level>
<Tags>User Interface</Tags>
</SampleMetadata>

4
MTDWalkthrough/README.md Normal file
Просмотреть файл

@ -0,0 +1,4 @@
MonoTouch.Dialog Element Walkthrough
====================================
This sample demonstrates how to use the Element API with MonoTouch.Dialog

Двоичные данные
MTDWalkthrough/Screenshots/MTDWalkthrough.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 116 KiB

17
MTDWalkthrough/Task.cs Normal file
Просмотреть файл

@ -0,0 +1,17 @@
using System;
namespace MTDWalkthrough
{
public class Task
{
public Task ()
{
}
public string Name { get; set; }
public string Description { get; set; }
public DateTime DueDate { get; set; }
}
}