Click here to Skip to main content
15,886,137 members
Home / Discussions / C#
   

C#

 
AnswerRe: List all the open ports Pin
Wayne Gaylard7-Aug-12 20:49
professionalWayne Gaylard7-Aug-12 20:49 
GeneralRe: List all the open ports Pin
Pete O'Hanlon8-Aug-12 1:36
mvePete O'Hanlon8-Aug-12 1:36 
GeneralRe: List all the open ports Pin
Wayne Gaylard8-Aug-12 3:33
professionalWayne Gaylard8-Aug-12 3:33 
AnswerRe: List all the open ports PinPopular
Ed Hill _5_7-Aug-12 23:17
Ed Hill _5_7-Aug-12 23:17 
GeneralRe: List all the open ports Pin
OriginalGriff8-Aug-12 0:18
mveOriginalGriff8-Aug-12 0:18 
AnswerRe: List all the open ports PinPopular
Pete O'Hanlon8-Aug-12 1:46
mvePete O'Hanlon8-Aug-12 1:46 
AnswerRe: List all the open ports Pin
jschell10-Aug-12 12:31
jschell10-Aug-12 12:31 
Generala better way to make, and populate, a List<Type> ? Pin
BillWoodruff7-Aug-12 16:34
professionalBillWoodruff7-Aug-12 16:34 
Current working code in a public static class: a List<Type> used internally:
// required directives [1]:
using System;
using System.Windows.Forms;
using System.Collections.Generic;
//
//
private static List<Type> OkToModify = new List<Type> 
{ 
    typeof(CheckBox),
    typeof(TextBox),
    typeof(Button), 
    typeof(Panel),
    typeof(Label)
};
By "working:" I mean that I can use the List<Type> to test if a given Control passed into the public static class is okay for the uses I make of it. Through, simply:
if (OkToModify.Contains(cntrl.GetType())) { processControl(cntrl) };
I keep thinking that somewhere in my reading (Skeet ? StackOverFlow ?), or here on CP, I have seen a "niftier" way to do this.

Appreciate any alternatives.

thanks, Bill

[1] edit: 'references changed to 'directives in response to feedback from PIEBALDconsult. However, they are, indeed, "required."
"Everything we call real is made of things that cannot be regarded as real." Niels Bohr


modified 7-Aug-12 23:56pm.

GeneralRe: a better way to make, and populate, a List<Type> ? Pin
PIEBALDconsult7-Aug-12 16:54
mvePIEBALDconsult7-Aug-12 16:54 
GeneralRe: a better way to make, and populate, a List ? Pin
BillWoodruff7-Aug-12 18:06
professionalBillWoodruff7-Aug-12 18:06 
GeneralRe: a better way to make, and populate, a List ? Pin
BillWoodruff9-Aug-12 8:35
professionalBillWoodruff9-Aug-12 8:35 
GeneralRe: a better way to make, and populate, a List ? Pin
PIEBALDconsult9-Aug-12 12:16
mvePIEBALDconsult9-Aug-12 12:16 
GeneralRe: a better way to make, and populate, a List ? Pin
SledgeHammer017-Aug-12 18:58
SledgeHammer017-Aug-12 18:58 
GeneralRe: a better way to make, and populate, a List ? Pin
PIEBALDconsult8-Aug-12 3:32
mvePIEBALDconsult8-Aug-12 3:32 
GeneralRe: a better way to make, and populate, a List ? Pin
DaveyM698-Aug-12 23:10
professionalDaveyM698-Aug-12 23:10 
GeneralRe: a better way to make, and populate, a List ? Pin
Pete O'Hanlon9-Aug-12 0:51
mvePete O'Hanlon9-Aug-12 0:51 
QuestionGet Variable Type from String Pin
eddieangel7-Aug-12 11:16
eddieangel7-Aug-12 11:16 
GeneralRe: Get Variable Type from String Pin
PIEBALDconsult7-Aug-12 13:18
mvePIEBALDconsult7-Aug-12 13:18 
GeneralRe: Get Variable Type from String Pin
BillWoodruff7-Aug-12 16:38
professionalBillWoodruff7-Aug-12 16:38 
GeneralRe: Get Variable Type from String Pin
SledgeHammer017-Aug-12 18:55
SledgeHammer017-Aug-12 18:55 
GeneralRe: Get Variable Type from String PinPopular
SledgeHammer017-Aug-12 18:52
SledgeHammer017-Aug-12 18:52 
GeneralRe: Get Variable Type from String Pin
PIEBALDconsult8-Aug-12 3:46
mvePIEBALDconsult8-Aug-12 3:46 
AnswerRe: Get Variable Type from String Pin
Shameel8-Aug-12 4:49
professionalShameel8-Aug-12 4:49 
GeneralRe: Get Variable Type from String Pin
SledgeHammer018-Aug-12 7:39
SledgeHammer018-Aug-12 7:39 
GeneralRe: Get Variable Type from String Pin
eddieangel8-Aug-12 6:01
eddieangel8-Aug-12 6:01 

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.