once installed, then choose Remotes>Putty>Generate Key to create a new SSH2 Key - save the private key somewhere and copy the public key to https://github.com/settings/ssh
after that... with perhaps just a little bit more fiddling through "Load Key" dialogs, then you should be able to:
clone your fork to a local git repository on your own hard drive
edit the code
commit changes in your fork back to you local git repository
push changes in your fork up to your github git repository
With it, is was really quick and easy to generate an ASP.Net MVC Controller action that allowed me to generate an excel spreadsheet with embedded data and with a chart! And with no Office or COM automation nastiness on the server :)
WooHoo :)
using System; using System.Web.Mvc; using Newtonsoft.Json; using OfficeOpenXml; using OfficeOpenXml.Drawing.Chart; using OfficeOpenXml.Style;
namespace MyApp.Controllers { public class ExportController : Controller { [Authorize] public ActionResult SafeDownload() { using (var package = new ExcelPackage()) { package.Workbook.Worksheets.Add("Test"); ExcelWorksheet ws = package.Workbook.Worksheets[1]; ws.Name = "Test"; //Setting Sheet's name ws.Cells.Style.Font.Size = 11; //Default font size for whole sheet ws.Cells.Style.Font.Name = "Calibri"; //Default Font name for whole sheet
//Merging cells and create a center heading for out table ws.Cells[1, 1].Value = "Sample DataTable Export"; // Heading Name ws.Cells[1, 1, 1, 10].Merge = true; //Merge columns start and end range ws.Cells[1, 1, 1, 10].Style.Font.Bold = true; //Font should be bold ws.Cells[1, 1, 1, 10].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; // Aligmnet is center
for (var i = 1; i < 11; i++) { for (var j = 2; j < 45; j++) { var cell = ws.Cells[j, i];
//Setting Value in cell cell.Value = i * (j - 1); } }
var chart = ws.Drawings.AddChart("chart1", eChartType.AreaStacked); //Set position and size chart.SetPosition(0, 630); chart.SetSize(800, 600);
// Add the data series. var series = chart.Series.Add(ws.Cells["A2:A46"], ws.Cells["B2:B46"]);
var memoryStream = package.GetAsByteArray(); var fileName = string.Format("MyData-{0:yyyy-MM-dd-HH-mm-ss}.xlsx", DateTime.UtcNow); // mimetype from http://stackoverflow.com/questions/4212861/what-is-a-correct-mime-type-for-docx-pptx-etc return base.File(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName); } } } }
Since installing VS2012, I've seen a few of these errors in my VS2010 VSMonoTouch (Visual Studio MonoTouch) builds:
The type or namespace name 'TargetFrameworkAttribute' does not exist in the namespace 'System.Runtime.Versioning' (are you missing an assembly reference?)
To workaround these, I've had to resort to adding a hacky line to my project files to prevent the attribute being generated and to keep them compiling:
<!-- somewhere after the Import of Microsoft.somelanguage.targets --> <Target Name="GenerateTargetFrameworkMonikerAttribute" />
I got asked a question on StackOverflow... http://stackoverflow.com/questions/12564272/making-mono-cross-platform-support-for-task-intent/12564548#12564548
-
I have a application for WP7 and Android, and this
application must have supporthas support for "any" connection type
(WiFi, NFC, Bluetooth etc)
I want to be able to request the user for Bluetooth Access, but I do
not want to program my UI specifically to Android Bluetooth, so the view
and view-model should not know which intent is used, all this should be
handled by the class implementing IConnectionService
The issue is that it should also work for Windows Phone which do not
use intents, it uses tasks, so how do I make an interface that allows me
to make either a Intent request or a task request without anyone
knowing what type of request is needed?
----------
This is similar to the way MvvmCross allows users to make phone calls.
When using this pattern:
The ViewModel code consumes a platform independent service via an interface - e.g.:
One of the challenges of your task may be the word "any" -
differences in platform implementation might make it hard to define a
cross-platform interface that works across all the platforms for any one
of NFC, Bluetooth, etc, let alone all of them.
Three months on from hitting some severe stumbling blocks in the Portable Library support within MonoTouch, I'm pleased to say that the last two weeks have seen huge leaps forwards in the vNext version.
Right now, the Portable Library layer is now running well under all of WP7, MonoDroid and MonoTouch :)
There are still some tooling issues... but overall, this is now working really well - so I'd like to invite users to have a play with the new projects!
Although there is some significant tooling hackery required to get portable library mvvm working, once you've done the initial hackery, then this shouldn't affect your existing workspaces and you should then be able to build and run portable versions of:
BestSellers (WP7, Droid, Touch)
CustomerManagement (WP7, Droid, Touch)
SimpleBinding (Droid, Touch)
Tutorial (WP7, Droid, Touch)
... and you might be able to run even more... :)
---
And the benefits for doing this are....
1. Simpler project structures:
2. Automated cross-platform refactoring - e.g. using resharper
3. Simpler porting to new platforms
4. A new plugin structure which makes mvvmcross lighter (smaller executables), which provides developers with more choice and which makes contributing new IoC modules more straightforward - now anyone can provide and consume new "plugins"
---
If you are interested in all this, then here's the instructions:
2. Install VisualStudio 2012 on the same PC... this updates the Portable Library tools to include v2 PCL support (which includes some MVVM/DataBinding helpers)
3. Install VSMonoTouch - https://github.com/follesoe/VSMonoTouch
- be sure to also copy across the v1.0 MonoTouch framework assemblies in the instructions there
4. Follow instructions based on http://jpobst.blogspot.co.uk/2012/04/mono-for-android-portable-libraries-in.html
- these say to install a file called "MonoAndroid,Version=v1.6+.xml" in "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile104\SupportedFrameworks" with content:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUT PLEASE NOTE - the target directory is Profile104
5. Install a similar file called "VSMonoTouch,Version=v1.0+.xml" in the same directory and for its content use:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Note: this file is even hackier than the MonoDroid one - it points the portable tools at Full .Net v1.0 in line with what the VSMonoTouch plugin does!)
After you have done this.... then you should be able to load and run the WP7 and Droid samples within MvvmCross_All.sln
... and you should also be able to build MonoTouch solutions too. And you should be able to refactor across all 3 platforms!
---
For the Mac:
Assuming you are starting with MonoDevelop with MonoTouch installed on a Mac
3. Sometimes (if I've checked in the wrong .sln file version) then before opening the MvvmCross_All.sln solution, you may need to change the first line from
Microsoft Visual Studio Solution File, Format Version 12.00
to
Microsoft Visual Studio Solution File, Format Version 11.00
After you've done these 3 steps.... then you should be able to:
- open the solution
- switch to the Debug|iPhoneSimulator branch
- run the BestSellers, CustomerManagement, SimpleDialogBinding, and Tutorial projects - other projects currently still have unresolved problems.
---
Further Notes....
- I'll be trying to get this branch fully working in the next month (that's my aim!)
- My intention is to switch all future MvvmCross development across to this portable approach
- If this happens, then I expect the existing non-portable tree will only get bug fixes - not new features.
- The exact timing of any switchover may depend a bit on tool changes from both Microsoft and Xamarin (and it may depend on clashes in my work and leisure time too!)
- There are a number of class and namespace breaking changes in the vNext (portable libraries) branch - most notably:
-- all Cirrious.MvvmCross.Android namespaces have moved to Cirrious.MvvmCross.Droid - this is to avoid name clashing issues with the global::Android namespace.
-- FirePropertyChanged has become RaisePropertyChanged - as this seems to be the more normal method name
- There are a number of fixes on the master branch which are not yet on the vnext branch
- There are a number of changes still to make in the vnext branch - e.g. IMvxServiceConsumer might switch to a simpler IMvxServiceConsumer - following a request/suggestion from @dsplaisted
- There are several dead files and directories left in the tree at present - mainly left over after refactoring - these will get tidied away soon.
- I've not yet tried much WinRT, console or PSS development on the vnext branch - so don't be surprised if those projects don't build or work!
- If anyone wants to help - with code, documentation, tools, samples or suggestions, then you are very welcome - just get in touch.
- As ever, bugs to GitHub issues please, and questions to StackOverflow :)
If you add Bootstrap to an ASP.Net MVC project and then see a few "object [Object] has no method on" errors which cause $.ready to fail, then.... check your jquery version
I've not had a lot of time to play with this yet, but in the last 24 hours I've managed to get a lot more of the Mvx vNext portable code building using the hint:
You may be able to fix this by editing the file /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild/Microsoft/Portable/v4.0/Microsoft.Portable.CSharp.targets, finding the PropertyGroup that sets MonoTouchAnd to it, adding the lines: smcs/Developer/MonoTouch/usr/bin
Found this hint via http://stackoverflow.com/questions/12041290/monodevelop-is-it-possible-to-switch-pcls-compiler/12062589#12062589 and https://bugzilla.xamarin.com/show_bug.cgi?id=5329 - wish I'd found it months ago (note to self - don't give up so easy next time!)
For Mac newbies, note that this file is in the root from the hard disk (not from the user) and that you will need to edit file (and folder?) permissions in order to edit it - you can do this from finder using 'more info'.