.net

How to change Task Flag Color in Microsoft.Office.Interop.Outlook via C#?

Hi i am coding a project with "Microsoft.Office.Interop.Outlook". How can i change flag color according to task importance (High, Medium, Low). i want to change color task importance public class MyTecOutLookTasks : IOutLook<MyTasks> { public Microsoft.Office.Interop.Outlook.TaskItem oTask { get; set; } ...

What is the difference between var foo = new Love(); AND object foo = new Love(); ?

Hi, As I am not familiar with implicit typing; can you please tell me the main differences between: var foo = new Love(); AND object foo = new Love(); ...

Supporting artificial "casting" of generated .Net types

(I applogise in advance for the length of this post, however the problem is fairly complex - hopefully everything is clear however I have simplified the scenario a lot and so there is a good chance that I've missed a vital fact, or there is something that I've not explained.) Setting the scene I'm using code generation to generate C# w...

Error message comes ON IE when try to download file

Hi, On this page it generates a Excel sheet and allows user to download that. But as shown below it does not work properly on IE (both 7 & 8) this works fine with Firefox,chrome and safari. Is there any settings we can do on both client side or Server side. image location thank you ...

Checking what version of .NET is required to run my code

I am writing a code base in C#, and have had issues with test PC's not having the correct service pack of .NET 3.5 installed to run the code (the same issue as occuring here: http://stackoverflow.com/questions/475319/exception-is-occuring-only-on-my-machine-method-not-found-waithandle-waitonein). I am wondering if there is a static code...

Access my Views from bound ItemsControl

Hi! I have a typical MVVM scenario: I have an ItemsControl bound to an ObservableCollection of StepsViewModels. I define a DataTemplate so that StepViewModels are rendered as StepViews. The same happens in the StepView: I have an ItemsControl to an ObservableCollection of ParameterViewModels with a DataTemplate to render them as Paramete...

Why does MSBuild require explicitly setting the target platform?

For a simple project of mine, a release build in Visual Studio produces an assembly of size 18,944 bytes. But if I build the same solution from the command line with MSBuild, I get an assembly of size 28,672 bytes. That's a difference of 9,728 bytes. I am invoking MSBuild with: msbuild /p:Configuration=Release /t:Rebuild MySolution.sln...

IHttpModule handling sockets

I had assignment to implement some custom encryption scheme on IIS. I first checked out ISAPI filters, but found out that they are deprecated and SSL is no go, because of device limitation and I was unable to find low resource native encryption supported by IIS. I am playing whit HttpModules. So when I catch BeginRequest I store HttpAp...

Calling COM from .NET, is it an example of Adapter pattern?

If I write a code that calls COM component from .NET, is it an example of Adapter pattern? ...

Error "HRESULT E_FAIL has been returned from a call to a COM component" when adding a reference to a .Net 4 project in Visual Studio 2010

Hi, I get an Error "HRESULT E_FAIL has been returned from a call to a COM component" when adding a .dll reference to a project in Visual Studio 2010. The weird thing is, if I make a local copy of the .dll, and reference it locally it's fine. However, if I try and reference it from our shared resources server (\server\release\Common\Pa...

Recent search functionality

Hi, I am working on C#.Net windows application. Here i want to implement search functionality as like as Microsoft outlook 2007 instant search. This functionality have "Recent Searchs", i want to listout last 20 searchs. These 20 search items where i have to store(file/db) and how to bring . Thanks ...

When might Application_EndRequest not be called?

We have an ASMX web service hosted in IIS 6, and are seeing some strange behaviour with one of our WebMethods. After an iisreset, the first call to a particular method fails to return to the client, which times out after 60 seconds. I've introduced logging into Application_BeginRequest and Application_EndRequest in the Global.asax.cs fi...

Using reflection to change implementation

My boss regards himself as a OOP Guru where as I consider him as a hobbyist programmer. He handles our Sage development, adding custom requirements to our clients Sage installations. He recently has got very excited by reflection, he is reflecting on Sage's assemblies in code and changing private members and event handlers. I thought t...

Can Reflector reverse engineer a C++/CLI application

I want to build an application being able to use .Net classes. If I go for C# I know that some tools like Refactor is able to reverse engineer the code (until I don't pay very expensive tools capable of avoiding this). Do you know if the same applies when my application is developed in Visual C++ ( with /clr ). You can easily mix Manage...

Pattern for class instantiation from only one single place?

C# .Net 4.0 I'd like to know how I can have a class which can only be instantiated from one single place. An example: I've got a Provider class. This class exposes a method called GetData. When GetData is called, the Provider will instanciate a Data class, populate and return it. The Data class cannot be instanciated by anybody differe...

how to compress uploaded data using WebClient C#

I am using WebClient with C# the following code works fine wc = new WebClient(); wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); NameValueCollection nvc = new NameValueCollection(); nvc.Add("webdata", JsonConvert.SerializeObject(webdata)); response = wc.UploadValues(@"http://localhost/api/results", "PUT", nvc); Th...

db4o - ignore specific class property

Hi, Is there a way (meta property maybe) to tell db4o to simply ignore a specific property of a class? I can't see anywhere to do that.. For my purpose I have a bunch of data entity that i need to persist now and then. I also sometimes need to hold a ref to a UI element associated with it, but I don't want db4o to persist that elemen...

How I can dynamically create new TabItems with views and viewModels for a TabControl in Silverlight with the MVVM Light Toolkit?

Hello everybody, I’m a starter with Silverlight and the MVVM Light Toolkit and I don’t know how to proper solve the following scenario: I have the following views with their corresponding viewModels: MainView , the Deault Startpage TabControlView, view with a single Tabcontrol, placed on the MainView… AllBugsGridView, datagrid with...

How to get rid COM context error

Hi, Am working on a windows form application which uses interop to call a COM dll. I keep getting this error in the app method where the flow is like this: 1.Fetch about 7 records[R] from database 2.For each of this record,app instantiates a COM class using Interop and does some processing/calculation using the same. 3.Then the app fet...

NuSOAP PHP web service and .NET WebService reference - problem

Hello I have created a PHP SOAP WebService with NuSOAP. I add a WebReference from C# application. I enter the URL of the WSDL, I can see methods in the wizard but no proxy code is generated. When I do update web reference, I get error message box: The custom tool 'MSDiscoCodeGenerator' failed. Unable to import binding 'XXXSoapBinding' ...