How to create multiple javafx controllers with different fxml files?

Use FXML as components by using a custom java class as fx:root and as fx:controller of your FXML file: http://docs.oracle.com/javafx/2/fxml_get_started/custom_control.htm To do so, you need to call in the constructor of your custom java class FXMLLoader which will load your FXML. The advantage is to change the way FXML load components. The classic way to … Read more

ASP.NET MVC Programmatically Get a List of Controllers

Using Jon’s suggestion of reflecting through the assembly, here is a snippet you may find useful: using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Web.Mvc; public class MvcHelper { private static List<Type> GetSubClasses<T>() { return Assembly.GetCallingAssembly().GetTypes().Where( type => type.IsSubclassOf(typeof(T))).ToList(); } public List<string> GetControllerNames() { List<string> controllerNames = new List<string>(); GetSubClasses<Controller>().ForEach( type => controllerNames.Add(type.Name)); return … Read more

SignalR calling client method from outside hub using GlobalHost.ConnectionManager.GetHubContext doesn’t work. But calling from within the hub does

I came across with same issue couple days ago. That took my 2 days to find solution and resolve it. After some serious investigate the problems root cause was the signalr dependency resolver that I set customly. At the end I found this link and that was saying this: Replacing the DependencyResolver You can change … Read more

AngularJS, ui.router, load template and controller based on user role

Loading template and controller based on user role While technically ui-router templateUrl function does not support injecting services you can use templateProvider to inject service that holds role variable or loads it asynchronously and then use $templateFactory to return HTML content. Consider following example: var app = angular.module(‘app’, [‘ui.router’]); app.service(‘session’, function($timeout, $q){ this.role = null; … Read more