Added Drawing, CoreLocation, and Background Execution (multitasking) samples, as well as screenshots, etc.

This commit is contained in:
Bryan Costanich 2011-10-03 16:53:30 -07:00
Родитель 75db722a20
Коммит 8bd26cc87a
95 изменённых файлов: 6502 добавлений и 0 удалений

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

@ -0,0 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackgroundExecution", "BackgroundExecution\BackgroundExecution.csproj", "{BE447407-5D4B-4EFF-A47B-07B1D49F2C9B}"
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
{BE447407-5D4B-4EFF-A47B-07B1D49F2C9B}.Debug|iPhone.ActiveCfg = Debug|iPhone
{BE447407-5D4B-4EFF-A47B-07B1D49F2C9B}.Debug|iPhone.Build.0 = Debug|iPhone
{BE447407-5D4B-4EFF-A47B-07B1D49F2C9B}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{BE447407-5D4B-4EFF-A47B-07B1D49F2C9B}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{BE447407-5D4B-4EFF-A47B-07B1D49F2C9B}.Release|iPhone.ActiveCfg = Release|iPhone
{BE447407-5D4B-4EFF-A47B-07B1D49F2C9B}.Release|iPhone.Build.0 = Release|iPhone
{BE447407-5D4B-4EFF-A47B-07B1D49F2C9B}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{BE447407-5D4B-4EFF-A47B-07B1D49F2C9B}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = BackgroundExecution\BackgroundExecution.csproj
EndGlobalSection
EndGlobal

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

@ -0,0 +1,95 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Threading;
namespace Example_BackgroundExecution
{
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
#region -= declarations and properties =-
protected UIWindow window;
protected UINavigationController mainNavController;
protected Example_BackgroundExecution.Screens.iPhone.HomeScreen_iPhone iPhoneHome;
#endregion
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create our window
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.MakeKeyAndVisible ();
// instantiate our main navigatin controller and add it's view to the window
mainNavController = new UINavigationController ();
iPhoneHome = new Example_BackgroundExecution.Screens.iPhone.HomeScreen_iPhone ();
mainNavController.PushViewController (iPhoneHome, false);
window.RootViewController = mainNavController;
// how to check if multi-tasking is supported
if(UIDevice.CurrentDevice.IsMultitaskingSupported) {
// code here to change your app's behavior
}
//
return true;
}
public override void WillEnterForeground (UIApplication application)
{
Console.WriteLine ("App will enter foreground");
}
// Runs when the activation transitions from running in the background to
// being the foreground application.
public override void OnActivated (UIApplication application)
{
Console.WriteLine ("App is becoming active");
}
public override void OnResignActivation (UIApplication application)
{
Console.WriteLine ("App moving to inactive state.");
}
public override void DidEnterBackground (UIApplication application)
{
Console.WriteLine ("App entering background state.");
// if you're creating a VOIP application, this is how you set the keep alive
//UIApplication.SharedApplication.SetKeepAliveTimout(600, () => { /* keep alive handler code*/ });
// register a long running task, and then start it on a new thread so that this method can return
int taskID = UIApplication.SharedApplication.BeginBackgroundTask ( () => {});
Thread task = new Thread (new ThreadStart ( () => { FinishLongRunningTask(taskID);}));
task.Start ();
}
protected void FinishLongRunningTask (int taskID)
{
Console.WriteLine ("Starting task " + taskID.ToString ());
Console.WriteLine ("Background time remaining: " + UIApplication.SharedApplication.BackgroundTimeRemaining.ToString ());
// sleep for 5 seconds to simulate a long running task
Thread.Sleep (5000);
Console.WriteLine ("Task " + taskID.ToString() + " finished");
Console.WriteLine ("Background time remaining: " + UIApplication.SharedApplication.BackgroundTimeRemaining.ToString ());
// call our end task
UIApplication.SharedApplication.EndBackgroundTask (taskID);
}
// [not guaranteed that this will run]
public override void WillTerminate (UIApplication application)
{
Console.WriteLine ("App is terminating.");
}
}
}

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

@ -0,0 +1,20 @@
using System;
using MonoTouch.UIKit;
namespace Example_BackgroundExecution
{
public class Application
{
public static void Main (string[] args)
{
try
{
UIApplication.Main (args, null, "AppDelegate");
}
catch (Exception e)
{
Console.WriteLine (e.ToString ());
}
}
}
}

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

@ -0,0 +1,101 @@
<?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>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BE447407-5D4B-4EFF-A47B-07B1D49F2C9B}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>Example_BackgroundExecution</RootNamespace>
<AssemblyName>Example_BackgroundExecution</AssemblyName>
<MtouchSdkVersion>3.2</MtouchSdkVersion>
</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>
<MtouchDebug>true</MtouchDebug>
<ConsolePause>false</ConsolePause>
<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>
<MtouchDebug>true</MtouchDebug>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
</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" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Compile Include="AppDelegate.cs" />
<Compile Include="Application.cs" />
<Compile Include="Screens\iPhone\HomeScreen_iPhone.xib.cs">
<DependentUpon>HomeScreen_iPhone.xib</DependentUpon>
</Compile>
<Compile Include="Screens\iPhone\HomeScreen_iPhone.xib.designer.cs">
<DependentUpon>HomeScreen_iPhone.xib</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="Code\" />
<Folder Include="Screens\" />
<Folder Include="Images\" />
<Folder Include="Images\Icons\" />
<Folder Include="Screens\iPhone\" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Screens\iPhone\HomeScreen_iPhone.xib" xmlns="" />
</ItemGroup>
<ItemGroup>
<Content Include="Images\Icons\29_icon.png" />
<Content Include="Images\Icons\50_icon.png" />
<Content Include="Images\Icons\57_icon.png" />
<Content Include="Images\Icons\58_icon.png" />
<Content Include="Images\Icons\72_icon.png" />
<Content Include="Images\Icons\114_icon.png" />
<Content Include="Images\Icons\512_icon.png" />
<Content Include="Default-Landscape~ipad.png" />
<Content Include="Default-Portrait~ipad.png" />
<Content Include="Default.png" />
<Content Include="Default%402x.png" />
</ItemGroup>
</Project>

Двоичные данные
BackgroundExecution/BackgroundExecution/Default-Landscape~ipad.png Executable file

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

После

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

Двоичные данные
BackgroundExecution/BackgroundExecution/Default-Portrait~ipad.png Executable file

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

После

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

Двоичные данные
BackgroundExecution/BackgroundExecution/Default.png Executable file

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

После

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

Двоичные данные
BackgroundExecution/BackgroundExecution/Default@2x.png Executable file

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

После

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

Двоичные данные
BackgroundExecution/BackgroundExecution/Images/Icons/114_icon.png Executable file

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

После

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

Двоичные данные
BackgroundExecution/BackgroundExecution/Images/Icons/29_icon.png Executable file

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

После

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

Двоичные данные
BackgroundExecution/BackgroundExecution/Images/Icons/50_icon.png Executable file

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

После

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

Двоичные данные
BackgroundExecution/BackgroundExecution/Images/Icons/512_icon.png Executable file

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

После

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

Двоичные данные
BackgroundExecution/BackgroundExecution/Images/Icons/57_icon.png Executable file

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

После

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

Двоичные данные
BackgroundExecution/BackgroundExecution/Images/Icons/58_icon.png Executable file

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

После

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

Двоичные данные
BackgroundExecution/BackgroundExecution/Images/Icons/72_icon.png Executable file

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

После

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

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

@ -0,0 +1,30 @@
<?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></key>
<string></string>
<key>CFBundleDisplayName</key>
<string>Multitasking</string>
<key>CFBundleIconFiles</key>
<array>
<string>Images/Icons/57_icon.png</string>
<string>Images/Icons/114_icon.png</string>
<string>Images/Icons/72_icon.png</string>
<string>Images/Icons/29_icon.png</string>
<string>Images/Icons/58_icon.png</string>
<string>Images/Icons/50_icon.png</string>
<string>Images/Icons/512_icon.png</string>
</array>
<key>MinimumOSVersion</key>
<string>3.0</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
<key>UIDeviceFamily</key>
<array>
<string>1</string>
</array>
</dict>
</plist>

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

@ -0,0 +1,240 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">768</int>
<string key="IBDocument.SystemVersion">10F569</string>
<string key="IBDocument.InterfaceBuilderVersion">788</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">117</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="711762367">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIButton" id="223306953">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 20}, {280, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Start a long running task</string>
<object class="NSColor" key="IBUIHighlightedTitleColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">7</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnStartLongRunningTask</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="223306953"/>
</object>
<int key="connectionID">9</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="223306953"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="711762367"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="223306953"/>
<reference key="parent" ref="191373211"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>1.IBEditorWindowLastContentRect</string>
<string>1.IBPluginDependency</string>
<string>8.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>HomeScreen_iPhone</string>
<string>UIResponder</string>
<string>{{346, 672}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">9</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">HomeScreen_iPhone</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>btnStartLongRunningTask</string>
<string>view</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>btnStartLongRunningTask</string>
<string>view</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">btnStartLongRunningTask</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">view</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<integer value="768" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">117</string>
</data>
</archive>

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

@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.Threading;
namespace Example_BackgroundExecution.Screens.iPhone
{
public partial class HomeScreen_iPhone : UIViewController
{
#region Constructors
// The IntPtr and initWithCoder constructors are required for items that need
// to be able to be created from a xib rather than from managed code
public HomeScreen_iPhone (IntPtr handle) : base(handle)
{
}
[Export("initWithCoder:")]
public HomeScreen_iPhone (NSCoder coder) : base(coder)
{
}
public HomeScreen_iPhone () : base("HomeScreen_iPhone", null)
{
}
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
this.Title = "Background Execution";
this.btnStartLongRunningTask.TouchUpInside += (s, e) => {
ThreadStart ts = new ThreadStart ( () => { this.DoSomething(); });
ts.Invoke();
};
}
public void DoSomething ()
{
// register our background task
int taskID = UIApplication.SharedApplication.BeginBackgroundTask ( () => { this.BackgroundTaskExpiring (); });
Console.WriteLine ("Starting background task " + taskID.ToString ());
// sleep for five seconds
Thread.Sleep (5000);
Console.WriteLine ("Background task " + taskID.ToString () + " completed.");
// mark our background task as complete
UIApplication.SharedApplication.EndBackgroundTask (taskID);
}
public void BackgroundTaskExpiring ()
{
Console.WriteLine ("Running out of time to complete you background task!");
}
}
}

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

@ -0,0 +1,47 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace Example_BackgroundExecution.Screens.iPhone {
// Base type probably should be MonoTouch.UIKit.UIViewController or subclass
[MonoTouch.Foundation.Register("HomeScreen_iPhone")]
public partial class HomeScreen_iPhone {
private MonoTouch.UIKit.UIView __mt_view;
private MonoTouch.UIKit.UIButton __mt_btnStartLongRunningTask;
#pragma warning disable 0169
[MonoTouch.Foundation.Connect("view")]
private MonoTouch.UIKit.UIView view {
get {
this.__mt_view = ((MonoTouch.UIKit.UIView)(this.GetNativeField("view")));
return this.__mt_view;
}
set {
this.__mt_view = value;
this.SetNativeField("view", value);
}
}
[MonoTouch.Foundation.Connect("btnStartLongRunningTask")]
private MonoTouch.UIKit.UIButton btnStartLongRunningTask {
get {
this.__mt_btnStartLongRunningTask = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnStartLongRunningTask")));
return this.__mt_btnStartLongRunningTask;
}
set {
this.__mt_btnStartLongRunningTask = value;
this.SetNativeField("btnStartLongRunningTask", value);
}
}
}
}

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

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleMetadata>
<ID>e797f7f2-5132-4aec-8605-dcfd3989a4a5</ID>
<IsFullApplication>false</IsFullApplication>
<Level>Beginning</Level>
<Tags>Multitasking</Tags>
</SampleMetadata>

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

@ -0,0 +1,34 @@
Core Animation
=================
This sample illustrates how to develop multitasking (background execution) aware applications in MonoTouch. The AppDelegate class illustrates the application lifecycle methods that should be overridden in order to gracefully handle state changes. Additionally, it illustrates how to register a long running task that will finish executing even though the app is put in a background state.
The home screen has a button that will launch a background task that will execute even if the app is backgrounded.
License
=======
The samples are licensed under the MIT X11 license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Authors
=======
Bryan Costanich

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

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

После

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

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

@ -0,0 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreLocation", "CoreLocation\CoreLocation.csproj", "{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}"
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
{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}.Debug|iPhone.ActiveCfg = Debug|iPhone
{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}.Debug|iPhone.Build.0 = Debug|iPhone
{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}.Release|iPhone.ActiveCfg = Release|iPhone
{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}.Release|iPhone.Build.0 = Release|iPhone
{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = CoreLocation\CoreLocation.csproj
EndGlobalSection
EndGlobal

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

@ -0,0 +1,31 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
namespace Example_CoreLocation
{
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
#region -= declarations and properties =-
protected UIWindow window;
protected MainViewController mainViewController;
#endregion
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create our window
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.MakeKeyAndVisible ();
// instantiate and load our main screen onto the window
mainViewController = new MainViewController ();
window.RootViewController = mainViewController;
//
return true;
}
}
}

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

@ -0,0 +1,20 @@
using System;
using MonoTouch.UIKit;
namespace Example_CoreLocation
{
public class Application// : UIApplication
{
public static void Main (string[] args)
{
try
{
UIApplication.Main (args, null, "AppDelegate");
}
catch (Exception e)
{
Console.WriteLine (e.ToString ());
}
}
}
}

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

@ -0,0 +1,107 @@
<?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>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>Example_CoreLocation</RootNamespace>
<AssemblyName>Example_CoreLocation</AssemblyName>
<MtouchSdkVersion>4.0</MtouchSdkVersion>
</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>
<MtouchLink>None</MtouchLink>
<MtouchDebug>true</MtouchDebug>
<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>
<MtouchLink>None</MtouchLink>
<MtouchI18n />
</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>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<MtouchI18n />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchI18n />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Compile Include="AppDelegate.cs" />
<Compile Include="Application.cs" />
<Compile Include="MainScreen\IMainScreen.cs" />
<Compile Include="MainScreen\MainViewController.cs" />
<Compile Include="MainScreen\MainViewController_iPad.xib.cs">
<DependentUpon>MainViewController_iPad.xib</DependentUpon>
</Compile>
<Compile Include="MainScreen\MainViewController_iPad.xib.designer.cs">
<DependentUpon>MainViewController_iPad.xib</DependentUpon>
</Compile>
<Compile Include="MainScreen\MainViewController_iPhone.xib.cs">
<DependentUpon>MainViewController_iPhone.xib</DependentUpon>
</Compile>
<Compile Include="MainScreen\MainViewController_iPhone.xib.designer.cs">
<DependentUpon>MainViewController_iPhone.xib</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="Images\Icons\29_icon.png" />
<Content Include="Images\Icons\50_icon.png" />
<Content Include="Images\Icons\57_icon.png" />
<Content Include="Images\Icons\58_icon.png" />
<Content Include="Images\Icons\72_icon.png" />
<Content Include="Images\Icons\114_icon.png" />
<Content Include="Images\Icons\512_icon.png" />
<Content Include="Default-Landscape~ipad.png" />
<Content Include="Default-Portrait~ipad.png" />
<Content Include="Default.png" />
<Content Include="Default%402x.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="MainScreen\" />
<Folder Include="Images\" />
<Folder Include="Images\Icons\" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="MainScreen\MainViewController_iPad.xib" xmlns="" />
<InterfaceDefinition Include="MainScreen\MainViewController_iPhone.xib" xmlns="" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
</Project>

Двоичные данные
CoreLocation/CoreLocation/Default-Landscape~ipad.png Executable file

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

После

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

Двоичные данные
CoreLocation/CoreLocation/Default-Portrait~ipad.png Executable file

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

После

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

Двоичные данные
CoreLocation/CoreLocation/Default.png Executable file

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

