Search Results

Search found 10381 results on 416 pages for 'delegate and events'.

Page 30/416 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • NHibernate requires events to be virtual?

    - by Jimit
    I'm attempting to map an entity hierarchy using NHibernate almost all of which have events. When attempting to build a session factory however, I get error messages similar to the following: Core.Domain.Entities.Delivery: method remove_Scheduled should be virtual Delivery is an entity in my domain model with an event called Scheduled. Since events cannot be declared virtual I'm at a loss as to how to proceed here. Why would NHibernate need events to be virtual?

    Read the article

  • Migrating a simple application from Application Delegate to ViewController Class

    - by eco_bach
    Hi Frst of all wanted to send out a huge thanks for the great feedback and support. I have a simple application working, right now simply loads a sequence of images and alows the user to step thru the images by clicking a button. All of my logic is in my Application Delegate class, with the image loading, initialization of UIImage Views etc happening in my applicationDidFinishLaunching method. My next step is to migrate as much as possible all of the logic from this class to a ViewController, to take advantage of the extra functionality etc in viewcontrollers. All my images and imageViews are initialized like the following in my applicationDidFinishLaunching. img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@image1.jpg" ofType:nil]]; imgView = [[UIImageView alloc] initWithImage:img]; How would I migrate this to a ViewController based application? Where would I put all of the logic currently in my applicationDidFinishLaunching method, or for loading of images, is it necessary to only load them here? Any feedback, tips, suggestions appreciated.

    Read the article

  • How to use Delegate in C# for Dictionary<int, List<string>>

    - by Emanuel
    The code: private delegate void ThreadStatusCallback(ReceiveMessageAction action, Dictionary<int, List<string>> message); ... Dictionary<int, List<string>> messagesForNotification = new Dictionary<int, List<string>>(); ... Invoke(new ThreadStatusCallback(ReceivesMessagesStatus), ReceiveMessageAction.Notification , messagesForNotification ); ... private void ReceivesMessagesStatus(ReceiveMessageAction action, object value) { ... } How can I send the two variable of type ReceiveMessageAction respectively Dictionary<int, List<string>> to the ReceivesMessagesStatus method. Thanks.

    Read the article

  • How to access objects of app Delegate into RootViewController

    - by Ashutosh
    I have a navigation based app in which i am calling a web service. I have done all the work which is required in the background to absorb the web services. The only thing left is to display it in a Table view. The data i want to display is stored in a Mutable array and i can see the data in console and this is in app delegate. I just want to pass this data somehow to root so that i can display it in table view. Could somebody help me with this.

    Read the article

  • ASP.NET logging Events in DB

    - by Greens
    Hi , Was wondering if ASP.NET's System.web.Management can be used for logging events like userLogin, Passwordchanges,access to some resources or should we use the system.Web.Management for logging of errors and healthmonitoring Is there any way that I can do the logging of events without re-inventing the whole thing. I know ELMAH is used for Errors can it be used for logging events too?.

    Read the article

  • fullcalendar, how to limit the number of events per day in the month view

    - by VNE_Hess
    I have many events on a day, and it works as expected but now looking at the month view, my calendar grid is much taller that expected. I'd like to hide some of these events from the month view, like a summary with a visual que that there are more on this day than can be shown. I can use eventRender and return false, but i would like to know how many events are on a given day, so i can limit the rendering to about 4, then perhaps i would add an event that says " more ... " So the question may be : how to count the events on a given date ? or is this more like a feature request to expose a max counter for month view ? thanks

    Read the article

  • c++/cli pass (managed) delegate to unmanaged code

    - by Ron Klein
    How do I pass a function pointer from managed C++ (C++/CLI) to an unmanaged method? I read a few articles, like this one from MSDN, but it describes two different assemblies, while I want only one. Here is my code: 1) Header (MyInterop.ManagedCppLib.h): #pragma once using namespace System; namespace MyInterop { namespace ManagedCppLib { public ref class MyManagedClass { public: void DoSomething(); }; }} 2) CPP Code (MyInterop.ManagedCppLib.cpp) #include "stdafx.h" #include "MyInterop.ManagedCppLib.h" #pragma unmanaged void UnmanagedMethod(int a, int b, void (*sum)(const int)) { int result = a + b; sum(result); } #pragma managed void MyInterop::ManagedCppLib::MyManagedClass::DoSomething() { System::Console::WriteLine("hello from managed C++"); UnmanagedMethod(3, 7, /* ANY IDEA??? */); } I tried creating my managed delegate and then I tried to use Marshal::GetFunctionPointerForDelegate method, but I couldn't compile.

    Read the article

  • pointer delegate in STL set.

    - by ananth
    hi. Im kinda stuck with using a set with a pointer delegate. my code is as follows: void Graph::addNodes (NodeSet& nodes) { for (NodeSet::iterator pos = nodes.begin(); pos != nodes.end(); ++pos) { addNode(*pos); } } Here NodeSet is defined as: typedef std::set NodeSet; The above piece of code works perfectly on my windows machine, but when i run the same piece of code on a MAC, it gives me the following error: no matching function for call to 'Graph::addNode(const boost::shared_ptr&)' FYI, Node_ptr is of type: typedef boost::shared_ptr Node_ptr; can somebody plz tell me why this is happening?

    Read the article

  • Magic Method __set() on a Instantiated Object

    - by streetparade
    Ok i have a problem, sorry if i cant explaint it clear but the code speaks for its self. i have a class which generates objects from a given class name; Say we say the class is Modules: public function name($name) { $this->includeModule($name); try { $module = new ReflectionClass($name); $instance = $module->isInstantiable() ? $module->newInstance() : "Err"; $this->addDelegate($instance); } catch(Exception $e) { Modules::Name("Logger")->log($e->getMessage()); } return $this; } The AddDelegate Method: protected function addDelegate($delegate) { $this->aDelegates[] = $delegate; } The __call Method public function __call($methodName, $parameters) { $delegated = false; foreach ($this->aDelegates as $delegate) { if(class_exists(get_class($delegate))) { if(method_exists($delegate,$methodName)) { $method = new ReflectionMethod(get_class($delegate), $methodName); $function = array($delegate, $methodName); return call_user_func_array($function, $parameters); } } } The __get Method public function __get($property) { foreach($this->aDelegates as $delegate) { if ($delegate->$property !== false) { return $delegate->$property; } } } All this works fine expect the function __set public function __set($property,$value) { //print_r($this->aDelegates); foreach($this->aDelegates as $k=>$delegate) { //print_r($k); //print_r($delegate); if (property_exists($delegate, $property)) { $delegate->$property = $value; } } //$this->addDelegate($delegate); print_r($this->aDelegates); } class tester { public function __set($name,$value) { self::$module->name(self::$name)->__set($name,$value); } } Module::test("logger")->log("test"); // this logs, it works echo Module::test("logger")->path; //prints /home/bla/test/ this is also correct But i cant set any value to class log like this Module::tester("logger")->path ="/home/bla/test/log/"; The path property of class logger is public so its not a problem of protected or private property access. How can i solve this issue? I hope i could explain my problem clear.

    Read the article

  • How to handle Windows Events in JAVA

    - by prasad
    I'd like to ask another question how to handle Windows' events in Java. To be specific, I'd like to know how to handle events such as mouse moved or mouse clicked in Windows XP and Vista. I want to wire my own custom behavior in my application to these events, even when my application is inactive or otherwise hidden. All help is appreciated!

    Read the article

  • UIButton not getting touch events inside a custom UITableViewCell

    - by user210504
    Hi! I have designed a custom UItableView Cell in IB. This cell has a UIButton with an associated action. This button is not getting touch events, however the cell itself gets the events when called. What could I be doing wrong here. +--------------------------------+ | +----------+ | Cell | Button | | +----------+ +--------------------------------+ When I tap on the Button tableviewcell gets the events. What could be wrong? EDIT: I just checked, that UIButton is also getting touch events, but so is the UITableViewCell. And at then end of it the action associated with UIButton is not getting called.

    Read the article

  • Split or individually edit repeating Google Calendar events

    - by Steve Crane
    Our company just moved from Microsoft Exchange with Outlook to Google Mail, Calendar, etc. and I am trying to modify a calendar event where it repeats, but the times across the days are not the same. I created an event from 10h00 to 16h30 and made it repeat for two days. Now the times need to be adjusted independently for the two days. I could just cancel the repeat and book a new appointment for the second day but the event has a confirmed room booking and with rooms at a premium I worry that someone else may grab the room before I can create the new second day event. Outlook had a way to modify repeating events individually but I'm not seeing anything like that in the Google Calendar web client. So my question is whether there is a way to individually edit repeating events, or failing that, to split the repeating event into individual ones?

    Read the article

  • Delegates vs. events in Cocoa

    - by aaronstacy
    I'm writing my first iPhone app, and I've been exploring the design patterns in Cocoa and Objective-C. I come from a background of client-side web development, so I'm trying to wrap my head around delegates. Specifically, I don't see why delegate objects are needed instead of event handlers. For instance, when the user presses a button, it is handled with an event (UITouchUpInside), but when the user finishes inputting to a text box and closes it with the 'Done' button, the action is handled by calling a method on the text box's delegate (textFieldShouldReturn). Why use a delegate method instead of an event? I also notice this in the view controller with the viewDidLoad method. Why not just use events?

    Read the article

  • What is the purpose of this delegate usage?

    - by Kev
    Whilst poking around some code in .NET Reflector in an app I don't have the source code for I found this: if (DeleteDisks) { using (List<XenRef<VDI>>.Enumerator enumerator3 = list.GetEnumerator()) { MethodInvoker invoker2 = null; XenRef<VDI> vdiRef; while (enumerator3.MoveNext()) { vdiRef = enumerator3.Current; if (invoker2 == null) { // // Why do this? // invoker2 = delegate { VDI.destroy(session, vdiRef.opaque_ref); }; } bestEffort(ref caught, invoker2); } } } if (caught != null) { throw caught; } private static void bestEffort(ref Exception caught, MethodInvoker func) { try { func(); } catch (Exception exception) { log.Error(exception, exception); if (caught == null) { caught = exception; } } } Why not call VDI.destroy() directly. Is this just a way of wrapping the same pattern of try { do something } catch { log error } if it's used a lot?

    Read the article

  • Tracing all events in VB.NET

    - by MatsT
    I keep running into situations where I don't know what event I have to listen to in order to execute my code at the correct time. Is there any way to get a log of all events that is raised? Any way to filter that log based on what object raised the event? EDIT: Final solution: Private Sub WireAllEvents(ByVal obj As Object) Dim parameterTypes() As Type = {GetType(System.Object), GetType(System.EventArgs)} Dim Events = obj.GetType().GetEvents() For Each ev In Events Dim handler As New DynamicMethod("", Nothing, parameterTypes, GetType(main)) Dim ilgen As ILGenerator = handler.GetILGenerator() ilgen.EmitWriteLine("Event Name: " + ev.Name) ilgen.Emit(OpCodes.Ret) ev.AddEventHandler(obj, handler.CreateDelegate(ev.EventHandlerType)) Next End Sub And yes, I know this is not a good solution when you actually want to do real stuff that triggers off the events. There are good reasons for the 1 method - 1 event approach, but this is still useful when trying to figure out which of the methods you want to add your handlers to.

    Read the article

  • How to handle touch events on UI Controls

    - by Sreelatha
    Hi, I have a query related to Touch events on the UI controls. I have 4 controls on the screen ( UITextField, UISlider, UISwitch, UIButton ). If the user touches any of the control on the screen, I want to fire touchesBegan and touchesEnded events on those controls in which I would implement some code. Please let me know how to fire these events. Thanks in advance, Sreelatha.

    Read the article

  • Implementing a client for ActiveMQ events

    - by recipriversexclusion
    I can listen to events from a certain topic in an ActiveMQ server using a simple asynchronous listener and print the incoming events to the console (code to that actually comes as an example in the activemq-cpp library). I would like to create clients on other machines that will listen to these events and update their displays. My question is: how to best go about doing this? Are there any Ajax examples you can point me that implement similar functionality? Or is there another technology (comet?) that is better to use for this scenario? How can I display the events in teh browser window as they are received by the client, should I use JQuery?

    Read the article

  • Magic Method __set() on a Instanciated Object

    - by streetparade
    Ok i have a problem, sorry if i cant explaint it clear but the code speaks for its self. i have a class which generates objects from a given class name; Say we say the class is Modules: public function name($name) { $this->includeModule($name); try { $module = new ReflectionClass($name); $instance = $module->isInstantiable() ? $module->newInstance() : "Err"; $this->addDelegate($instance); } catch(Exception $e) { Modules::Name("Logger")->log($e->getMessage()); } return $this; } The AddDelegate Method: protected function addDelegate($delegate) { $this->aDelegates[] = $delegate; } The __call Method public function __call($methodName, $parameters) { $delegated = false; foreach ($this->aDelegates as $delegate) { if(class_exists(get_class($delegate))) { if(method_exists($delegate,$methodName)) { $method = new ReflectionMethod(get_class($delegate), $methodName); $function = array($delegate, $methodName); return call_user_func_array($function, $parameters); } } } The __get Method public function __get($property) { foreach($this->aDelegates as $delegate) { if ($delegate->$property !== false) { return $delegate->$property; } } } All this works fine expect the function __set public function __set($property,$value) { //print_r($this->aDelegates); foreach($this->aDelegates as $k=>$delegate) { //print_r($k); //print_r($delegate); if (property_exists($delegate, $property)) { $delegate->$property = $value; } } //$this->addDelegate($delegate); print_r($this->aDelegates); } class tester { public function __set($name,$value) { self::$module->name(self::$name)->__set($name,$value); } } Module::test("logger")->log("test"); // this logs, it works echo Module::test("logger")->path; //prints /home/bla/test/ this is also correct But i cant set any value to class log like this Module::tester("logger")->path ="/home/bla/test/log/"; The path property of class logger is public so its not a problem of protected or private property access. How can i solve this issue? I hope i could explain my problem clear.

    Read the article

  • presentmodalviewcontroller not working properly in Application Delegate in iPhone

    - by sujyanarayan
    Hi, I'm using two UIViewController in Application Delegate and navigating to UIViewController using presentmodalviewcontroller. But Problem is that presentmodalviewcontroller works for first time UIViewController and when i want to navigate to second UIViewController using presentmodalviewcontroller then its showing first UIViewController. The following is the code:- -(void)removeTabBar:(NSString *)str { HelpViewController *hvc =[[HelpViewController alloc] initWithNibName:@"HelpViewController" bundle:[NSBundle mainBundle]]; VideoPlaylistViewController *vpvc =[[VideoPlaylistViewController alloc] initWithNibName:@"VideoPlaylistViewController" bundle:[NSBundle mainBundle]]; if ([str isEqualToString:@"Help"]) { [tabBarController.view removeFromSuperview]; [vpvc dismissModalViewControllerAnimated:YES]; [viewController presentModalViewController:hvc animated:YES]; [hvc release]; } if ([str isEqualToString:@"VideoPlaylist"]) { [hvc dismissModalViewControllerAnimated:YES]; [viewController presentModalViewController:vpvc animated:YES]; [vpvc release]; } } Can Somebody help me in solving the problem?

    Read the article

  • SQL Query to select upcoming events with a start and end date

    - by Chris T
    I need to display upcoming events from a database. The problem is when I use the query I'm currently using any events with a start day that has passed will show up lower on the list of upcoming events regardless of the fact that they are current My table (yaml): columns: title: type: string(255) notnull: true default: Untitled Event start_time: type: time end_time: type: time start_day: type: date notnull: true end_day: type: date description: type: string(500) default: This event has no description category_id: integer My query (doctrine): $results = Doctrine_Query::create() ->from("sfEventItem e, e.Category c") ->select("e.title, e.start_day, e.description, e.category_id, e.slug") ->addSelect("c.title, c.slug") ->orderBy("e.start_day, e.start_time, e.title") ->limit(5) ->execute(array(), Doctrine_Core::HYDRATE_ARRAY); Basically I'd like any events that is currently going on (so if today is in between start_day and end_day) to be at the top of the list. How would I go about doing this if it's even possible? Raw sql queries are good answers too because they're pretty easy to turn into DQL.

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >