.net

WinForms Chart Control autoscroll

Hello. I've got a bar's graphic in a chart control in my app. I've set the properties as this code shows: Chart1.ChartAreas("ChartArea1").AxisX.ScrollBar.Enabled = True Chart1.ChartAreas("ChartArea1").AxisX.IsLabelAutoFit = True Chart1.ChartAreas("ChartArea1").AxisX.ScaleView.Size = 40 I did that becaus I wanted to fix the columns wi...

How to add attachments to mailitem using Outlook late binding

I'm trying to create a mail item and add some attachments to it using late binding. I've already managed to create the mail item, but I cannot invoke the Attachments property. object objApp; object objEmail; Type objClassType = Type.GetTypeFromProgID("Outlook.Application"); objApp = Activator.CreateInstance(objClassType); // Microsoft...

A general question on model-view-presenter (C#), should the model know the presenter?

I have a MVP (passive view) setup, and it is going quite well. I recently read Martin Fowlers description of this (http://martinfowler.com/eaaDev/PassiveScreen.html) and he writes "Another advantage that Passive View is a very explicit mechanism. There's very little reliance on Observer mechanisms or declarative mappings." In my MVP I h...

How to persist/store values at runtime.

I have a scenario which is as follows:- A form containing 2 grids. The grid on the left contains a list of groups. When a group is selected the grid on the right populates with another list with check boxes. I would like to be able to select group A and select some random check boxes and then switch to group B and select some other che...

How to generate custom Nunit Report?

Hi All, I am posting this query with lot of hope. I have created a framework using Selenium RC with C#,Nunit and NANT. and Implement Nunit2Report for converting XML report output from Nunit to HTML format. But the HTML report are not clear as we used to get using TestNG and LoggingSelenium (Selenium Java Framework). My Query: ...

Custom Assymetric Cryptography Algorithm.

Hi everyone. I want to use an asymmetric cryptography algorithm, but i need it have short Key Size(not like RSA which is at least 384). I need it to be about around 20. Is it possible ? ...

Idea for this view the list item horizontally in asp.net page.

i need to display the list one by one in the same line. It mean instead of binding the value in the row i need bind it in new column first row value. Is that any control available to view the item horizontally . i have my data in data table. ...

Socket/threading problem: The Undo operation encountered a context that is different from what was applied in the corresponding Set operation

Hi, I'm having problems with the above much asked-about error. We have a TCP/IP server application which has been working fine for some years. I now need to allow the application to accept connections from directly connected USB devices, by internally using a socket connection to patch through to localhost (127.0.0.1) within the server...

Is there any data binding support for MonoTouch?

I am thinking about how an application can be written to work on both Windows 7 Phone and IPhone, one option is to use MonoTouch and structure the app with MVVM, then only the views will need to be different between the platforms. However MonoTouch does not seem to support data binding. When (if) data binding support is added to Mon...

Elmah add message to error logged through call to Raise(e)

I'm a bit confused at how to add a message to an error logged programatically with ELMAH. eg: public ActionResult DoSomething(int id) { try { ... } catch (Exception e) { // I want to include the 'id' param value here, and maybe some // other stuff, but how? ErrorSignal.FromCurrentContext().Raise(e);...

C# Problem authenticating webservice between two webapplications

I'm working on a webapplication which runs central at a company. This webapplication needs to make a call to a service which is part of a second webapplication. In the central webapplication i have this piece of code; var clientUri = "http://website.localhost/Services/Info.svc/account"; var uri = new Uri(clientUri); var networkCredenti...

IDisposable implementation for the class which holds threads

Good morning! Let's assume we have the following class: class MultithreadOperation : IDisposable { private IList<Thread> operationThreads; public void StartOperation() { // Initialize and start threads and put them to operationThreads } public void StopOperation() { // Aborts each thread. ...

Difference between .NET Web Service & Web Service Application (NOT Web-Application OR WCF Service App)

Can anyone point me in the direction of resources that explain the difference between the two? They appear to do the same thing but are implemented in a different way.. e.g. web service application compiles to dll and global.asax.vb compiles into the app, rather than being treated in the same way as a normal web service. Edit: web-serv...

Do I need to restore the Graphics state after painting in my OnPaint override (for a .NET Control)

Consider the following overriden OnPaint method for a .NET Control: protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.RotateTransform(180); // lots of drawing code } Is it a problem that I do not restore the state of the e.Graphics object when I am finished? In Java this is often done by making...

.NET 3.5: anonymous delegate for handlers with ref params

I have public delegate void DocumentCompleteEventHandler(object pDisp, ref object URL) Can i use lambda expression such as : ie.DocumentComplete += (o, e) => { }; It expression doesn't work. How should i change it for using in code? Is it possible? ...

How to call Assembly.Load(Bytes[]) in SL 4 app?

I'm trying to use Assembly.Load(Byte[]) in a Silverlight 4 app and i'm getting MethodAccessException. As far as I understand that's because my app code is Transparent and this method is Critical. Is there any SafeCritical API to load assembly from byte array? Then I want to create an instance of type (SL app doesn't have a compile time ...

Adding user permissions that may not yet exist depending on Active Directory

Hi, I'm using .NET to automatically create a user in Active Directory, afterwards I'm using WMI to execute shell commands on another server in the network to create a directory and set its permissions (with cacls) to grant the new user full access to this directory and it works. However, LDAP is running on two servers in the network and ...

Need a library for creating binary Excel files from ASP.NET anyone know a good one?

Preferably free if possible. I've tried using xml / html formats but I'm running into a problem where by excel prompts the user with a security warning because the content does not match the MIME type (the sheet is downloaded on the web), no way around this it seems. ...

Getting file version info in the Compact Framework

I have some code that needs to be able to find the version number of an assembly, given a string saying where it's located. I can't get this to work: Assembly assembly = Assembly.LoadFrom("\\Program Files\\Microsoft SQL Server Compact Edition\\v3.5\\sqlcecompact35.dll"); throws a System.IO.IOException: File or assembly name '\Progra...

Design pattern: Which one to choose?

First of all this is all just concept, I have no actual programming done yet. This is the situation: I have a Class A which uses the Filesystemwatcher to watch for changes in a folder. (using events) Then I have a 'Collection Class' B which has a List of A's. Now what I want to happen is as follows, A Change happens with the folder, ...