После

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

Двоичные данные
CoreLocation/CoreLocation/Default@2x.png Executable file

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

После

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

Двоичные данные
CoreLocation/CoreLocation/Images/Icons/114_icon.png Executable file

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

После

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

Двоичные данные
CoreLocation/CoreLocation/Images/Icons/29_icon.png Executable file

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

После

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

Двоичные данные
CoreLocation/CoreLocation/Images/Icons/50_icon.png Executable file

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

После

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

Двоичные данные
CoreLocation/CoreLocation/Images/Icons/512_icon.png Executable file

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

После

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

Двоичные данные
CoreLocation/CoreLocation/Images/Icons/57_icon.png Executable file

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

После

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

Двоичные данные
CoreLocation/CoreLocation/Images/Icons/58_icon.png Executable file

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

После

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

Двоичные данные
CoreLocation/CoreLocation/Images/Icons/72_icon.png Executable file

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

После

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

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

@ -0,0 +1,24 @@
<?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>CFBundleDisplayName</key>
<string>Core Location</string>
<key>CFBundleIconFiles</key>
<array>
<string>Images/Icons/57_icon.png</string>
<string>Images/Icons/114_icon.png</string>
<string>Images/Icons/72_icon.png</string>
<string>Images/Icons/29_icon.png</string>
<string>Images/Icons/58_icon.png</string>
<string>Images/Icons/50_icon.png</string>
<string>Images/Icons/512_icon.png</string>
</array>
<key>MinimumOSVersion</key>
<string>3.0</string>
<key>UIDeviceFamily</key>
<array>
<string>1</string>
</array>
</dict>
</plist>

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

@ -0,0 +1,20 @@
using System;
using MonoTouch.UIKit;
namespace Example_CoreLocation
{
/// <summary>
/// This interface is so we can use a different xib for iPhone and iPad from the same code.
/// </summary>
public interface IMainScreen
{
UILabel LblAltitude { get; }
UILabel LblLatitude { get; }
UILabel LblLongitude { get; }
UILabel LblCourse { get; }
UILabel LblMagneticHeading { get; }
UILabel LblSpeed { get; }
UILabel LblTrueHeading { get; }
UILabel LblDistanceToParis { get; }
}
}

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

@ -0,0 +1,136 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using MonoTouch.CoreLocation;
using Example_CoreLocation.MainScreen;
namespace Example_CoreLocation
{
public class MainViewController : UIViewController
{
#region -= declarations =-
MainViewController_iPhone mainViewController_iPhone;
MainViewController_iPad mainViewController_iPad;
IMainScreen mainScreen = null;
// location stuff
CLLocationManager iPhoneLocationManager = null;
// uncomment this if you want to use the delegate pattern
//LocationDelegate locationDelegate = null;
#endregion
#region -= constructors =-
//
// Constructor invoked from the NIB loader
//
public MainViewController (IntPtr p) : base(p)
{
}
public MainViewController () : base()
{
}
#endregion
public override void ViewDidLoad ()
{
// all your base
base.ViewDidLoad ();
// load the appropriate view, based on the device type
this.LoadViewForDevice ();
// initialize our location manager and callback handler
iPhoneLocationManager = new CLLocationManager ();
// uncomment this if you want to use the delegate pattern:
//locationDelegate = new LocationDelegate (mainScreen);
//iPhoneLocationManager.Delegate = locationDelegate;
// you can set the update threshold and accuracy if you want:
//iPhoneLocationManager.DistanceFilter = 10; // move ten meters before updating
//iPhoneLocationManager.HeadingFilter = 3; // move 3 degrees before updating
// you can also set the desired accuracy:
iPhoneLocationManager.DesiredAccuracy = 1000; // 1000 meters/1 kilometer
// you can also use presets, which simply evalute to a double value:
//iPhoneLocationManager.DesiredAccuracy = CLLocation.AccuracyNearestTenMeters;
// handle the updated location method and update the UI
iPhoneLocationManager.UpdatedLocation += (object sender, CLLocationUpdatedEventArgs e) => {
mainScreen.LblAltitude.Text = e.NewLocation.Altitude.ToString () + "meters";
mainScreen.LblLongitude.Text = e.NewLocation.Coordinate.Longitude.ToString () + "º";
mainScreen.LblLatitude.Text = e.NewLocation.Coordinate.Latitude.ToString () + "º";
mainScreen.LblCourse.Text = e.NewLocation.Course.ToString () + "º";
mainScreen.LblSpeed.Text = e.NewLocation.Speed.ToString () + "meters/s";
// get the distance from here to paris
mainScreen.LblDistanceToParis.Text = (e.NewLocation.DistanceFrom(new CLLocation(48.857, 2.351)) / 1000).ToString() + "km";
};
// handle the updated heading method and update the UI
iPhoneLocationManager.UpdatedHeading += (object sender, CLHeadingUpdatedEventArgs e) => {
mainScreen.LblMagneticHeading.Text = e.NewHeading.MagneticHeading.ToString () + "º";
mainScreen.LblTrueHeading.Text = e.NewHeading.TrueHeading.ToString () + "º";
};
// start updating our location, et. al.
if (CLLocationManager.LocationServicesEnabled)
iPhoneLocationManager.StartUpdatingLocation ();
if (CLLocationManager.HeadingAvailable)
iPhoneLocationManager.StartUpdatingHeading ();
}
#region -= protected methods =-
// Loads either the iPad or iPhone view, based on the current device
protected void LoadViewForDevice()
{
// load the appropriate view based on the device
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
mainViewController_iPad = new MainViewController_iPad ();
this.View.AddSubview (mainViewController_iPad.View);
mainScreen = mainViewController_iPad as IMainScreen;
} else {
mainViewController_iPhone = new MainViewController_iPhone ();
this.View.AddSubview (mainViewController_iPhone.View);
mainScreen = mainViewController_iPhone as IMainScreen;
}
}
#endregion
// If you don't want to use events, you could define a delegate to do the
// updates as well, as shown here.
public class LocationDelegate : CLLocationManagerDelegate
{
IMainScreen ms;
public LocationDelegate (IMainScreen mainScreen) : base()
{
ms = mainScreen;
}
public override void UpdatedLocation (CLLocationManager manager, CLLocation newLocation, CLLocation oldLocation)
{
ms.LblAltitude.Text = newLocation.Altitude.ToString () + "meters";
ms.LblLongitude.Text = newLocation.Coordinate.Longitude.ToString () + "º";
ms.LblLatitude.Text = newLocation.Coordinate.Latitude.ToString () + "º";
ms.LblCourse.Text = newLocation.Course.ToString () + "º";
ms.LblSpeed.Text = newLocation.Speed.ToString () + "meters/s";
// get the distance from here to paris
ms.LblDistanceToParis.Text = (newLocation.DistanceFrom(new CLLocation(48.857, 2.351)) / 1000).ToString() + "km";
}
public override void UpdatedHeading (CLLocationManager manager, CLHeading newHeading)
{
ms.LblMagneticHeading.Text = newHeading.MagneticHeading.ToString () + "º";
ms.LblTrueHeading.Text = newHeading.TrueHeading.ToString () + "º";
}
}
}
}

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

