Search Results

Search found 17 results on 1 pages for 'pickels'.

Page 1/1 | 1 

  • Visual studio - precompile - dotless

    - by Pickels
    I wonder if there is a way to precompile *.less files(http://www.dotlesscss.com/) with visual studio. The site gives me a dotless.compiler.exe but I am not sure how to hook this up to visual studio. I am looking for a solution for both Webforms and Mvc. Friendly Greetings, Pickels

    Read the article

  • Asp.net Security: IIdentity.IsAuthenticated default implementation.

    - by Pickels
    Hello Stackoverflowers, I am writing my own custom Identity class which implements IIdentity. I don't need to change the default method IsAuthenticated but so now I was wondering how does the default IIdentity determines if it should return true or false? I thought to find the answer in the FormsAuthenticationTicket I am using but not sure if that is correct. Thanks in advance, Pickels

    Read the article

  • DotNetOpenAuth: Mock ClaimsResponse

    - by Pickels
    Hello, I was wondering how I can mock the ClaimseReponse class in DotNetOpenAuth? This is the class(remove a few properties): [Serializable] public sealed class ClaimsResponse : ExtensionBase, IClientScriptExtensionResponse, IExtensionMessage, IMessageWithEvents, IMessage { public static bool operator !=(ClaimsResponse one, ClaimsResponse other); public static bool operator ==(ClaimsResponse one, ClaimsResponse other); [MessagePart("email")] public string Email { get; set; } [MessagePart("fullname")] public string FullName { get; set; } public override bool Equals(object obj); public override int GetHashCode(); } This is what I tried: ClaimsResponse MockCR = new ClaimsResponse(); MockCR.Email = "[email protected]"; MockCR.FullName = "Mister T"; I get the following error: '...ClaimsResponse(string)' is inaccessible due to its protection level. Kind regards, Pickels

    Read the article

  • Asp.net: Replace GenericPrincipal

    - by Pickels
    Hello, I was wondering what the best way is to replace the genericPrincipal with my own CustomGenericPrincipal. At the moment I have something like this but I aint sure if it's correct. protected void Application_AuthenticateRequest(Object sender, EventArgs e) { HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName]; if (authCookie != null) { FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value); var identity = new CustomIdentity(authTicket); var principal = new CustomPrincipal(identity); Context.User = principal; } else { //Todo: check if this is correct var genericIdentity = new CustomGenericIdentity(); Context.User = new CustomPrincipal(genericIdentity); } } I need to replace it because I need a Principal that implements my ICustomPrincipal interface because I am doing the following with Ninject: Bind<ICustomPrincipal>().ToMethod(x => (ICustomPrincipal)HttpContext.Current.User) .InRequestScope(); So what's the best way to replace the GenericPrincipal? Thanks in advance, Pickels

    Read the article

  • Moq: Unable to cast to interface

    - by Pickels
    Hello, earlier today I asked this question. So since moq creates it's own class from an interface I wasn't able to cast it to a different class. So it got me wondering what if I created a ICustomPrincipal and tried to cast to that. This is how my mocks look: var MockHttpContext = new Mock<HttpContextBase>(); var MockPrincipal = new Mock<ICustomPrincipal>(); MockHttpContext.SetupGet(h => h.User).Returns(MockPrincipal.Object); In the method I am trying to test the follow code gives the error(again): var user = (ICustomPrincipal)httpContext.User; The error is the following: Unable to cast object of type 'IPrincipalProxy4081807111564298854aabfc890edcc8' to type 'MyProject.Web.ICustomPrincipal'. I guess I still need some practice with interfaces and moq but shouldn't I be able to cast the class that moq created back to ICustomPrincipal? I know httpContext.User returns an IPrincipal so maybe something gets lost there? Well if anybody can help me I would appreciate that. Pickels Edit: As requested the full code of the method I am testing. It's still not finished but this is what I have so far: public bool AuthorizeCore(HttpContextBase httpContext) { if (httpContext == null) { throw new ArgumentNullException("httpContext"); } var user = (ICustomPrincipal)httpContext.User; if (!user.Identity.IsAuthenticated) { return false; } return true; }

    Read the article

  • Sequential animations in Jquery

    - by Pickels
    I see a lot people struggling with this(me included). I guess it's mostly due to not perfectly knowing how Javascript scopes work. An image slideshow is a good example of this. So lets say you have series of images, the first one fades in = waits = fades out = next image. When I first created this I was already a little lost. I think the biggest problem for creating the basics is to keep it clean. I noticed working with callbacks can get uggly pretty fast. So to make it even more complicated most slideshows have control buttons. Next, previous, go to img, pause, ... I've been trying this for a while now and this is where I got: $(InitSlideshow); function InitSlideshow() { var img = $("img").hide(); var animate = { wait: undefined, start: function() { img.fadeIn(function() { animate.middle(); }); }, middle: function() { animate.wait = setTimeout(function() { animate.end(); }, 1000); }, end: function() { img.fadeOut(function() { animate.start(); }); }, stop: function() { img.stop(); clearTimeout(animate.wait); } }; $("#btStart").click(animate.start); $("#btStop").click(animate.stop); }; This code works(I think) but I wonder how other people deal with sequentials animations in Jquery? Tips and tricks are most welcome. So are links to good resources dealing with this issue. If this has been asked before I will delete this question. I didn't find a lot of info about this right away. I hope making this community wiki is correct as there is not one correct answer to my question. Kind regards, Pickels

    Read the article

  • Asp.net Mvc - Kigg: Maintain User object in HttpContext.Items between requests.

    - by Pickels
    Hallo, first I want to say that I hope this doesn't look like I am lazy but I have some trouble understanding a piece of code from the following project. http://kigg.codeplex.com/ I was going through the source code and I noticed something that would be usefull for my own little project I am making. In their BaseController they have the following code: private static readonly Type CurrentUserKey = typeof(IUser); public IUser CurrentUser { get { if (!string.IsNullOrEmpty(CurrentUserName)) { IUser user = HttpContext.Items[CurrentUserKey] as IUser; if (user == null) { user = AccountRepository.FindByClaim(CurrentUserName); if (user != null) { HttpContext.Items[CurrentUserKey] = user; } } return user; } return null; } } This isn't an exact copy of the code I adjusted it a little to my needs. This part of the code I still understand. They store their IUser in HttpContext.Items. I guess they do it so that they don't have to call the database eachtime they need the User object. The part that I don't understand is how they maintain this object in between requests. If I understand correctly the HttpContext.Items is a per request cache storage. So after some more digging I found the following code. internal static IDictionary<UnityPerWebRequestLifetimeManager, object> GetInstances(HttpContextBase httpContext) { IDictionary<UnityPerWebRequestLifetimeManager, object> instances; if (httpContext.Items.Contains(Key)) { instances = (IDictionary<UnityPerWebRequestLifetimeManager, object>) httpContext.Items[Key]; } else { lock (httpContext.Items) { if (httpContext.Items.Contains(Key)) { instances = (IDictionary<UnityPerWebRequestLifetimeManager, object>) httpContext.Items[Key]; } else { instances = new Dictionary<UnityPerWebRequestLifetimeManager, object>(); httpContext.Items.Add(Key, instances); } } } return instances; } This is the part where some magic happens that I don't understand. I think they use Unity to do some dependency injection on each request? In my project I am using Ninject and I am wondering how I can get the same result. I guess InRequestScope in Ninject is the same as UnityPerWebRequestLifetimeManager? I am also wondering which class/method they are binding to which interface? Since the HttpContext.Items get destroyed each request how do they prevent losing their user object? Anyway it's kinda a long question so I am gradefull for any push in the right direction. Kind regards, Pickels

    Read the article

  • Windows 2008 VPS always crashes when out of disk space

    - by Pickels
    Hello, I am renting a Windows server 2008 dc SP2 VPS for hosting my Asp.Net projects. Now for the second time this month my VPS ran out of disk space. The first time it was a log file that got to big and yesterday it was my mistake for uploading a website without noticing the lack of space on my VPS. Now the side effect this has is that my VPS corrupts some files when trying to write them. Last time it was Plesk that stopped working yesterday it was IIS. So I was wondering is this normal behavior? I called my service provider to ask if they could restore a back-up and to ask if this is normal and they ensured me it was. I am not trying to blame them and I know it's mostly my fault for not monitoring my VPS better or for not setting better defaults.

    Read the article

  • Jquery: Datalink - Data linking

    - by Pickels
    I was trying out the Jquery Data linking proposal from Microsoft and noticed something strange. My objects get this extra property and I was wondering what the reason for that is. I first thought it was a mistake I made but I noticed their demo page does the same thing This is the json result of my objects: [{ "propertyName":"ProductNamese", "controlType":"Text", "jQuery1274021322131":6 }, { "propertyName":"Price", "controlType":"Number", "jQuery1274021322131":9 }, { "propertyName":"Description", "controlType":"TextArea", "jQuery1274021322131":12 } ] The property I am talking about is "jQuery1274021322131".

    Read the article

  • Ninject: Abstract Class

    - by Pickels
    Hello, Do I need to do something different in an abstract class to get dependency injection working with Ninject? I have a base controller with the following code: public abstract class BaseController : Controller { public IAccountRepository AccountRepository { get; set; } } My module looks like this: public class WebDependencyModule : NinjectModule { public override void Load() { Bind<IAccountRepository>().To<AccountRepository>(); } } And this is my Global.asax: protected override void OnApplicationStarted() { Kernel.Load(new WebDependencyModule()); } protected override IKernel CreateKernel() { return new StandardKernel(); } It works when I decorate the IAccountRepository property with the [Inject] attribute. Thanks in advance.

    Read the article

  • Administrator account: Where, when and how?

    - by Pickels
    Where, when and how to insert/create the administrator account for a website? Here are a few ways I encountered in other websites/webapplication. Installation wizard: You see this a lot in blog software or forums. When you install the application it will ask you to create an administrator user. Private webapplication will most likely not have this. Installation file: A file you run to install your application. This file will create the administrator account for you. Configuration files: A configuration file that holds the credentials for the administrator account. Manually insert it into a database: Manually insert the administrator info into the database.

    Read the article

  • Javascript: 'this' changes when assigning a property?

    - by Pickels
    I know 'this' can be a problem when you don't understand Javascript well but this one got me a little puzzled. var ControlTypes = { TextBox: function () { console.log(this); this.Name = "TextBox"; console.log(this); } } ControlTypes.TextBox(); Firebug gives the following result: Object {} Object { Name="TextBox"} The first object is ControlTypes and the second one is Textbox. Could anybody explain the behavior behind this?

    Read the article

  • Update int array based on parent

    - by Pickels
    I have the following int[] in my database: '{0}' '{0,0}' '{0,0,0}' '{0,0,0,0}' This column is used to sort my tree data. Now when a parent updates it's order the children should also update. For example if the second record updates it's order to 1 it should result in the following. '{0}' '{0,1}' '{0,1,0}' '{0,1,0,0}' So I was wondering what the query would be to update record 3 and 4. In case it's not clear what I am asking leave a comment I can add additional information. Screenshot of my actual data:

    Read the article

1