Assuming you had some kind of factory-created resource that would still belong to the factory after construction like this:
public class Resource : IDisposable {
public void Dispose() { /* ... */ }
}
public class ResourceManager : IDisposable {
public Resource Load() { /* create resource and add to list */ }
public void Dispose()...
I want to create a structure Degrees for a GPX library. In the XSD for GPX (GPX 1.1 Schema) degreesType is defined as minInclusive = 0 and maxExclusive = 360. The structure now shall have two public static fields MinValue = 0 and MaxValue = x:
public struct Degrees : IFormattable, IComparable, IComparable<Degrees>, IEquatable<Degrees>
{...
How do I go about creating my own taskbar toolbar, a la Windows Media Player:
Examples or documentation or even open source software that implements this for just about any language would be appreciated, but Google isn't being very helpful. Ultimately, I would like to do this in C# (I expect to need P/Invoke) for XP onwards, but any l...
I have the following code which throws an exception (detail in code comments below). I am merely trying to use an instance of an enum as part of the Where clause. I understand the message, but I don't understand why EF cannot parse an Int32 enum.
It works if I copy the enum to an Int32 and then filter on that, but it seems very messy.
...
Preferrably with any non-virus open source license
...
The situation:
I have a class library, called RT.Servers, containing a few resources (of type byte[], but I don't think that's important)
The same class library contains a method which returns one of those resources
I have a simple program (with a reference to that library) that only calls that single method
I get a MissingManifestRe...
Since I need to send email by code, I'm currently using plan text but since outlook, by default, remove the extra line break it screw up my formatting and I don't want that, I tried to put my text into html but now the email is marked as spam.
My last choice is to move the text into rtf but now my question is.
What is the easiest way t...
I have a xml structure like this:
<Items>
<Configuration>
<ConfigurationSetting>Setting1</ConfigurationSetting>
<ConfigurationSetting>Setting2</ConfigurationSetting>
</Configuration>
<MetaData>
...
</MetaData>
<Group>
<GroupType>MyType1</GroupType>
<GroupType>MyType2</GroupType>
...
I'm working on a small distributed system, which is completely message driven. Right now, I usually open up a socket each time I have to send something and close it right afterwards. State is only maintained on the server side (for instance, if no message arrives for 5 minutes from a client, consider it dead).
However, I have to do some...
I have an HTML document stored in memory as an Linq-to-XML object tree. How can I serialize an XDocument as HTML, taking into account the idiosyncrasies of HTML?
For example, empty tags such as <br/> should be serialized as <br>, whereas an empty <div/> should be serialized as <div></div>.
HTML output is possible from an XSLT styleshe...
I have a some html being generated by JQuery on a Share Point page. I want to use uploadify in this html to upload a file to the server. Alexander has helped by providing the following sample code which is based partially on http://www.uploadify.com/forum/viewtopic.php?f=5&t=45.
upload.ashx
<%@ Assembly Name="ClassName, Version=1....
How can I be notified when a calculated column value changes ?
...
Hi,
Currently I have a DataGrid, and a datasource.
The Datasource is directly pulled from the database in this order:
Id, SalaryId, Old, New
Problem is that it displays the SalaryId, I want it to display the SalaryId Value
How do I do this?
Thanks,
-Kristof
...
I'm using ADO.NET with a strongly typed dataset in C# (.NET 3.5). I want to insert a new row to two tables which are related in an 1:n relation.
The table Attachments holds the primary key part of the relation and the table LicenseAttachments holds the foreign key part.
AttachmentsDataSet.InvoiceRow invoice; // Set to a valid row, also...
I have a web service that I'd like to include as a project reference inside a windows forms application. (The application will be running on non-networked hardware.) I could simply copy the *.vb files I need into my forms project, but I'd rather not fork the code base.
It wasn't hard to include the ASP project in the windows forms sol...
I am wondering if it is possible (and what the syntax would be) to send an object's method to a function.
Example:
Object "myObject" has two methods "method1" and "method2"
I would like to have a function along the lines of:
public bool myFunc(var methodOnObject)
{
[code here]
var returnVal = [run methodOnObject here]
[code...
I am looking for a data structure to add,remove,get,find on categories.
for example:
books
drama
science fiction
other
Sports
Cycling
Golf
Team Sports
soccer
football
etc.
I think about using tree from C5 for example, but it looks like it has only red-black trees.
Any suggestions?
...
I have a fileupload control that allows users to upload images but before they can upload images I want to resize thomse images to mas 640x480 size the problem is I can't figure out what to do next. This is what I have;
// CALL THE FUNCTION THAT WILL RESIZE THE IMAGE
protected void btnUploadFile_Click(object sender, EventArgs e)
{
S...
How would one configure asp.net / asmx to not use soap encoding at all when generating wsdls from a .NET interface? In short, a .NET SOAP Web Service is producing a wsdl that includes soap encoding. For example:
<s:schema targetNamespace="http://tempuri.org/AbstractTypes">
<s:import namespace="http://schemas.xmlsoap.org/soap/enco...
I am looking for a .Net CMS that allows me to expose pages/articles that are created in the CMS to other applications without querying the CMS database. Preferably this would be done through an API and by exposing them through a custom secured webservice.
I know Sitefinity can do this.
Do you know if
Umbraco
DotNetNuke
can do th...