Search Results

Search found 817 results on 33 pages for 'overriding'.

Page 12/33 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Should I forward the a call to .Equals onto .Equals<T>?

    - by Jaimal Chohan
    So, I've got you bog standard c# object, overriding Equalsand implementing IEquatable public override int GetHashCode() { return _name.GetHashCode(); } public override bool Equals(object obj) { return Equals(obj as Tag) } #region IEquatable<Tag> Members public bool Equals(Tag other) { if (other == null) return false; else return _name == other._name; } #endregion Now, for some reason, I used to think that forwarding the calls from Equals into Equals was bad, no idea why, perhaps I read it a long time ago, anyway I'd write separate (but logically same) code for each method. Now I think forwarding Equals to Equals is okay, for obvious reasons, but for the life me I can't remember why I thought it wasn't before. Any thoughts?

    Read the article

  • Good practices in screen states management?

    - by DevilWithin
    I wonder what are the best ways to organize different screens in a game? I am thinking of it like this: Inheriting a base State class, and overriding update and render methods, to handle the current screen. Then, under certain events a StateManager is able to activate another Screen State, and the game screen changes as only the current State is rendered. On the activation of a new screen, effects like fading could be added, and also the same goes for its deactivation. This way a flow of screen could be made. By saying when A ends, B starts, allowing for complex animations etc. Toughts?

    Read the article

  • Am I violating LSP if the condition can be checked?

    - by William
    This base class for some shapes I have in my game looks like this. Some of the shapes can be resized, some of them can not. private Shape shape; public virtual void SetSizeOfShape(int x, int y) { if (CanResize()){ shape.Width = x; shape.Height = y; } else { throw new Exception("You cannot resize this shape"); } } public virtual bool CanResize() { return true; } In a sub class of a shape that I don't ever want to resize I am overriding the CanResize() method so a piece of client code can check before calling the SetSizeOfShape() method. public override bool CanResize() { return false; } Here's how it might look in my client code: public void DoSomething(Shape s) { if(s.CanResize()){ s.SetSizeOfShape(50, 70); } } Is this violating LSP?

    Read the article

  • Full brightness and keyboard backligh at boot

    - by joelalmeidaptg
    I own an Asus N56VZ, and each time I start Ubuntu (13.10 and prior versions) my screen brightness and keyboard backlights reset their values to the max. Ubuntu doesn't save my settings on reboot. I was wondering if someone could help me with this? It is horrible when, at night, I turn on my computer - it is like looking directly to the sun, and it hurts my eyes. I tried googling and none of the pages I found actually helped. I think my issue might be grub-related. I have a dual-boot with Windows 8.1, so before I start my computer I see grub to choose my operating system. My screen starts at full brightness as soon as I reach grub. Maybe he is making the OS forget about my last values, overriding it with its? Does someone knows how to solve this? Thanks in advance :) PS: I'm using bumblebee with Nvidia driver 304, but this issue existed before I installed it.

    Read the article

  • Nitrogen [Apply] seems to be sent to background. Dual monitors, two wallpapers.

    - by schomper
    I'm trying to get two separate wallpapers for my two monitor set up. I've installed nitrogen which I heard is able to do this. However when I press apply in the nitrogen GUI nothing happens on my screens and the old wallpaper is left up. When I log out I can briefly see the wallpaper set up I designed with nitrogen but then it goes back to the old wallpaper. I feel like something is overriding the nitrogen settings. Any help with how to change this will be greatly appreciated. Thank you.

    Read the article

  • PowerShell - Parameter Value Tab Expansion for Enum types

    - by Adam Driscoll
    Is it possible to implement parameter value tab expansion for enum parameter types? Creating a binary cmdlet with parameter definition: [Parameter] public SomeEnum Type {get;set;} Is there some way to type: Add-MyThing -Type S<tab> To get: Add-MyThing -Type SomeEnumValue Where: public enum SomeEnum { SomeEnumValue, SomeEnumValue2 } I know it may be possible with overriding the TabExpansion function but I was wondering if there was something I could do within my cmdlet to expose this type of functionality.

    Read the article

  • Blackberry Menu from native blackberry application

    - by chrishawn
    I have an application that inserts an ApplicationMenuItem into the native blackberry contacts menu. I can get this to work just fine. Now my question is how would I change or remove that ApplicationMenuItem based on the contact that i am highlighted on? Would I need to use a GlobalEventListener? I assume overriding makeMenu can only be done for menus on my own screens and not the native contacts screen?

    Read the article

  • UIWebView links inactive

    - by user292781
    I have a webview that displays properly, however the links are entirely inactive. If I try to select a link the selection magnifying glass appears. I've tried overriding - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType but the method will not execute. The class extends UIViewController <UIWebViewDelegate>, and my view is located in a tabbar, but I'm fairly certain everything's connected properly. Any suggestions?

    Read the article

  • Can I use UIRefreshControl with UICollectionViewScrollDirectionHorizontal?

    - by Dan Abramov
    You can add UIRefreshControl to UICollectionView (or any UIScrollView for that matter) by adding it to collection's subviews: UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged]; [self.collectionView addSubview:refreshControl]; This doesn't work when collection view layout has UICollectionViewScrollDirectionHorizontal. I tried overriding layoutSubviews to put refresh control to the left, but it wouldn't track scrolling progress this way. Can I trick it into working with horizontal layouts?

    Read the article

  • UINavigationBar multi-line title

    - by benasher44
    Is there a straightforward way of overriding the titleView of the current navigation bar item in a navigation bar within a navigation controller? I've tried creating a new UIView and replacing the titleView property of topView with my own UIVIew with no success. Basically, I want a multi-line title for the navigation bar title. Any suggestions?

    Read the article

  • Filtering manager for django model, customized by user

    - by valya
    Hi there! I have a model, smth like this: class Action(models.Model): def can_be_applied(self, user): #whatever return True and I want to override its default Manager. But I don't know how to pass the current user variable to the manager, so I have to do smth like this: [act for act in Action.objects.all() if act.can_be_applied(current_user)] How do I get rid of it by just overriding the manager? Thanks.

    Read the article

  • Problem in RadDataPager Localization

    - by SSS
    I have to use localization for Telerik RadDataPager in silverlight. For this i have developed a class inheriting RadDataPager by overriding OnApplyBaseTemplate Method. but after using this custom class now error is coming for PageSize, Source, DisplayMode etc are not found in class, Please reply if someone has done localization in RadDataPager.

    Read the article

  • Java Finalize method call

    - by Rajesh Kumar J
    I need to find when finalized method called in the JVM. I Created a test Class which write into file when finalized method called by Overriding the protected finalize method It is not executing. Can anybody tell me the reason why it is not executing?? Thanks in Advance

    Read the article

  • WPF - TextBlock - Cannot override OnRender

    - by Nitin Chaudhari
    Hi, I am creating a custom control by deriving TextBlock, my intention is to do some custom rendering based on some dependency properties. However the OnRender method is sealed on TextBlock. Although I can get my work done by overriding OnRenderSizeChanged, this is not correct. Any ideas on how can i do it the right way? Thanks in advance.

    Read the article

  • Is it possible to override the default logging for Glassfish v3?

    - by kgrad
    Related to this question. It appears that Glassfish is exporting slf4j into my application and overriding my logging solution. Is it possible for me to override Glassfish's logging and have my own logging solution take precedence? After searching, I have only found ways to modify the log using logging.properties. I am not married to my current implementation, but I am interested in making it work. thanks.

    Read the article

  • In ASP.NET MVC, why wouldn't I tack on HandleError on a base controller and be done with it?

    - by Jiho Han
    Since HandleError is inherited by the derived Controllers, why wouldn't I just create (or have) a base controller, and apply HandleError on it so that any controllers that inherits from the base controller will automatically be handled as well? And then I would tack on overriding HandleError on controllers and individual actions. Can anyone think of any reason why I wouldn't want to apply HandleError to the base controller?

    Read the article

  • Setting style of ContextMenu on subitems

    - by thedesertfox
    I have created a custom style and template for MenuItem and ContextMenu, and for my first level, that works great, but whenever I add a SubMenu item, the style of that ContextMenu reverts back to the default style. How can I make sure that item uses my custom style? I've tried using the <;Style TargetType="ContextMenu" Key="{x:Type ContextMenu}" syntax as well, and it doesn't seem to be overriding it either.

    Read the article

  • How to toggle orientation lock in android?

    - by pixel
    I want to create checkbox in my preference Activity that allows user to toggle orientation change. In similar questions people write only about complete orientation lock (by overriding onConfigurationChanged method or adding configChanges in AndroidManifest.xml) or orientation enforcing ( by setRequestedOrientation ). Is there a way to toggle orientation lock?

    Read the article

  • Apache/PHP: error_log per Virtual Host?

    - by Michael Stum
    On one Linux Server running Apache and PHP 5, we got multiple Virtual Hosts with separate logfiles and everything. The only thing we cannot seem to separate between virtual hosts is the php error_log. Overriding this setting in the <Location> of the httpd.conf does not seem to do anything. Did I overlook something? Is there a way to have separate php error_logs for each Virtual Host?

    Read the article

  • Inheriting Web Part from both ICellProvider and ICellConsumer

    - by tyumener
    Hi there. What I'm trying to accomplish is to make a series of 3 web parts. One that acts as a provider, second - consumer of a first web part and at the same time a provider for a third web part, third web part - consumer of the second. When overriding the EnsureInterfaces Method the second parameter is InterfaceType and I'm able to enter InterfaceTypes.ICellConsumer OR InterfaceTypes.ICellConsumer. Is it possible to make the second web part act both as a provider and a consumer?

    Read the article

  • Is method hiding ever a good idea

    - by ScottS
    In C# the new keyword can be used to hide a base class method without overriding the base class method. I've never encountered a situation where hiding a method was the best choice available. Are there any situations where method hiding is the best choice?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >