.net

How to design User authentication for 2 servers

I need to authenticate a user from 2 servers. First, a user would be authenticated from Server A, on success, his AD (Active Directory) credentials would be authenticated to Server B (which is AD). Should, server A, send an OKAY signal to Server B (Active Directory) that server A has done with authentication and its okay. I am confused...

How do I substitute one value for a property in a LINQ query result for another value?

I have the following T-SQL that replaces blank values with '[Unknown]'. How can I achieve this in a LINQ to EF query? select distinct case when CostCentre = '' then '[Unknown]' else CostCentre end as CostCentre ...

having trouble returning this type in A Asynchronous WCF Service Call From Silverlight

I have a WCF Service. It returns the below type. I get the data in the first level but not any of the data in the nested lists... What could be my problem? using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace slCF2.Web { public class Customer { string _firstname; string...

Converting between WPF font size and "standard" font size

I've noticed in WPF, the default font size of 12 points is roughly equivalent to 9 points in "normal" applications (e.g. WordPad), 10 pt in WPF is roughly 7 pt standard, and when I try to match the default font size of 10 pt in WordPad in WPF, I've found 13 is the closest. First of all, why does WPF use such bizarre non-standard font si...

Tracking changes in complex object graph

I started to think about tracking changes in complex object graph in disconnected application. I have already found several solutions but I would like to know if there is any best practice or what solution do you use and why? I passed same question to MSDN forum but I received only single answer. I would like to have more answers to lear...

Mocking COM Interfaces using Rhino Mocks

I have a COM library that I have to reference in my app and I am trying to mock its interfaces. I am getting exceptions when I am doing this MockRepository.GenerateMock<IAmAComInterface>(); I don't get exceptions when I do this: MockRepository.GenerateDynamicMockWithRemoting<IAmAComInterface>(); but none of my expectations are verifyin...

How do you decide on the means of passing model data from asp.net mvc controllers to views?

There seem to be multiple means of passing model data from controllers in asp.net mvc to views. Its not clear to me if there's a recommended approach in the mvc v1 and v2 releases or if like most things in life, it depends. I've seen several approaches: Option 1 - Populate the controller's ViewData dixtionary in either an icky string-ba...

Trying to convert a xml file to an object

Heya all, I was wondering what your opinion about this would be. I'm trying to convert an xml file to a .net object. It's a xml file from the World of Warcraft armory. Here is an example. <?xml version="1.0" encoding="UTF-8"?> <baseStats> <strength attack="48" base="48" block="-1" effective="58"/> <agility armor="114" attack="-1" ba...

Adorners bleeding through

I have an expander defined as such; <Canvas Panel.ZIndex="99"> <Expander HorizontalAlignment="Left" VerticalAlignment="Top"> <StackPanel Background="White"> <TextBlock>Some Stuff in the Expander</TextBlock> </StackPanel> </Expander> </Canvas> This allows for the expander to draw over other content. The problem I'm having i...

Setting Connection string in dbml files using Linq to SQL in Visual Studio 2008

I have an application that works with a database "TestDB". At the time I was developing the application I was using linq to sql and adding my data tables by dragging and dropping to the TestDB.dbml file and probably .net automatically sets the connection string to the local sql server on my machine. The application is supposed to launch ...

API strategy of known .Net projects

I am writing an API for my application and have a few open questions (with versioning in mind). Should users call directly my objects or need I provide some abstraction? Should code that users wrote with version X of the API only work with version X or should it work also with the latest version? Initially I thought "abstraction" and...

Accessing REST WebService in VB.NET

I am trying to access a REST webservice, however my code doesn't work and keeps throwing a HTTP 401 error see this example screen cap from Wireshark of the initial ssl request: image link This is from a Curl call to the same web address with the same details. The issue is that under my VB.NET version the "Extension: server_name" (and ...

WPF's RichTextBox performance issues

WPF's RTB is terribly slow when working with any realistic amount of text. And by realistic amount, I mean what you'd expect any text editor to be able to handle (100kb? At least) without showing any signs of slowness. This expected RTB behavior is not the case for me. Actually, the control works pretty much like it should when text is ...

Inconsistent anti-aliasing in WPF 3.5

I am getting strange aliasing behaviour in a WPF app using FluidKit's ElementFlow control. We are using the control in an app at work for presenting content, and when the elements of the ElementFlow are tilted, the edges alias as per the following image: In order to avoid the aliasing, we decided to get rid of the tilt angle, so I crea...

.NET should I store references or values?

I need to store in my object which values have already been handlerd, I am doubting what would cost more performance, should I create an array that stores: The instance references (they are not structs, only ref classes) The hashcode of the items The name of the name of the properties (string) that have been handled Update my aim is ...

PostSharp 1.5 and .Net 4

Postsharp is great, but only the 1.5 version is still opensource. Does it work with .net 4.0? If not, are there any other good AOP weavers out there? I'm not interested in the proxy type. ...

server.transfer to other website url

Hi, I want server.transfer to transfer the control to a different website other than the one I am in currently. Is that possible. One way I thought of doing is to read the contents of that website and write in the response but would love to know if any other way to do so. My website is www.xyz.com/otherwebsite/forms/page.aspx So in ab...

How Can I Remove Items From A ListBox?

This code isn't working. It doesn't raise an exception or even do anything visible. private void RemoveSelectedFiles() { lstPhotos.Items.Remove(lstPhotos.SelectedItems); } How can I remove the selected items from a ListBox? ...

Can a VS project generate two execute files?

I want to develop a application including two execute files(one as main entry,the other as upgrader). I'm wondering if the two execute files can be generated in a VS project ? if can't,are there better way to develop the two execute files? and how to share some Model code? thanks in advance! ...

Using Response.Filter with Response.TransmitFile

I'm using Response.Filter in order to implement stream compression in accordance with HTTP Request Header Accept-Encoding Here's the important stuff: if (AcceptEncoding.Contains("deflate") || AcceptEncoding == "*") { HttpApp.Response.Filter = new DeflateStream(PreviousOutputStream, CompressionMode.Compress)...