I find it useful to right-click on an interface, and click "Implement Interface." This will create any missing interface members in a new region. However, if your interface has recently changed (ie some of the members already exist, some do not) the members will not be placed together in the same region.
Is there an easy way to collect ...
Hi,
I want to write a unit test which tests the function of a class called UploadedFile.
The problem I face is this class' static constructor uses HttpContext.Current property and because I am running my unit test from a class library I do not have an HttpContext at the testing time.
Look at my static constructor:
static UploadedFil...
I try to write some codes about Generate list from Anonymous type via below codes :
public static List<T> MakeList<T>(T itemOftype)
{
List<T> newList = new List<T>();
newList.Add(itemOftype);
return newList;
}
But ERROR return me:
A primary key field specified via the
KeyFieldName property is not found in
the underl...
Short question:
I would like to spawn a single background thread that would process work items submitted to a queue (like a threadpool with one thread). Some of the work items are capable of reporting progress, some are not. Which one of the .NET's myriad of multithreading approaches should I use?
Long explanation (to avoid asking ab...
One console application in a .net solution references another console application in the same solution but when building the first one, the second/referenced one's secondapp.exe.config file is not being deployed over.. does anyone know why or how I could do that?
...
Hi Guys,
I wonder if any one has experienced the following issue and can give me some pointers.
We have an MID form with Cut, Copy, Paste, and Delete child menu items of a menuItem called Edit. Each of these child menu items has the ShortcutKeys property set with CTRL+X, CTRL+C, CTL+V, and Del, respectively. The short cut key and combi...
I am new to .net. I created one website.I want to implement Zlib compression technique for compressing data in each every page, so that i can access open my website quickly.But i don't know where I have to write code for that and how to implement it. Can yo send me the sample application code or zip file.
...
Hi I have developed an asp.net web application which will generate report pack for various customers. We will convert them to pdfs. Our requirement is to provide viewing of PDF document in the website itself with flipping effect. For a sample please click the below link.
http://viewer.zmags.com/showmag.php?magid=174428#/page18/
How can...
If we need some information that can be achieved only through dynamic query then should not it be written in the application code directly (in DAL) rather than in the stored procedure?
Because the benefit we achieve from SP is already lost if we use dynamic query in it which is the already saved execution execution plan along with it.
...
I am trying to write a unit test using .NET 4 to ensure that an object can be garbage collected after some code is run. In Java, I would use assertGC to ensure that a weak reference is collected. How can I write this type of test for .NET?
I have tried keeping a WeakReference to the object and calling GC.Collect(), but as you'd expect, ...
Look at this example code, from a Telerik MVC grid:
<% Html.Telerik().Grid(Model.InstallerList)
.Name("InstallerGrid")
.DataKeys(key => key.Add(c => c.InstallerID))
.Columns(column =>
{
column.Template(action =>
{%>
<%= Html.ActionLink("Edit", "Edit", new{ id = action.InstallerID}) %> ...
I have visual state = loading. And i need in this visual state show loading circle with always repeated animation. But it repeats only once! How can i set repeat behavior to forever??
<VisualState x:Name="LoadingChildNodes">
<Storyboard RepeatBehavior="Forever" AutoReverse="False">
...
Hi,
I'm a bit lost here with how the ListView works.
When my ListView is created I do some coloring depending of the data in the result set.
protected void ListView1_ItemCreated(object sender, ListViewItemEventArgs e)
{
DataRow myRow;
DataRowView myRowView;
myRowView = (DataRowView)e.Item.DataItem;
myRow = myRowView.Ro...
Consider the following Enum and a corrsponding nullable field of that type
enum PossibleOptions { One, Two }
PossibleOptions? option;
Alternatively I could declare the enum and the corresponding field as
enum PossibleOptions { Unspecified, One, Two }
PossibleOptions option;
This non-nullable field would be initialized to the fir...
Hello,
Does anybody knows if it's possible to record a voice and transcribe it to text in real time?
I want to do that with silverlight or if it's not possible with the standard .Net framework
thanks for help
...
I have a WIN32 COM DLL.
And I want to Convert .NET DLL.
Is it possible?
Thanks.
...
We currently build our .net website in C# in Visual Studio 2010 Pro on our dev server, then manually publish it and upload to the live server where it is copied over the current files to go live.
We want to automate this process as much as possible and if possible push it at a certain time, such as every day at midnight. We don't curren...
In looking at some code reflected from the WCF libraries, I'm seeing a pattern used to create exceptions:
if(argument == null)
{
throw Error.ArgumentNull("argument");
}
Null arguments being the simplest example, with other types of exceptions available through the static error class.
What is the value of this factory pattern? Why...
On my WPF application, I am using DataContractSerializer to serialize object. I observed that it fails to serialize the types that has got an event or delegate declaration. Consider the following failing code:
[Serializable]
public abstract class BaseClass
{
public string Name { get; set; }
public event PropertyChangedEventHand...
This simple program starts with 15 threads - according to the count. Sometimes during its lifetime it drops a few, but they come back.
class Program
{
static void Main(string[] args)
{
while (true)
{
Console.WriteLine(Process.GetCurrentProcess().Threads.Count);
Thread.Sleep(500);
...