Search Results

Search found 691 results on 28 pages for 'registering'.

Page 2/28 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • ASP.NET MVC AcceptVerbs and registering routes

    - by Pure.Krome
    Hi Folks, do I have to register the HttpVerb constraint in my route definition (when i'm registering routes) if i have decorated my action method with the [AcceptVerbs(..)] attribute already? eg. i have this. [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(FormCollection formCollection) { .. } do i need to add this to the route that refers to this action, as a constraint?

    Read the article

  • Programmatically modifying an embedded resource before registering/referencing it on the page

    - by Jimock
    Hi All, Firstly, "Modifying" may be the wrong term, I see a few people have posted online just asking whether they can actually modify an embedded resource. What I am wanting to to, is use a resource in my assembly as a kind of template which I would do a find and replace on before registering it on the page - is this possible? For example; say I have a few lines of jQuery as an embedded resource in my assembly and in this script I am referencing a CSS class name that can be set by the front-end programmer. Since I do not know what the CSS class will be until implementation, is there a way of going through the embedded resource and replacing, say, $myclass$ with ThisClassName. Any help would be appreciated, if it's not possible then at least tell me so I can stop chasing my tail. Cheers, James

    Read the article

  • Problem Registering a Generic Repository with Windsor IoC

    - by Robin
    I’m fairly new to IoC and perhaps my understanding of generics and inheritance is not strong enough for what I’m trying to do. You might find this to be a mess. I have a generic Repository base class: public class Repository<TEntity> where TEntity : class, IEntity { private Table<TEntity> EntityTable; private string _connectionString; private string _userName; public string UserName { get { return _userName; } set { _userName = value; } } public Repository() {} public Repository(string connectionString) { _connectionString = connectionString; EntityTable = (new DataContext(connectionString)).GetTable<TEntity>(); } public Repository(string connectionString, string userName) { _connectionString = connectionString; _userName = userName; EntityTable = (new DataContext(connectionString)).GetTable<TEntity>(); } // Data access methods ... ... } and a SqlClientRepository that inherits Repository: public class SqlClientRepository : Repository<Client> { private Table<Client> ClientTable; private string _connectionString; private string _userName; public SqlClientRepository() {} public SqlClientRepository(string connectionString) : base(connectionString) { _connectionString = connectionString; ClientTable = (new DataContext(connectionString)).GetTable<Client>(); } public SqlClientRepository(string connectionString, string userName) : base(connectionString, userName) { _connectionString = connectionString; _userName = userName; ClientTable = (new DataContext(connectionString)).GetTable<Client>(); } // data access methods unique to Client repository ... } The Repository class provides some generics methods like Save, Delete, etc, that I want all my repository derived classes to share. The TEntity parameter is constrained to the IEntity interface: public interface IEntity { int Id { get; set; } NameValueCollection GetSaveRuleViolations(); NameValueCollection GetDeleteRuleViolations(); } This allows the Repository class to reference these methods within its Save and Delete methods. Unit tests work fine on mock SqlClientRepository instances as well as live unit tests on the real database. However, in the MVC context: public class ClientController : Controller { private SqlClientRepository _clientRepository; public ClientController(SqlClientRepository clientRepository) { this._clientRepository = clientRepository; } public ClientController() { } // ViewResult methods ... ... } ... _clientRepository is always null. I’m using Windor Castle as an IoC container. Here is the configuration: <component id="ClientRepository" service="DomainModel.Concrete.Repository`1[[DomainModel.Entities.Client, DomainModel]], DomainModel" type="DomainModel.Concrete.SqlClientRepository, DomainModel" lifestyle="PerWebRequest"> <parameters> <connectionString>#{myConnStr}</connectionString> </parameters> </component> I’ve tried many variations in the Windsor configuration file. I suspect it’s more of a design flaw in the above code. As I'm looking over my code, it occurs to me that when registering components with an IoC container, perhaps service must always be an interface. Could this be it? Does anybody have a suggestion? Thanks in advance.

    Read the article

  • .NET HttpListener: when registering both HTTP & HTTPS I get "conflicts with an existing registration

    - by Greg
    I'm trying to use .NET HttpListener in a C# project. When I register my prefix "http://*:8080/" it does not seem to work for HTTPS urls (i.e. doesn't pick them up). When I try the following code to register both the HTTP and HTTPS versions of the prefix however I get the error: "Failed to listen on prefix 'https://:8080/' because it conflicts with an existing registration on the machine."* How can I get my prefix working for both HTTP & HTTPS? private HttpListener _listener; // Create prefixes var prefixes = new List<string>(); prefixes.Add("http://*:8080/"); prefixes.Add("https://*:8080/"); // Create HttpListener _listener = new HttpListener(); foreach (string prefix in prefixes) { _listener.Prefixes.Add(prefix); } _listener.Start(); // <== ERROR HERE thanks

    Read the article

  • Registering instances with MEF

    - by yang
    I have to register an object instance into a container. I can't use the generic ComposeExportedValue<T> since I don't know what T is at compile time. The method I need is something like this: container.RegisterInstance(Type someType, object instance) Any ideas? Thanks.

    Read the article

  • Problem registering a dll - Access Denied

    - by Vidar
    When trying to run regasm in Win2008 Server: regasm "C:\Program Files\FooProg\Bar.dll" /tlb:"C:\Program Files\FooProg\Bar.tlb" I get the following error: RegAsm : error RA0000 : An error occurred while saving the exported type library: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) what does this mean

    Read the article

  • Properly registering JavaScript and CSS in MVC 2 Editor Templates

    - by Jaxidian
    How do I properly register javascript blocks in an ASP.NET MVC 2 (RTM) Editor template? The specific scenario I'm in is that I want to use Dynarch JSCal2 DateTimePicker for my standard datetime picker, but this question is in general to any reusable javascript package. I have my template working properly now but it has my JS and CSS includes in my master page and I would rather only include these things if I actually need them: <link rel="stylesheet" type="text/css" href="../../Content/JSCal2-1.7/jscal2.css" /> <link rel="stylesheet" type="text/css" href="../../Content/JSCal2-1.7/border-radius.css" /> <script type="text/javascript" src="../../Scripts/JSCal2-1.7/jscal2.js"></script> <script type="text/javascript" src="../../Scripts/JSCal2-1.7/lang/en.js"></script> So obviously I could just put these lines into my template, but then if I have a screen that has 5 DateTimePickers, then this content would be duplicated 5 times which wouldn't be ideal. Anyways, I still want my View's Template to trigger this code being put into the <head> of my page. While it is completely unrelated to my asking this question, I thought I'd share my template on here (so far) in case it's useful in any way: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DateTime>" %> <%= Html.TextBoxFor(model => Model) %> <input type="button" id="<%= ViewData.TemplateInfo.GetFullHtmlFieldId("cal-trigger") %>" value="..." /> <script type="text/javascript"> var <%= ViewData.TemplateInfo.GetFullHtmlFieldId("cal") %> = Calendar.setup({ trigger : "<%= ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty) %>", inputField : "<%= ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty) %>", onSelect : function() { this.hide(); }, showTime : 12, selectionType : Calendar.SEL_SINGLE, dateFormat : '%o/%e/%Y %l:%M %P' }); </script>

    Read the article

  • registering httpModules in web.config

    - by Praesagus
    I am trying to register a custom HttpHandler in the web.config file. MSDN's example shows an entry that is commented out...um which doesn't work so well. When I uncomment I receive a Could not load file or assembly 'HttpModule.cs' or one of its dependencies. The system cannot find the file specified. error. The file name is HttpModule.cs and the class name is MyHttpModule. There is no explicit namespace yet. <httpModules> <add name="MyHttpModule" type="MyHttpModule, HttpModule" /> <httpModules> I am sure I am overlooking the obvious. Do I need to specify the file path somewhere? Thanks in advance.

    Read the article

  • iPhone Key-Value Observer: observer not registering in UITableViewController

    - by Scott
    Hi Fellow iPhone Developers, I am an experienced software engineer but new to the iPhone platform. I have successfully implemented sub-classed view controllers and can push and pop parent/child views on the view controller stack. However, I have struck trouble while trying to update a view controller when an object is edited in a child view controller. After much failed experimentation, I discovered the key-value observer API which looked like the perfect way to do this. I then registered an observer in my main/parent view controller, and in the observer I intend to reload the view. The idea is that when the object is edited in the child view controller, this will be fired. However, I think that the observer is not being registered, because I know that the value is being updated in the editing view controller (I can see it in the debugger), but the observing method is never being called. Please help! Code snippets follow below. Object being observed. I believe that this is key-value compliant as the value is set when called with the setvalue message (see Child View Controller below). X.h: @interface X : NSObject <NSCoding> { NSString *name; ... @property (nonatomic, retain) NSString *name; X.m: @implementation X @synthesize name; ... Main View Controller.h: @class X; @interface XViewController : UITableViewController { X *x; ... Main View Controller.m: @implementation XViewController @synthesize x; ... - (void)viewDidLoad { ... [self.x addObserver:self forKeyPath: @"name" options: (NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld) context:nil]; [super viewDidLoad]; } ... - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([keyPath isEqual:@"name"]) { NSLog(@"Found change to X"); [self.tableView reloadData]; } [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } Child View Controller.m: (this correctly sets the value in the object in the child view controller) [self.x setValue:[[tempValues objectForKey:key] text] forKey:@"name"];

    Read the article

  • Page.ClientScript.RegisterClientScriptBlock problem in chrome, not registering

    - by user270399
    Hello! I am using Page.ClientScript.RegisterClientScriptBlock to register a variable that tells the site to show something for the user (Don't need to get in to what is show). I am going to try to use RegisterStartupScript instead and see if i get any other result, i will get back on that. In my site i use jquery to look for that variable and do something if it exists. This works very well in IE 6,7,8 & FF but not in Chrome. In Chrome it works sometimes but most of the time it does not work, the variable does not get inserted on the page. The variable is beeing inserted in the Page_PreRender. Someone that has got a workaround for this or have experienced the same problem? Thanks

    Read the article

  • CompliationLock throws HttpException when registering areas for ASP.NET MVC unit tests

    - by patridge
    The moment I added a unit test to my ASP.NET MVC application to test some of the area routing, I got an HttpException coming out of the System.Web.Complication.CompilationLock type initializer with the following stack trace. System.Web.HttpException : The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception. ----> System.TypeInitializationException : The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception. ----> System.NullReferenceException : Object reference not set to an instance of an object. at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() at System.Web.Compilation.BuildManager.GetReferencedAssemblies() at System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.GetReferencedAssemblies() at System.Web.Mvc.TypeCacheUtil.FilterTypesInAssemblies(IBuildManager buildManager, Predicate`1 predicate) at System.Web.Mvc.TypeCacheUtil.GetFilteredTypesFromAssemblies(String cacheName, Predicate`1 predicate, IBuildManager buildManager) at System.Web.Mvc.AreaRegistration.RegisterAllAreas(RouteCollection routes, IBuildManager buildManager, Object state) at System.Web.Mvc.AreaRegistration.RegisterAllAreas(Object state) at System.Web.Mvc.AreaRegistration.RegisterAllAreas() at StpWeb.MvcApplication.RegisterRoutes(RouteCollection routes) in Global.asax.cs: line 16 at StpWeb.Tests.RoutesTest.TestFixtureSetUp() in RoutesTest.cs: line 11 --TypeInitializationException at System.Web.Compilation.CompilationLock.GetLock(ref Boolean gotLock) at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() --NullReferenceException at System.Web.Compilation.CompilationLock..cctor()

    Read the article

  • Registering IWindsorContainer with ASPNET MVC 2.0 Areas

    - by Bernard Larouche
    I had the following code that was working well before the addition of Areas in MVC 2 : protected override IWindsorContainer CreateContainer(string windsorConfig) { IWindsorContainer container = new WindsorContainer(); container.Register(Component.For<IUnitOfWorkFactory>() .ImplementedBy<NHibernateUnitOfWorkFactory>()); container.Register(AllTypes.Of<IController>() .FromAssembly(typeof(HomeController).Assembly) .Configure(t => t.Named(t.Implementation.Name.ToUpper()) .LifeStyle.Is(LifestyleType.Transient))); return container; } It doesn't work anymore with MVC 2.0 Areas feature. Could you guide me through a possible solution Thanks

    Read the article

  • Providing or Filtering assemblies when registering areas for an ASP.NET MVC 2.0 application

    - by HackedByChinese
    I have a large application that currently exists as a hybrid of WebForms and MVC 2.0. Startup of my application is dreadful, and the culprit is primarily because of the AreaRegistration.RegisterAllAreas call. More specifically, that it is using the System.Web. Compilation.BuildManager.GetReferencedAssemblies to enumerate all types in assemblies directly referenced by the application and test them to see if they derive from AreaRegistration. Unfortunately, I have a number of third-party assemblies that happen to be quite extensive, so this initial load can be pretty bad. I'd have much better results if I could tell it which assemblies to look for AreaRegistrations, or even register areas manually for the time being. I can gather up all the internals of AreaRegistration to create and invoke the registration, but I'm just curious if others have had and worked around this issue.

    Read the article

  • Registering javascript handler function to handle CollapsiblePanelExtender event

    - by Sergej Andrejev
    I checked my html page generated by asp.net and I can see this line Sys.Application.initialize(); Sys.Application.add_init(function() { $create(AjaxControlToolkit.CollapsiblePanelBehavior, { "ClientStateFieldID":"rptActiveQuotes_ctl01_qcQuote_cpeDetails_ClientState", "CollapseControlID":"rptActiveQuotes_ctl01_qcQuote_imgShowHide", "Collapsed":true, "CollapsedImage":"Images/expandablePlus.gif", "ExpandControlID":"rptActiveQuotes_ctl01_qcQuote_imgShowHide", "ExpandedImage":"Images/expandableMinus.gif", "ImageControlID":"rptActiveQuotes_ctl01_qcQuote_imgShowHide", "id":"rptActiveQuotes_ctl01_qcQuote_cpeDetails" }, null, null, $get("rptActiveQuotes_ctl01_qcQuote_pDetails")); }); I think it's generated from CollapsiblePanelExtender with name cpeDetails. And I see you can pass number of events to it, wich is now null (third argument). What should I do to set add_ended event there?

    Read the article

  • Backbone.js not registering Model.hasChanged event

    - by Brian M. Hunt
    Hello, I'm trying to get a View in Backbone.js to save when there's a 'change' event if (and only if) the data has changed. Long story short, I've a 'change' event set on the View that calls this: function changed_event() { log.debug("Before: " + this.model.get('name')) // not 'contrived!' this.model.set({'name': 'contrived!'}); log.debug("After: " + this.model.get('name')) // 'contrived!' if (this.model.hasChanged()) { alert("This is never called."); } } I'd like to know why the model.hasChanged() is false when clearly the model has been changed. I'm not sure what other information is necessary, but if there is more information that may be helpful please comment and I'll elaborate. Thank you for reading.

    Read the article

  • Flex PureMVC: Mediator not registering

    - by LazerWonder
    A component is created at runtime and a mediator is created and registered. All is well. In a separate view, another instance of that component is created. The mediator is created but onRegister() isn't called the 2nd time. I don't know if this is normal... but if it is, how do I get it to call onRegister() the second time? Thanks. :)

    Read the article

  • My sample app is getting crash while registering to Filechangeinfo notification

    - by Solitaire
    public partial class Form1 : Form { [DllImport("coredll.dll")] static extern int SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong); [DllImport("coredll.dll")] static extern IntPtr CallWindowProc(IntPtr lpPrevWndFunc, IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam); [DllImport("coredll.dll")] public static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex); //public struct tagSHCHANGENOTIFYENTRY //{ // [MarshalAs(UnmanagedType.SysUInt)] // public ulong dwEventMask; // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4096)] // public string WatchDir; // [MarshalAs(UnmanagedType.Bool)] // public bool fRecursive; //} //tagSHCHANGENOTIFYENTRY test; //[DllImport("aygshell.dll")] //static extern bool SHChangeNotifyRegister(IntPtr hwnd, ref tagSHCHANGENOTIFYENTRY test); const int GWL_WNDPROC = -4; public delegate int WindProc(IntPtr hWnd, int msg, IntPtr Wparam, IntPtr lparam); static private WindProc SampleProc; IntPtr OldDefProc = IntPtr.Zero; public enum SHCNE : uint { SHCNE_RENAMEITEM = 0x00000001, SHCNE_CREATE = 0x00000002, SHCNE_DELETE = 0x00000004, SHCNE_MKDIR = 0x00000008, SHCNE_RMDIR = 0x00000010, SHCNE_MEDIAINSERTED = 0x00000020, SHCNE_MEDIAREMOVED = 0x00000040, SHCNE_DRIVEREMOVED = 0x00000080, SHCNE_DRIVEADD = 0x00000100, SHCNE_NETSHARE = 0x00000200, SHCNE_NETUNSHARE = 0x00000400, SHCNE_ATTRIBUTES = 0x00000800, SHCNE_UPDATEDIR = 0x00001000, SHCNE_UPDATEITEM = 0x00002000, SHCNE_SERVERDISCONNECT = 0x00004000, SHCNE_UPDATEIMAGE = 0x00008000, SHCNE_DRIVEADDGUI = 0x00010000, SHCNE_RENAMEFOLDER = 0x00020000, SHCNE_FREESPACE = 0x00040000, SHCNE_EXTENDED_EVENT = 0x04000000, SHCNE_ASSOCCHANGED = 0x08000000, SHCNE_DISKEVENTS = 0x0002381F, SHCNE_GLOBALEVENTS = 0x0C0581E0, SHCNE_ALLEVENTS = 0x7FFFFFFF, SHCNE_INTERRUPT = 0x80000000, } public enum SHCNF { SHCNF_IDLIST = 0x0000, SHCNF_PATHA = 0x0001, SHCNF_PRINTERA = 0x0002, SHCNF_DWORD = 0x0003, SHCNF_PATHW = 0x0005, SHCNF_PRINTERW = 0x0006, SHCNF_TYPE = 0x00FF, SHCNF_FLUSH = 0x1000, SHCNF_FLUSHNOWAIT = 0x2000 } public const uint WM_SHNOTIFY = 0x0401; private const int WM_FILECHANGEINFO = (0x8000 + 0x101); public struct SHChangeNotifyEntry { public IntPtr pIdl; [MarshalAs(UnmanagedType.Bool)] public Boolean Recursively; } [DllImport("coredll.dll", EntryPoint = "#2", CharSet = CharSet.Auto)] private static extern uint SHChangeNotifyRegister( IntPtr hWnd, SHCNF fSources, SHCNE fEvents, uint wMsg, int cEntries, ref SHChangeNotifyEntry pFsne); [DllImport("Ceshell.dll", CharSet = CharSet.Auto)] private static extern uint SHGetSpecialFolderLocation( IntPtr hWnd, CSIDL nFolder, out IntPtr Pidl); public enum CSIDL { /// <summary> /// Desktop /// </summary> CSIDL_DESKTOP = 0x0000, /// <summary> /// Internet Explorer (icon on desktop) /// </summary> CSIDL_INTERNET = 0x0001, /// <summary> /// Start Menu\Programs /// </summary> CSIDL_PROGRAMS = 0x0002, /// <summary> /// My Computer\Control Panel /// </summary> CSIDL_CONTROLS = 0x0003, /// <summary> /// My Computer\Printers /// </summary> CSIDL_PRINTERS = 0x0004, /// <summary> /// My Documents /// </summary> CSIDL_PERSONAL = 0x0005, /// <summary> /// user name\Favorites /// </summary> CSIDL_FAVORITES = 0x0006, /// <summary> /// Start Menu\Programs\Startup /// </summary> CSIDL_STARTUP = 0x0007, /// <summary> /// user name\Recent /// </summary> CSIDL_RECENT = 0x0008, /// <summary> /// user name\SendTo /// </summary> CSIDL_SENDTO = 0x0009, /// <summary> /// desktop\Recycle Bin /// </summary> CSIDL_BITBUCKET = 0x000a, /// <summary> /// user name\Start Menu /// </summary> CSIDL_STARTMENU = 0x000b, /// <summary> /// logical "My Documents" desktop icon /// </summary> CSIDL_MYDOCUMENTS = 0x000c, /// <summary> /// "My Music" folder /// </summary> CSIDL_MYMUSIC = 0x000d, /// <summary> /// "My Videos" folder /// </summary> CSIDL_MYVIDEO = 0x000e, /// <summary> /// user name\Desktop /// </summary> CSIDL_DESKTOPDIRECTORY = 0x0010, /// <summary> /// My Computer /// </summary> CSIDL_DRIVES = 0x0011, /// <summary> /// Network Neighborhood (My Network Places) /// </summary> CSIDL_NETWORK = 0x0012, /// <summary> /// user name>nethood /// </summary> CSIDL_NETHOOD = 0x0013, /// <summary> /// windows\fonts /// </summary> CSIDL_FONTS = 0x0014, CSIDL_TEMPLATES = 0x0015, /// <summary> /// All Users\Start Menu /// </summary> CSIDL_COMMON_STARTMENU = 0x0016, /// <summary> /// All Users\Start Menu\Programs /// </summary> CSIDL_COMMON_PROGRAMS = 0X0017, /// <summary> /// All Users\Startup /// </summary> CSIDL_COMMON_STARTUP = 0x0018, /// <summary> /// All Users\Desktop /// </summary> CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019, /// <summary> /// user name\Application Data /// </summary> CSIDL_APPDATA = 0x001a, /// <summary> /// user name\PrintHood /// </summary> CSIDL_PRINTHOOD = 0x001b, /// <summary> /// user name\Local Settings\Applicaiton Data (non roaming) /// </summary> CSIDL_LOCAL_APPDATA = 0x001c, /// <summary> /// non localized startup /// </summary> CSIDL_ALTSTARTUP = 0x001d, /// <summary> /// non localized common startup /// </summary> CSIDL_COMMON_ALTSTARTUP = 0x001e, CSIDL_COMMON_FAVORITES = 0x001f, CSIDL_INTERNET_CACHE = 0x0020, CSIDL_COOKIES = 0x0021, CSIDL_HISTORY = 0x0022, /// <summary> /// All Users\Application Data /// </summary> CSIDL_COMMON_APPDATA = 0x0023, /// <summary> /// GetWindowsDirectory() /// </summary> CSIDL_WINDOWS = 0x0024, /// <summary> /// GetSystemDirectory() /// </summary> CSIDL_SYSTEM = 0x0025, /// <summary> /// C:\Program Files /// </summary> CSIDL_PROGRAM_FILES = 0x0026, /// <summary> /// C:\Program Files\My Pictures /// </summary> CSIDL_MYPICTURES = 0x0027, /// <summary> /// USERPROFILE /// </summary> CSIDL_PROFILE = 0x0028, /// <summary> /// x86 system directory on RISC /// </summary> CSIDL_SYSTEMX86 = 0x0029, /// <summary> /// x86 C:\Program Files on RISC /// </summary> CSIDL_PROGRAM_FILESX86 = 0x002a, /// <summary> /// C:\Program Files\Common /// </summary> CSIDL_PROGRAM_FILES_COMMON = 0x002b, /// <summary> /// x86 Program Files\Common on RISC /// </summary> CSIDL_PROGRAM_FILES_COMMONX86 = 0x002c, /// <summary> /// All Users\Templates /// </summary> CSIDL_COMMON_TEMPLATES = 0x002d, /// <summary> /// All Users\Documents /// </summary> CSIDL_COMMON_DOCUMENTS = 0x002e, /// <summary> /// All Users\Start Menu\Programs\Administrative Tools /// </summary> CSIDL_COMMON_ADMINTOOLS = 0x002f, /// <summary> /// user name\Start Menu\Programs\Administrative Tools /// </summary> CSIDL_ADMINTOOLS = 0x0030, /// <summary> /// Network and Dial-up Connections /// </summary> CSIDL_CONNECTIONS = 0x0031, /// <summary> /// All Users\My Music /// </summary> CSIDL_COMMON_MUSIC = 0x0035, /// <summary> /// All Users\My Pictures /// </summary> CSIDL_COMMON_PICTURES = 0x0036, /// <summary> /// All Users\My Video /// </summary> CSIDL_COMMON_VIDEO = 0x0037, /// <summary> /// Resource Direcotry /// </summary> CSIDL_RESOURCES = 0x0038, /// <summary> /// Localized Resource Direcotry /// </summary> CSIDL_RESOURCES_LOCALIZED = 0x0039, /// <summary> /// Links to All Users OEM specific apps /// </summary> CSIDL_COMMON_OEM_LINKS = 0x003a, /// <summary> /// USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning /// </summary> CSIDL_CDBURN_AREA = 0x003b, /// <summary> /// Computers Near Me (computered from Workgroup membership) /// </summary> CSIDL_COMPUTERSNEARME = 0x003d, /// <summary> /// combine with CSIDL_ value to force folder creation in SHGetFolderPath() /// </summary> CSIDL_FLAG_CREATE = 0x8000, /// <summary> /// combine with CSIDL_ value to return an unverified folder path /// </summary> CSIDL_FLAG_DONT_VERIFY = 0x4000, /// <summary> /// combine with CSIDL_ value to insure non-alias versions of the pidl /// </summary> CSIDL_FLAG_NO_ALIAS = 0x1000, /// <summary> /// combine with CSIDL_ value to indicate per-user init (eg. upgrade) /// </summary> CSIDL_FLAG_PER_USER_INIT = 0x0800, /// <summary> /// mask for all possible /// </summary> CSIDL_FLAG_MASK = 0xFF00, } public enum SHGetFolderLocationReturnValues : uint { /// <summary> /// Success /// </summary> S_OK = 0x00000000, /// <summary> /// The CSIDL in nFolder is valid but the folder does not exist /// </summary> S_FALSE = 0x00000001, /// <summary> /// The CSIDL in nFolder is not valid /// </summary> E_INVALIDARG = 0x80070057 } public static IntPtr GetPidlFromFolderID(IntPtr hWnd, CSIDL Id) { IntPtr pIdl = IntPtr.Zero; SHGetFolderLocationReturnValues res = (SHGetFolderLocationReturnValues) SHGetSpecialFolderLocation( hWnd, Id, out pIdl); return (pIdl); } public Form1() { InitializeComponent(); SampleProc = new WindProc (SubclassWndProc); OldDefProc = GetWindowLong(this.Handle, GWL_WNDPROC); SetWindowLong(this.Handle, GWL_WNDPROC, Marshal.GetFunctionPointerForDelegate(SampleProc)/*SampleProc.Method.MethodHandle.Value.ToInt32()*/); //tagSHCHANGENOTIFYENTRY changeentry = new tagSHCHANGENOTIFYENTRY(); //changeentry.dwEventMask = (ulong)SHCNE.SHCNE_ALLEVENTS; //changeentry.fRecursive = true; //changeentry.WatchDir = null; //SHChangeNotifyRegister(this.Handle, ref changeentry); SHChangeNotifyEntry changeentry = new SHChangeNotifyEntry(); changeentry.pIdl = GetPidlFromFolderID(this.Handle, CSIDL.CSIDL_DESKTOP); changeentry.Recursively = true; try { uint notifyid = SHChangeNotifyRegister( this.Handle, SHCNF.SHCNF_TYPE | SHCNF.SHCNF_IDLIST, SHCNE.SHCNE_ALLEVENTS, WM_FILECHANGEINFO, 1, ref changeentry); } catch (Exception ee) { } i am failing in SHChangeNotifyRegister please help me.. tell me the reason why i am crashing..same code work fine for desktop.. please help Thanks.

    Read the article

  • Problems with registering click event listener to a frame-element

    - by distractedBySquirrels
    Hi everybody, I ran into a problem with adding an event listener. I wrote a Firefox plugin a while ago for my bachelor thesis. It was based on a different attacker model than you would normally expect. In this scenario the attacker was the service provider (like Facebook, Google,...), who reads all your private data stored on their site (via JS). My final solution was to temporally allow JS (while the page loads and after an user action occured). To observe the interaction I used event listener, which worked very well so far. But last week I noticed that my approach doesn't work with web sites which are using a frameset (I added the event listener to the body...). So I tried to add the listener to the frameset respectively to the frame. But the clicks are only noticed when you actually click on the frame... (eg resize the frame with your mouse) But I want to register clicks on the document loaded inside the frame. I already tried the .frameElement. Sadly it seems that Firefox doesn't like my (or, which is more likely, I'm too stuipd :) ) and claims there are no frames... Could anyone tell me how to add an event listener to the document inside a frame? The web site looks like this: <html> <head> <title>Frameset Test</title> </head> <frameset cols="150,*"> <frame src="nav.html" name="Navigation"> <frame src="main.html" name="Main"> </frameset> </html> This was my first bigger projekt with Mozilla so this could be a really dumb failure of mine... I hope you guys can help me. Thanks in advance. Sebastian

    Read the article

  • Question about registering COM server and Add Reference to it in a C# project

    - by smwikipedia
    I build a COM server in raw C++, here is the procedure: (1) write an IDL file to define the interface and library. (2) use msidl.exe to compile the IDL file to necessary .h, .c, .tlb files. (3) implement the COM server in C++ and build a .dll file. (4) add the following registry entris: [HKEY_CLASSES_ROOT\RawComCarLib.ComCar.1\CurVer] @="RawComCarLib.ComCar.1" ;CLSID [HKEY_CLASSES_ROOT\CLSID{6CC26343-167B-4CF2-9EDF-99368A62E91C}] @="RawComCarLib.ComCar.1" [HKEY_CLASSES_ROOT\CLSID{6CC26343-167B-4CF2-9EDF-99368A62E91C}\InprocServer32] @="D:\com\Project01.dll" [HKEY_CLASSES_ROOT\CLSID{6CC26343-167B-4CF2-9EDF-99368A62E91C}\ProgID] @="RawComCarLib.ComCar.1" [HKEY_CLASSES_ROOT\CLSID{6CC26343-167B-4CF2-9EDF-99368A62E91C}\TypeLib] @="{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}" ;TypeLib [HKEY_CLASSES_ROOT\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}] [HKEY_CLASSES_ROOT\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}\1.0] @="Car Server Type Lib" [HKEY_CLASSES_ROOT\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}\1.0\0] [HKEY_CLASSES_ROOT\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}\1.0\0\win32] @="D:\com\Project01.tlb" [HKEY_CLASSES_ROOT\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}\1.0\FLAGS] @="0" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib{E5C0EE8F-8806-4FE3-BC0E-3A56CFB38BEE}\1.0\0\win32] @="C:\Windows\System32\msdatsrc.tlb" (5) I try to add reference to the COM by click the Add Reference in the C# project. (6) In the COM tab, I saw my "Car Server Type Lib", it's ok until now. I try to use the Object Browser to browse my COM lib, but the Visual Studio said "the following components could not be browsed", and I noticed that there's no new reference added to the list in the C# project Reference. I can use the tlbimp.exe to generate a interop.CarCom.dll, and then use the COM through this interop dll, but I want this interop assembly to be generated automatically when I just add reference to the COM. Could someone tell me what's wrong? Many thanks.

    Read the article

  • Registering custom webcontrol inside mvc view?

    - by kastermester
    I am in the middle of a project where I am migrating some code for a website from WebForms to MVC - unfortunatly there's not enough time to do it all at once, so I will have to do some... not so pretty solutions. I am though facing a problems with a custom control I have written that inherits from the standard GridView control namespace Controls { public class MyGridView : GridView { ... } } I have added to the web.config file as usual: <configuration> ... <system.web> ... <pages> ... <controls> ... <add tagPrefix="Xui" namespace="Controls"/> </controls> </pages> </system.web> </configuration> Then on the MVC View: <Xui:MyGridView ID="GridView1" runat="server" ...>...</Xui:MyGgridView> However I am getting a parser error stating that the control cannot be found. I am suspecting this has to do with the mix up of MVC and WebForms, however I am/was under the impression that such mixup should be possible, is there any kind of tweak for this? I realise this solution is far from ideal, however there's no time to "do the right thing". Thanks

    Read the article

  • Registering NUnit DynamicMock Instances in a UnityContainer

    - by Phil
    I'm somewhat new to Unity and dependency injection. I'm trying to write a unit test that goes something like this: [Test] public void Test() { UnityContainer container = new UnityContainer(); DynamicMock myMock = new DynamicMock(typeof(IMyInterface)); container.RegisterInstance(typeof(IMyInterface), myMock.MockInstance); //Error here // Continue unit test... } When this test executes, the container throws an ArgumentNullException inside the RegisterInstance method with the message Value cannot be null. Parameter name: assignmentValueType. The top line of the stack trace is at Microsoft.Practices.Unity.Utility.Guard.TypeIsAssignable(Type assignmentTargetType, Type assignmentValueType, String argumentName). Why can't I register a MockInstance with the UnityContainer, and how do I work around this?

    Read the article

  • Android: Registering ContextMenu for a Custom ListAdapter

    - by primal
    Hi, I made a custom list adapter extending the Base adapter. Each item in the list has an imagebutton, 2 textviews and a button. I tried to add the context menu to the list so as to display some options for an item in the list. registerForContextMenu(getListView()); I used a MenuInflater object to inflate the context menu xml file. But on clicking the items in the list nothing shows up or the usual highlighting of the item of list on click isn't shown. Is it that the context menu doesn't work for custom list views? Any help would be much appreciated. Regards, Primal

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >