.net

LINQ2SQL: How do I declare a member variable of type var?

I have a class like this public class foo { private void getThread() { var AllThreads = from sc in db.ScreenCycles join s in db.Screens on sc.ScreenID equals s.ScreenID select s; } } I want to make the AllThreads variable a class variable...

.Net 3.5 - Best way to communicate with another .Net Process?

Hello, I have a library that interacts with our phone system, ie, Hey phone, call this number for me. This library is used in one of our in house products. I would like to put this instead in a service, so that any of our in house products can send the service a message to place a phone call. So basically I want to communicate from a ...

webform or winform, how to choose?

What would be the normal way to decide which way to go? In my case, what if user-base was under 10 persons you have no control over CAS but can install the framework needed to import/export let say excel file/pdf would be intranet security is really important business logic is somehow complex ...

.NET interop in PowerBuilder

I'm looking for a way to do two-way communication between a PB object and a .NET (C#) object. In looking at Brad's .NET version of his GUI controls, I see how to give the .NET object a reference to the PB object. But in that example, it's cast as a PowerObject (basically). That C# code only calls TriggerEvent() on the PB object. I want ...

PropertyGrid in Java Swing

Does Java Swing have a control similar to the PropertyGrid in .NET? if so, which one is it? Or at least which one comes closest to it? Thanks! ...

How to List All Locations in MapPoint 2009 within a PlaceCategory using .NET (C# or VB.NET)?

I have MapPoint 2009 installed and added a reference to the "Microsoft MapPoint 16.0 Object Library (North America)" COM component to my C# project. If I do the following, I can get a list of all the "places" within a specific city: var m = new MapPoint.Application(); var map = m.ActiveMap; MapPoint.FindResults r = map.FindPlaceResults...

How To Improve Browser Detection with Request.Context.Browser Object?

I'm using an HTTP handler in .NET 2.0 and need to detect browser and version. How do I implement Ocean's Browsercaps in .NET 2.0? ...

.Net multiple event handlers per an event that returns a value

If I have an event whose handler returns a bool, what happens if I attach multiple events?? see this example public class MyClass { public delegate bool MyEventHandler(object sender, EventArgs e); public event MyEventHandler Submit; public void DoSubmissions() { if (Submit != null && Submit(this, null)) { Console.Write("HOO...

Standard Thread safe .Net Dictionary

MSDN points out that mutating access to the .NET Dictionary<K,V> type is not thread safe. Is there a standard thread safe version? Note: "No there is not" is a valid answer if it is true. In that cases (and it seem to be) I'll go off and do the lock thing. Almost Duplicate What’s the best way of implementing a thread-safe Dictionary...

WPF hide MenuItem on ContextMenu based on object property

I need to programatically show/hide a MenuItem, what would be the best way to do this? ...

Working with a hashtable of unknown but similar objects (C#)

I have a hash table which can contain any number of objects. All of these objects implement some similar methods / properties and some of their own. For example all objects in the hashtable may have a method called PrintText taking a single parameter of type string. All the objects are however instantiated from different classes. Is it...

What is a good Fax Server to use?

Any recommendation of a Fax server to use in Windows? Looking for good API support for incoming faxes. (Lots of them are good for outgoing). I want to route incoming faxes to email programmatically after the server gets the fax and set Whitelist of phone numbers to filter spam - all in code. ...

Which languages have been implemented on the Common Language Runtime?

Does anyone know of a comprehensive list of languages that target the .NET Common Language Runtime? I'm interested specifically in Windows implementations but if there is a list that includes CLI languages on other platforms (Mono, etc) then that's helpful, too. I just can't seem to uncover this information in Google. ...

Using wcf to expose SyndicationFeedFormatter OR IList<SyndicationItem>

I would like to expose a SyndicationFeedFormatter with wcf and basicHttpBinding. I continue to get errors like that shown below. I have included the interface/class and the web.config wcf configuration. I have tried to expose SyndicationFeedFormatter as well as IList but am unable to get past the following error. Has anyone been able...

Why does WPF support binding to properties of an object, but not fields?

I've got a WCF service that passes around status updates via a struct like so: [DataContract] public struct StatusInfo { [DataMember] public int Total; [DataMember] public string Authority; } ... public StatusInfo GetStatus() { ... } I expose a property in a ViewModel like this: public class ServiceViewModel : ViewModel { ...

Using MySql stored procedures for .NET Data Access Layer

Hi. I'm using .NET 2.0 and/or 3.5. Weird thing is, everytime I add a query, whether via TableAdapter or a plain query in a Dataset, using a MySQL stored procedure (whether be a select, update, insert, delete), the wizard doesn't finish (the dialog suddenly disappears, I'm back to designer mode and the query isn't added to the tableadap...

How can I use .NET to traverse the directory structure of a website?

Simple question. How can I use .NET to traverse the directory structure of a website? What I want to do is access a particular directory then scan through the files looking for .html files and then download them. I know to use WebClient.DownloadString() to copy the files, but how can I do the searching through the directories? ...

How to add list in ListBox?

Hello again; i need to show X,Y,Risk in ListBoxes. But i can not do it. public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List<TrainigSet> listtraining = new List<TrainigSet>(); TrainigSet tr = new TrainigSet(); ...

How to sort list type generic if more than one property?

I have a list-generic that has a property (class type). I need a sort method for Z parameters (TrainingSet): public override List<TrainingSet> CalculatedDistancesArray (List<TrainigSet> ts, double x, double y, int k) { for (int i =0; i < ts.Count; i++) { ts[i].Z = (Math.Sqrt(Math.Pow((ts[i].X - x), 2) ...

Localized region/country names in .NET

Is it possible to retrieve a localized name of a country in .NET? The RegionInfo class has only the EnglishName, DisplayName and NativeName - but it doesn't seem to be possible to get for example the local Danish name for "Austria" which is "Østrig". They will always return the English name, no matter which Culture or UICulture the thre...