private void setExpressionSegment(parentControl x) { if (x.GetType() == typeof(OUTPUT)) return; if (x.GetType() == typeof(AND)) { x.boolean = "(" + x.inp1Boolean + "." + x.inp2Boolean + ")"; expressionBox.TextDecorations = null; } else if (x.GetType() == typeof(OR)) { x.boolean = "(" + x.inp1Boolean + "+" + x.inp2Boolean + ")"; expressionBox.TextDecorations = null; } else if (x.GetType() == typeof(XOR)) { x.boolean = "(" + x.inp1Boolean + "⊕" + x.inp2Boolean + ")"; expressionBox.TextDecorations = null; } else if (x.GetType() == typeof(NAND)) { x.boolean = "!(" + x.inp1Boolean + "." + x.inp2Boolean + ")"; expressionBox.TextDecorations = TextDecorations.OverLine; } else if (x.GetType() == typeof(NOR)) { x.boolean = "!(" + x.inp1Boolean + "+" + x.inp2Boolean + ")"; expressionBox.TextDecorations = TextDecorations.OverLine; } else if (x.GetType() == typeof(NOT)) { x.boolean = "!" + x.inp2Boolean; expressionBox.TextDecorations = TextDecorations.OverLine; } expressionBox.Text = x.boolean; }
string s = "text"; s = ".ol " + s; if ( s.StartsWith( ".ol " ) ) { s = s.Substring( 4 ); // etc. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)