.net-3.5

Finding all classes with a particular attribute

I've got a .NET library in which I need to find all the classes which have a custom attribute I've defined on them, and I want to be able to find them on-the-fly when an application is using my library (ie - I don't want a config file somewhere which I state the assembly to look in and/ or the class names). I was looking at AppDomain.Cu...

Exposing Objects (DataContracts) that may not be directly used by a WCF service?

I have some object classes that use inheritance. It seems that I can only get access to the objects that are directly used by a service. Let me show you what I am trying to accomplish: [DataContract] public class Object1 { [DataMember] int Id {get; set;} } [DataContract] public class object2: Object1 { [DataMember] string N...

Floating child window in WPF

Hi, I want to create floating child window in .NET 3.0 WPF application. What I'm doing is: sideWindow = new SideWindow(this); sideWindow.Left = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - sideWindow.Width; sideWindow.Top = 125; sideWindow.WindowStartupLocation = WindowStartupLocation.Manual; sideWindow.Owner = this; sid...

Best way to wire up database-driven menu in ASP.NET MVC

I'm looking for a way to handle a database-driven menu in ASP.NET MVC that doesn't violate the MVC principles. I want to replace the hard-coded, default, "Home, About" menu with something from my database. How would I wire this up? Would I just set up a ContentPlaceHolder in my Site.Master and have regenerated in my Views? That does...

How to get UpdatePanel from causing whole page postback?

Hello, I am using .NET 3.5 and building pages inside of the Community Server 2008 framework. On one of the pages I am trying to get an UpdatePanel working. I took a sample straight from ASP.NET website, but for some reason when I try and perform the function - update a time in an UpdatePanel to current time by clicking a button. Here...

Finding controls inside nested master pages

I have a master page which is nested 2 levels. It has a master page, and that master page has a master page. When I stick controls in a ContentPlaceHolder with the name "bcr" - I have to find the controls like so: Label lblName =(Label)Master.Master.FindControl("bcr").FindControl("bcr").FindControl("Conditional1").FindControl("ctl03")...

Searching for a component in NET 3.5

Hello, I'm searching for a component similiar to this one(Delphi) in .NET 3.5 SP1 Thanks. ...

Storing DataRelation in xml?

Hi, I am designing a db application using a novel approach. (atleast novel to me... :) ) So I am doing some research for the same. I am using .NET 3.5 ADO.NET Datasets to work with data and store it offline in XML. First, is this approach any good for a serious (though a small db, 4-5 users, ~25 tables ~3-4k records in each) applicat...

Datasets and XML in place of proper db: Not a good idea?

In continuation of: http://stackoverflow.com/questions/729634/storing-datarelation-in-xml Thanks to everybody for answers to my earlier thread. However, could I ask the reason why everybody is not supporting this XML based approach? What exactly will be the problems? I can apply connstraints to dataset, and I can, I guess, also use tran...

PLINQ: Will Parallel Extensions automatically handle single and multi-core environments?

Will LINQ's parallel extensions automatically detect the number of cores and utilize them all? Conversely, if the code is run on a single core machine, will it still work or do I have to detect the number of cores and tell PLINQ how many to run across? Sadly, I don't have access to any single core machines to test my code on so I can...

Best .NET3.5 based strategy for creating disconnected db application.

Hi group: My requirements are: Relatively small database: 25-30 tables with 4-5k rows in each. 4-5 users with their own copies of local database on their laptops. Sync when needed or at the end of the day. Free solution, as am making this setup for a NFP ogranization. I have been researching various options in last few days. At last I ...

Winforms DataBind to Control's Visible Property

WinForms, .NetFramework 3.5 Are there any known issues when databinding to a control's visible property? The control is always NOT visible regardless of what my property is. Public ReadOnly Property IsRibbonCategory() As Boolean Get Return True End Get End Property I tried the control's text property and other properti...

How do I loop through all layers of Treeview nodes?

Read EDIT 2 first I am trying to set up some way to visually distinguish the nodes in a winform app. For example, alternating colors. Can some one start me down that path? Also, has anyone else had to do that before and how did you do it? Thanks EDIT I had seen the backcolor setting as well(Thank You) but I am having trouble gett...

How to convert Func<T, bool> to Predicate<T>?

Yes I've seen this but I couldn't find the answer to my specific question. Given a lambda testLambda that takes T and returns a boolean (I can make it either Predicate or Func that's up to me) I need to be able to use both List.FindIndex(testLambda) (takes a Predicate) and List.Where(testLambda) (takes a Func). Any ideas how to do b...

Using combobox properties in C# NET 3.5

Hello, I'd like to know how to set a combobox to be read only,meaning the user cannot write text into it,but just select? Another question,how to determinate the text of the selected choice.For example it has index of 4 values(10,20,30 and 40).If the user chooce 20,how can I get the Text of the choice he selected(Not the index number,b...

How can I tell if my form is displayed beyond the screen?

So I have two forms, mainform and extraform. extraform is set always moved to the right of mainform when mainform initializes Sometimes mainform takes up both monitors and extraform is pushed off the screen never to be seen again. I would like to prevent this if possible. How can I do so? It must support dual monitors, that may or may no...

How to import a net assembly

Hello, I downloaded zlib.NET and there's a file that I must import,its named "zlib.net.dll". My question is :How do I import that file so I can use it in C# Express 2008 like "System.zlib.etc"? Thanks. ...

Save file from a byte[] in C# NET 3.5

Hello, My TCP Client receives a image within a packet.The image is compressed with zlib.The task is to decompress the image and put it on the form. I'm planning to save the compressed image in the current directory,decompress it and load the decompressed file on the form. The first problem comes with saving the file(compressed).The zl...

Cannot Load C++ DLL in C#

Hello, >My previous thread< I created this one,because I installed WinXP on VMBox and I cannot get it working again. This time I created an OnLoad Event on my form if (LoadLibrary("blowfish.dll") == 0) { Misc.LogToFile("Could not load dll", true); Application.Exit(); } Runs fine on my...

Start another EXE in Managed Code

Is it possible to start another EXE in Managed Code? At this time, all I can do is use: System.Diagnostics.Process.Start(exeName) Is there another way to call another EXE within the same project? Thanks! JFV ...