Examples of EventKitUi or EventKit in Monotouch - xamarin.ios

I am new to app development, but have developed in .Net sense inception. I was wondering if someone has any examples of how to use the EventKitUI.
My goal is to have a calendar view in my app and then if they choose to add it to their calendar they can.
I also want to be able to link to pdf documents from the content of the event.

Do you mean something like this?
class Testclass{
public event EventHandler Clicked;
public Testclass{
}
public void FireEvent(){
if(Clicked!=null){
this.Clicked(this,new EventArgs());
}
} }

Related

Why my custom C# extention does not execute when deployed to Spotfire WebPlauer/Consumer

I have a simple custom Add-in that just displays a message to the user.
namespace GeorgiSpotfireCustomExtention
{
public class GeorgiEvent : CustomApplicationEventHandler
{
protected override void OnApplicationInstanceCreated(AnalysisApplication application)
{
base.OnApplicationInstanceCreated(application);
MessageBox.Show("On Application Instance Created");
}
}
}
That is my CustomAddIn class:
public sealed class CustomAddIn : AddIn
{
// Override methods in this class to register your extensions.
protected override void RegisterApplicationEventHandlers(ApplicationEventHandlerRegistrar registrar)
{
base.RegisterApplicationEventHandlers(registrar);
registrar.Register(new GeorgiEvent());
}
}
I am just trying to learn the package deployment process. When I am running it locally - in the installed Spotfire Analyst client it displays the message just fine:
However, when I package the extention, add it to the server (via the "Deployments & Packages" section, adding the "spk" file and then saving the area, the message is not shown when I try to open a document in the WebPlayer/Consumer.
Notes: I am choosing "TIBCO Spotfire Any Client" for my intended client in the Package Builder when building the spk file.
from the Spotfire Wiki (emphasis mine):
WinForms graphical user interface is a component of the .NET Framework and not something supplied by Tibco Spotfire. It's not recommended to implement solutions using Forms, but sometimes it could be handy when debugging. There is no commitment that it will work in future versions of the Analyst client. Forms are not supported on the Web Player.
the example listed on the wiki is for IronPython, but presumably the same holds true for C# extensions.
Correct. My assumption, and I don’t really know a lot about .NET, so this is not absolute, is that the form is rendered on the machine executing the code. In the case of your example above, the dialog would pop on the Node Manager host. If you’re really set on using an alert like this, you can accomplish it in JavaScript with an ‘alert()’. There is probably a way to render dialogues o in the web client too, but I don’t know it offhand.

Automatic binding to some service properties in Catel with Fody

Assuming there is some service:
public interface IDeviceManagerService
{
ISomeDeviceApi Api { get; }
}
It's purpose is to monitor external environment (USB, network, etc.), instantiate device API when the device detected and make property null when the device is no longer available.
Supposing there is a view model with this service injected, I would like to have change notifications for IDeviceManagerService.Api to make things like below possible (for example, having the button which is only active when the device API is available).
private Boolean OnSomeCommandCanExecute()
{
return _deviceManagerService.Api != null;
}
I wonder if there is a clean way to make this work without manual change notifications handling (with Catel.Fody or PropertyChanged.Fody). So far I have managed to get working result by making service implementation derived from ModelBase, registering it's injected instance as a [Model] inside the view model and exposing it's Api property using [ViewModelToModel] attribute, but this is very dirty way.
Is there some common approach or It would be better to go with implementing INotifyPropertyChanged and use notifications wrapper instead?
In most approaches, services don't implement INotifyPropertyChanged (they are not models), so my recommendation is to add manual events:
public interface IDeviceManagerService
{
ISomeDeviceApi Api { get; }
event EventHandler<DeviceApiEventArgs> ApiChanged;
}
This way you can deal with the stuff you are interested in (subscribe in InitializeAsync, unsubscribe in CloseAsync).

Asp.net 4 Webforms Authorization using attribute

Hiii All, I'm a little bit newbie to ASP.net, I'm building a web application using asp.net 4, I got into authorization aspects, I have read some articles related to this concept, But none of them comes with what I want.
I don't want to use web.confing to implement authorization concept, what I want to use is attribute level authorization.
I would like to have the ability to something like this.
[AdminAuthorization]
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
Please don't provide me with another scenario, and please be patient because I have said I'm still newbie.

monotouch implement singleton Admob ads

I am trying to implement Admob ads in my App.
After a few tests I made with previous apps, i have realized that a static Ad between screens usually make a better eCPM.
So I have searched a bit and found a post on implementing a singleton for Admob - unfortunetally it's written in objective-C.
I wonder if someone implemented something similar in monotouch or maybe implemented something which will get the same result.
This is the relevant post:
Creating A GADBannerView Singleton in AdMob Applications
Thanks for your help!
I would just make a static variable using Lazy<T>:
private static Lazy<GADBannerView> _adBanner = new Lazy<GADBannerView>(() => new GADBannerView());
public static GADBannerView AdBanner
{
get { return _adBanner.Value; }
}
You could put this in your AppDelegate, or just in a static class.

Jar file for HttpRequestHandler in lwuit in j2me

I need to open a web page in j2me emulator. As I have the flow that I can do this by using HTMLComponent. But I can not use this HttpRequestHandler class to create handler in j2me in Lwuit can anybody say me what is missing in my j2me? If is there any JAR file to use it then give me suggestion to make use of it. Then I have also tried DocumentRequestHandler in the same instead of HttpRequestHandler But it show me emulator that "Error in connecting stream"
My code is:
DocumentRequestHandler handler=new DocumentRequestHandler() {
public InputStream resourceRequested(DocumentInfo di) {
return null;
// throw new UnsupportedOperationException("Not supported yet.");
}
};
HTMLComponent htmlc=new HTMLComponent(handler);
htmlc.setPage("http://facebook.com");
addComponent(htmlc);
show();
In this code what i need to return in DocumentRequestHandler?
The class you are looking for is available at LWUITBrowser sample application and can be checked out from the LWUIT SVN under MIDP/applications.

Resources