.net

WCF & ASP.NET Membership Provider

I know for WCF to work with a membership provider you have to explicitly configure it: (e.g. http://www.codewrecks.com/blog/index.php/2009/09/08/use-aspnet-membership-provider-with-a-wcf-svc-service/) But if you already have the ASP.NET site using it, can't you prevent anonymous access to the service simply by doing the following? <l...

How can I retrieve a DataGridView from the clipboard? (It ends up being Null in clipboard).

I am unable to read a pasted datagridviewrow object from the clipboard. All I want to do is, when a user has the entire row selected and copied, I would paste that row into the clipboard as a DataObject. That works just fine but when I attempt to read that DataObject (after the user clicks Paste) the DataGridViewRow that's saved in the c...

O(1) hash look ups?

I ran across an assertion that HashSet<T>.Contains() is an O(1) operation. This surprised me since every discussion of hashing I've encountered mentions the possibility of collisions, potentially leading to O(n) run time. Being curious, I looked into documentation for HashSet<T>.Contains and also HashTable.Contains. The documentation ...

Is it possible to make real cross platform applications with Silverlight?

I really wanna do cross platform applications. I have great experience in .NET, so the only option is Silverlight. But it's not as powerful as WPF (yet). Is it possible to use WPF's controls like Menu & ToolBar? Is it possible to make real installers for Silverlight apps? (Not just out of browser install.) Is it really worth it, or s...

XElement.Value not reading multi-line data

I current have the following XML fragment that I'm parsing to read its values and display them on a web page: <root> <PostcardTitle>The Needles</PostcardTitle> <PostcardDescr>Granite Dells, Prescott</PostcardDescr> <PostcardImage> <img alt="GraniteDells" src="GraniteDells.jpg" /> </PostcardImage> <PostcardDate /> <Postca...

How to create DataTemplate with Links

Hi, I'm trying to create DataTemplates for a PropertyCollection (of PropertyDescriptors) to display the items in the collection in this format, descriptor1 > descriptor2 > descriptor3 > descriptor4 > descriptor5 Each descriptor would be a link (using Hyperlink), my question is can I do this with Labels (which is not an ItemsControl ho...

calculator in .net framwork

how to make a calculator in GUI (.NET) ...

MSN/Live Messenger Song with media player

How do i programically tell MSN/Live Messenger what song i am playing? I found this but that seems to be more about protocol and i just want to know how it works on a IPC level. ...

Creating objects using LINQ

I have an xml file that looks like this; <Employee> <EmployeeName>Burt Reynolds</EmployeeName> <EmployeeTitle>Bad Ass</EmployeeTitle> <EmployeeStory> <EmployeeStoryHeaderParagraph> <EmployeeHeader>Employee Header 1</EmployeeHeader> <EmployeeParagraphs> <EmployeeParagraph>Employe...

RESTful web services

I am new to RESTful web services. We are taking the REST route for building our public web services to be consumed by out clients.And i had a few questions. Are there any kind of limitation with pure REST webs services? and if yes then would a hybrid REST web service take care of those limitations? I am thinking about using SSL + Hash...

copy struct which contains another struct

struct is a value type in C#. when we assign a struct to another struct variable, it will copy the values. how about if that struct contains another struct? It will automatically copy the values of the inner struct? ...

What is WCF? and what can it do?

I looked up WCF and i cant exactly figured out what it is. I found this page and it seems to be a way for an app to allow other applications to call functions. Sort of loading a DLL and calling functions but using TCP instead and not loading a DLL but forcing a user to run an app. I am still confused about it. Can someone explain what i...

What shell cmd to launch directory in MAC OS X

What shell command can i use to launch/open a folder in mac os x? I will be executing it in .NET ...

How GC cleanup the struct?

I think the GC may treat reference type and value type differently. GC will collect the reference type if there is nobody have a reference to it. When GC will collect the value type like struct? My struct is not small. I want it be collected as earlier as possible. With a profiler software, I saw that struct has a big accumulation and i...

.NET - need 10 points around an ellipse

Simple code fragment below draws an ellipse on a VB.NET panel. I now need to locate 10 points ON that ellipse, so I can draw small circles along the edge (the final effect will be an elliptical "table" with 10 "seats" around it. Help filling in the center of my loop below appreciated. Private Sub Panel1_Paint(ByVal sender As Objec...

Is there a static value defined in the .NET framework for sql server's date range?

Is there a static value defined in the .net framework library similar to DateTime.MinValue and DateTime.MaxValue except with values that reflect Sql Server's datetime datatype range? (January 1, 1753 - December 31, 9999) ...

How should I initialize variables that will be used in a try/catch/finaly block?

If I am using a try/catch/finally block where and how should I initialize variables? For example say I'm trying to use a FileStream . I want to catch any exceptions thrown while creating or using the stream. Then regardless of whether there were any problems or not I want to ensure any stream created is closed. So I'd do something like ...

Newbie question about PascalCase

ReSharper extension of VS suggest me to use PascalCase in below property. public Color Color { get; private set; } Here Color is Enum type. I would never thought this can be possible because it is same name with type. But it is valid. Is it something suggested by general rules ? Do I have to listen ReSharper always ? Would be apprecia...

Freeform XML configuration section body in app.config

Is there a way to make a configuration section that would allow a freeform XML body? How would I get that freeform body in code? For example I'd like to create a ModuleConfigurationSection like this: <modules> <module name="ModuleA" type="My.Namespace.ModuleA, My.Assembly"> <moduleConfig> <serviceAddress>http://...

How to animate the font weight of a label in WPF?

I'm having trouble finding an animation storyboard type that allows me to animate the FontWeight property of a label from "Normal" to "Bold". Does anyone have any experience with this? ...