@ -0,0 +1,763 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">768</int>
<string key="IBDocument.SystemVersion">10F569</string>
<string key="IBDocument.InterfaceBuilderVersion">788</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">117</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBProxyObject" id="711762367">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUILabel" id="123106650">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{76, 57}, {66, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Latitude:</string>
<object class="NSColor" key="IBUITextColor" id="184672039">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="852931344">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{308, 57}, {80, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Longitude:</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="954528809">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{276, 86}, {112, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Course:</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="376977755">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{80, 86}, {62, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Altitude:</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="603906923">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 57}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">[lat]</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="685299897">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{396, 57}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">[lon]</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="296716788">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 86}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">[alt]</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="317567968">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{396, 86}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">[course]</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="518971304">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, 115}, {112, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Speed:</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="568645197">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 115}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">[speed]</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="395407107">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, 196}, {112, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Mag. Heading:</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="283876731">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 196}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">[mag head]</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="310875943">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, 283}, {226, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Paris (lat 48.857, long 2.351):</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="399714698">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{264, 283}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">[distance to paris]</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="568047389">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{308, 196}, {112, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">True Heading:</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="971747263">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{428, 196}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">[true head]</string>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="28750116">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 20}, {107, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Location:</string>
<object class="NSFont" key="IBUIFont" id="559137337">
<string key="NSName">HelveticaNeue-Bold</string>
<double key="NSSize">24</double>
<int key="NSfFlags">16</int>
</object>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="482539481">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 244}, {144, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Distance To:</string>
<reference key="IBUIFont" ref="559137337"/>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="81890198">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 159}, {109, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Heading:</string>
<reference key="IBUIFont" ref="559137337"/>
<reference key="IBUITextColor" ref="184672039"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
</object>
<string key="NSFrameSize">{768, 1004}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">7</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblAltitude</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="296716788"/>
</object>
<int key="connectionID">24</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblCourse</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="317567968"/>
</object>
<int key="connectionID">25</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblLatitude</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="603906923"/>
</object>
<int key="connectionID">26</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblLongitude</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="685299897"/>
</object>
<int key="connectionID">27</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblMagneticHeading</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="283876731"/>
</object>
<int key="connectionID">28</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblSpeed</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="568645197"/>
</object>
<int key="connectionID">29</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblTrueHeading</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="971747263"/>
</object>
<int key="connectionID">30</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblDistanceToParis</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="399714698"/>
</object>
<int key="connectionID">34</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="123106650"/>
<reference ref="603906923"/>
<reference ref="28750116"/>
<reference ref="852931344"/>
<reference ref="685299897"/>
<reference ref="376977755"/>
<reference ref="296716788"/>
<reference ref="954528809"/>
<reference ref="317567968"/>
<reference ref="518971304"/>
<reference ref="568645197"/>
<reference ref="81890198"/>
<reference ref="395407107"/>
<reference ref="283876731"/>
<reference ref="568047389"/>
<reference ref="971747263"/>
<reference ref="482539481"/>
<reference ref="310875943"/>
<reference ref="399714698"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="711762367"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="123106650"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="852931344"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
<reference key="object" ref="954528809"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="376977755"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="603906923"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">13</int>
<reference key="object" ref="685299897"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="296716788"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="317567968"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="518971304"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="568645197"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="395407107"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="283876731"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="568047389"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="971747263"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="28750116"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="81890198"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">31</int>
<reference key="object" ref="482539481"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">32</int>
<reference key="object" ref="310875943"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">33</int>
<reference key="object" ref="399714698"/>
<reference key="parent" ref="191373211"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>1.IBEditorWindowLastContentRect</string>
<string>1.IBLastUsedUIStatusBarStylesToTargetRuntimesMap</string>
<string>1.IBPluginDependency</string>
<string>10.IBPluginDependency</string>
<string>11.IBPluginDependency</string>
<string>12.IBPluginDependency</string>
<string>13.IBPluginDependency</string>
<string>14.IBPluginDependency</string>
<string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.IBPluginDependency</string>
<string>18.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
<string>21.IBPluginDependency</string>
<string>22.IBPluginDependency</string>
<string>23.IBPluginDependency</string>
<string>31.IBPluginDependency</string>
<string>32.IBPluginDependency</string>
<string>33.IBPluginDependency</string>
<string>8.IBPluginDependency</string>
<string>9.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>MainViewController_iPad</string>
<string>UIResponder</string>
<string>{{228, 57}, {768, 1024}}</string>
<object class="NSMutableDictionary">
<string key="NS.key.0">IBCocoaTouchFramework</string>
<integer value="0" key="NS.object.0"/>
</object>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">34</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">MainViewController_iPad</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>lblAltitude</string>
<string>lblCourse</string>
<string>lblDistanceToParis</string>
<string>lblLatitude</string>
<string>lblLongitude</string>
<string>lblMagneticHeading</string>
<string>lblSpeed</string>
<string>lblTrueHeading</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>lblAltitude</string>
<string>lblCourse</string>
<string>lblDistanceToParis</string>
<string>lblLatitude</string>
<string>lblLongitude</string>
<string>lblMagneticHeading</string>
<string>lblSpeed</string>
<string>lblTrueHeading</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">lblAltitude</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblCourse</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblDistanceToParis</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblLatitude</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblLongitude</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblMagneticHeading</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblSpeed</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblTrueHeading</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<integer value="768" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">117</string>
</data>
</archive>

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

@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Example_CoreLocation.MainScreen
{
public partial class MainViewController_iPad : UIViewController, IMainScreen
{
#region Constructors
// The IntPtr and initWithCoder constructors are required for controllers that need
// to be able to be created from a xib rather than from managed code
public MainViewController_iPad (IntPtr handle) : base(handle)
{
Initialize ();
}
[Export("initWithCoder:")]
public MainViewController_iPad (NSCoder coder) : base(coder)
{
Initialize ();
}
public MainViewController_iPad () : base("MainViewController_iPad", null)
{
Initialize ();
}
void Initialize ()
{
}
#endregion
public UILabel LblAltitude
{
get { return this.lblAltitude; }
}
public UILabel LblLatitude
{
get { return this.lblLatitude; }
}
public UILabel LblLongitude
{
get { return this.lblLongitude; }
}
public UILabel LblCourse
{
get { return this.lblCourse; }
}
public UILabel LblMagneticHeading
{
get { return this.lblMagneticHeading; }
}
public UILabel LblSpeed
{
get { return this.lblSpeed; }
}
public UILabel LblTrueHeading
{
get { return this.lblTrueHeading; }
}
public UILabel LblDistanceToParis
{
get { return this.lblDistanceToParis; }
}
}
}

145
CoreLocation/CoreLocation/MainScreen/MainViewController_iPad.xib.designer.cs сгенерированный Executable file
Просмотреть файл

@ -0,0 +1,145 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace Example_CoreLocation.MainScreen {
// Base type probably should be MonoTouch.UIKit.UIViewController or subclass
[MonoTouch.Foundation.Register("MainViewController_iPad")]
public partial class MainViewController_iPad {
private MonoTouch.UIKit.UIView __mt_view;
private MonoTouch.UIKit.UILabel __mt_lblAltitude;
private MonoTouch.UIKit.UILabel __mt_lblCourse;
private MonoTouch.UIKit.UILabel __mt_lblLatitude;
private MonoTouch.UIKit.UILabel __mt_lblLongitude;
private MonoTouch.UIKit.UILabel __mt_lblMagneticHeading;
private MonoTouch.UIKit.UILabel __mt_lblSpeed;
private MonoTouch.UIKit.UILabel __mt_lblTrueHeading;
private MonoTouch.UIKit.UILabel __mt_lblDistanceToParis;
#pragma warning disable 0169
[MonoTouch.Foundation.Connect("view")]
private MonoTouch.UIKit.UIView view {
get {
this.__mt_view = ((MonoTouch.UIKit.UIView)(this.GetNativeField("view")));
return this.__mt_view;
}
set {
this.__mt_view = value;
this.SetNativeField("view", value);
}
}
[MonoTouch.Foundation.Connect("lblAltitude")]
private MonoTouch.UIKit.UILabel lblAltitude {
get {
this.__mt_lblAltitude = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblAltitude")));
return this.__mt_lblAltitude;
}
set {
this.__mt_lblAltitude = value;
this.SetNativeField("lblAltitude", value);
}
}
[MonoTouch.Foundation.Connect("lblCourse")]
private MonoTouch.UIKit.UILabel lblCourse {
get {
this.__mt_lblCourse = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblCourse")));
return this.__mt_lblCourse;
}
set {
this.__mt_lblCourse = value;
this.SetNativeField("lblCourse", value);
}
}
[MonoTouch.Foundation.Connect("lblLatitude")]
private MonoTouch.UIKit.UILabel lblLatitude {
get {
this.__mt_lblLatitude = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblLatitude")));
return this.__mt_lblLatitude;
}
set {
this.__mt_lblLatitude = value;
this.SetNativeField("lblLatitude", value);
}
}
[MonoTouch.Foundation.Connect("lblLongitude")]
private MonoTouch.UIKit.UILabel lblLongitude {
get {
this.__mt_lblLongitude = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblLongitude")));
return this.__mt_lblLongitude;
}
set {
this.__mt_lblLongitude = value;
this.SetNativeField("lblLongitude", value);
}
}
[MonoTouch.Foundation.Connect("lblMagneticHeading")]
private MonoTouch.UIKit.UILabel lblMagneticHeading {
get {
this.__mt_lblMagneticHeading = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblMagneticHeading")));
return this.__mt_lblMagneticHeading;
}
set {
this.__mt_lblMagneticHeading = value;
this.SetNativeField("lblMagneticHeading", value);
}
}
[MonoTouch.Foundation.Connect("lblSpeed")]
private MonoTouch.UIKit.UILabel lblSpeed {
get {
this.__mt_lblSpeed = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblSpeed")));
return this.__mt_lblSpeed;
}
set {
this.__mt_lblSpeed = value;
this.SetNativeField("lblSpeed", value);
}
}
[MonoTouch.Foundation.Connect("lblTrueHeading")]
private MonoTouch.UIKit.UILabel lblTrueHeading {
get {
this.__mt_lblTrueHeading = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblTrueHeading")));
return this.__mt_lblTrueHeading;
}
set {
this.__mt_lblTrueHeading = value;
this.SetNativeField("lblTrueHeading", value);
}
}
[MonoTouch.Foundation.Connect("lblDistanceToParis")]
private MonoTouch.UIKit.UILabel lblDistanceToParis {
get {
this.__mt_lblDistanceToParis = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblDistanceToParis")));
return this.__mt_lblDistanceToParis;
}
set {
this.__mt_lblDistanceToParis = value;
this.SetNativeField("lblDistanceToParis", value);
}
}
}
}

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

@ -0,0 +1,763 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">768</int>
<string key="IBDocument.SystemVersion">10F569</string>
<string key="IBDocument.InterfaceBuilderVersion">788</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">117</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="711762367">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUILabel" id="990245184">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{76, 57}, {66, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Latitude:</string>
<object class="NSColor" key="IBUITextColor" id="598183245">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="528769690">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{62, 86}, {80, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Longitude:</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="511378272">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, 144}, {112, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Course:</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="931380009">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{80, 115}, {62, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Altitude:</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="995723869">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 57}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">[lat]</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="727530119">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 86}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">[lon]</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="636456941">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 115}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">[alt]</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="741503706">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 144}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">[course]</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="87776119">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, 173}, {112, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Speed:</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="807652957">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 173}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">[speed]</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="1015734015">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, 248}, {112, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Mag. Heading:</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="588335155">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 248}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">[mag head]</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="585449781">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, 277}, {112, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">True Heading:</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="728301204">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{150, 277}, {150, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">[true head]</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="65217568">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 20}, {98, 29}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Location:</string>
<object class="NSFont" key="IBUIFont" id="406536139">
<string key="NSName">Helvetica</string>
<double key="NSSize">24</double>
<int key="NSfFlags">16</int>
</object>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="145887418">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 211}, {109, 29}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Heading:</string>
<reference key="IBUIFont" ref="406536139"/>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="1063454895">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 308}, {136, 29}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Distance To:</string>
<reference key="IBUIFont" ref="406536139"/>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUILabel" id="568759085">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, 345}, {226, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Paris (lat 48.857, long 2.351):</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">2</int>
</object>
<object class="IBUILabel" id="549177644">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, 374}, {226, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">[distance to paris]</string>
<reference key="IBUITextColor" ref="598183245"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">7</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblAltitude</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="636456941"/>
</object>
<int key="connectionID">24</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblCourse</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="741503706"/>
</object>
<int key="connectionID">25</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblLatitude</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="995723869"/>
</object>
<int key="connectionID">26</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblLongitude</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="727530119"/>
</object>
<int key="connectionID">27</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblMagneticHeading</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="588335155"/>
</object>
<int key="connectionID">28</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblSpeed</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="807652957"/>
</object>
<int key="connectionID">29</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblTrueHeading</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="728301204"/>
</object>
<int key="connectionID">30</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lblDistanceToParis</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="549177644"/>
</object>
<int key="connectionID">35</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="990245184"/>
<reference ref="528769690"/>
<reference ref="511378272"/>
<reference ref="931380009"/>
<reference ref="995723869"/>
<reference ref="727530119"/>
<reference ref="636456941"/>
<reference ref="741503706"/>
<reference ref="87776119"/>
<reference ref="807652957"/>
<reference ref="1015734015"/>
<reference ref="588335155"/>
<reference ref="585449781"/>
<reference ref="728301204"/>
<reference ref="65217568"/>
<reference ref="145887418"/>
<reference ref="568759085"/>
<reference ref="1063454895"/>
<reference ref="549177644"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="711762367"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="990245184"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="528769690"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
<reference key="object" ref="511378272"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="931380009"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="995723869"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">13</int>
<reference key="object" ref="727530119"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="636456941"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="741503706"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="87776119"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="807652957"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="1015734015"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="588335155"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="585449781"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="728301204"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="65217568"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="145887418"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">31</int>
<reference key="object" ref="568759085"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">32</int>
<reference key="object" ref="549177644"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">34</int>
<reference key="object" ref="1063454895"/>
<reference key="parent" ref="191373211"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>1.IBEditorWindowLastContentRect</string>
<string>1.IBPluginDependency</string>
<string>10.IBPluginDependency</string>
<string>11.IBPluginDependency</string>
<string>12.IBPluginDependency</string>
<string>13.IBPluginDependency</string>
<string>14.IBPluginDependency</string>
<string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.IBPluginDependency</string>
<string>18.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
<string>21.IBPluginDependency</string>
<string>22.IBPluginDependency</string>
<string>23.IBPluginDependency</string>
<string>31.IBPluginDependency</string>
<string>32.IBPluginDependency</string>
<string>34.IBPluginDependency</string>
<string>8.IBPluginDependency</string>
<string>9.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>MainViewController_iPhone</string>
<string>UIResponder</string>
<string>{{352, 655}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">35</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">MainViewController_iPhone</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>lblAltitude</string>
<string>lblCourse</string>
<string>lblDistanceToParis</string>
<string>lblLatitude</string>
<string>lblLongitude</string>
<string>lblMagneticHeading</string>
<string>lblSpeed</string>
<string>lblTrueHeading</string>
<string>view</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>lblAltitude</string>
<string>lblCourse</string>
<string>lblDistanceToParis</string>
<string>lblLatitude</string>
<string>lblLongitude</string>
<string>lblMagneticHeading</string>
<string>lblSpeed</string>
<string>lblTrueHeading</string>
<string>view</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">lblAltitude</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblCourse</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblDistanceToParis</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblLatitude</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblLongitude</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblMagneticHeading</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblSpeed</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">lblTrueHeading</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">view</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<integer value="768" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">117</string>
</data>
</archive>

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

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Example_CoreLocation.MainScreen
{
public partial class MainViewController_iPhone : UIViewController, IMainScreen
{
#region Constructors
// The IntPtr and initWithCoder constructors are required for controllers that need
// to be able to be created from a xib rather than from managed code
public MainViewController_iPhone (IntPtr handle) : base(handle)
{
Initialize ();
}
[Export("initWithCoder:")]
public MainViewController_iPhone (NSCoder coder) : base(coder)
{
Initialize ();
}
public MainViewController_iPhone () : base("MainViewController_iPhone", null)
{
Initialize ();
}
void Initialize ()
{
}
#endregion
public UILabel LblAltitude
{
get { return this.lblAltitude; }
}
public UILabel LblLatitude
{
get { return this.lblLatitude; }
}
public UILabel LblLongitude
{
get { return this.lblLongitude; }
}
public UILabel LblCourse
{
get { return this.lblCourse; }
}
public UILabel LblMagneticHeading
{
get { return this.lblMagneticHeading; }
}
public UILabel LblSpeed
{
get { return this.lblSpeed; }
}
public UILabel LblTrueHeading
{
get { return this.lblTrueHeading; }
}
public UILabel LblDistanceToParis
{
get { return this.lblDistanceToParis; }
}
}
}

145
CoreLocation/CoreLocation/MainScreen/MainViewController_iPhone.xib.designer.cs сгенерированный Executable file
Просмотреть файл

@ -0,0 +1,145 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace Example_CoreLocation.MainScreen {
// Base type probably should be MonoTouch.UIKit.UIViewController or subclass
[MonoTouch.Foundation.Register("MainViewController_iPhone")]
public partial class MainViewController_iPhone {
private MonoTouch.UIKit.UIView __mt_view;
private MonoTouch.UIKit.UILabel __mt_lblAltitude;
private MonoTouch.UIKit.UILabel __mt_lblCourse;
private MonoTouch.UIKit.UILabel __mt_lblLatitude;
private MonoTouch.UIKit.UILabel __mt_lblLongitude;
private MonoTouch.UIKit.UILabel __mt_lblMagneticHeading;
private MonoTouch.UIKit.UILabel __mt_lblSpeed;
private MonoTouch.UIKit.UILabel __mt_lblTrueHeading;
private MonoTouch.UIKit.UILabel __mt_lblDistanceToParis;
#pragma warning disable 0169
[MonoTouch.Foundation.Connect("view")]
private MonoTouch.UIKit.UIView view {
get {
this.__mt_view = ((MonoTouch.UIKit.UIView)(this.GetNativeField("view")));
return this.__mt_view;
}
set {
this.__mt_view = value;
this.SetNativeField("view", value);
}
}
[MonoTouch.Foundation.Connect("lblAltitude")]
private MonoTouch.UIKit.UILabel lblAltitude {
get {
this.__mt_lblAltitude = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblAltitude")));
return this.__mt_lblAltitude;
}
set {
this.__mt_lblAltitude = value;
this.SetNativeField("lblAltitude", value);
}
}
[MonoTouch.Foundation.Connect("lblCourse")]
private MonoTouch.UIKit.UILabel lblCourse {
get {
this.__mt_lblCourse = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblCourse")));
return this.__mt_lblCourse;
}
set {
this.__mt_lblCourse = value;
this.SetNativeField("lblCourse", value);
}
}
[MonoTouch.Foundation.Connect("lblLatitude")]
private MonoTouch.UIKit.UILabel lblLatitude {
get {
this.__mt_lblLatitude = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblLatitude")));
return this.__mt_lblLatitude;
}
set {
this.__mt_lblLatitude = value;
this.SetNativeField("lblLatitude", value);
}
}
[MonoTouch.Foundation.Connect("lblLongitude")]
private MonoTouch.UIKit.UILabel lblLongitude {
get {
this.__mt_lblLongitude = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblLongitude")));
return this.__mt_lblLongitude;
}
set {
this.__mt_lblLongitude = value;
this.SetNativeField("lblLongitude", value);
}
}
[MonoTouch.Foundation.Connect("lblMagneticHeading")]
private MonoTouch.UIKit.UILabel lblMagneticHeading {
get {
this.__mt_lblMagneticHeading = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblMagneticHeading")));
return this.__mt_lblMagneticHeading;
}
set {
this.__mt_lblMagneticHeading = value;
this.SetNativeField("lblMagneticHeading", value);
}
}
[MonoTouch.Foundation.Connect("lblSpeed")]
private MonoTouch.UIKit.UILabel lblSpeed {
get {
this.__mt_lblSpeed = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblSpeed")));
return this.__mt_lblSpeed;
}
set {
this.__mt_lblSpeed = value;
this.SetNativeField("lblSpeed", value);
}
}
[MonoTouch.Foundation.Connect("lblTrueHeading")]
private MonoTouch.UIKit.UILabel lblTrueHeading {
get {
this.__mt_lblTrueHeading = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblTrueHeading")));
return this.__mt_lblTrueHeading;
}
set {
this.__mt_lblTrueHeading = value;
this.SetNativeField("lblTrueHeading", value);
}
}
[MonoTouch.Foundation.Connect("lblDistanceToParis")]
private MonoTouch.UIKit.UILabel lblDistanceToParis {
get {
this.__mt_lblDistanceToParis = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblDistanceToParis")));
return this.__mt_lblDistanceToParis;
}
set {
this.__mt_lblDistanceToParis = value;
this.SetNativeField("lblDistanceToParis", value);
}
}
}
}

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

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleMetadata>
<ID>747bae48-05f5-4dec-a9fa-4cb979056b2d</ID>
<IsFullApplication>false</IsFullApplication>
<Level>Intermediate</Level>
<Tags>Location Services</Tags>
</SampleMetadata>

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

@ -0,0 +1,32 @@
Core Animation
=================
This sample illustrates how to retrieve location, orientation, and velocity data from the device using the Core Location API exposed in MonoTouch. It covers initializing the CLLocationManager, configuring update frequency and accuracy, and receiving updates using both the event and delegate pattern. It also illustrates how to get retrieve "Distance To" information.
License
=======
The samples are licensed under the MIT X11 license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Authors
=======
Bryan Costanich

Двоичные данные
CoreLocation/Screenshots/01.PNG Normal file

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

После

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

Двоичные данные
CoreLocation/Screenshots/02.PNG Normal file

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

После

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

26
Drawing/Drawing.sln Normal file
Просмотреть файл

@ -0,0 +1,26 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Drawing", "Drawing\Drawing.csproj", "{3C05703F-0141-4F1A-A986-DFC409288411}"
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
{3C05703F-0141-4F1A-A986-DFC409288411}.Debug|iPhone.ActiveCfg = Debug|iPhone
{3C05703F-0141-4F1A-A986-DFC409288411}.Debug|iPhone.Build.0 = Debug|iPhone
{3C05703F-0141-4F1A-A986-DFC409288411}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{3C05703F-0141-4F1A-A986-DFC409288411}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{3C05703F-0141-4F1A-A986-DFC409288411}.Release|iPhone.ActiveCfg = Release|iPhone
{3C05703F-0141-4F1A-A986-DFC409288411}.Release|iPhone.Build.0 = Release|iPhone
{3C05703F-0141-4F1A-A986-DFC409288411}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{3C05703F-0141-4F1A-A986-DFC409288411}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Drawing\Drawing.csproj
EndGlobalSection
EndGlobal

36
Drawing/Drawing/AppDelegate.cs Executable file
Просмотреть файл

@ -0,0 +1,36 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
namespace Example_Drawing
{
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
#region -= declarations and properties =-
protected UIWindow window;
protected UINavigationController mainNavController;
protected Example_Drawing.Screens.iPad.Home.HomeScreen iPadHome;
#endregion
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create our window
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.MakeKeyAndVisible ();
// instantiate our main navigatin controller and add it's view to the window
mainNavController = new UINavigationController ();
iPadHome = new Example_Drawing.Screens.iPad.Home.HomeScreen ();
mainNavController.PushViewController (iPadHome, false);
window.RootViewController = mainNavController;
//
return true;
}
}
}

20
Drawing/Drawing/Application.cs Executable file
Просмотреть файл

@ -0,0 +1,20 @@
using System;
using MonoTouch.UIKit;
namespace Example_Drawing
{
public class Application// : UIApplication
{
public static void Main (string[] args)
{
try
{
UIApplication.Main (args, null, "AppDelegate");
}
catch (Exception e)
{
Console.WriteLine (e.ToString ());
}
}
}
}

Двоичные данные
Drawing/Drawing/Default-Landscape~ipad.png Executable file

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

После

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

Двоичные данные
Drawing/Drawing/Default-Portrait~ipad.png Executable file

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

После

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

Двоичные данные
Drawing/Drawing/Default.png Executable file

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

После

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

Двоичные данные
Drawing/Drawing/Default@2x.png Executable file

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

После

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

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

