I just need a quick answer to this question. If I have a custom class that implements IDisposable, in my void Dispose(){}; function whats supposed to go in there? Do I null all the resources I am using? Any help would be appreciated.
daviiie
Posts
-
Trouble understanding IDisposable -
Hashsets and objects...Ahh yes wasn't entirely clear sorry. Basically I want to do an intersect but only on object properties but retaining the original objects. Either that or can you suggest an a better way to extract objects from a hashset based on criterium? I'm looking to use hashsets better performance to reference objects in memory. Lists and Dictionarys arent doing it for me.
-
Hashsets and objects...Hi all, I want to populate a Hashset with a series of objects then perfom operations such as intersects and excepts but not on the objects contained within the hashset as a whole, rather a peroperty of the object. So for example: Hashset allPeople = new Hashset(){ new Person { name="Tom", age=22, eyeColour="blue" }, new Person { name="James", age=32, eyeColour="brown" }, new Person { name="Mark", age=25, eyeColour="brown" } }; A hashet of "Person" objects that I then wish to compare against another hashset. The catch is though that I dont want the objects to have to be the same. So another hashset: Hashset brownEyedPeople = new Hashset(){ new Person { name="Jake", age=35, eyeColour="brown" }, new Person { name="Sam", age=44, eyeColour="brown" } }; I then want to do an intersect so "allPeople.Intersect(brownEyedPeople)" but only on the property "eyeColour". So effectively it would remove James and Mark from the first hashset. I hope that all made sense, I've been trying to find examples but havent been able to yet. Cheers.
-
HttpPostedFileBase and locking...Hi all, Ok this is the problem. I am using the microsoft MVC web framework to build a web app. I have a method that uploads files to the server by retriving the HttpPostedFileBase files from the HttpFileCollectionBase in the Request. I then invoke the HttpPostedFileBase method SaveAs(path) to save those files to the filesystem. I have just implemented a Remove method that takes the filename and path, ensures the existence of the file by calling File.Exists() then attempting to call File.Delete() to remove the said file. The problem is when I have just uploaded this file, when I go then to delete it right away I get a "The process cannot access the file 'C:\....\file.jpg' because it is being used by another process." Now I suspect that that HttpPostedFileBase method SaveAs() has locked that file and not released it. But I am not 100% sure. My only other suspision is that the actual page view method goes and does a: DirectoryInfo info = new DirectoryInfo(imagesPath.ToString()); FileInfo[] files = info.GetFiles(); In order to retrieve all the files located in that directory. One of the two of these is locking that file. I am more inclined to believe its the SaveAs() method as the remove works intermittently and if it were the page view I'd expect it not to work ever. Does anyone know anything about this, I have been googling away like mad trying to find out how to get HttpPostedFileBase to release the file its just saved with no avail. Cheers.
-
Interesting Project?Hi Colin, I suppose I should have been more specific. By fun and interesting I would consider projects that use funky data structures or algorithms. I like stuff thats a little bit out of the box. I recently, just for the fun of it, developed an swi-prolog web service (the web service was already pre-written by swi, i'm not that good) to query a topic map database structure to dynamically assert facts which can in turn be queried by prolog and dumped out as xml which is picked up by a flex front end and displayed. I will eventually get around to making some kind of simple natural language processor and inference engine type thing and get it hosted. As fun as that was though I consider it something that would be seen as a "hobbyist" computing activity that although would be an interesting thing to display at an interview isn't really that relevant when it comes to c# .net jobs. I'd like something that utalizes c# in perhaps an unusual way, or to write a tool that perhaps would be very useful to other developers. A dll that I could open source and say "you know that thing that always annoys you when you program, well I've done something that sidesteps it...enjoy". I was thinking perhaps about some sort of encoding library because I am always running into problems with encodings and have yet to find something that makes my life easier. Nice website by the way, I am a fellow Glasweigien although I don't currently live in the uk.
-
Interesting Project?Hey all, I am a relatively new programmer. Worked in the industry for about a year and a half as a junior and obviously college and uni before that. I am looking for something fun to do, but also something that I could possibly display to other prospective employers, maybe something that could be of use for the development community. Does anyone have any ideas of what I could write in c# that would.. 1. Be quite fun to develop 2. Be interesting an unusual that I could maybe blog about 3. Help me to learn more about fundamental processes and practices I am basically a bit fed up with the usual run of the mill development I do here and am looking for a project that I could turn around to someone and say "hey, I did that". Any idea's would be welcome. Cheers.
-
Cross development platform form embedding.Could someone point me at the risks of embedding forms from one development invironment into other development environments? For example writing an application in python and embedding it into a windows application or vice versa and the two apps have to communicate with each other. I have been tasked with writing a windows app with a composite Gui which will have a COM facade and then have it embedded into an Omnis Studio form. For those of you unfamiliar with Omnis Studio think of Visual Studio on acid. What are the dangers of writing an application in C# then embedding it onto another development platforms form?
-
Help needed to end the madness.All, I am a junior developer at a company and I have been given a rather unusual task. We have 2 development environments, one is C# .Net 2.0 and the other is called Omnis Studio. For those of you not familiar with Omnis Studio just imagine Visual Studio on acid. Now all of my companies legacy systems are written in omnis studio and we want to get away from that development tool. But the system that is written is a rather monolithic monstrosity that cannot be easily broken out. We have identified a system that we want to replace within it and are about to use a .Net library with a COM facade so that omnis studio can work with it. The plan being that if we slowly replace enough then it will be more .Net than omnis and we can wholesale change it. This is where the problem comes in. My manager wants me to write a GUI application which we then embed in an omnis form. Now I think this idea is mental and that it will end horribly. What I would like are the thoughts and oppinions of this board in regards to cross platform form embedding. What I want is to write a simple data object with a COM facade and slowly replace the middle of the system so that Omnis will merely be a GUI interface which at an appropriate time we can peel off and replace with a .Net gui. I feel that if we get into the form embedding business that we will end up with frankenstein's monster patchwork quilt of a system where when we finally decide to peel away omnis we will have a set of independant GUI's that will be as bad as what they replaced. If people could give their thoughts on this matter I would be greatfull and any links to resources that would be helpful. To clarify my position it would be like embedding a delphi form in .Net, or a python form in ruby. I don't really see the need as the origional system already has forms and buttons and should only interface with a middle tier data objects. Thanks in advance for any help.
-
ImageButton Transparency.........I have an image button on my form. But the problem is the button is round, but the button is square. So I want a round button on an imagebutton, where the white around the sides doens't show up. Much like if you make it non-opaque in a graphics package, i.e. it just disregards any white as being not there. Can anyone help?
-
Retriving variables............Right I have a flash interface, and I need to pass a variable from flash to asp.net in order to set a variable that is important to the running of my web page. here is my action script ****************************************** btn_1.onRelease = function(){ PosId = "First"; getURL("WebForm2.aspx", "_self", "POST"); }; ****************************************** Now I need to know how to retieve that vaiable in asp.net. I have tried using, Dim Pos As String Pos = Request.QueryString("PosId") But this doesn't work, any help would be appreciated.
-
Updating to databaseI have no idea what your talking about. "the problem is how to write the code to update the data on the page" Cant you put it in the code in the: Private Sub DropDownList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList.SelectedIndexChanged ?????
-
Saudis to short live ...(excuse my english)I once read a statistic that the entire arab world produces less (in terms of inductry) than norway. Once the oil runs out I doubt very much whether anyone will have any real interest in the middle east, its a hole of a place anyway. Oil is the only thing it has going for it. As for chernobyl, that was just the ruski's spoiling it for the rest of us. If it hadn't been for their sub standard working practices then nuclear power wouldn't have gotten such a bad name.
-
Does anyone know......How to pass variables from Flash to Asp.net? I am stuck.
-
Asp.net and Flash Variables...........I have made a flash interface that opens web pages I have created in asp.net. The problem I have is that my whole site basically needs session variables to run, and these variables are decided on the opening page, which is now Flash, depending on the users selection. So I know that Flash variables can be sent using POST. But how do I retrieve these variables through Asp.Net/VB.net? Thanks.
-
Dynamically changing Flash Movies.......I figured it out by myself, finally!!! :-)
-
Dynamically changing Flash Movies.......Here is my code..... ********************************************************************* ********************************************************************* Now when I try to change the 'URL="Banner.swf"' to 'URL="Banner2.swf"' during runtime using the 'Flash1.Attributes("URL") = "Banner2.swf"' code.....the webform goes starts up as normal, but the Flash Movie doesn't load, and the little status counter thing at the bottom starts as if the page is loading up, but nothing ever happens. It just hangs. Does anyone know why this is?
-
.NET Framework.........It's ok I found and fixed the problem. For reference the problem was.... In the .NET Framework 1.0, ASP.NET applications use the TEMP folder that is designated by the environment variables to store temporary files. In .NET Framework 1.1, ASP.NET applications use the profile folder for the local ASPNET account to write temporary files. This profile folder is C:\Documents and Settings\ServerName\ASPNET\TEMP. The ASPNET account has permissions to write to this folder.
-
.NET Framework.........I have just installed the .NET Framework 1.1 on my machine. But the web application I was developing can no longer access the database I have. I keep getting the error..... System.Data.OleDb.OleDbException: Unspecified error Now I know it has something or other to do with permissions. And Have been messing around with every option I can find but still it doesn't want to access it. Another strage thing it is doing, is I have a number of different .jpgs for the different webforms. And because when I upload it to my webhost it doesn't recognise the file path c:\webapplication....etc etc I simply store all the .jpgs in the root folders and just access it by Image1.jpg instead of having a path name. Right now one of my webforms beckground is blank, if I change it to Image4.Jpg it shows up, if I change it back to Image5.jpg it goes blank again, despite both files being in the root folder. Any help would be appreciated.
-
Dynamically change Flash movies.........What I have is a web page, that allows you to select 1 of 12 possible options. When one of these 12 options are selected I want the web form that it loads to dynamically choose a flash movie file based on the selection. Here is my code in HTML
-
Datagrid Formatting.......Anyone know alot about them? I am fed up with the information being displayed as one long row that stretches away off the screen. Is there a way of making it 2 columns or even three but with the same data in it obviously. Cheers