Click here to Skip to main content
15,889,808 members
Home / Discussions / C#
   

C#

 
GeneralRe: write at a particular position in a text document [modified] Pin
firefeet20-Aug-09 1:03
firefeet20-Aug-09 1:03 
AnswerRe: write at a particular position in a text document [modified] Pin
Tr@v20-Aug-09 10:20
Tr@v20-Aug-09 10:20 
GeneralRe: write at a particular position in a text document Pin
firefeet20-Aug-09 17:53
firefeet20-Aug-09 17:53 
AnswerRe: write at a particular position in a text document Pin
Tr@v21-Aug-09 7:44
Tr@v21-Aug-09 7:44 
QuestionUpdate datagrid cell Pin
bonzaiholding19-Aug-09 22:35
bonzaiholding19-Aug-09 22:35 
AnswerRe: Update datagrid cell Pin
padmanabhan N19-Aug-09 22:54
padmanabhan N19-Aug-09 22:54 
GeneralUsing Dynamic predicates (Linq) Pin
Sayed Sajid19-Aug-09 22:32
Sayed Sajid19-Aug-09 22:32 
QuestionDelegate.CreateDelegate in so non static function Pin
bonzaiholding19-Aug-09 21:56
bonzaiholding19-Aug-09 21:56 
Hi,
If i have Event in some class the contain a lot of function from its kink and i want each instance to check another term how can i get delegate to non static Methods?
In the code the problem is in this line because the function need to be static but i need it to operate with the data inside of the instance:

VFC.ValidSystemFunction += (ValidSystem)Delegate.CreateDelegate(typeof(ValidSystem), mi);
(mi i MethodInfo the point to non static method).

for example :
public class ValidationFunctionClass
{

        public int Id;
        public string Name;
        public bool Checked;
        public double Min;
        public double Max;
        public ValidSystem ValidSystemFunction;//Event


        #region List of condition functions
        public bool Nc(DuplexTSystem DTS)
        {
            return  DTS.Nc>= Min && DTS.Nc <= Max;
        }
        public bool qr(DuplexTSystem DTS)
        {
            return DTS.qr >= Min && DTS.qr<= Max;
        }
        ....
}


And i want to have a list with all the condtions :
other class:

class B
{

public void InsertDataToList()
{
      List<ValidationFunctionClass> m_ValidadtionFuncClass = new List<ValidationFunctionClass>();
            System.Reflection.MethodInfo[] mi_Arr = typeof(ValidationFunctionClass).GetMethods();
            int ind=0;
            foreach (MethodInfo mi in mi_Arr)
            {
                ind++;
                ValidationFunctionClass VFC = new ValidationFunctionClass();
                VFC.Id = ind;
                VFC.Name = mi.Name;
                VFC.Checked = true;
                VFC.Min = 0;
                VFC.Max = 100;
                VFC.ValidSystemFunction += (ValidSystem)Delegate.CreateDelegate(typeof(ValidSystem), mi);
                m_ValidadtionFuncClass.Add(VFC);

            }
}

}


Can some when tell me what can i do this row VFC.ValidSystemFunction += (ValidSystem)Delegate.CreateDelegate(typeof(ValidSystem), mi);

when the function is not static ? (Instance)
Thanks for all your help... I need it...
AnswerRe: Delegate.CreateDelegate in so non static function Pin
bonzaiholding19-Aug-09 22:32
bonzaiholding19-Aug-09 22:32 
QuestionDetecting a change in excel spreadsheet cell Pin
NarVish19-Aug-09 21:29
NarVish19-Aug-09 21:29 
AnswerRe: Detecting a change in excel spreadsheet cell Pin
Rajesh R Subramanian19-Aug-09 21:33
professionalRajesh R Subramanian19-Aug-09 21:33 
GeneralRe: Detecting a change in excel spreadsheet cell Pin
NarVish20-Aug-09 0:46
NarVish20-Aug-09 0:46 
GeneralRe: Detecting a change in excel spreadsheet cell Pin
FilipKrnjic25-Aug-09 3:59
FilipKrnjic25-Aug-09 3:59 
QuestionSystem.Globalization.CultureInfo cannot be serialized because it does not have a parameterless constructor Pin
Mouleswarareddy19-Aug-09 21:16
Mouleswarareddy19-Aug-09 21:16 
AnswerRe: System.Globalization.CultureInfo cannot be serialized because it does not have a parameterless constructor Pin
stancrm19-Aug-09 21:30
stancrm19-Aug-09 21:30 
QuestionEvaluate a String that contains code Pin
Chad Roeder19-Aug-09 21:02
Chad Roeder19-Aug-09 21:02 
AnswerRe: Evaluate a String that contains code Pin
Pete O'Hanlon19-Aug-09 22:55
mvePete O'Hanlon19-Aug-09 22:55 
GeneralRe: Evaluate a String that contains code Pin
Chad Roeder26-Aug-09 8:58
Chad Roeder26-Aug-09 8:58 
QuestionGridview Pin
mjawadkhatri19-Aug-09 20:59
mjawadkhatri19-Aug-09 20:59 
AnswerRe: Gridview Pin
HimanshuJoshi19-Aug-09 21:04
HimanshuJoshi19-Aug-09 21:04 
AnswerRe: Gridview Pin
Vimalsoft(Pty) Ltd19-Aug-09 22:20
professionalVimalsoft(Pty) Ltd19-Aug-09 22:20 
AnswerRe: Gridview Pin
padmanabhan N19-Aug-09 22:43
padmanabhan N19-Aug-09 22:43 
AnswerRe: Gridview Pin
wyj12020-Aug-09 0:40
wyj12020-Aug-09 0:40 
QuestionNetworkStream problem... Pin
Trapper-Hell19-Aug-09 20:43
Trapper-Hell19-Aug-09 20:43 
AnswerRe: NetworkStream problem... Pin
Luc Pattyn19-Aug-09 22:51
sitebuilderLuc Pattyn19-Aug-09 22:51 

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.