10:40PM in Xamarin.iOS
this is the error :
but I know there is a Start() in application
what is wrong ?
part of the code you cant see in the picture :
using System;
using Urho.Audio;
using Urho.Gui;
namespace Brain_Entrainment
{
public class IsochronicTones : Application
{
public float beat {get;set;}
public float Frequency {get;set}
public float Amplitude {get;set}
Related
I have following below 2 queries related to TinkerPop 3:
1) Which Frames version is compatible with tinkerpop3?
2) TinkerPop3 official documentation states that the Frames feature has merged into "Traversal" but I could not found any information on that. So, please help me on this how we will implement it using Java.
Frames is no longer supported for TP3 unfortunately. But that shouldn't make you upset, there is an alternative.
Have you checked Peapod? It does what Frames do but for Tinkerpop3.
#Vertex
public abstract class Person {
public abstract String getName();
public abstract void setName(String name);
public abstract List<Knows> getKnows();
public abstract Knows getKnows(Person person);
public abstract Knows addKnows(Person person);
public abstract Knows removeKnows(Person person);
}
#Edge
public abstract class Knows {
public abstract void setYears(int years);
public abstract int getYears();
}
and then you could easily use it like this
Graph g = //define your graph heere
FramedGraph graph = new FramedGraph(g, Person.class.getPackage());
Person marko = graph.v(1, Person.class);
For more information, have a look here.
Disclaimer: I'm a contributor to Peapod.
I'm trying to inject this user service via Unity (mvc5) in an actionfilter but it is null. How can I implement this?
public class TestFilter : ActionFilterAttribute
{
// this is always null
[Dependency]
public IUserService UserService { get; set; }
// other members
}
You must register UnityFilterAttributeFilterProvider as a FilterProvider first.
Modify the App_Start > UnityMvcActivator's Start method like this:
public static void Start()
{
var container = UnityConfig.GetConfiguredContainer();
FilterProviders.Providers.Remove(FilterProviders.Providers.OfType<FilterAttributeFilterProvider>().First());
FilterProviders.Providers.Add(new UnityFilterAttributeFilterProvider(container));
DependencyResolver.SetResolver(new UnityDependencyResolver(container));
Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(typeof(UnityPerRequestHttpModule));
}
If you could not find the method. You probably installed wrong or out of date package. consider installing Install-Package Unity.Mvc on the package manager console.
I am using Xamarin.iOS. I have created UIView with a few UITextFields. I am looking for best way to initialize text value in these textfields from code.
I can pass text data in the constructor of UIViewContoller, but I don't have access to textFields inside it (they are null). I can change text value of textFields in viewDidLoad method.
I don't want to create additional fields in controller class to store data passed by constructor and use them in viewDidLoad. Do you know better solution ?
I don't want to create additional fields in controller class to store
data passed by constructor and use them in viewDidLoad.
But that's how it's meant to be done.
Alternatively, you can create less fields/properties in your viewcontroller if you use a MVVM pattern:
public class UserViewModel {
public string Name { get; set;}
public string Title { get; set;}
}
public class UserViewController : UIViewController
{
UserViewModel viewModel;
public UserViewController (UserViewModel viewModel) : base (...)
{
this.viewModel = viewModel;
}
public override void ViewDidLoad ()
{
userName.Text = viewModel.Name;
userTitle.Text = viewModel.Title;
}
}
That's the kind of pattern which gives you a lot of code reuse accross platforms (android, WP, ...) and clearly separate concerns. It's a (very) little bit of extra code, but it's worth every byte.
I am working on MonoTouch binding of an Objective-C application. I referred iOS Binding Walkthrough.
I have generated libraries for i386, ARM and then a universal library. Further, I created a MonoTouch Binding Project. I have generated ApiDefinition using Sharpie and added the universal library generated earlier. Now when I build this project I am getting the following error.
ADClusterAnnotation.g.cs(86,86): Error CS0533: AnnotationClusterMap.ADClusterAnnotation.Coordinate' hides inherited abstract member MonoTouch.MapKit.MKAnnotation.Coordinate' (CS0533)
Here is the code snippet of ADClusterAnnotation:
File ADClusterannotation.h
#interface ADClusterAnnotation : NSObject <MKAnnotation> {
CLLocationCoordinate2D _coordinates;
}
#property (nonatomic) CLLocationCoordinate2D coordinate;
#end
File ADClusterAnnotation.m
#synthesize coordinate = _coordinates;
Here is the code snippet from ApiDefinition
[BaseType (typeof (MKAnnotation))]
public partial interface ADClusterAnnotation {
[Export ("coordinate")]
CLLocationCoordinate2D Coordinate { get; set; }
}
So I think we need to change something in ApiDefinition. I tried removing Coordinate from ADClusterAnnotation in the API definition, but then it gives an error that it implements an abstract member. What am I missing with regard to Monotouch binding?
Overriding an abstract member require c# new or override
You can get that to be generated by changing your ApiDefinition to:
[BaseType (typeof (MKAnnotation))]
public partial interface ADClusterAnnotation {
[Export ("coordinate")]
[New]
CLLocationCoordinate2D Coordinate { get; set; }
}
I get the following error: The type 'EfTest.Person' was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive, nested or generic, and does not inherit from EntityObject.
when running this code:
using System.Data.Entity;
namespace EfTest
{
internal class Program
{
private static void Main(string[] args)
{
using (var db = new PersonContext())
{
db.Persons.Add(new Person());
db.SaveChanges();
}
}
}
public class PersonContext : DbContext
{
public DbSet<Person> Persons { get; set; } //people ;)
}
public class Person : EfTest2.Person
{
public int PersonId { get; set; }
public string Name { get; set; }
}
}namespace EfTest2
{
public class Person
{
public int Age { get; set; }
}
}
can you help and explain why new type can not have same name as its base?
I would focus on the keyword nested in the error. I'm sure taking it out of EfTest2 namespace and keeping the namespace the same will correct this issue. Of course then you must change the base class name from Person to some thing else.
EF has quite complex multi-layered mapping and some of these layers are not directly visible outside. This is a problem of mapping objects into their entity representation in EDM. The point is that EF is not using full class names (including namespaces) but only bare class names so your Person classes are in collision and only one can be resolved.
The origin of this behavior is probably in EF 4.0 when it was used to simplify class creation for POCO models and make namespaces independent on the EDMX.
I think you cannot write the class next to the main session.
You have to separate it to another cs file.
I solved the problem by doing that. Worth a try