New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Conditional oprearation detector in C Sharp


Posted Date:     Total Responses: 0    Posted By: Mahesh   Member Level: Platinum   Points/Cash: 5   


using System;
using System.Collections.Generic;
using System.Text;

namespace FormulaEditor
{
///
/// Conditional oprearation detector
///

public class OptionalDetector : IMultiOperationDetector
{
///
/// Conditional type
///

const Boolean type = false;

///
/// Singleton
///

public static readonly OptionalDetector Object = new OptionalDetector();

///
/// Begin
///

//private int begin;

///
/// End
///

//private int end;

///
/// Constructor
///

protected OptionalDetector()
{
}


///
/// The "has begin" sign
///

public bool HasBegin
{
get
{
return false;
}
}

///
/// The "has end" sign
///

public bool HasEnd
{
get
{
return false;
}
}

///
/// Count of arguments
///

public int Count
{
get
{
return 2;
}
}

///
/// Detects i - th symbol of operation
///

/// The symbol number
/// Symbol of detection
///
public bool Detect(int i, MathSymbol symbol)
{
if (!(symbol is BinarySymbol))
{
return false;
}
char c = symbol.Symbol;
if (i == 0)
{
return c == '?';
}
else
{
return c == ':';
}
}


///
/// Accept operation
///

/// Types of operands
/// Operation
public IObjectOperation Accept(object[] types)
{
if (types[0].Equals(type))
{
if (types[1].Equals(types[2]))
{
return new OptionalOperation(types[1]);
}
else
{
throw new Exception("Imcompatible types of optional operation");
}
}
return null;
}
}

}


Project Feedbacks


No feedbacks found. Be the first to respond and make money from revenue sharing program.

Post Feedback
You must Sign In to post a feedback.
Next Project: Conditional operation in C Sharp language
Previous Project: Composition g * f of one variable functions in C Sharp

Return to Project Index

Post New Project


Related Projects



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.