Click here to Skip to main content
15,907,326 members
Home / Discussions / C#
   

C#

 
GeneralTextbox event Pin
chettu30-Mar-05 17:42
chettu30-Mar-05 17:42 
GeneralRe: Textbox event Pin
S. Senthil Kumar30-Mar-05 19:10
S. Senthil Kumar30-Mar-05 19:10 
QuestionHow to start SQL Server 2000 Pin
rroobb30-Mar-05 17:27
rroobb30-Mar-05 17:27 
AnswerRe: How to start SQL Server 2000 Pin
Anonymous31-Mar-05 16:57
Anonymous31-Mar-05 16:57 
Generalstructure Pin
LeeeNN30-Mar-05 13:35
LeeeNN30-Mar-05 13:35 
GeneralRe: structure Pin
Christian Graus30-Mar-05 14:34
protectorChristian Graus30-Mar-05 14:34 
GeneralRe: structure Pin
LeeeNN30-Mar-05 14:43
LeeeNN30-Mar-05 14:43 
GeneralRe: structure Pin
Christian Graus30-Mar-05 15:04
protectorChristian Graus30-Mar-05 15:04 
public struct XXX
{
byte [] xx;
}

Your problem is that a struct cannot have a parameterless constructor, so you can only provide constructors that set this value by passing it in. However, you CAN add a property, which could be:

byte [] xx
{
set
{
System.Diagnostics.Debug.Assert(value.Length <= 5, "XXX.xx must be an array of 5 bytes or less");
etc.

Or you could be nice and just copy the first 5 bytes of a larger array, it depends what the struct value really is, and what is valid behaviour for your situation. Half a comment may be OK, half an IP address probably isn't.

Christian

I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
GeneralRe: structure Pin
Sebastian Schneider30-Mar-05 21:10
Sebastian Schneider30-Mar-05 21:10 
GeneralRe: structure Pin
Mathew Hall31-Mar-05 3:26
Mathew Hall31-Mar-05 3:26 
GeneralLocating and Extracting VS.Net Icons for Pluggin use Pin
Tristan Rhodes30-Mar-05 12:56
Tristan Rhodes30-Mar-05 12:56 
GeneralRe: Locating and Extracting VS.Net Icons for Pluggin use Pin
Syed Abdul Khader30-Mar-05 21:39
Syed Abdul Khader30-Mar-05 21:39 
GeneralInherited windows forms control...which event... Pin
Member 9630-Mar-05 12:45
Member 9630-Mar-05 12:45 
GeneralRe: Inherited windows forms control...which event... Pin
Member 9631-Mar-05 8:40
Member 9631-Mar-05 8:40 
GeneralCursors and threads Pin
PaleyX30-Mar-05 12:00
PaleyX30-Mar-05 12:00 
GeneralRe: Cursors and threads Pin
Pyro Joe30-Mar-05 12:22
Pyro Joe30-Mar-05 12:22 
GeneralRe: Cursors and threads Pin
PaleyX30-Mar-05 12:26
PaleyX30-Mar-05 12:26 
Generalreplacement regular expression Pin
Pyro Joe30-Mar-05 11:57
Pyro Joe30-Mar-05 11:57 
GeneralRe: replacement regular expression Pin
Christian Graus30-Mar-05 12:08
protectorChristian Graus30-Mar-05 12:08 
GeneralRe: replacement regular expression Pin
Pyro Joe30-Mar-05 12:18
Pyro Joe30-Mar-05 12:18 
GeneralRe: replacement regular expression Pin
Christian Graus30-Mar-05 12:24
protectorChristian Graus30-Mar-05 12:24 
GeneralRe: replacement regular expression Pin
Dave Kreskowiak30-Mar-05 16:09
mveDave Kreskowiak30-Mar-05 16:09 
GeneralRe: replacement regular expression Pin
Pyro Joe30-Mar-05 16:34
Pyro Joe30-Mar-05 16:34 
GeneralRe: replacement regular expression Pin
Yulianto.30-Mar-05 18:25
Yulianto.30-Mar-05 18:25 
GeneralRe: replacement regular expression Pin
mav.northwind31-Mar-05 0:17
mav.northwind31-Mar-05 0:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.