.net

Catching Click event of hyperlink on PDF in IFrame.

I'm loading pdf's into an iframe on my web page by setting the src of the iframe to the path of the pdf document. This works as I'd like for viewing the pdf. The problem is that some of the pdf's have hyperlinks in them to external websites which, when clicked, load the external website in my iframe. So my question is: is it possible t...

Unexpected System.__Canon with reflection

Breakdown "System.Reflection.TargetException: Object does not match target type." when calling MethodBase.Invoke within a derivate of RealProxy. Problem appeared suddenly and without any apparent reason in the svn commit logs or the server event logs. Scenario Windows Server 2008 R2 Standard, 64 bit Microsoft .NET Framework Version: 2.0...

Attacks on WPF applications

What attacks or security vulnerabilities are specific to WPF applications? To clarify, I'm not asking how to do SQL Injection on WPF apps, or what kind of crypto should I use, or... I'm also not specifically asking about flaws in the Framework, or in WPF itself, rather flaws that might manifest based on improper implementation. Very spec...

Where to place the timer in a mvvm project that polls a feed

I have a MVVM project that polls a feed every 10 seconds to see for updates. The result from the feed is displayed using a ObervableCollection. This works nice, but Im unsure as to where I can put my dispatchedtimer. Should it be in the Model.DataService or in the ViewModel.MainViewModel? thanks ...

how to run one .msi under parent msi, It throws error "Another installation is in progress..."

hi I have created custom action dll file with embedded resource as SQL Server Compact Edition msi...this dll is assigned as a custom action in setup project ..but when i run setup msi it will throws error saying that another installation is in progress... I tried process.waitforExit(3000) options in code but still couldnt find solution?...

Lazy load with MEF ?

Take a look at this code : public class Program { [import]IMain Main {get; set;} ... private Compose() {...} } internal interface IMain { ... } [Export(typeof(IMain)] public class Main : IMain { [import] Interace1 Object1 {get;set;} [import] Interace2 Object2 {get;set;} } ... I want to lazy load Object2 after the compositio...

F#+.Net, calculation error using the System.Math.Floor function

Hi everybody, here's a function I wrote to print every digit of a float number in F#: let rec TestFloor (fnum:float) = let floor = System.Math.Floor(fnum) printfn "fnum:%f floor:%f" fnum floor if floor > 0.0 then TestFloor((fnum - floor) * 10.0) Anyway the result is strange, for example: > TestFloor 1.23;; fnum:1.230000 f...

What's the best way to manage SQLite connections in Windows from a .NET application?

I'm using SQLite in Windows from a .NET app. The .NET app is using the Open Source System.Data.SQLite library. In my app, there are many threads accessing the same database. Is it best to: Create and destroy connections as needed (what's the maximum number I can have?) Create a long lived connection and use it from different threads...

How to tell that a reflected type is anonymous

Possible Duplicates: How to identify anonymous methods in System.Reflection Anonymous Types - Are there any distingushing characteristics? The CLR doesn't know an anonymous type from a 'normal' type - that's something the compiler handles. How am I supposed to tell that a type found during reflection is anonymous? public st...

Is it legal to make code decompiled from .Net libraries publicly available?

I am pretty sure that reverse-engineering\decompiling .Net libraries which have no protection methods to prevent this is legal (at least in the EU and US) using tools such as Reflector. This is something that I do from time-to-time myself e.g. when faced with particular bugs, or lack of API documentation. I am thinking of the .Net frame...

Creating separate handlers for different users - WCF chat

Hello I'm following this brilliant piece of article to dissect and understand chat using WCF. The logic is that when a user joins a chat an event handler is created for that particular user and is stored in a dictionary. lock (syncObj) { if (!checkIfPersonExists(person.Name) && person != null) { ...

Picture Box - Tool Tip Text ( .NET 2.0 - C# )

Is it possible to have a Tool Tip Text for a PictureBox. If so, please give me a solution. I am working in .NET 2.0 with C# ...

How to access ContextBoundObject object in IMessageSync.SyncProcessMessage method

Hi, is there a way to access object on which intercepted method was called inside custom IMessageSink? I would like to set some properties on that object that would scope only for duration of method call, manage them, dispose etc... public IMessage SyncProcessMessage(IMessage msg) { Preprocess(msg); IMessage returnMethod = m_n...

Distributing windows media player 11 with .net based application

I am developing a WPF based application using .NET 3.5 SP1, which required windows media player 11 to be installed on end user machine. For pain free installation I want that the setup should handle everything. Is there any redistributable package of WMP 11 is available? In other words, What is the best option to solve this problem? ...

Should I use .NET (System.Net.Mail) to batch send my web application's emails or SQL (msdb.sp_send_dbmail)?

Scenario: 1) My application is a .NET 3.5 C# web app and the database is SQL 2008. 2) Emails will be in the region of 100 to 1000 a day and are triggered by various web user interactions with the app. 3) Most emails will contain attachment(s) between 50KB and 5MB. Some emails will be HTML and some will be plain text. 4) All attachmen...

C# custom xml serialization

Hello StackOverflow! i need help, i have some data coming in xml, i want to make an object out of, do something with it, serialize it back and send it away... but it must be some sort of custom serialization. xml like: <Animals Ver="12" class="1" something="2"> <Dog Ver="12" class="2" something="17"> <Name> a </Name> ...

Differentiate senior from medior developers

How can I differentiate senior .NET developer from medior .NET developer on interview ? What is the baseline for senior? Any comments or examples would great for me. ...

Why is Main method private?

New console project template creates a Main method like this: class Program { static void Main(string[] args) { } } Why is it that neither the Main method nor the Program class need to be public? ...

NHibernate.MappingException: An association from the table table refers to an unmapped class: Int32

Hi, im starting whit Nhibernate and have managed to get a few examples working, but now the aplication im makin throws this exeption when Nhibernate load the configuration. NHibernate.MappingException: An association from the table TBL_MARCADAS refers to an unmapped class: Int32 at NHibernate.Cfg.Configuration.SecondPassCompileForeign...

Create hyperlinks in MVC Action Method

I have an action method returning a JsonResult in my controller: public JsonResult GetDetails() { var rows = //Linq-To-SQL //Linq-To-Entities var lifts = (from r in rows group r by new { r.LiftID, r.LiftDate } into g select new { ...