@ -0,0 +1,147 @@
<?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>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3C05703F-0141-4F1A-A986-DFC409288411}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>Example_Drawing</RootNamespace>
<AssemblyName>Example_Drawing</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>
<MtouchDebug>true</MtouchDebug>
<MtouchLink>None</MtouchLink>
<MtouchI18n />
<MtouchUseArmv7>false</MtouchUseArmv7>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchLink>None</MtouchLink>
<MtouchI18n />
<MtouchUseArmv7>false</MtouchUseArmv7>
</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>
<MtouchDebug>true</MtouchDebug>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchI18n />
<MtouchUseArmv7>false</MtouchUseArmv7>
<IpaPackageName />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchI18n />
<MtouchUseArmv7>false</MtouchUseArmv7>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Folder Include="Images\" />
<Folder Include="Screens\" />
<Folder Include="Images\Icons\" />
<Folder Include="Images\" />
<Folder Include="Images\" />
<Folder Include="Images\" />
<Folder Include="Images\" />
<Folder Include="Images\" />
<Folder Include="Screens\iPad\" />
<Folder Include="Screens\iPad\Home\" />
<Folder Include="Screens\iPad\DrawRectVsPath\" />
<Folder Include="Screens\iPad\DrawOffScreenUsingCGBitmapContext\" />
<Folder Include="Screens\iPad\Layers\" />
<Folder Include="Screens\iPad\CoordinatesOnScreen\" />
<Folder Include="Screens\iPad\CoordinatesOffScreen\" />
<Folder Include="Screens\iPad\OnScreenUncorrectedTextRotation\" />
<Folder Include="Screens\iPad\FlagOffScreen\" />
<Folder Include="Screens\iPad\Images\" />
<Folder Include="Screens\iPad\ColorPattern\" />
<Folder Include="Screens\iPad\StencilPattern\" />
<Folder Include="Screens\iPad\Shadows\" />
<Folder Include="Screens\iPad\HitTesting\" />
<Folder Include="Screens\iPad\TouchDrawing\" />
<Folder Include="Screens\iPad\FlagOnScreen\" />
<Folder Include="Screens\iPad\Transformations\" />
</ItemGroup>
<ItemGroup>
<Content Include="Images\Icons\29_icon.png" />
<Content Include="Images\Icons\50_icon.png" />
<Content Include="Images\Icons\57_icon.png" />
<Content Include="Images\Icons\58_icon.png" />
<Content Include="Images\Icons\72_icon.png" />
<Content Include="Images\Icons\114_icon.png" />
<Content Include="Images\Icons\512_icon.png" />
<Content Include="Default-Landscape~ipad.png" />
<Content Include="Default-Portrait~ipad.png" />
<Content Include="Default.png" />
<Content Include="Default%402x.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="AppDelegate.cs" />
<Compile Include="Application.cs" />
<Compile Include="Screens\iPad\Home\HomeScreen.xib.cs">
<DependentUpon>HomeScreen.xib</DependentUpon>
</Compile>
<Compile Include="Screens\iPad\Home\HomeScreen.xib.designer.cs">
<DependentUpon>HomeScreen.xib</DependentUpon>
</Compile>
<Compile Include="Screens\iPad\DrawRectVsPath\Controller.cs" />
<Compile Include="Screens\iPad\DrawRectVsPath\View.cs" />
<Compile Include="Screens\iPad\DrawOffScreenUsingCGBitmapContext\Controller.cs" />
<Compile Include="Screens\iPad\Layers\View.cs" />
<Compile Include="Screens\iPad\Layers\Controller.cs" />
<Compile Include="Screens\iPad\CoordinatesOffScreen\Controller.cs" />
<Compile Include="Screens\iPad\CoordinatesOnScreen\Controller.cs" />
<Compile Include="Screens\iPad\CoordinatesOnScreen\View.cs" />
<Compile Include="Screens\iPad\OnScreenUncorrectedTextRotation\Controller.cs" />
<Compile Include="Screens\iPad\OnScreenUncorrectedTextRotation\View.cs" />
<Compile Include="Screens\iPad\FlagOffScreen\Controller.cs" />
<Compile Include="Screens\iPad\Images\Controller.cs" />
<Compile Include="Screens\iPad\ColorPattern\Controller.cs" />
<Compile Include="Screens\iPad\StencilPattern\Controller.cs" />
<Compile Include="Screens\iPad\Shadows\Controller.cs" />
<Compile Include="Screens\iPad\HitTesting\Controller.cs" />
<Compile Include="Screens\iPad\HitTesting\View.cs" />
<Compile Include="Screens\iPad\TouchDrawing\Controller.cs" />
<Compile Include="Screens\iPad\TouchDrawing\View.cs" />
<Compile Include="Screens\iPad\FlagOnScreen\Controller.cs" />
<Compile Include="Screens\iPad\FlagOnScreen\View.cs" />
<Compile Include="Screens\iPad\Transformations\Controller.cs" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Screens\iPad\Home\HomeScreen.xib" />
<InterfaceDefinition Include="" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
</Project>

Двоичные данные
Drawing/Drawing/Images/Icons/114_icon.png Executable file

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

После

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

Двоичные данные
Drawing/Drawing/Images/Icons/29_icon.png Executable file

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

После

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

Двоичные данные
Drawing/Drawing/Images/Icons/50_icon.png Executable file

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

После

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

Двоичные данные
Drawing/Drawing/Images/Icons/512_icon.png Executable file

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

После

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

Двоичные данные
Drawing/Drawing/Images/Icons/57_icon.png Executable file

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

После

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

Двоичные данные
Drawing/Drawing/Images/Icons/58_icon.png Executable file

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

После

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

Двоичные данные
Drawing/Drawing/Images/Icons/72_icon.png Executable file

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

После

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

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

@ -0,0 +1,32 @@
<?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>CFBundleDisplayName</key>
<string>Drawing</string>
<key>CFBundleIconFiles</key>
<array>
<string>Images/Icons/Apress-57x57.png</string>
<string>Images/Icons/Apress-114x114.png</string>
<string>Images/Icons/Apress-72x72.png</string>
<string>Images/Icons/Apress-29x29.png</string>
<string>Images/Icons/Apress-58x58.png</string>
<string>Images/Icons/Apress-50x50.png</string>
<string>Images/Icons/72_icon.png</string>
<string>Images/Icons/50_icon.png</string>
<string>Images/Icons/29_icon.png</string>
<string>Images/Icons/512_icon.png</string>
</array>
<key>MinimumOSVersion</key>
<string>4.3</string>
<key>UIDeviceFamily</key>
<array>
<string>2</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>

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

@ -0,0 +1,94 @@
using System;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.CoreGraphics;
namespace Example_Drawing.Screens.iPad.ColorPattern
{
public class Controller : UIViewController
{
UIImageView imageView;
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// set the background color of the view to white
View.BackgroundColor = UIColor.White;
// instantiate a new image view that takes up the whole screen and add it to
// the view hierarchy
RectangleF imageViewFrame = new RectangleF (0, -NavigationController.NavigationBar.Frame.Height, View.Frame.Width, View.Frame.Height);
imageView = new UIImageView (imageViewFrame);
View.AddSubview (imageView);
// create our offscreen bitmap context
// size
SizeF bitmapSize = new SizeF (View.Frame.Size);
using (CGBitmapContext context = new CGBitmapContext (IntPtr.Zero
, (int)bitmapSize.Width, (int)bitmapSize.Height, 8
, (int)(4 * bitmapSize.Width), CGColorSpace.CreateDeviceRGB ()
, CGImageAlphaInfo.PremultipliedFirst)) {
// declare vars
RectangleF patternRect = new RectangleF (0, 0, 16, 16);
// set the color space of our fill to be the patter colorspace
context.SetFillColorSpace (CGColorSpace.CreatePattern (null));
// create a new pattern
CGPattern pattern = new CGPattern (patternRect
, CGAffineTransform.MakeRotation (.3f), 16, 16, CGPatternTiling.NoDistortion
, true, DrawPolkaDotPattern);
// set our fill as our pattern, color doesn't matter because the pattern handles it
context.SetFillPattern (pattern, new float[] { 1 });
// fill the entire view with that pattern
context.FillRect (imageView.Frame);
// output the drawing to the view
imageView.Image = UIImage.FromImage (context.ToImage ());
}
}
// This is our pattern callback. it's called by coregraphics to create
// the pattern base.
protected void DrawPolkaDotPattern (CGContext context)
{
context.SetRGBFillColor (.3f, .3f, .3f, 1);
context.FillEllipseInRect (new RectangleF (4, 4, 8, 8));
}
// This is a slightly more complicated draw pattern, but using it is just
// as easy as the previous one. To use this one, simply change "DrawPolkaDotPattern"
// in line 54 above to "DrawStarPattern"
protected void DrawStarPattern (CGContext context)
{
// declare vars
float starDiameter = 16;
// 144º
float theta = 2 * (float)Math.PI * (2f / 5f);
float radius = starDiameter / 2;
// move up and over
context.TranslateCTM (starDiameter / 2, starDiameter / 2);
context.MoveTo (0, radius);
for (int i = 1; i < 5; i++) {
context.AddLineToPoint (radius * (float)Math.Sin (i * theta), radius * (float)Math.Cos (i * theta));
}
// fill our star as dark gray
context.SetRGBFillColor (.3f, .3f, .3f, 1);
context.ClosePath ();
context.FillPath ();
}
}
}

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

@ -0,0 +1,140 @@
using System;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.CoreGraphics;
namespace Example_Drawing.Screens.iPad.CoordinatesOffScreen
{
public class Controller : UIViewController
{
UIImageView imageView;
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// set the background color of the view to white
View.BackgroundColor = UIColor.White;
// instantiate a new image view that takes up the whole screen and add it to
// the view hierarchy
RectangleF imageViewFrame = new RectangleF (0, -NavigationController.NavigationBar.Frame.Height, View.Frame.Width, View.Frame.Height);
imageView = new UIImageView (imageViewFrame);
View.AddSubview (imageView);
// create our offscreen bitmap context
// size
SizeF bitmapSize = new SizeF (View.Frame.Size);
using (CGBitmapContext context = new CGBitmapContext (IntPtr.Zero
, (int)bitmapSize.Width, (int)bitmapSize.Height, 8
, (int)(4 * bitmapSize.Width), CGColorSpace.CreateDeviceRGB ()
, CGImageAlphaInfo.PremultipliedFirst))
{
// declare vars
int remainder;
int textHeight = 20;
#region -= vertical ticks =-
// create our vertical tick lines
using (CGLayer verticalTickLayer = CGLayer.Create (context, new SizeF (20, 3))) {
// draw a single tick
verticalTickLayer.Context.FillRect (new RectangleF (0, 1, 20, 2));
// draw a vertical tick every 20 pixels
float yPos = 20;
int numberOfVerticalTicks = ((context.Height / 20) - 1);
for (int i = 0; i < numberOfVerticalTicks; i++) {
// draw the layer
context.DrawLayer (verticalTickLayer, new PointF (0, yPos));
// starting at 40, draw the coordinate text nearly to the top
if (yPos > 40 && i < (numberOfVerticalTicks - 2)) {
// draw it every 80 points
Math.DivRem ( (int)yPos, (int)80, out remainder);
if (remainder == 0)
ShowTextAtPoint (context, 30, (yPos - (textHeight / 2)), yPos.ToString (), textHeight);
}
// increment the position of the next tick
yPos += 20;
}
}
#endregion
#region -= horizontal ticks =-
// create our horizontal tick lines
using (CGLayer horizontalTickLayer = CGLayer.Create (context, new SizeF (3, 20))) {
horizontalTickLayer.Context.FillRect (new RectangleF (1, 0, 2, 20));
// draw a horizontal tick every 20 pixels
float xPos = 20;
int numberOfHorizontalTicks = ((context.Width / 20) - 1);
for (int i = 0; i < numberOfHorizontalTicks; i++) {
context.DrawLayer (horizontalTickLayer, new PointF (xPos, 0));
// starting at 100, draw the coordinate text nearly to the top
if (xPos > 100 && i < (numberOfHorizontalTicks - 1)) {
// draw it every 80 points
Math.DivRem ((int)xPos, (int)80, out remainder);
if (remainder == 0)
ShowCenteredTextAtPoint (context, xPos, 30, xPos.ToString (), textHeight);
}
// increment the position of the next tick
xPos += 20;
}
}
#endregion
// draw our "origin" text
ShowTextAtPoint (context, 20, (20 + (textHeight / 2)), "Origin (0,0)", textHeight);
#region -= points =-
// (250,700)
context.FillEllipseInRect (new RectangleF (250, 700, 6, 6));
ShowCenteredTextAtPoint (context, 250, 715, "(250,700)", textHeight);
// (500,300)
context.FillEllipseInRect (new RectangleF (500, 300, 6, 6));
ShowCenteredTextAtPoint (context, 500, 315, "(500,300)", textHeight);
#endregion
// output the drawing to the view
imageView.Image = UIImage.FromImage (context.ToImage ());
}
}
protected void ShowTextAtPoint (CGContext context, float x, float y, string text, int textHeight)
{
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.ShowTextAtPoint (x, y, text, text.Length);
}
private void ShowCenteredTextAtPoint (CGContext context, float centerX, float y, string text, int textHeight)
{
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Invisible);
context.ShowTextAtPoint (centerX, y, text, text.Length);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.ShowTextAtPoint (centerX - (context.TextPosition.X - centerX) / 2, y, text, text.Length);
}
}
}

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

@ -0,0 +1,31 @@
using System;
using MonoTouch.UIKit;
namespace Example_Drawing.Screens.iPad.CoordinatesOnScreen
{
public class Controller : UIViewController
{
#region -= constructors =-
public Controller () : base()
{
}
#endregion
public override void LoadView ()
{
View = new View ();
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// set the background color of the view to white
View.BackgroundColor = UIColor.White;
}
}
}

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

@ -0,0 +1,128 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using System.Drawing;
namespace Example_Drawing.Screens.iPad.CoordinatesOnScreen
{
public class View : UIView
{
#region -= constructors =-
public View () : base()
{
}
#endregion
// rect changes depending on if the whole view is being redrawn, or just a section
public override void Draw (RectangleF rect)
{
Console.WriteLine ("Draw() Called");
base.Draw (rect);
// get a reference to the context
using (CGContext context = UIGraphics.GetCurrentContext ()) {
// declare vars
int remainder;
int textHeight = 20;
// invert the 'y' coordinates on the text
context.TextMatrix = CGAffineTransform.MakeScale (1, -1);
#region -= vertical ticks =-
// create our vertical tick lines
using (CGLayer verticalTickLayer = CGLayer.Create (context, new SizeF (20, 3))) {
// draw a single tick
verticalTickLayer.Context.FillRect (new RectangleF (0, 1, 20, 2));
// draw a vertical tick every 20 pixels
float yPos = 20;
int numberOfVerticalTicks = (((int)Frame.Height / 20) - 1);
for (int i = 0; i < numberOfVerticalTicks; i++) {
// draw the layer
context.DrawLayer (verticalTickLayer, new PointF (0, yPos));
// starting at 40, draw the coordinate text nearly to the top
if (yPos > 40 && i < (numberOfVerticalTicks - 2)) {
// draw it every 80 points
Math.DivRem ((int)yPos, (int)80, out remainder);
if (remainder == 0)
ShowTextAtPoint (context, 30, (yPos - (textHeight / 2)), yPos.ToString (), textHeight);
}
// increment the position of the next tick
yPos += 20;
}
}
#endregion
#region -= horizontal ticks =-
// create our horizontal tick lines
using (CGLayer horizontalTickLayer = CGLayer.Create (context, new SizeF (3, 20))) {
horizontalTickLayer.Context.FillRect (new RectangleF (1, 0, 2, 20));
// draw a horizontal tick every 20 pixels
float xPos = 20;
int numberOfHorizontalTicks = (((int)Frame.Width / 20) - 1);
for (int i = 0; i < numberOfHorizontalTicks; i++) {
context.DrawLayer (horizontalTickLayer, new PointF (xPos, 0));
// starting at 100, draw the coordinate text nearly to the top
if (xPos > 100 && i < (numberOfHorizontalTicks - 1)) {
// draw it every 80 points
Math.DivRem ((int)xPos, (int)80, out remainder);
if (remainder == 0) {
ShowCenteredTextAtPoint (context, xPos, 40, xPos.ToString (), textHeight);
}
}
// increment the position of the next tick
xPos += 20;
}
}
#endregion
// draw our "origin" text
ShowTextAtPoint (context, 20, (30 + (textHeight / 2)), "Origin (0,0)", textHeight);
#region -= points =-
// (250,700)
context.FillEllipseInRect (new RectangleF (250, 700, 6, 6));
ShowCenteredTextAtPoint (context, 250, 695, "(250,700)", textHeight);
// (500,300)
context.FillEllipseInRect (new RectangleF (500, 300, 6, 6));
ShowCenteredTextAtPoint (context, 500, 295, "(500,300)", textHeight);
#endregion
}
}
protected void ShowTextAtPoint (CGContext context, float x, float y, string text, int textHeight)
{
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.ShowTextAtPoint (x, y, text, text.Length);
}
private void ShowCenteredTextAtPoint (CGContext context, float centerX, float y, string text, int textHeight)
{
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Invisible);
context.ShowTextAtPoint (centerX, y, text, text.Length);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.ShowTextAtPoint (centerX - (context.TextPosition.X - centerX) / 2, y, text, text.Length);
}
}
}

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

@ -0,0 +1,49 @@
using System;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.CoreGraphics;
namespace Example_Drawing.Screens.iPad.DrawOffScreenUsingCGBitmapContext
{
public class Controller : UIViewController
{
#region -= constructors =-
public Controller () : base()
{
}
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// no data
IntPtr data = IntPtr.Zero;
// size
SizeF bitmapSize = new SizeF (200, 300);
//View.Frame.Size;
// 32bit RGB (8bits * 4components (aRGB) = 32bit)
int bitsPerComponent = 8;
// 4bytes for each pixel (32 bits = 4bytes)
int bytesPerRow = (int)(4 * bitmapSize.Width);
// no special color space
CGColorSpace colorSpace = CGColorSpace.CreateDeviceRGB ();
// aRGB
CGImageAlphaInfo alphaType = CGImageAlphaInfo.PremultipliedFirst;
using (CGBitmapContext context = new CGBitmapContext (data
, (int)bitmapSize.Width, (int)bitmapSize.Height, bitsPerComponent
, bytesPerRow, colorSpace, alphaType)) {
// draw whatever here.
}
}
}
}

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

@ -0,0 +1,28 @@
using System;
using MonoTouch.UIKit;
namespace Example_Drawing.Screens.iPad.DrawRectVsPath
{
public class Controller : UIViewController
{
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void LoadView ()
{
Console.WriteLine ("LoadView() Called");
base.LoadView ();
View = new View ();
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
}
}
}

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

@ -0,0 +1,55 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using System.Drawing;
namespace Example_Drawing.Screens.iPad.DrawRectVsPath
{
public class View : UIView
{
#region -= constructors =-
public View () : base() { }
#endregion
// rect changes depending on if the whole view is being redrawn, or just a section
public override void Draw (RectangleF rect)
{
Console.WriteLine ("Draw() Called");
base.Draw (rect);
using (CGContext context = UIGraphics.GetCurrentContext ()) {
// fill the background with white
// set fill color
UIColor.White.SetFill ();
//context.SetRGBFillColor (1, 1, 1, 1f);
// paint
context.FillRect (rect);
// draw a rectangle using stroke rect
UIColor.Blue.SetStroke ();
context.StrokeRect (new RectangleF (10, 10, 200, 100));
// draw a rectangle using a path
context.BeginPath ();
context.MoveTo (220, 10);
context.AddLineToPoint (420, 10);
context.AddLineToPoint (420, 110);
context.AddLineToPoint (220, 110);
context.ClosePath ();
UIColor.DarkGray.SetFill ();
context.DrawPath (CGPathDrawingMode.FillStroke);
// draw a rectangle using a path
CGPath rectPath = new CGPath ();
rectPath.AddRect (new RectangleF (new PointF (430, 10), new SizeF (200, 100)));
context.AddPath (rectPath);
context.DrawPath (CGPathDrawingMode.Stroke);
}
}
}
}

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

@ -0,0 +1,278 @@
using System;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.CoreGraphics;
namespace Example_Drawing.Screens.iPad.FlagOffScreen
{
public class Controller : UIViewController
{
UIImageView imageView;
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// set the background color of the view to white
View.BackgroundColor = UIColor.White;
// instantiate a new image view that takes up the whole screen and add it to
// the view hierarchy
RectangleF imageViewFrame = new RectangleF (0, -NavigationController.NavigationBar.Frame.Height, View.Frame.Width, View.Frame.Height);
imageView = new UIImageView (imageViewFrame);
View.AddSubview (imageView);
// create our offscreen bitmap context
// size
SizeF bitmapSize = new SizeF (imageView.Frame.Size);
using (CGBitmapContext context = new CGBitmapContext (IntPtr.Zero
, (int)bitmapSize.Width, (int)bitmapSize.Height, 8
, (int)(4 * bitmapSize.Width), CGColorSpace.CreateDeviceRGB ()
, CGImageAlphaInfo.PremultipliedFirst)) {
// draw our coordinates for reference
DrawCoordinateSpace (context);
// draw our flag
DrawFlag (context);
// add a label
DrawCenteredTextAtPoint (context, 384, 700, "Stars and Stripes", 60);
// output the drawing to the view
imageView.Image = UIImage.FromImage (context.ToImage ());
}
}
protected void DrawFlag (CGContext context)
{
// declare vars
int i, j;
// general sizes
float flagWidth = imageView.Frame.Width * .8f;
float flagHeight = (float)(flagWidth / 1.9);
PointF flagOrigin = new PointF (imageView.Frame.Width * .1f, imageView.Frame.Height / 3);
// stripe
float stripeHeight = flagHeight / 13;
float stripeSpacing = stripeHeight * 2;
RectangleF stripeRect = new RectangleF (0, 0, flagWidth, stripeHeight);
// star field
float starFieldHeight = 7 * stripeHeight;
float starFieldWidth = flagWidth * (2f / 5f);
RectangleF starField = new RectangleF (flagOrigin.X, flagOrigin.Y + (6 * stripeHeight), starFieldWidth, starFieldHeight);
// stars
float starDiameter = flagHeight * 0.0616f;
float starHorizontalCenterSpacing = (starFieldWidth / 6);
float starHorizontalPadding = (starHorizontalCenterSpacing / 4);
float starVerticalCenterSpacing = (starFieldHeight / 5);
float starVerticalPadding = (starVerticalCenterSpacing / 4);
PointF firstStarOrigin = new PointF (flagOrigin.X + starHorizontalPadding, flagOrigin.Y + flagHeight - starVerticalPadding - (starVerticalCenterSpacing / 2));
PointF secondRowFirstStarOrigin = new PointF (firstStarOrigin.X + (starHorizontalCenterSpacing / 2), firstStarOrigin.Y - (starVerticalCenterSpacing / 2));
// white background + shadow
context.SaveState ();
context.SetShadow (new SizeF (15, -15), 7);
context.SetRGBFillColor (1, 1, 1, 1);
context.FillRect (new RectangleF (flagOrigin.X, flagOrigin.Y, flagWidth, flagHeight));
context.RestoreState ();
// create a stripe layer
using (CGLayer stripeLayer = CGLayer.Create (context, stripeRect.Size)) {
// set red as the fill color
// this works
stripeLayer.Context.SetRGBFillColor (1f, 0f, 0f, 1f);
// but this doesn't ????
//stripeLayer.Context.SetFillColor (new float[] { 1f, 0f, 0f, 1f });
// fill the stripe
stripeLayer.Context.FillRect (stripeRect);
// loop through the stripes and draw the layer
context.SaveState ();
for (i = 0; i < 7; i++) {
Console.WriteLine ("drawing stripe layer");
// draw the layer
context.DrawLayer (stripeLayer, flagOrigin);
// move the origin
context.TranslateCTM (0, stripeSpacing);
}
context.RestoreState ();
}
// draw the star field
//BUGBUG: apple bug - this only works on on-screen CGContext and CGLayer
//context.SetFillColor (new float[] { 0f, 0f, 0.329f, 1.0f });
context.SetRGBFillColor (0f, 0f, 0.329f, 1.0f);
context.FillRect (starField);
// create the star layer
using (CGLayer starLayer = CGLayer.Create (context, starField.Size)) {
// draw the stars
DrawStar (starLayer.Context, starDiameter);
// 6-star rows
// save state so that as we translate (move the origin around,
// it goes back to normal when we restore)
context.SaveState ();
context.TranslateCTM (firstStarOrigin.X, firstStarOrigin.Y);
// loop through each row
for (j = 0; j < 5; j++) {
// each star in the row
for (i = 0; i < 6; i++) {
// draw the star, then move the origin to the right
context.DrawLayer (starLayer, new PointF (0f, 0f));
context.TranslateCTM (starHorizontalCenterSpacing, 0f);
}
// move the row down, and then back left
context.TranslateCTM ( (-i * starHorizontalCenterSpacing), -starVerticalCenterSpacing);
}
context.RestoreState ();
// 5-star rows
context.SaveState ();
context.TranslateCTM (secondRowFirstStarOrigin.X, secondRowFirstStarOrigin.Y);
// loop through each row
for (j = 0; j < 4; j++) {
// each star in the row
for (i = 0; i < 5; i++) {
context.DrawLayer (starLayer, new PointF (0f, 0f));
context.TranslateCTM (starHorizontalCenterSpacing, 0);
}
context.TranslateCTM ( (-i * starHorizontalCenterSpacing), -starVerticalCenterSpacing);
}
context.RestoreState ();
}
}
// Draws the specified text starting at x,y of the specified height to the context.
protected void DrawTextAtPoint (CGContext context, float x, float y, string text, int textHeight)
{
// configure font
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
// set it to fill in our text, don't just outline
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
// call showTextAtPoint
context.ShowTextAtPoint (x, y, text, text.Length);
}
protected void DrawCenteredTextAtPoint (CGContext context, float centerX, float y, string text, int textHeight)
{
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Invisible);
context.ShowTextAtPoint (centerX, y, text, text.Length);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.ShowTextAtPoint (centerX - (context.TextPosition.X - centerX) / 2, y, text, text.Length);
}
// Draws a star at the bottom left of the context of the specified diameter
protected void DrawStar (CGContext context, float starDiameter)
{
// declare vars
// 144º
float theta = 2 * (float)Math.PI * (2f / 5f);
float radius = starDiameter / 2;
// move up and over
context.TranslateCTM (starDiameter / 2, starDiameter / 2);
context.MoveTo (0, radius);
for (int i = 1; i < 5; i++) {
context.AddLineToPoint (radius * (float)Math.Sin (i * theta), radius * (float)Math.Cos (i * theta));
}
context.SetRGBFillColor (1, 1, 1, 1);
context.ClosePath ();
context.FillPath ();
}
// Draws our coordinate grid
protected void DrawCoordinateSpace (CGBitmapContext context)
{
// declare vars
int remainder;
int textHeight = 20;
#region -= vertical ticks =-
// create our vertical tick lines
using (CGLayer verticalTickLayer = CGLayer.Create (context, new SizeF (20, 3)))
{
// draw a single tick
verticalTickLayer.Context.FillRect (new RectangleF (0, 1, 20, 2));
// draw a vertical tick every 20 pixels
float yPos = 20;
int numberOfVerticalTicks = ((context.Height / 20) - 1);
for (int i = 0; i < numberOfVerticalTicks; i++) {
// draw the layer
context.DrawLayer (verticalTickLayer, new PointF (0, yPos));
// starting at 40, draw the coordinate text nearly to the top
if (yPos > 40 && i < (numberOfVerticalTicks - 2)) {
// draw it every 80 points
Math.DivRem ((int)yPos, (int)80, out remainder);
if (remainder == 0)
DrawTextAtPoint (context, 30, (yPos - (textHeight / 2)), yPos.ToString (), textHeight);
}
// increment the position of the next tick
yPos += 20;
}
}
#endregion
#region -= horizontal ticks =-
// create our horizontal tick lines
using (CGLayer horizontalTickLayer = CGLayer.Create (context, new SizeF (3, 20)))
{
horizontalTickLayer.Context.FillRect (new RectangleF (1, 0, 2, 20));
// draw a horizontal tick every 20 pixels
float xPos = 20;
int numberOfHorizontalTicks = ((context.Width / 20) - 1);
for (int i = 0; i < numberOfHorizontalTicks; i++) {
context.DrawLayer (horizontalTickLayer, new PointF (xPos, 0));
// starting at 100, draw the coordinate text nearly to the top
if (xPos > 100 && i < (numberOfHorizontalTicks - 1)) {
// draw it every 80 points
Math.DivRem ((int)xPos, (int)80, out remainder);
if (remainder == 0)
DrawCenteredTextAtPoint (context, xPos, 30, xPos.ToString (), textHeight);
}
// increment the position of the next tick
xPos += 20;
}
}
#endregion
// draw our "origin" text
DrawTextAtPoint (context, 20, (20 + (textHeight / 2)), "Origin (0,0)", textHeight);
}
}
}

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

@ -0,0 +1,31 @@
using System;
using MonoTouch.UIKit;
namespace Example_Drawing.Screens.iPad.FlagOnScreen
{
public class Controller : UIViewController
{
#region -= constructors =-
public Controller () : base()
{
}
#endregion
public override void LoadView ()
{
View = new View ();
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// set the background color of the view to white
View.BackgroundColor = UIColor.White;
}
}
}

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

