New Member FAQ
|
Forums
|
Earn Revenue
Resources
Entrance
Ask Experts
Exam Papers
Jobs
English
Projects
Universities
Colleges
Courses
Schools
Training
My India
Members
|
Communities
|
Business Directory
|
Classifieds
|
Reviews
|
Silverlight Games
|
Peer Appraisal
|
Bookmarks
|
Polls
|
Mentors
|
Links
|
B.Tech Projects
|
Lobby
|
Gift Shop
|
Chat
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
PROSENJIT MANN...
(667)
Mr. Anindya
(453)
ashish
(422)
Last 7 Days
PROSENJIT MANN...
(1781)
Shobha Manasa
(1774)
Lenin
(1522)
more...
Awards & Gifts
Online Exams
Aptitude Questions
General Aptitude Tests
Medical Entrance
Engineering Entrance
Bank Tests
TOEFL & IELTS Questions
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.
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
Stack using double linked list
C program which copies one file to another.
Program to check whether switch at P0.28 and P0.29 of LPC2148 for toggle LED at P0.21 and P0.22
Deadlock program
C++ program : To find whether two strings contain equal number of characters
Advertise Here
Contact Us
Advertise
Editors
Privacy Policy
Terms Of Use
ISC Technologies.
2006 - 2009 All Rights Reserved.