Search Results

Search found 3 results on 1 pages for 'prutswonder'.

Page 1/1 | 1 

  • Etiquette for refactoring other people's sourcecode?

    - by Prutswonder
    Our team of software developers consists of a bunch of experienced programmers with a variety of programming styles and preferences. We do not have standards for everything, just the bare necessities to prevent total chaos. Recently, I bumped into some refactoring done by a colleague. My code looked somewhat like this: public Person CreateNewPerson(string firstName, string lastName) { var person = new Person() { FirstName = firstName, LastName = lastName }; return person; } Which was refactored to this: public Person CreateNewPerson (string firstName, string lastName) { Person person = new Person (); person.FirstName = firstName; person.LastName = lastName; return person; } Just because my colleague needed to update some other method in one of the classes I wrote, he also "refactored" the method above. For the record, he's one of those developers that despises syntactic sugar and uses a different bracket placement/identation scheme than the rest of us. My question is: What is the (C#) programmer's etiquette for refactoring other people's sourcecode (both semantic and syntactic)?

    Read the article

  • Capture reload/endrequest event after server redirect to download file

    - by Prutswonder
    Inside a webpage I have an Excel download button, which redirects to a webpage that serves the requested Excel file via the application/ms-excel MIME type, which usually results in a file download in the browser. In the webpage, I have the following jQuery code: $(document).ready(function () { $(".div-export .button").click(function () { setBusy(true); }); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () { setBusy(false); }); }); Which displays a busy animation while the user waits for the Excel file to be served. Problem is: The animation doesn't end (setBusy(false);) after the file download, because the endRequest event doesn't get fired, probably because of the server redirect. Does anyone have a workaround for this? Edit: The download button is handled in an UpdatePanel.

    Read the article

  • Flex fixed and variable height - can it be set in markup?

    - by Prutswonder
    I've got the following Flex application markup: <app:MyApplicationClass xmlns:app="*" width="100%" height="100%" layout="vertical" horizontalScrollPolicy="off" verticalScrollPolicy="off"> <mx:VBox id="idPageContainer" width="100%" height="100%" verticalGap="0" horizontalScrollPolicy="off" verticalScrollPolicy="off"> <mx:HBox id="idTopContainer" width="100%" height="28" horizontalGap="2"> (top menu stuff goes here) </mx:HBox> <mx:HBox id="idBottomContainer" width="100%" height="100%" verticalScrollPolicy="off" clipContent="false"> (page stuff goes here) </mx:HBox> </mx:VBox> </app:MyApplicationClass> When I run it, it displays top panel with a fixed height, and a bottom panel with variable height. I expect the bottom panel's height to contain the remaining height, but it somehow overflows off-page. The only way I found to fix this height issue (so far) is to programmatically set the height to be fixed instead of variable: <mx:HBox id="idBottomContainer" width="100%" height="700" verticalScrollPolicy="off" clipContent="false"> (page stuff goes here) </mx:HBox> And code-behind: package { import mx.containers.HBox; import mx.core.Application; import mx.events.ResizeEvent; // (...) public class MyApplicationClass extends Application { public var idBottomContainer:HBox; // (...) private function ON_CreationComplete (event:FlexEvent) : void { // (...) addEventListener(ResizeEvent.RESIZE, ON_Resize); } private function ON_Resize (event:Event) : void { idBottomContainer.height = this.height - idTopContainer.height; } } } But this solution is too "dirty" and I'm looking for a more elegant way. Does anyone know an alternative?

    Read the article

1