@ -0,0 +1,272 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using System.Drawing;
namespace Example_Drawing.Screens.iPad.FlagOnScreen
{
public class View : UIView
{
#region -= constructors =-
public View () : base() { }
#endregion
// rect changes depending on if the whole view is being redrawn, or just a section
public override void Draw (RectangleF rect)
{
Console.WriteLine ("Draw() Called");
base.Draw (rect);
// get a reference to the context
using (CGContext context = UIGraphics.GetCurrentContext ()) {
// convert to View space
CGAffineTransform affineTransform = CGAffineTransform.MakeIdentity ();
// invert the y axis
affineTransform.Scale (1, -1);
// move the y axis up
affineTransform.Translate (0, Frame.Height);
context.ConcatCTM (affineTransform);
// draw our coordinates for reference
DrawCoordinateSpace (context);
// draw our flag
DrawFlag (context);
// add a label
DrawCenteredTextAtPoint (context, 384, 700, "Stars and Stripes", 60);
}
}
protected void DrawFlag (CGContext context)
{
// declare vars
int i, j;
// general sizes
float flagWidth = Frame.Width * .8f;
float flagHeight = (float)(flagWidth / 1.9);
PointF flagOrigin = new PointF (Frame.Width * .1f, Frame.Height / 3);
// stripe
float stripeHeight = flagHeight / 13;
float stripeSpacing = stripeHeight * 2;
RectangleF stripeRect = new RectangleF (0, 0, flagWidth, stripeHeight);
// star field
float starFieldHeight = 7 * stripeHeight;
float starFieldWidth = flagWidth * (2f / 5f);
RectangleF starField = new RectangleF (flagOrigin.X, flagOrigin.Y + (6 * stripeHeight), starFieldWidth, starFieldHeight);
// stars
float starDiameter = flagHeight * 0.0616f;
float starHorizontalCenterSpacing = (starFieldWidth / 6);
float starHorizontalPadding = (starHorizontalCenterSpacing / 4);
float starVerticalCenterSpacing = (starFieldHeight / 5);
float starVerticalPadding = (starVerticalCenterSpacing / 4);
PointF firstStarOrigin = new PointF (flagOrigin.X + starHorizontalPadding, flagOrigin.Y + flagHeight - starVerticalPadding - (starVerticalCenterSpacing / 2));
PointF secondRowFirstStarOrigin = new PointF (firstStarOrigin.X + (starHorizontalCenterSpacing / 2), firstStarOrigin.Y - (starVerticalCenterSpacing / 2));
// white background + shadow
context.SaveState ();
// note: when drawing on-screen,the coord space for shadows doesn't get modified
context.SetShadow (new SizeF (15, 15), 7);
context.SetRGBFillColor (1, 1, 1, 1);
context.FillRect (new RectangleF (flagOrigin.X, flagOrigin.Y, flagWidth, flagHeight));
context.RestoreState ();
// create a stripe layer
using (CGLayer stripeLayer = CGLayer.Create (context, stripeRect.Size)) {
// set red as the fill color
// this works
stripeLayer.Context.SetRGBFillColor (1f, 0f, 0f, 1f);
// but this doesn't ????
//stripeLayer.Context.SetFillColor (new float[] { 1f, 0f, 0f, 1f });
// fill the stripe
stripeLayer.Context.FillRect (stripeRect);
// loop through the stripes and draw the layer
context.SaveState ();
for (i = 0; i < 7; i++) {
Console.WriteLine ("drawing stripe layer");
// draw the layer
context.DrawLayer (stripeLayer, flagOrigin);
// move the origin
context.TranslateCTM (0, stripeSpacing);
}
context.RestoreState ();
}
// draw the star field
//BUGBUG: apple bug - this only works on on-screen CGContext and CGLayer
//context.SetFillColor (new float[] { 0f, 0f, 0.329f, 1.0f });
context.SetRGBFillColor (0f, 0f, 0.329f, 1.0f);
context.FillRect (starField);
// create the star layer
using (CGLayer starLayer = CGLayer.Create (context, starField.Size)) {
// draw the stars
DrawStar (starLayer.Context, starDiameter);
// 6-star rows
// save state so that as we translate (move the origin around,
// it goes back to normal when we restore)
context.SaveState ();
context.TranslateCTM (firstStarOrigin.X, firstStarOrigin.Y);
// loop through each row
for (j = 0; j < 5; j++) {
// each star in the row
for (i = 0; i < 6; i++) {
// draw the star, then move the origin to the right
context.DrawLayer (starLayer, new PointF (0f, 0f));
context.TranslateCTM (starHorizontalCenterSpacing, 0f);
}
// move the row down, and then back left
context.TranslateCTM ((-i * starHorizontalCenterSpacing), -starVerticalCenterSpacing);
}
context.RestoreState ();
// 5-star rows
context.SaveState ();
context.TranslateCTM (secondRowFirstStarOrigin.X, secondRowFirstStarOrigin.Y);
// loop through each row
for (j = 0; j < 4; j++) {
// each star in the row
for (i = 0; i < 5; i++) {
context.DrawLayer (starLayer, new PointF (0f, 0f));
context.TranslateCTM (starHorizontalCenterSpacing, 0);
}
context.TranslateCTM ((-i * starHorizontalCenterSpacing), -starVerticalCenterSpacing);
}
context.RestoreState ();
}
}
// Draws the specified text starting at x,y of the specified height to the context.
protected void DrawTextAtPoint (CGContext context, float x, float y, string text, int textHeight)
{
// configure font
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
// set it to fill in our text, don't just outline
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
// call showTextAtPoint
context.ShowTextAtPoint (x, y, text, text.Length);
}
protected void DrawCenteredTextAtPoint (CGContext context, float centerX, float y, string text, int textHeight)
{
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Invisible);
context.ShowTextAtPoint (centerX, y, text, text.Length);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.ShowTextAtPoint (centerX - (context.TextPosition.X - centerX) / 2, y, text, text.Length);
}
// Draws a star at the bottom left of the context of the specified diameter
protected void DrawStar (CGContext context, float starDiameter)
{
// declare vars
// 144º
float theta = 2 * (float)Math.PI * (2f / 5f);
float radius = starDiameter / 2;
// move up and over
context.TranslateCTM (starDiameter / 2, starDiameter / 2);
context.MoveTo (0, radius);
for (int i = 1; i < 5; i++) {
context.AddLineToPoint (radius * (float)Math.Sin (i * theta), radius * (float)Math.Cos (i * theta));
}
context.SetRGBFillColor (1, 1, 1, 1);
context.ClosePath ();
context.FillPath ();
}
/// <summary>
/// Draws our coordinate grid
/// </summary>
protected void DrawCoordinateSpace (CGContext context)
{
// declare vars
int remainder;
int textHeight = 20;
#region -= vertical ticks =-
// create our vertical tick lines
using (CGLayer verticalTickLayer = CGLayer.Create (context, new SizeF (20, 3))) {
// draw a single tick
verticalTickLayer.Context.FillRect (new RectangleF (0, 1, 20, 2));
// draw a vertical tick every 20 pixels
float yPos = 20;
int numberOfVerticalTicks = ((int)(Frame.Height / 20) - 1);
for (int i = 0; i < numberOfVerticalTicks; i++) {
// draw the layer
context.DrawLayer (verticalTickLayer, new PointF (0, yPos));
// starting at 40, draw the coordinate text nearly to the top
if (yPos > 40 && i < (numberOfVerticalTicks - 2)) {
// draw it every 80 points
Math.DivRem ((int)yPos, (int)80, out remainder);
if (remainder == 0)
DrawTextAtPoint (context, 30, (yPos - (textHeight / 2)), yPos.ToString (), textHeight);
}
// increment the position of the next tick
yPos += 20;
}
}
#endregion
#region -= horizontal ticks =-
// create our horizontal tick lines
using (CGLayer horizontalTickLayer = CGLayer.Create (context, new SizeF (3, 20))) {
horizontalTickLayer.Context.FillRect (new RectangleF (1, 0, 2, 20));
// draw a horizontal tick every 20 pixels
float xPos = 20;
int numberOfHorizontalTicks = ((int)(Frame.Width / 20) - 1);
for (int i = 0; i < numberOfHorizontalTicks; i++) {
context.DrawLayer (horizontalTickLayer, new PointF (xPos, 0));
// starting at 100, draw the coordinate text nearly to the top
if (xPos > 100 && i < (numberOfHorizontalTicks - 1)) {
// draw it every 80 points
Math.DivRem ((int)xPos, (int)80, out remainder);
if (remainder == 0)
DrawCenteredTextAtPoint (context, xPos, 30, xPos.ToString (), textHeight);
}
// increment the position of the next tick
xPos += 20;
}
}
#endregion
// draw our "origin" text
DrawTextAtPoint (context, 20, (20 + (textHeight / 2)), "Origin (0,0)", textHeight);
}
}
}

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

@ -0,0 +1,29 @@
using System;
using MonoTouch.UIKit;
namespace Example_Drawing.Screens.iPad.HitTesting
{
public class Controller : UIViewController
{
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void LoadView ()
{
Console.WriteLine ("LoadView() Called");
base.LoadView ();
View = new View ();
View.BackgroundColor = UIColor.White;
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
}
}
}

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

@ -0,0 +1,87 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using System.Drawing;
using MonoTouch.Foundation;
namespace Example_Drawing.Screens.iPad.HitTesting
{
public class View : UIView
{
CGPath myRectangleButtonPath;
bool touchStartedInPath;
#region -= constructors =-
public View () : base() { }
#endregion
// rect changes depending on if the whole view is being redrawn, or just a section
public override void Draw (RectangleF rect)
{
Console.WriteLine ("Draw() Called");
base.Draw (rect);
using (CGContext context = UIGraphics.GetCurrentContext ()) {
// draw a rectangle using a path
myRectangleButtonPath = new CGPath ();
myRectangleButtonPath.AddRect (new RectangleF (new PointF (100, 10), new SizeF (200, 400)));
context.AddPath (myRectangleButtonPath);
context.DrawPath (CGPathDrawingMode.Stroke);
}
}
// Raised when a user begins a touch on the screen. We check to see if the touch
// was within our path. If it was, we set the _touchStartedInPath = true so that
// we can track to see if when the user raised their finger, it was also in the path
public override void TouchesBegan (NSSet touches, UIEvent evt)
{
base.TouchesBegan (touches, evt);
// get a reference to the touch
UITouch touch = touches.AnyObject as UITouch;
// make sure there was one
if (touch != null) {
// check to see if the location of the touch was within our path
if (myRectangleButtonPath.ContainsPoint (touch.LocationInView (this), true))
touchStartedInPath = true;
}
}
// Raised when a user raises their finger from the screen. Since we need to check to
// see if the user touch started and ended within the path, we have to track to see
// when the finger is raised, if it did.
public override void TouchesEnded (NSSet touches, UIEvent evt)
{
base.TouchesEnded (touches, evt);
// get a reference to any of the touches
UITouch touch = touches.AnyObject as UITouch;
// if there is a touch
if (touch != null) {
// the point of touch
PointF pt = touch.LocationInView (this);
// if the touch ended in the path AND it started in the path
if (myRectangleButtonPath.ContainsPoint (pt, true) && touchStartedInPath) {
Console.WriteLine ("touched at location: " + pt.ToString ());
UIAlertView alert = new UIAlertView ("Hit!", "You sunk my battleship!", null, "OK", null);
alert.Show ();
}
}
// reset
touchStartedInPath = false;
}
// if for some reason the touch was cancelled, we clear our _touchStartedInPath flag
public override void TouchesCancelled (NSSet touches, UIEvent evt)
{
base.TouchesCancelled (touches, evt);
touchStartedInPath = false;
}
}
}

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

@ -0,0 +1,835 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">768</int>
<string key="IBDocument.SystemVersion">10D573</string>
<string key="IBDocument.InterfaceBuilderVersion">786</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">460.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">112</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBProxyObject" id="711762367">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIButton" id="425473159">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 20}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSFont" key="IBUIFont" id="1033838756">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Draw Rectangle vs. Path</string>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="100543285">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="183808867">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
</object>
<object class="IBUIButton" id="591152255">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 65}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Draw using CGBitmapContext</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="826340580">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 110}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Using Layers</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="69823712">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 245}, {292, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">On-screen Uncorrected Text Rotation</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="1057618426">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 155}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">On-screen Coordinates</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="384965679">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 200}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Off-screen Coordinates</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="741662393">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 290}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Off-screen Flag</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="368059820">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 335}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">On-screen Flag</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="110552306">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 380}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Image</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="549708469">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 425}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Color Pattern</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="358157058">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 470}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Stencil Pattern</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="1020234674">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 515}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Shadows</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="274383091">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 560}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Hit Testing</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="166304750">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 605}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Touch Drawing</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
<object class="IBUIButton" id="545133842">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 650}, {239, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="1033838756"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Transformations</string>
<reference key="IBUIHighlightedTitleColor" ref="100543285"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="183808867"/>
</object>
</object>
<string key="NSFrameSize">{768, 1004}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">7</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnDrawRectVsPath</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="425473159"/>
</object>
<int key="connectionID">9</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnDrawUsingCGBitmapContext</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="591152255"/>
</object>
<int key="connectionID">12</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnDrawUsingLayers</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="826340580"/>
</object>
<int key="connectionID">13</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnOffScreenCoords</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="384965679"/>
</object>
<int key="connectionID">16</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnOnScreenCoords</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="1057618426"/>
</object>
<int key="connectionID">17</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnOnScreenUncorrectedText</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="69823712"/>
</object>
<int key="connectionID">19</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnOffScreenFlag</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="741662393"/>
</object>
<int key="connectionID">22</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnImage</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="110552306"/>
</object>
<int key="connectionID">24</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnPatterns</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="549708469"/>
</object>
<int key="connectionID">26</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnStencilPattern</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="358157058"/>
</object>
<int key="connectionID">28</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnShadows</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="1020234674"/>
</object>
<int key="connectionID">30</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnHitTesting</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="274383091"/>
</object>
<int key="connectionID">32</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnTouchDrawing</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="166304750"/>
</object>
<int key="connectionID">34</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnOnScreenFlag</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="368059820"/>
</object>
<int key="connectionID">38</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">btnTransformations</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="545133842"/>
</object>
<int key="connectionID">40</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="425473159"/>
<reference ref="591152255"/>
<reference ref="826340580"/>
<reference ref="1057618426"/>
<reference ref="384965679"/>
<reference ref="69823712"/>
<reference ref="741662393"/>
<reference ref="368059820"/>
<reference ref="110552306"/>
<reference ref="549708469"/>
<reference ref="358157058"/>
<reference ref="1020234674"/>
<reference ref="274383091"/>
<reference ref="166304750"/>
<reference ref="545133842"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="711762367"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="425473159"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
<reference key="object" ref="591152255"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="826340580"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="1057618426"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="384965679"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="69823712"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="741662393"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="110552306"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">25</int>
<reference key="object" ref="549708469"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="358157058"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">29</int>
<reference key="object" ref="1020234674"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">31</int>
<reference key="object" ref="274383091"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">33</int>
<reference key="object" ref="166304750"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">37</int>
<reference key="object" ref="368059820"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">39</int>
<reference key="object" ref="545133842"/>
<reference key="parent" ref="191373211"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>1.IBEditorWindowLastContentRect</string>
<string>1.IBLastUsedUIStatusBarStylesToTargetRuntimesMap</string>
<string>1.IBPluginDependency</string>
<string>10.IBPluginDependency</string>
<string>11.IBPluginDependency</string>
<string>14.IBPluginDependency</string>
<string>15.IBPluginDependency</string>
<string>18.IBPluginDependency</string>
<string>21.IBPluginDependency</string>
<string>23.IBPluginDependency</string>
<string>25.IBPluginDependency</string>
<string>27.IBPluginDependency</string>
<string>29.IBPluginDependency</string>
<string>31.IBPluginDependency</string>
<string>33.IBPluginDependency</string>
<string>37.IBPluginDependency</string>
<string>39.IBPluginDependency</string>
<string>8.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>HomeScreen</string>
<string>UIResponder</string>
<string>{{312, 0}, {783, 856}}</string>
<object class="NSMutableDictionary">
<string key="NS.key.0">IBCocoaTouchFramework</string>
<integer value="0" key="NS.object.0"/>
</object>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">40</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">HomeScreen</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>btnDrawRectVsPath</string>
<string>btnDrawUsingCGBitmapContext</string>
<string>btnDrawUsingLayers</string>
<string>btnHitTesting</string>
<string>btnImage</string>
<string>btnOffScreenCoords</string>
<string>btnOffScreenFlag</string>
<string>btnOnScreenCoords</string>
<string>btnOnScreenFlag</string>
<string>btnOnScreenUncorrectedText</string>
<string>btnPatterns</string>
<string>btnShadows</string>
<string>btnStencilPattern</string>
<string>btnTouchDrawing</string>
<string>btnTransformations</string>
<string>view</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>btnDrawRectVsPath</string>
<string>btnDrawUsingCGBitmapContext</string>
<string>btnDrawUsingLayers</string>
<string>btnHitTesting</string>
<string>btnImage</string>
<string>btnOffScreenCoords</string>
<string>btnOffScreenFlag</string>
<string>btnOnScreenCoords</string>
<string>btnOnScreenFlag</string>
<string>btnOnScreenUncorrectedText</string>
<string>btnPatterns</string>
<string>btnShadows</string>
<string>btnStencilPattern</string>
<string>btnTouchDrawing</string>
<string>btnTransformations</string>
<string>view</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">btnDrawRectVsPath</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnDrawUsingCGBitmapContext</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnDrawUsingLayers</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnHitTesting</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnImage</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnOffScreenCoords</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnOffScreenFlag</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnOnScreenCoords</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnOnScreenFlag</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnOnScreenUncorrectedText</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnPatterns</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnShadows</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnStencilPattern</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnTouchDrawing</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">btnTransformations</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">view</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<integer value="768" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">112</string>
</data>
</archive>

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

@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Example_Drawing.Screens.iPad.Home
{
public partial class HomeScreen : UIViewController
{
#region Constructors
// The IntPtr and initWithCoder constructors are required for controllers that need
// to be able to be created from a xib rather than from managed code
public HomeScreen (IntPtr handle) : base(handle) { }
[Export("initWithCoder:")]
public HomeScreen (NSCoder coder) : base(coder) { }
public HomeScreen () : base("HomeScreen", null) { }
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
btnDrawRectVsPath.TouchUpInside += delegate {
NavigationController.PushViewController (new DrawRectVsPath.Controller (), true);
};
btnDrawUsingCGBitmapContext.TouchUpInside += delegate {
NavigationController.PushViewController (new DrawOffScreenUsingCGBitmapContext.Controller (), true);
};
btnDrawUsingLayers.TouchUpInside += delegate {
NavigationController.PushViewController (new Layers.Controller (), true);
};
btnOnScreenCoords.TouchUpInside += delegate {
NavigationController.PushViewController (new CoordinatesOnScreen.Controller (), true);
};
btnOffScreenCoords.TouchUpInside += delegate {
NavigationController.PushViewController (new CoordinatesOffScreen.Controller (), true);
};
btnOnScreenUncorrectedText.TouchUpInside += delegate {
NavigationController.PushViewController (new OnScreenUncorrectedTextRotation.Controller (), true);
};
btnImage.TouchUpInside += delegate {
NavigationController.PushViewController (new Images.Controller (), true);
};
btnOffScreenFlag.TouchUpInside += delegate {
NavigationController.PushViewController (new FlagOffScreen.Controller (), true);
};
btnOnScreenFlag.TouchUpInside += delegate {
NavigationController.PushViewController (new FlagOnScreen.Controller (), true);
};
btnPatterns.TouchUpInside += delegate {
NavigationController.PushViewController (new ColorPattern.Controller (), true);
};
btnStencilPattern.TouchUpInside += delegate {
NavigationController.PushViewController (new StencilPattern.Controller (), true);
};
btnShadows.TouchUpInside += delegate {
NavigationController.PushViewController (new Shadows.Controller (), true);
};
btnHitTesting.TouchUpInside += delegate {
NavigationController.PushViewController (new HitTesting.Controller (), true);
};
btnTouchDrawing.TouchUpInside += delegate {
NavigationController.PushViewController (new TouchDrawing.Controller (), true);
};
btnTransformations.TouchUpInside += delegate {
NavigationController.PushViewController (new Transformations.Controller (), true);
};
}
}
}

