Jump to content
Xtreme .Net Talk

Wraith

Avatar/Signature
  • Posts

    80
  • Joined

  • Last visited

Wraith's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. MSDN - Basic Instincs - Deploying Assemblies You want a probing element that specifies the private bin path of your data folder.
  2. The problem is that you don't understand regular expressions well enough to realise that the leading / and trailing /i in the pattern you're trying to use are nonsense. I think they're sed syntax but i don't really think it matters particularly, they're clearly not helpful to you. I stongly suggest you not use regular expression until you have some idea how they work, they're complicated and often subtle and if you rely on them to work without knowing when they're likely to fail you're going to end up missing or corrupting information in the rest of your application sooner or later.
  3. Attributes are stored in the filesystem, they're metadata. If you mean properties then no there is no standard way of dealing with them.
  4. System.IO methods do not allow stream syntax and do not check for reserved names. If you want to do these things you have to do it yourself.
  5. Wraith

    Arrays

    It is the nature of single processor systems that only a single instruction can be executing at any one time. They take a very short amount of time so you can do lots of them together meaning that to slow moving things like people it can _look_ like there are multipe things happening at once. There aren't. One thing at a time on single processor systems, always. If you don't understand this then you need to, it is important and you're not going to use threading effectively or possibly even correctly until you do.
  6. What new way is this? I've the express editions and have installed the service packs and i can't see any new way of doing things.
  7. KeyedCollection Generic Class using System.Collections.ObjectModel; public class MyObjectNameKeyedCollection : KeyedCollection<string,MyObject> { protected override string GetKeyForItem(MyObject item) { if (item==null) { throw new ArgumenNullException("item","item is null"); } if (item.name==null) { throw new ArgumentException("item name is null","item") } if (item.name.Length==0) { throw new ArgumentException("item name is empty","item"); } return item.name } }
  8. If you wanted to use the hashcode like that you'd need to override GetHashcode() and return a value derived from the content of the class rather than a strict identity value as it is now. It is inadvisible to alter the hashcode of something during it's lifetime, the same object should always return the same hashcode. Even if you decided to use this method i wanted to attack your application i'd just derive from your type and override hashcode to return the initial value which i'd save as a new field. Using Protected Private and Internal accessibility declarations as well as possible wrapper and immutable classes is probably your best approach.
  9. Why are you using regex to do the path manipulation? Seriuosly considering using the Path static methods instead, if (Path.IsRooted(foo)) foo=Path.GetFileName(foo); for example. Similarly if you want to create a new path with the application current directory and the filename you should use Path.Combine() instead of manually glueing bits of strings together. You're making a component, which i'm going to assume really means you're deriving from Component (or Control or Form or some other class which either inherits from Component or implements IComponent) so instead of using the .Site property which can be null without first checking it (which can cause a NullReferenceException) why don't you just use the DesignMode Property which won't require you to use expcetion in flow control logic and will simply return a boolean value you can use to determine design mode status or not.
  10. You don't need 2.0 to get a simple case insensitive hashtable, System.Collection.Specialized.CollectionUtils.CreateCaseInsensitiveHashtable() does exactly that for you and has been present since 1.0. If you are using 2.0 and you want a case insensitive string comparer it makes sense to use System.StringComparer.InvariantCultureIgnoreCase or System.StringComparer.CurrentCultureIgnoreCase rather than going to the trouble of writing your own. If you want an IDictionary with ordered why not look at the OrderedDictionary class that was added in 2.0? its in System.Collection.Specialized. It has a constructor which takes only an IEqualityComparer as an argument and helpfully StringComparer (and all its various static fields since they are derived from StringComparer) all implement IEqualityComparer and IEqualityComparer<string>. That means all you have to do is import System and System.Collections.Specialized and you can have a class that does exactly what you want with: IDictionary variable = new OrderedDictionary(StringComparer.CurrentCultureIgnoreCase);
  11. I've been perplexed by this in the past. Mine is working now and i can't remember exactly which debugger options i had to change. I think you need to ToString() evaluation and JustMyCode enabled, give it a try.
  12. When you leave things in it yes. when you remove those items you'll find it strangely undeletable from the ide.
  13. The folder is a fake folder, its just some xml in the project file and can be easily removed simply by editing the project file in a text editor. The msbuild project syntax can let you do all sorts of things when you get started playing about with it
  14. Application.Exit() is the rude way of tearing down the application. It doesn't ask the currently running form(s) to close, it just yoinks the environment out from under them which is why your breakpoints aren't getting hit. If you've not noticed any problems then you're lucky and all the things that aren't getting disposed were only scoped to your application so when the process dies they're effectively dead. Form.Close(), it closes the form and if that is the MainForm of the Application the Application will cleanly shut down the messageloop and continue through Main which is normally empty. Think about it. You started the application by creating a form and telling the application object to start sending messages at it (this is what Application.Run does) so to shut it down politely the form should tell the application that its all finished now thanks and then go away. Doing it externally from Application.Exit() isn't the form telling the application its finished.
  15. A call to a virtual function should (and will) execute the most derived instance of the function present. So in your derived class the overriding function will be called unless you use some specific mechanism (the base keyword, or a direct typed reference to a base class in VB) If ot doesn't then theres something wrong with reality in your program. The behavior where the base version of a virtual function is called from a derived context without specific call to base is totally conter intuative and possible contrary to the runtime design. You expected the correct behavior. if this behavior isn't happening then there is something wrong. Make the base function abstract? afterall if its empty and virtual and inheritors are required to override then it pretty much already is abstract by agreement. Of course that means you'd need BaseClass ot be abstract which may or may not work for you. If you can repeatably make this weird behavior occur i'd like to see working code, inheritance doesn't work the way you say it seems to be and you shouldn't be able to do what you say you have.
×
×
  • Create New...