|
Raihan Masud wrote: .NET Framework Designers used Design Patterns for their Base Class Libraries?
Of course!
Raihan Masud wrote: If yes, How?
Various patterns are used throughout the entire BCL.
Raihan Masud wrote: And what are those patterns
These are questions that you'll have to ask the Design Team. I'm willing to bet that it's more than just a few different patterns in a few different places.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hey folks,
what is the fastest way to have a clean fresh System.IO.MemoryStream each time i write into it?
one way is to make a
ms.SetLength(0)
before i write in to it. Another way is to create a new one each time. i think this two methods aren't very fast. is there another posibility to clear a stream?
thanks, bernd
|
|
|
|
|
No, there isn't. If you want something faster, perhaps you should use something other than MemoryStream. Why the need for speed?
---
b { font-weight: normal; }
|
|
|
|
|
thanks guffa,
speed is always nice to have and what's faster, setting the length to 0 or create a new one?
|
|
|
|
|
That depends. Setting the length to 0 should probably be faster than creating a new one, but the speed of that single action is not all that affects the speed of your application. A MemoryStream that is reset will probably handle memory allocations differently from a newly created one. I know too little about that difference, and especially too little about what your application is doing, to advice you in either direction.
Don't do premature omtimization. You should always avoid anti-patterns (known bad solutions), but specific optimization should generally be put off until you know where and why you need it.
---
b { font-weight: normal; }
|
|
|
|
|
i integrated ironPython in my application to ensure sccripting support. ironPython writes it's output into a stream.
but you're right...currently everythings works fine and performace is till now no problem.
thanks for your help!
|
|
|
|
|
i am currently a developer that uses .net as my main programming environment. and i wanted to know how could i use .net to create License and then in turn use them to protect the applications that i have developed?
can some one please point me into the right direction? posible some tutorials or papers on how i can use .net to implement this????
kenny edmond
|
|
|
|
|
There's all sorts of ways, but they can all be circumvented as .NET code can be decompiled.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
so how would you add a license feature to your applications you developed???
kenny
|
|
|
|
|
Try to hide some vital code in a C++ component ( not managed ) which also handles the licencing, to slow down people trying to decompile it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
We have windows service as batch application and web application as configuration GUI for batch application. I am trying to package it using VS 2003 Deployment options, not sure which project to choose.
Installing package(setup.exe) should create webforms in Virtual root and install windows service.I know how to use service installer and web setup, but not sure how to combine both.
Regards,
MaulikCE
|
|
|
|
|
First, I'm sorry to post it here because I don't know where to post it.
Now to the subject. I have designing a sniffer socket that read a raw packet of network packet (it be IP, TCP, UDP, ICMP, and others). Now I want to send the packet back into network so it can be continued into wide network. But the problem is I not create the server.
More explaination, here I design a socket that read HTTP request, after check the packet with my filter, it will decide the packet will continued or dropped. I have learn socket programming and every example always create a pair (client and server). But this the server is other application (because this I filter HTTP packet, then the server is WebServer that I not design it).
So can anyone suggest me something, like how to build raw socket to send the raw packet.
Regards,
Ariston Darmayuda.
|
|
|
|
|
Hello!
Please, I need help by solving two problems regarding the new DataGridView control.
Here is my simple example code:
// ==================== SNIP ====================
using System;
using System.Collections;
using System.Windows.Forms;
// Add a DataGridView named dataGridView1 to Form1.
namespace DataGridTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// Create an Order list...
IList order = new ArrayList();
order.Add(new Item(1, "Keyboard", 1, "http://www.keyboard.com/"));
order.Add(new Item(2, "Mouse", 1, "http://www.mouse.com/"));
order.Add(new Item(3, "Monitor", 2, "http://www.monitor.com/"));
// Add a Button column...
DataGridViewColumn col = new DataGridViewButtonColumn();
col.HeaderText = "Link";
col.Name = col.DataPropertyName = "URL";
dataGridView1.Columns.Add(col);
// And fill the DataGridView...
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = order;
}
}
// Instances representing Order items
class Item
{
private int id;
private string description;
private int quantity;
private string url;
public Item(int i, string d, int q, string u)
{
id = i;
description = d;
quantity = q;
url = u;
}
public int Id { get { return id; } }
public string Description { get { return description; } }
public int Quantity { get { return quantity; } }
public string URL { get { return url; } }
}
}
// ==================== SNIP ====================
1.
How can I achieve that the user can sort the table by clicking the sort glyph of a column? (In the old DataGrid control that works by default.)
2.
The button cells should all show a text like "Link...". But programmatically I need to get the URL value of each cell and not the displayed text. Is that possible?
Numerous thanks for all advices.
Regards,
Amd Opteron
|
|
|
|
|
I've not used this control, still in VS 2003 but it seems to me that you need to enable the 'AllowSorting' and 'AllowNavigation' properties of the grid. Presuming of course that this control has these properties!
Hope that helps!
Steve
|
|
|
|
|
1. Sorting is not automatically supported when binding lists. You will have to bind click events for the headers and sort the list manually (and do a refresh on the grid). With manually I mean using ArrayList.Sort with a defined comparer you have coded.
|
|
|
|
|
I have the folowing Problem:
I want to have a ListBox control which is able to display Text und a NumericUpDown control for each Item in the ListBox.
I don't know how to face this problem .
Should I extend the ListBox class and override the OnDrawItem() ???
Or start a new control from scratch ???
Any usefull hint is welcome.
|
|
|
|
|
I reckon this needs a new control. It also sounds like a convoluted UI.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
It is clearly mentioned in the installation document that WSE 2.0 can not be installed on later versions of .net 1.1.
So can i assume that the WSE 2.0 is built in in .Net 2.0 or i have to use WSE 3.0 to work with .net 2.0.
can any body give me a brief explanation.
ThanX in advance.
Ramesh.Kanjinghat
|
|
|
|
|
WSE 3.0 must be installed (i'ts an add-on, not part of the basic framwork). You might want to consider using WCF (winfx/.Net3.0) instead, since it is much cleaner than WSE 3.0. .Net 3.0 is also an add-on to Net 2.0, and has a separate installer.
|
|
|
|
|
hi guys
i recently downloaded the Helix SDK for real. i want to embed a real media video on my application. could someone tell me how to do it?
vineet
|
|
|
|
|
It's very unlikely you'll come acrossed someone who has used the SDK. Your best source of information is the people who wrote the SDK. Try the forums or IRC on that site and you'll get a better answer. There's even a link on their home page called "Need Help?"!
-- modified at 8:59 Friday 4th August, 2006
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Guys,
I have a questions regarding visual studio .net. Few days back as usual I had a problem with my PC which led to format my PC, and it was the corrupted Page file. Despite of my effort for days I couldn't recover to windows. I felt really bad because I couldn't recover my projects on my PC. There were a lot of files I lost during this process. What I have done now is I have bought an external hard drive with good capacity. I was thinking a lot the line to leave my project files housed on this project. It was annoying when it came to working with Visual Studio.net; because it creates solution file and .suo(don't what this file is?) What I am looking in to is that if I can create a project on external hard drive rather then setting to the local drive on PC. If you can please guide me in achieving this, I will really appreciate it. Thanks,
|
|
|
|
|
When you start a new project, just set the location in the field provided!
Steve
|
|
|
|
|
Hello,
I would like to ask you about tool, which can generate documentation for projects in .NET 2.0 based on XML documentation files.
I know only an unofficial version of NDoc with support for .NET 2.0.
http://jonas.lagerblad.com/blog/?p=4
Maybe you know alternative to this tool?
Thanks in advance
Wojtek
|
|
|
|
|
Hi,
Sandcastle should help you. There is even an article[^] here on CodeProject for it which features a rudimentary GUI for this command line tool.
|
|
|
|