243
Drawing/Drawing/Screens/iPad/Home/HomeScreen.xib.designer.cs сгенерированный Executable file
Просмотреть файл

@ -0,0 +1,243 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace Example_Drawing.Screens.iPad.Home {
// Base type probably should be MonoTouch.UIKit.UIViewController or subclass
[MonoTouch.Foundation.Register("HomeScreen")]
public partial class HomeScreen {
private MonoTouch.UIKit.UIView __mt_view;
private MonoTouch.UIKit.UIButton __mt_btnDrawRectVsPath;
private MonoTouch.UIKit.UIButton __mt_btnDrawUsingCGBitmapContext;
private MonoTouch.UIKit.UIButton __mt_btnDrawUsingLayers;
private MonoTouch.UIKit.UIButton __mt_btnOffScreenCoords;
private MonoTouch.UIKit.UIButton __mt_btnOnScreenCoords;
private MonoTouch.UIKit.UIButton __mt_btnOnScreenUncorrectedText;
private MonoTouch.UIKit.UIButton __mt_btnOffScreenFlag;
private MonoTouch.UIKit.UIButton __mt_btnImage;
private MonoTouch.UIKit.UIButton __mt_btnPatterns;
private MonoTouch.UIKit.UIButton __mt_btnStencilPattern;
private MonoTouch.UIKit.UIButton __mt_btnShadows;
private MonoTouch.UIKit.UIButton __mt_btnHitTesting;
private MonoTouch.UIKit.UIButton __mt_btnTouchDrawing;
private MonoTouch.UIKit.UIButton __mt_btnOnScreenFlag;
private MonoTouch.UIKit.UIButton __mt_btnTransformations;
#pragma warning disable 0169
[MonoTouch.Foundation.Connect("view")]
private MonoTouch.UIKit.UIView view {
get {
this.__mt_view = ((MonoTouch.UIKit.UIView)(this.GetNativeField("view")));
return this.__mt_view;
}
set {
this.__mt_view = value;
this.SetNativeField("view", value);
}
}
[MonoTouch.Foundation.Connect("btnDrawRectVsPath")]
private MonoTouch.UIKit.UIButton btnDrawRectVsPath {
get {
this.__mt_btnDrawRectVsPath = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnDrawRectVsPath")));
return this.__mt_btnDrawRectVsPath;
}
set {
this.__mt_btnDrawRectVsPath = value;
this.SetNativeField("btnDrawRectVsPath", value);
}
}
[MonoTouch.Foundation.Connect("btnDrawUsingCGBitmapContext")]
private MonoTouch.UIKit.UIButton btnDrawUsingCGBitmapContext {
get {
this.__mt_btnDrawUsingCGBitmapContext = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnDrawUsingCGBitmapContext")));
return this.__mt_btnDrawUsingCGBitmapContext;
}
set {
this.__mt_btnDrawUsingCGBitmapContext = value;
this.SetNativeField("btnDrawUsingCGBitmapContext", value);
}
}
[MonoTouch.Foundation.Connect("btnDrawUsingLayers")]
private MonoTouch.UIKit.UIButton btnDrawUsingLayers {
get {
this.__mt_btnDrawUsingLayers = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnDrawUsingLayers")));
return this.__mt_btnDrawUsingLayers;
}
set {
this.__mt_btnDrawUsingLayers = value;
this.SetNativeField("btnDrawUsingLayers", value);
}
}
[MonoTouch.Foundation.Connect("btnOffScreenCoords")]
private MonoTouch.UIKit.UIButton btnOffScreenCoords {
get {
this.__mt_btnOffScreenCoords = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnOffScreenCoords")));
return this.__mt_btnOffScreenCoords;
}
set {
this.__mt_btnOffScreenCoords = value;
this.SetNativeField("btnOffScreenCoords", value);
}
}
[MonoTouch.Foundation.Connect("btnOnScreenCoords")]
private MonoTouch.UIKit.UIButton btnOnScreenCoords {
get {
this.__mt_btnOnScreenCoords = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnOnScreenCoords")));
return this.__mt_btnOnScreenCoords;
}
set {
this.__mt_btnOnScreenCoords = value;
this.SetNativeField("btnOnScreenCoords", value);
}
}
[MonoTouch.Foundation.Connect("btnOnScreenUncorrectedText")]
private MonoTouch.UIKit.UIButton btnOnScreenUncorrectedText {
get {
this.__mt_btnOnScreenUncorrectedText = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnOnScreenUncorrectedText")));
return this.__mt_btnOnScreenUncorrectedText;
}
set {
this.__mt_btnOnScreenUncorrectedText = value;
this.SetNativeField("btnOnScreenUncorrectedText", value);
}
}
[MonoTouch.Foundation.Connect("btnOffScreenFlag")]
private MonoTouch.UIKit.UIButton btnOffScreenFlag {
get {
this.__mt_btnOffScreenFlag = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnOffScreenFlag")));
return this.__mt_btnOffScreenFlag;
}
set {
this.__mt_btnOffScreenFlag = value;
this.SetNativeField("btnOffScreenFlag", value);
}
}
[MonoTouch.Foundation.Connect("btnImage")]
private MonoTouch.UIKit.UIButton btnImage {
get {
this.__mt_btnImage = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnImage")));
return this.__mt_btnImage;
}
set {
this.__mt_btnImage = value;
this.SetNativeField("btnImage", value);
}
}
[MonoTouch.Foundation.Connect("btnPatterns")]
private MonoTouch.UIKit.UIButton btnPatterns {
get {
this.__mt_btnPatterns = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnPatterns")));
return this.__mt_btnPatterns;
}
set {
this.__mt_btnPatterns = value;
this.SetNativeField("btnPatterns", value);
}
}
[MonoTouch.Foundation.Connect("btnStencilPattern")]
private MonoTouch.UIKit.UIButton btnStencilPattern {
get {
this.__mt_btnStencilPattern = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnStencilPattern")));
return this.__mt_btnStencilPattern;
}
set {
this.__mt_btnStencilPattern = value;
this.SetNativeField("btnStencilPattern", value);
}
}
[MonoTouch.Foundation.Connect("btnShadows")]
private MonoTouch.UIKit.UIButton btnShadows {
get {
this.__mt_btnShadows = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnShadows")));
return this.__mt_btnShadows;
}
set {
this.__mt_btnShadows = value;
this.SetNativeField("btnShadows", value);
}
}
[MonoTouch.Foundation.Connect("btnHitTesting")]
private MonoTouch.UIKit.UIButton btnHitTesting {
get {
this.__mt_btnHitTesting = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnHitTesting")));
return this.__mt_btnHitTesting;
}
set {
this.__mt_btnHitTesting = value;
this.SetNativeField("btnHitTesting", value);
}
}
[MonoTouch.Foundation.Connect("btnTouchDrawing")]
private MonoTouch.UIKit.UIButton btnTouchDrawing {
get {
this.__mt_btnTouchDrawing = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnTouchDrawing")));
return this.__mt_btnTouchDrawing;
}
set {
this.__mt_btnTouchDrawing = value;
this.SetNativeField("btnTouchDrawing", value);
}
}
[MonoTouch.Foundation.Connect("btnOnScreenFlag")]
private MonoTouch.UIKit.UIButton btnOnScreenFlag {
get {
this.__mt_btnOnScreenFlag = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnOnScreenFlag")));
return this.__mt_btnOnScreenFlag;
}
set {
this.__mt_btnOnScreenFlag = value;
this.SetNativeField("btnOnScreenFlag", value);
}
}
[MonoTouch.Foundation.Connect("btnTransformations")]
private MonoTouch.UIKit.UIButton btnTransformations {
get {
this.__mt_btnTransformations = ((MonoTouch.UIKit.UIButton)(this.GetNativeField("btnTransformations")));
return this.__mt_btnTransformations;
}
set {
this.__mt_btnTransformations = value;
this.SetNativeField("btnTransformations", value);
}
}
}
}

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

@ -0,0 +1,71 @@
using System;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.CoreGraphics;
namespace Example_Drawing.Screens.iPad.Images
{
public class Controller : UIViewController
{
UIImageView imageView;
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// set the background color of the view to white
View.BackgroundColor = UIColor.White;
// instantiate a new image view that takes up the whole screen and add it to
// the view hierarchy
RectangleF imageViewFrame = new RectangleF (0, -NavigationController.NavigationBar.Frame.Height, View.Frame.Width, View.Frame.Height);
imageView = new UIImageView (imageViewFrame);
View.AddSubview (imageView);
// create our offscreen bitmap context
// size
SizeF bitmapSize = new SizeF (View.Frame.Size);
using (CGBitmapContext context = new CGBitmapContext (IntPtr.Zero
, (int)bitmapSize.Width, (int)bitmapSize.Height, 8
, (int)(4 * bitmapSize.Width), CGColorSpace.CreateDeviceRGB ()
, CGImageAlphaInfo.PremultipliedFirst)) {
// declare vars
UIImage apressImage = UIImage.FromFile ("Images/Icons/512_icon.png");
PointF imageOrigin = new PointF ((imageView.Frame.Width / 2) - (apressImage.CGImage.Width / 2), (imageView.Frame.Height / 2) - (apressImage.CGImage.Height / 2));
RectangleF imageRect = new RectangleF (imageOrigin.X, imageOrigin.Y, apressImage.CGImage.Width, apressImage.CGImage.Height);
// draw the image
context.DrawImage (imageRect, apressImage.CGImage);
// output the drawing to the view
imageView.Image = UIImage.FromImage (context.ToImage ());
}
}
protected void ShowTextAtPoint (CGContext context, float x, float y, string text, int textHeight)
{
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.ShowTextAtPoint (x, y, text, text.Length);
}
private void ShowCenteredTextAtPoint (CGContext context, float centerX, float y, string text, int textHeight)
{
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Invisible);
context.ShowTextAtPoint (centerX, y, text, text.Length);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.ShowTextAtPoint (centerX - (context.TextPosition.X - centerX) / 2, y, text, text.Length);
}
}
}

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

@ -0,0 +1,30 @@
using System;
using MonoTouch.UIKit;
namespace Example_Drawing.Screens.iPad.Layers
{
public class Controller : UIViewController
{
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void LoadView ()
{
Console.WriteLine ("LoadView() Called");
base.LoadView ();
View = new View ();
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
}
}
}

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

@ -0,0 +1,71 @@
using System;
using MonoTouch.CoreGraphics;
using System.Drawing;
using MonoTouch.UIKit;
namespace Example_Drawing.Screens.iPad.Layers
{
public class View : UIView
{
#region -= constructors =-
public View () : base() { }
#endregion
// rect changes depending on if the whole view is being redrawn, or just a section
public override void Draw (RectangleF rect)
{
Console.WriteLine ("Draw() Called");
base.Draw (rect);
using (CGContext context = UIGraphics.GetCurrentContext ()) {
CGAffineTransform affineTransform = context.GetCTM ();
//affineTransform.Scale (1, -1);
affineTransform.Translate (1, -1);
context.ConcatCTM (affineTransform);
// fill the background with white
// set fill color
UIColor.White.SetFill ();
//context.SetRGBFillColor (1, 1, 1, 1f);
// paint
context.FillRect (rect);
PointF[] myStarPoints = { new PointF (5f, 5f)
, new PointF (10f, 15f), new PointF (10f, 15f)
, new PointF (15f, 5f), new PointF (15f, 5f)
, new PointF (12f, 5f), new PointF (15f, 5f)
, new PointF (2.5f, 11f), new PointF (2.5f, 11f)
, new PointF (16.5f, 11f), new PointF (16.5f, 11f)
, new PointF (5f, 5f) };
// create the layer
using (CGLayer starLayer = CGLayer.Create (context, rect.Size)) {
// set fill to blue
starLayer.Context.SetRGBFillColor (0f, 0f, 1f, 1f);
starLayer.Context.AddLines (myStarPoints);
starLayer.Context.FillPath ();
// draw the layer onto our screen
float starYPos = 5;
float starXPos = 5;
for (int row = 0; row < 50; row++) {
// reset the x position for each row
starXPos = 5;
//
for (int col = 0; col < 30; col++) {
context.DrawLayer (starLayer, new PointF (starXPos, starYPos));
starXPos += 20;
}
starYPos += 20;
}
}
}
}
}
}

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

@ -0,0 +1,29 @@
using System;
using MonoTouch.UIKit;
namespace Example_Drawing.Screens.iPad.OnScreenUncorrectedTextRotation
{
public class Controller : UIViewController
{
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void LoadView ()
{
View = new View ();
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// set the background color of the view to white
View.BackgroundColor = UIColor.White;
}
}
}

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

@ -0,0 +1,40 @@
using System;
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using System.Drawing;
namespace Example_Drawing.Screens.iPad.OnScreenUncorrectedTextRotation
{
public class View : UIView
{
#region -= constructors =-
public View () : base() { }
#endregion
// rect changes depending on if the whole view is being redrawn, or just a section
public override void Draw (RectangleF rect)
{
Console.WriteLine ("Draw() Called");
base.Draw (rect);
// get a reference to the context
using (CGContext context = UIGraphics.GetCurrentContext ()) {
// declare vars
ShowCenteredTextAtPoint (context, 384, 400, "Hello World!", 60);
}
}
protected void ShowCenteredTextAtPoint (CGContext context, float centerX, float y, string text, int textHeight)
{
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Invisible);
context.ShowTextAtPoint (centerX, y, text, text.Length);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.ShowTextAtPoint (centerX - (context.TextPosition.X - centerX) / 2, y, text, text.Length);
}
}
}

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

