Permalink
Browse files

Merge branch 'master' of github.com:NashXam/wallet-sized

  • Loading branch information...
2 parents 7374156 + 58af9b1 commit 9275751760ca544084fd07bf1d98af04b7be0249 @bryanhunter bryanhunter committed Feb 19, 2014
@@ -0,0 +1,54 @@
+//
+// Library.fs
+//
+// Author:
+// Paulmichael Blasucci <pblasucci@gmail.com>
+//
+// Copyright (c) 2014
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+namespace WalletSized.Core
+
+open System
+
+type WalletItem =
+ { Name :string
+ Stamp :DateTime
+ Value :WalletItemValue }
+
+ override item.ToString () =
+ sprintf "{WalletItem.Name=%s; Stamp=%A; Value=%A}"
+ item.Name
+ item.Stamp
+ item.Value
+
+and WalletItemValue =
+ | Note of string
+ | Link of string
+ | Photo of string
+
+ override item.ToString () =
+ match item with
+ | Note value -> sprintf "Note %s" value
+ | Link value -> sprintf "Link %s" value
+ | Photo value -> sprintf "Photo %s" value
+
+// extensions to simplfy being called from languages other than F#
+type WalletItem with
+ static member Note (name,value) =
+ {Name=name; Stamp=DateTime.UtcNow; Value=Note value}
+ static member Link (name,value) =
+ {Name=name; Stamp=DateTime.UtcNow; Value=Link value}
+ static member Photo (name,value) =
+ {Name=name; Stamp=DateTime.UtcNow; Value=Photo value}
@@ -0,0 +1,50 @@
+<?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>
+ <ProductVersion>12.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{53AFDF04-58BC-4F73-80CF-E23A8CC92719}</ProjectGuid>
+ <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{4925A630-B079-445D-BCD4-3A9C94FE9307}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <RootNamespace>WalletSized.Core</RootNamespace>
+ <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
+ <AssemblyName>WalletSized.Core</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <PlatformTarget>
+ </PlatformTarget>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <PlatformTarget>
+ </PlatformTarget>
+ <ConsolePause>false</ConsolePause>
+ <Tailcalls>true</Tailcalls>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Core" />
+ <Reference Include="FSharp.Core" />
+ <Reference Include="monotouch" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Resources\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" />
+ <ItemGroup>
+ <Compile Include="Library.fs" />
+ </ItemGroup>
+</Project>
View
@@ -0,0 +1,46 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WalletSized", "WalletSized\WalletSized.csproj", "{25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}"
+EndProject
+Project("{4925A630-B079-445d-BCD4-3A9C94FE9307}") = "WalletSized.Core", "WalletSized.Core\WalletSized.Core.fsproj", "{53AFDF04-58BC-4F73-80CF-E23A8CC92719}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|iPhoneSimulator = Debug|iPhoneSimulator
+ Release|iPhoneSimulator = Release|iPhoneSimulator
+ Debug|iPhone = Debug|iPhone
+ Release|iPhone = Release|iPhone
+ Ad-Hoc|iPhone = Ad-Hoc|iPhone
+ AppStore|iPhone = AppStore|iPhone
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.AppStore|iPhone.Build.0 = AppStore|iPhone
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.Debug|iPhone.ActiveCfg = Debug|iPhone
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.Debug|iPhone.Build.0 = Debug|iPhone
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.Release|iPhone.ActiveCfg = Release|iPhone
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.Release|iPhone.Build.0 = Release|iPhone
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
+ {25CBCB8F-0F42-4E18-BC8E-0890E2E28B7D}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.AppStore|iPhone.ActiveCfg = Release|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.AppStore|iPhone.Build.0 = Release|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.Release|iPhone.Build.0 = Release|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {53AFDF04-58BC-4F73-80CF-E23A8CC92719}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = WalletSized\WalletSized.csproj
+ EndGlobalSection
+EndGlobal
@@ -0,0 +1,13 @@
+<Properties>
+ <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhoneSimulator" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.IPhoneRetina4.7.0" />
+ <MonoDevelop.Ide.Workbench ActiveDocument="WalletSized/MasterViewController.cs">
+ <Files>
+ <File FileName="WalletSized/MasterViewController.cs" Line="72" Column="67" />
+ <File FileName="WalletSized/DetailViewController.cs" Line="55" Column="6" />
+ </Files>
+ </MonoDevelop.Ide.Workbench>
+ <MonoDevelop.Ide.DebuggingService.Breakpoints>
+ <BreakpointStore />
+ </MonoDevelop.Ide.DebuggingService.Breakpoints>
+ <MonoDevelop.Ide.DebuggingService.PinnedWatches />
+</Properties>
@@ -0,0 +1,57 @@
+//
+// AppDelegate.cs
+//
+// Author:
+// Paulmichael Blasucci <pblasucci@gmail.com>
+//
+// Copyright (c) 2014
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MonoTouch.Foundation;
+using MonoTouch.UIKit;
+
+namespace WalletSized {
+ // The UIApplicationDelegate for the application. This class is responsible for launching the
+ // User Interface of the application, as well as listening (and optionally responding) to
+ // application events from iOS.
+ [Register ("AppDelegate")]
+ public partial class AppDelegate : UIApplicationDelegate {
+ // class-level declarations
+ UINavigationController navigationController;
+ UIWindow window;
+ //
+ // This method is invoked when the application has loaded and is ready to run. In this
+ // method you should instantiate the window, load the UI into it and then make the window
+ // visible.
+ //
+ // You have 17 seconds to return from this method, or iOS will terminate your application.
+ //
+ public override bool FinishedLaunching (UIApplication app,NSDictionary options) {
+ window = new UIWindow (UIScreen.MainScreen.Bounds);
+
+ var controller = new MasterViewController ();
+ navigationController = new UINavigationController (controller);
+ window.RootViewController = navigationController;
+
+ // make the window visible
+ window.MakeKeyAndVisible ();
+
+ return true;
+ }
+ }
+}
+
@@ -0,0 +1,72 @@
+//
+// DetailViewController.cs
+//
+// Author:
+// Paulmichael Blasucci <pblasucci@gmail.com>
+//
+// Copyright (c) 2014
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+using System;
+using System.Drawing;
+using System.Collections.Generic;
+using MonoTouch.Foundation;
+using MonoTouch.UIKit;
+
+using WalletSized.Core;
+
+namespace WalletSized {
+ public partial class DetailViewController : UIViewController {
+ WalletItem detailItem;
+
+ public DetailViewController () : base ("DetailViewController",null) {
+ Title = NSBundle.MainBundle.LocalizedString ("Details","Details");
+
+ // Custom initialization
+ }
+
+ public void SetDetailItem (object newDetailItem) {
+ if (detailItem != newDetailItem) {
+ detailItem = (WalletItem) newDetailItem;
+
+ // Update the view
+ ConfigureView ();
+ }
+ }
+
+ void ConfigureView () {
+ // Update the user interface for the detail item
+ if (IsViewLoaded && detailItem != null)
+ detailDescriptionLabel.Text = String.Format ("[{1}] {0}: {2}"
+ ,detailItem.Name
+ ,detailItem.Stamp
+ ,detailItem.Value);
+ }
+
+ public override void DidReceiveMemoryWarning () {
+ // Releases the view if it doesn't have a superview.
+ base.DidReceiveMemoryWarning ();
+
+ // Release any cached data, images, etc that aren't in use.
+ }
+
+ public override void ViewDidLoad () {
+ base.ViewDidLoad ();
+
+ // Perform any additional setup after loading the view, typically from a nib.
+ ConfigureView ();
+ }
+ }
+}
+

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 9275751

Please sign in to comment.