Add ExampleBrowser for Mac
This commit is contained in:
Родитель
75cd5b00f3
Коммит
a06686abe2
|
@ -0,0 +1,88 @@
|
|||
using System;
|
||||
|
||||
using Foundation;
|
||||
using AppKit;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace ExampleBrowser
|
||||
{
|
||||
using ExampleLibrary;
|
||||
|
||||
public partial class AppDelegate : NSApplicationDelegate
|
||||
{
|
||||
PlotWindowController plotWindowController;
|
||||
ExampleInfo currentExample;
|
||||
|
||||
public AppDelegate ()
|
||||
{
|
||||
}
|
||||
|
||||
List<ExampleInfo> exampleList;
|
||||
|
||||
public override void FinishedLaunching (NSObject notification)
|
||||
{
|
||||
plotWindowController = new PlotWindowController ();
|
||||
|
||||
var menu = new NSMenu ();
|
||||
|
||||
var appMenu = new NSMenu ();
|
||||
appMenu.AddItem (new NSMenuItem ("Next example", "n", (s, e) => this.NextExample (1)));
|
||||
appMenu.AddItem (new NSMenuItem ("Previous example", "p", (s, e) => this.NextExample (-1)));
|
||||
appMenu.AddItem (NSMenuItem.SeparatorItem);
|
||||
appMenu.AddItem (new NSMenuItem ("Quit", "q", (s, e) => NSApplication.SharedApplication.Terminate (menu)));
|
||||
menu.AddItem (new NSMenuItem { Submenu = appMenu });
|
||||
|
||||
var fileMenu = new NSMenu ("File");
|
||||
fileMenu.AddItem (new NSMenuItem ("Export", "e"));
|
||||
menu.AddItem (new NSMenuItem { Submenu = fileMenu });
|
||||
|
||||
var editMenu = new NSMenu ("Edit");
|
||||
editMenu.AddItem (new NSMenuItem ("Copy", "c"));
|
||||
menu.AddItem (new NSMenuItem { Submenu = editMenu });
|
||||
|
||||
var examplesMenu = new NSMenu ("Examples");
|
||||
exampleList = Examples.GetList ();
|
||||
|
||||
var categories = exampleList.Select (e => e.Category).Distinct ().OrderBy (c => c).ToArray ();
|
||||
var categoryMenus = new Dictionary<string,NSMenu> ();
|
||||
foreach (var category in categories) {
|
||||
var categoryMenu = new NSMenu (category);
|
||||
examplesMenu.AddItem (new NSMenuItem (category) { Submenu = categoryMenu });
|
||||
categoryMenus.Add (category, categoryMenu);
|
||||
}
|
||||
|
||||
foreach (var example in exampleList) {
|
||||
var item = new NSMenuItem (example.Title, (s, e) => this.SetExample (example));
|
||||
var categoryMenu = categoryMenus [example.Category];
|
||||
categoryMenu.AddItem (item);
|
||||
}
|
||||
menu.AddItem (new NSMenuItem { Submenu = examplesMenu });
|
||||
this.SetExample (exampleList.First ());
|
||||
|
||||
plotWindowController.Window.MakeKeyAndOrderFront (this);
|
||||
NSApplication.SharedApplication.MainMenu = menu;
|
||||
}
|
||||
|
||||
public void SetExample (ExampleInfo example)
|
||||
{
|
||||
this.plotWindowController.SetExample (example);
|
||||
this.currentExample = example;
|
||||
}
|
||||
|
||||
public void NextExample (int delta)
|
||||
{
|
||||
var index = this.exampleList.IndexOf (this.currentExample);
|
||||
index += delta;
|
||||
if (index < 0)
|
||||
index = this.exampleList.Count - 1;
|
||||
if (index >= this.exampleList.Count)
|
||||
index = 0;
|
||||
this.SetExample (this.exampleList [index]);
|
||||
}
|
||||
|
||||
public void Export ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace ExampleBrowser
|
||||
{
|
||||
[global::Foundation.Register ("AppDelegate")]
|
||||
public partial class AppDelegate
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
<?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)' == '' ">AnyCPU</Platform>
|
||||
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A354B462-B05D-4D1B-B844-C122511AE0BE}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>ExampleBrowser</RootNamespace>
|
||||
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
|
||||
<AssemblyName>ExampleBrowser</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<UseSGen>false</UseSGen>
|
||||
<IncludeMonoRuntime>false</IncludeMonoRuntime>
|
||||
<EnablePackageSigning>false</EnablePackageSigning>
|
||||
<CodeSigningKey>Mac Developer</CodeSigningKey>
|
||||
<EnableCodeSigning>false</EnableCodeSigning>
|
||||
<CreatePackage>false</CreatePackage>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<LinkMode>SdkOnly</LinkMode>
|
||||
<UseSGen>false</UseSGen>
|
||||
<IncludeMonoRuntime>true</IncludeMonoRuntime>
|
||||
<EnablePackageSigning>false</EnablePackageSigning>
|
||||
<CodeSigningKey>Developer ID Application</CodeSigningKey>
|
||||
<EnableCodeSigning>true</EnableCodeSigning>
|
||||
<CreatePackage>true</CreatePackage>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\AppStore</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<LinkMode>SdkOnly</LinkMode>
|
||||
<UseSGen>false</UseSGen>
|
||||
<IncludeMonoRuntime>true</IncludeMonoRuntime>
|
||||
<PackageSigningKey>3rd Party Mac Developer Installer</PackageSigningKey>
|
||||
<CreatePackage>true</CreatePackage>
|
||||
<CodeSigningKey>3rd Party Mac Developer Application</CodeSigningKey>
|
||||
<EnableCodeSigning>true</EnableCodeSigning>
|
||||
<EnablePackageSigning>true</EnablePackageSigning>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.Mac" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="AppDelegate.designer.cs">
|
||||
<DependentUpon>AppDelegate.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PlotWindow.cs" />
|
||||
<Compile Include="PlotWindow.designer.cs">
|
||||
<DependentUpon>PlotWindow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PlotWindowController.cs" />
|
||||
<Compile Include="PlotWindowController.designer.cs">
|
||||
<DependentUpon>PlotWindowController.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\ExampleLibrary\ExampleLibrary.csproj">
|
||||
<Project>{FACB89E5-53A5-4748-9F5B-E0714EBB37B2}</Project>
|
||||
<Name>ExampleLibrary</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\OxyPlot\OxyPlot.csproj">
|
||||
<Project>{7A0B35C0-DD17-4964-8E9A-44D6CECDC692}</Project>
|
||||
<Name>OxyPlot</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\OxyPlot.Xamarin.Mac\OxyPlot.Xamarin.Mac.csproj">
|
||||
<Project>{7DC4B440-5328-4929-BF32-56A1209ED4DD}</Project>
|
||||
<Name>OxyPlot.Xamarin.Mac</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="PlotWindow.xib" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,34 @@
|
|||
<?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>ExampleBrowser</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com..ExampleBrowser</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>ExampleBrowser</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.8</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
|
||||
using AppKit;
|
||||
|
||||
namespace ExampleBrowser
|
||||
{
|
||||
static class MainClass
|
||||
{
|
||||
static void Main (string[] args)
|
||||
{
|
||||
NSApplication.Init ();
|
||||
|
||||
var application = NSApplication.SharedApplication;
|
||||
application.Delegate = new AppDelegate ();
|
||||
application.Run ();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
|
||||
using Foundation;
|
||||
using AppKit;
|
||||
|
||||
namespace ExampleBrowser
|
||||
{
|
||||
public partial class PlotWindow : NSWindow
|
||||
{
|
||||
public PlotWindow (IntPtr handle) : base (handle)
|
||||
{
|
||||
}
|
||||
|
||||
[Export ("initWithCoder:")]
|
||||
public PlotWindow (NSCoder coder) : base (coder)
|
||||
{
|
||||
}
|
||||
|
||||
public override void AwakeFromNib ()
|
||||
{
|
||||
base.AwakeFromNib ();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace ExampleBrowser
|
||||
{
|
||||
[global::Foundation.Register ("PlotWindow")]
|
||||
public partial class PlotWindow
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,189 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1060</int>
|
||||
<string key="IBDocument.SystemVersion">10D573</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">762</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.CocoaPlugin</string>
|
||||
<string key="NS.object.0">762</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="2" />
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</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="NSCustomObject" id="1001">
|
||||
<string key="NSClassName">PlotWindowController</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1003">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1004">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="748157544">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{131, 74}, {606, 354}}</string>
|
||||
<int key="NSWTFlags">611844096</int>
|
||||
<string key="NSWindowTitle">Window</string>
|
||||
<string key="NSWindowClass">PlotWindow</string>
|
||||
<nil key="NSViewClass" />
|
||||
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
|
||||
<object class="NSView" key="NSWindowView" id="312036702">
|
||||
<reference key="NSNextResponder" />
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{606, 354}</string>
|
||||
<reference key="NSSuperview" />
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
|
||||
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">window</string>
|
||||
<reference key="source" ref="1001" />
|
||||
<reference key="destination" ref="748157544" />
|
||||
</object>
|
||||
<int key="connectionID">6</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">-2</int>
|
||||
<reference key="object" ref="1001" />
|
||||
<reference key="parent" ref="0" />
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="1003" />
|
||||
<reference key="parent" ref="0" />
|
||||
<string key="objectName">First Responder</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-3</int>
|
||||
<reference key="object" ref="1004" />
|
||||
<reference key="parent" ref="0" />
|
||||
<string key="objectName">Application</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="748157544" />
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="312036702" />
|
||||
</object>
|
||||
<reference key="parent" ref="0" />
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">3</int>
|
||||
<reference key="object" ref="312036702" />
|
||||
<reference key="parent" ref="748157544" />
|
||||
</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.IBPluginDependency</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>-3.IBPluginDependency</string>
|
||||
<string>2.IBEditorWindowLastContentRect</string>
|
||||
<string>2.IBPluginDependency</string>
|
||||
<string>2.IBWindowTemplateEditedContentRect</string>
|
||||
<string>2.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>3.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{319, 371}, {606, 354}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{319, 371}, {606, 354}}</string>
|
||||
<boolean value="YES" />
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</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">6</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PlotWindow</string>
|
||||
<string key="superclassName">NSWindow</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey" />
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PlotWindowController</string>
|
||||
<string key="superclassName">NSWindowController</string>
|
||||
<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">IBCocoaFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.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>
|
||||
</data>
|
||||
</archive>
|
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
|
||||
using Foundation;
|
||||
using AppKit;
|
||||
|
||||
namespace ExampleBrowser
|
||||
{
|
||||
using ExampleLibrary;
|
||||
using OxyPlot;
|
||||
using OxyPlot.Xamarin.Mac;
|
||||
|
||||
public partial class PlotWindowController : NSWindowController
|
||||
{
|
||||
private PlotView plotView;
|
||||
|
||||
public PlotWindowController (IntPtr handle) : base (handle)
|
||||
{
|
||||
}
|
||||
|
||||
[Export ("initWithCoder:")]
|
||||
public PlotWindowController (NSCoder coder) : base (coder)
|
||||
{
|
||||
}
|
||||
|
||||
public PlotWindowController () : base ("PlotWindow")
|
||||
{
|
||||
}
|
||||
|
||||
public override void AwakeFromNib ()
|
||||
{
|
||||
base.AwakeFromNib ();
|
||||
}
|
||||
|
||||
public new PlotWindow Window {
|
||||
get { return (PlotWindow)base.Window; }
|
||||
}
|
||||
|
||||
public override void WindowDidLoad ()
|
||||
{
|
||||
base.WindowDidLoad ();
|
||||
plotView = new PlotView (this.Window.Frame);
|
||||
Window.ContentView = plotView;
|
||||
}
|
||||
|
||||
public void SetExample(ExampleInfo example){
|
||||
this.Window.Title = example.Title;
|
||||
plotView.Model = example.PlotModel;
|
||||
plotView.Controller = example.PlotController;
|
||||
plotView.InvalidatePlot (true);
|
||||
}
|
||||
}
|
||||
}
|
7
Source/Examples/Xamarin.Mac/ExampleBrowser/PlotWindowController.designer.cs
сгенерированный
Normal file
7
Source/Examples/Xamarin.Mac/ExampleBrowser/PlotWindowController.designer.cs
сгенерированный
Normal file
|
@ -0,0 +1,7 @@
|
|||
namespace ExampleBrowser
|
||||
{
|
||||
[global::Foundation.Register ("PlotWindowController")]
|
||||
public partial class PlotWindowController
|
||||
{
|
||||
}
|
||||
}
|
|
@ -21,7 +21,7 @@ namespace SimpleDemo
|
|||
menu.AddItem (menuItem);
|
||||
|
||||
var appMenu = new NSMenu ();
|
||||
var quitItem = new NSMenuItem ("Quit " + NSProcessInfo.ProcessInfo.ProcessName, "q", (s, e) => NSApplication.SharedApplication.Terminate (menu));
|
||||
var quitItem = new NSMenuItem ("Quit", "q", (s, e) => NSApplication.SharedApplication.Terminate (menu));
|
||||
appMenu.AddItem (quitItem);
|
||||
|
||||
menuItem.Submenu = appMenu;
|
||||
|
|
|
@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleLibrary", "Examples\
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleDemo", "Examples\Xamarin.Mac\SimpleDemo\SimpleDemo.csproj", "{AC685CC2-AE9B-4C9A-8A70-B71D25D2DB90}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleBrowser", "Examples\Xamarin.Mac\ExampleBrowser\ExampleBrowser.csproj", "{A354B462-B05D-4D1B-B844-C122511AE0BE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.Xamarin.Mac", "OxyPlot.Xamarin.Mac\OxyPlot.Xamarin.Mac.csproj", "{7DC4B440-5328-4929-BF32-56A1209ED4DD}"
|
||||
EndProject
|
||||
Global
|
||||
|
@ -55,6 +57,22 @@ Global
|
|||
{7DC4B440-5328-4929-BF32-56A1209ED4DD}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{7DC4B440-5328-4929-BF32-56A1209ED4DD}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{7DC4B440-5328-4929-BF32-56A1209ED4DD}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.AppStore|iPhone.ActiveCfg = AppStore|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.AppStore|iPhone.Build.0 = AppStore|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{AC685CC2-AE9B-4C9A-8A70-B71D25D2DB90}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{AC685CC2-AE9B-4C9A-8A70-B71D25D2DB90}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
|
||||
{AC685CC2-AE9B-4C9A-8A70-B71D25D2DB90}.AppStore|iPhone.ActiveCfg = AppStore|Any CPU
|
||||
|
@ -91,9 +109,10 @@ Global
|
|||
GlobalSection(NestedProjects) = preSolution
|
||||
{FACB89E5-53A5-4748-9F5B-E0714EBB37B2} = {0AB67A65-9645-4DF6-98A2-D5734D212E7C}
|
||||
{AC685CC2-AE9B-4C9A-8A70-B71D25D2DB90} = {0AB67A65-9645-4DF6-98A2-D5734D212E7C}
|
||||
{A354B462-B05D-4D1B-B844-C122511AE0BE} = {0AB67A65-9645-4DF6-98A2-D5734D212E7C}
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = Examples\Xamarin.Mac\SimpleDemo\SimpleDemo.csproj
|
||||
StartupItem = Examples\Xamarin.Mac\ExampleBrowser\ExampleBrowser.csproj
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
Загрузка…
Ссылка в новой задаче