@ -0,0 +1,66 @@
using System;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.CoreGraphics;
namespace Example_Drawing.Screens.iPad.Shadows
{
public class Controller : UIViewController
{
UIImageView imageView;
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// set the background color of the view to white
View.BackgroundColor = UIColor.White;
// instantiate a new image view that takes up the whole screen and add it to
// the view hierarchy
RectangleF imageViewFrame = new RectangleF (0, -NavigationController.NavigationBar.Frame.Height, View.Frame.Width, View.Frame.Height);
imageView = new UIImageView (imageViewFrame);
View.AddSubview (imageView);
// create our offscreen bitmap context
// size
SizeF bitmapSize = new SizeF (View.Frame.Size);
using (CGBitmapContext context = new CGBitmapContext (IntPtr.Zero, (int)bitmapSize.Width, (int)bitmapSize.Height, 8, (int)(4 * bitmapSize.Width), CGColorSpace.CreateDeviceRGB (), CGImageAlphaInfo.PremultipliedFirst)) {
//==== create a grayscale shadow
// 1) save graphics state
context.SaveState ();
// 2) set shadow context for offset and blur
context.SetShadow (new SizeF (10, -10), 15);
// 3) perform your drawing operation
context.SetRGBFillColor (.3f, .3f, .9f, 1);
context.FillRect (new RectangleF (100, 600, 300, 250));
// 4) restore the graphics state
context.RestoreState ();
//==== create a color shadow
// 1) save graphics state
context.SaveState ();
// 2) set shadow context for offset and blur
context.SetShadowWithColor(new SizeF (15, -15), 10, UIColor.Blue.CGColor);
// 3) perform your drawing operation
context.SelectFont ("Helvetica-Bold", 40, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
string text = "Shadows are fun and easy!";
context.ShowTextAtPoint (150, 200, text, text.Length);
// 4) restore the graphics state
context.RestoreState ();
// output the drawing to the view
imageView.Image = UIImage.FromImage (context.ToImage ());
}
}
}
}

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

@ -0,0 +1,92 @@
using System;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.CoreGraphics;
namespace Example_Drawing.Screens.iPad.StencilPattern
{
public class Controller : UIViewController
{
UIImageView imageView;
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// set the background color of the view to white
View.BackgroundColor = UIColor.White;
// instantiate a new image view that takes up the whole screen and add it to
// the view hierarchy
RectangleF imageViewFrame = new RectangleF (0, -NavigationController.NavigationBar.Frame.Height, View.Frame.Width, View.Frame.Height);
imageView = new UIImageView (imageViewFrame);
View.AddSubview (imageView);
// create our offscreen bitmap context
// size
SizeF bitmapSize = new SizeF (View.Frame.Size);
using (CGBitmapContext context = new CGBitmapContext (IntPtr.Zero, (int)bitmapSize.Width, (int)bitmapSize.Height, 8, (int)(4 * bitmapSize.Width), CGColorSpace.CreateDeviceRGB (), CGImageAlphaInfo.PremultipliedFirst)) {
// declare vars
RectangleF patternRect = new RectangleF (0, 0, 16, 16);
// set the color space of our fill to be the patter colorspace
context.SetFillColorSpace (CGColorSpace.CreatePattern (CGColorSpace.CreateDeviceRGB()));
// create a new pattern
CGPattern pattern = new CGPattern (patternRect, CGAffineTransform.MakeRotation (.3f)
, 16, 16, CGPatternTiling.NoDistortion, false, DrawPolkaDotPattern);
// set our fill as our pattern, color doesn't matter because the pattern handles it
context.SetFillPattern (pattern, new float[] { 1, 0, 0, 1 });
// fill the entire view with that pattern
context.FillRect (imageView.Frame);
// output the drawing to the view
imageView.Image = UIImage.FromImage (context.ToImage ());
}
}
/// <summary>
/// This is our pattern callback. it's called by coregraphics to create
/// the pattern base.
/// </summary>
protected void DrawPolkaDotPattern (CGContext context)
{
context.FillEllipseInRect (new RectangleF (4, 4, 8, 8));
}
/// <summary>
/// This is a slightly more complicated draw pattern, but using it is just
/// as easy as the previous one. To use this one, simply change "DrawPolkaDotPattern"
/// in line 54 above to "DrawStarPattern"
/// </summary>
protected void DrawStarPattern (CGContext context)
{
// declare vars
float starDiameter = 16;
// 144º
float theta = 2 * (float)Math.PI * (2f / 5f);
float radius = starDiameter / 2;
// move up and over
context.TranslateCTM (starDiameter / 2, starDiameter / 2);
context.MoveTo (0, radius);
for (int i = 1; i < 5; i++) {
context.AddLineToPoint (radius * (float)Math.Sin (i * theta), radius * (float)Math.Cos (i * theta));
}
// fill our star as dark gray
context.ClosePath ();
context.FillPath ();
}
}
}

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

@ -0,0 +1,31 @@
using System;
using MonoTouch.UIKit;
namespace Example_Drawing.Screens.iPad.TouchDrawing
{
public class Controller : UIViewController
{
#region -= constructors =-
public Controller () : base() { }
#endregion
public override void LoadView ()
{
Console.WriteLine ("LoadView() Called");
base.LoadView ();
View = new View ();
View.BackgroundColor = UIColor.White;
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
}
}
}

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

@ -0,0 +1,91 @@
using System;
using MonoTouch.CoreGraphics;
using System.Drawing;
using MonoTouch.UIKit;
using System.Collections.Generic;
using MonoTouch.Foundation;
namespace Example_Drawing.Screens.iPad.TouchDrawing
{
public class View : UIView
{
List<Spot> touchSpots = new List<Spot> ();
SizeF spotSize = new SizeF(15,15);
#region -= constructors =-
public View () : base() { }
#endregion
/// <summary>
/// rect changes depending on if the whole view is being redrawn, or just a section
/// </summary>
public override void Draw (RectangleF rect)
{
Console.WriteLine ("Draw() Called");
base.Draw (rect);
using (CGContext context = UIGraphics.GetCurrentContext ()) {
// turn on anti-aliasing
context.SetAllowsAntialiasing (true);
// loop through each spot and draw it
foreach (Spot spot in touchSpots) {
context.SetRGBFillColor (spot.Red, spot.Green, spot.Blue, spot.Alpha);
context.FillEllipseInRect (new RectangleF (spot.Point, spotSize));
}
}
}
public override void TouchesBegan (NSSet touches, UIEvent evt)
{
base.TouchesBegan (touches, evt);
// get the touch
UITouch touch = touches.AnyObject as UITouch;
if (touch != null) { AddSpot (touch); }
}
public override void TouchesMoved (NSSet touches, UIEvent evt)
{
base.TouchesMoved (touches, evt);
// get the touch
UITouch touch = touches.AnyObject as UITouch;
if (touch != null) { AddSpot (touch); }
}
protected void AddSpot (UITouch touch)
{
// create a random color spot at the point of touch, then add it to the others
Spot spot = Spot.CreateNewRandomColor (touch.LocationInView (this));
touchSpots.Add (spot);
// tell the OS to redraw
SetNeedsDisplay ();
}
protected class Spot
{
public PointF Point { get; set; }
public float Red { get; set; }
public float Green { get; set; }
public float Blue { get; set; }
public float Alpha { get; set; }
public static Spot CreateNewRandomColor(PointF point)
{
Random rdm = new Random (Environment.TickCount);
Spot spot = new View.Spot () {
Red = (float)rdm.NextDouble ()
, Green = (float)rdm.NextDouble ()
, Blue = (float)rdm.NextDouble ()
, Alpha = 1
};
spot.Point = point;
return spot;
}
}
}
}

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

@ -0,0 +1,259 @@
using System;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.CoreGraphics;
namespace Example_Drawing.Screens.iPad.Transformations
{
public class Controller : UIViewController
{
UIImageView imageView;
UIButton btnUp;
UIButton btnRight;
UIButton btnDown;
UIButton btnLeft;
UIButton btnReset;
UIButton btnRotateLeft;
UIButton btnRotateRight;
UIButton btnScaleUp;
UIButton btnScaleDown;
float currentScale, initialScale = 1.0f;
PointF currentLocation, initialLocation = new PointF(380, 500);
float currentRotation , initialRotation = 0;
float movementIncrement = 20;
float rotationIncrement = (float)(Math.PI * 2 / 16);
float scaleIncrement = 1.5f;
#region -= constructors =-
public Controller () : base()
{
currentScale = initialScale;
currentLocation = initialLocation;
currentRotation = initialRotation;
}
#endregion
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// set the background color of the view to white
View.BackgroundColor = UIColor.White;
// instantiate a new image view that takes up the whole screen and add it to
// the view hierarchy
RectangleF imageViewFrame = new RectangleF (0, -NavigationController.NavigationBar.Frame.Height, View.Frame.Width, View.Frame.Height);
imageView = new UIImageView (imageViewFrame);
View.AddSubview (imageView);
// add all of our buttons
InitializeButtons ();
DrawScreen ();
}
protected void DrawScreen ()
{
// create our offscreen bitmap context
// size
SizeF bitmapSize = new SizeF (imageView.Frame.Size);
using (CGBitmapContext context = new CGBitmapContext (IntPtr.Zero, (int)bitmapSize.Width, (int)bitmapSize.Height, 8, (int)(4 * bitmapSize.Width), CGColorSpace.CreateDeviceRGB (), CGImageAlphaInfo.PremultipliedFirst)) {
// save the state of the context while we change the CTM
context.SaveState ();
// draw our circle
context.SetRGBFillColor (1, 0, 0, 1);
context.TranslateCTM (currentLocation.X, currentLocation.Y);
context.RotateCTM (currentRotation);
context.ScaleCTM (currentScale, currentScale);
context.FillRect (new RectangleF (-10, -10, 20, 20));
// restore our transformations
context.RestoreState ();
// draw our coordinates for reference
DrawCoordinateSpace (context);
// output the drawing to the view
imageView.Image = UIImage.FromImage (context.ToImage ());
}
}
protected void InitializeButtons ()
{
InitButton (ref btnUp, new PointF (600, 20), 50, @"/\");
View.AddSubview (btnUp);
InitButton (ref btnRight, new PointF (660, 60), 50, ">");
View.AddSubview (btnRight);
InitButton (ref btnDown, new PointF (600, 100), 50, @"\/");
View.AddSubview (btnDown);
InitButton (ref btnLeft, new PointF (540, 60), 50, @"<");
View.AddSubview (btnLeft);
InitButton (ref btnReset, new PointF (600, 60), 50, @"X");
View.AddSubview (btnReset);
InitButton (ref btnRotateLeft, new PointF (540, 140), 75, "<@");
View.AddSubview (btnRotateLeft);
InitButton (ref btnRotateRight, new PointF (635, 140), 75, "@>");
View.AddSubview (btnRotateRight);
InitButton (ref btnScaleUp, new PointF (540, 180), 75, "+");
View.AddSubview (btnScaleUp);
InitButton (ref btnScaleDown, new PointF (635, 180), 75, "-");
View.AddSubview (btnScaleDown);
btnReset.TouchUpInside += delegate {
currentScale = initialScale;
currentLocation = initialLocation;
currentRotation = initialRotation;
DrawScreen();
};
btnUp.TouchUpInside += delegate {
currentLocation.Y += movementIncrement;
DrawScreen ();
};
btnDown.TouchUpInside += delegate {
currentLocation.Y -= movementIncrement;
DrawScreen ();
};
btnLeft.TouchUpInside += delegate {
currentLocation.X -= movementIncrement;
DrawScreen ();
};
btnRight.TouchUpInside += delegate {
currentLocation.X += movementIncrement;
DrawScreen ();
};
btnScaleUp.TouchUpInside += delegate {
currentScale = currentScale * scaleIncrement;
DrawScreen ();
};
btnScaleDown.TouchUpInside += delegate {
currentScale = currentScale / scaleIncrement;
DrawScreen ();
};
btnRotateLeft.TouchUpInside += delegate {
currentRotation += rotationIncrement;
DrawScreen ();
};
btnRotateRight.TouchUpInside += delegate {
currentRotation -= rotationIncrement;
DrawScreen ();
};
}
protected void InitButton (ref UIButton button, PointF location, float width, string text)
{
button = UIButton.FromType (UIButtonType.RoundedRect);
button.SetTitle (text, UIControlState.Normal);
button.Frame = new RectangleF (location, new SizeF (width, 33));
}
// Draws the specified text starting at x,y of the specified height to the context.
protected void DrawTextAtPoint (CGContext context, float x, float y, string text, int textHeight)
{
// configure font
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
// set it to fill in our text, don't just outline
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
// call showTextAtPoint
context.ShowTextAtPoint (x, y, text, text.Length);
}
/// <summary>
///
/// </summary>
protected void DrawCenteredTextAtPoint (CGContext context, float centerX, float y, string text, int textHeight)
{
context.SelectFont ("Helvetica-Bold", textHeight, CGTextEncoding.MacRoman);
context.SetTextDrawingMode (CGTextDrawingMode.Invisible);
context.ShowTextAtPoint (centerX, y, text, text.Length);
context.SetTextDrawingMode (CGTextDrawingMode.Fill);
context.ShowTextAtPoint (centerX - (context.TextPosition.X - centerX) / 2, y, text, text.Length);
}
/// <summary>
/// Draws our coordinate grid
/// </summary>
protected void DrawCoordinateSpace (CGBitmapContext context)
{
// declare vars
int remainder;
int textHeight = 20;
#region -= vertical ticks =-
// create our vertical tick lines
using (CGLayer verticalTickLayer = CGLayer.Create (context, new SizeF (20, 3))) {
// draw a single tick
verticalTickLayer.Context.FillRect (new RectangleF (0, 1, 20, 2));
// draw a vertical tick every 20 pixels
float yPos = 20;
int numberOfVerticalTicks = ((context.Height / 20) - 1);
for (int i = 0; i < numberOfVerticalTicks; i++) {
// draw the layer
context.DrawLayer (verticalTickLayer, new PointF (0, yPos));
// starting at 40, draw the coordinate text nearly to the top
if (yPos > 40 && i < (numberOfVerticalTicks - 2)) {
// draw it every 80 points
Math.DivRem ((int)yPos, (int)80, out remainder);
if (remainder == 0)
DrawTextAtPoint (context, 30, (yPos - (textHeight / 2)), yPos.ToString (), textHeight);
}
// increment the position of the next tick
yPos += 20;
}
}
#endregion
#region -= horizontal ticks =-
// create our horizontal tick lines
using (CGLayer horizontalTickLayer = CGLayer.Create (context, new SizeF (3, 20))) {
horizontalTickLayer.Context.FillRect (new RectangleF (1, 0, 2, 20));
// draw a horizontal tick every 20 pixels
float xPos = 20;
int numberOfHorizontalTicks = ((context.Width / 20) - 1);
for (int i = 0; i < numberOfHorizontalTicks; i++) {
context.DrawLayer (horizontalTickLayer, new PointF (xPos, 0));
// starting at 100, draw the coordinate text nearly to the top
if (xPos > 100 && i < (numberOfHorizontalTicks - 1)) {
// draw it every 80 points
Math.DivRem ((int)xPos, (int)80, out remainder);
if (remainder == 0)
DrawCenteredTextAtPoint (context, xPos, 30, xPos.ToString (), textHeight);
}
// increment the position of the next tick
xPos += 20;
}
}
#endregion
// draw our "origin" text
DrawTextAtPoint (context, 20, (20 + (textHeight / 2)), "Origin (0,0)", textHeight);
}
}
}

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

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleMetadata>
<ID>064a9ab4-1e58-4cf6-a1c2-aab04997aa57</ID>
<IsFullApplication>false</IsFullApplication>
<Level>Intermediate</Level>
<Tags>Core Graphics</Tags>
</SampleMetadata>

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

@ -0,0 +1,32 @@
Core Animation
=================
This sample illustrates how to use Core Graphics in MonoTouch. It covers on and off screen graphics contexts, layers, transformations, text, images, stencils, patterns, shadows, and more.
License
=======
The samples are licensed under the MIT X11 license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Authors
=======
Bryan Costanich

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

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

После

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

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

@ -0,0 +1,7 @@
{\rtf1\ansi\ansicpg1252\cocoartf1138
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
\f0\fs24 \cf0 TODO: when i'm back on my big monitor, take proper screenshots.}