private void button1_Click(object sender, EventArgs e) { var Colon = new Colon { Name = TName.Text, Age = TAge.Text, Gender = CGender.Text, FileNo = TFileNo.Text, Date = dateTimePicker1.Value, Premedication = TPremedication.Text, Scope = CScope.Text, ReferredDoctor = TReferredDoctor.Text, ClinicalData = TClinicalData.Text, Preparation = CPreparation.Text, AnalInspection = TAnalInspection.Text, PRExam = TPRExam.Text, Ileum = TIleum.Text, ColonDetails = TColon.Text, Rectum = TRectum.Text, Conclusion = TConclusion.Text, Assistant = TAssistant.Text, Endoscopist = TEndoscopist.Text, }; _context.Colons.Add(Colon); _context.SaveChanges(); //ReportDocument cryRpt = new ReportDocument(); //cryRpt.Load("CrystalReport1.rpt"); //ParameterFieldDefinitions crParameterFieldDefinitions; //ParameterFieldDefinition crParameterFieldDefinition; //ParameterValues crParameterValues = new ParameterValues(); //ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); //crParameterDiscreteValue.Value = Colon.Id; //crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields; //crParameterFieldDefinition = crParameterFieldDefinitions["Id"]; //crParameterValues = crParameterFieldDefinition.CurrentValues; //crParameterValues.Clear(); //crParameterValues.Add(crParameterDiscreteValue); //crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); CrystalReport1 cr = new CrystalReport1(); cr.SetParameterValue("@Id", Colon.Id); var ForCr = new ReportViewerForm(); ForCr.crystalReportViewer1.ReportSource = cr; ForCr.crystalReportViewer1.Refresh(); ForCr.Show(); //ForCr.crystalReportViewer1.ReportSource = cryRpt; //ForCr.crystalReportViewer1.Refresh(); //var cr = new CrystalReport1(); //cr.Load("CrystalReport1.rpt"); //var txt1 = cr.ReportDefinition.Sections["Section1"].ReportObjects["Text1"]; //txt1 = TName; }
public override bool Parse(ItemFactory itemFactory, ITextProvider text, TokenStream tokens) { // foo : bar rgb(1,2,3) "baz" url(quux) / moo goo ! important ; // First item is property name. Allow -webkit and *foo - the latter is used for 'commenting out' PropertyName = ParseName(itemFactory, text, tokens); if (tokens.CurrentToken.TokenType == CssTokenType.Colon || tokens.CurrentToken.TokenType == CssTokenType.DoubleColon) { Colon = Children.AddCurrentAndAdvance(tokens, CssClassifierContextType.Punctuation); if (Colon.TokenType != CssTokenType.Colon) { Colon.AddParseError(ParseErrorType.UnexpectedToken, ParseErrorLocation.WholeItem); } } // Parse values while (KeepParsingValues(tokens)) { switch (tokens.CurrentToken.TokenType) { case CssTokenType.Bang: ParseBang(itemFactory, text, tokens); break; default: ParseDefaultChild(itemFactory, text, tokens); break; } } ParseAfterValues(itemFactory, text, tokens); // Add appropriate errors if (PropertyName == null) { AddParseError(ParseErrorType.PropertyNameMissing, ParseErrorLocation.BeforeItem); } else if (Colon != null) { int semiColonIndex = (Semicolon != null) ? Children.IndexOf(Semicolon) : Children.Count; if (Children.IndexOf(Colon) + 1 == semiColonIndex) { Colon.AddParseError(ParseErrorType.PropertyValueMissing, ParseErrorLocation.AfterItem); } } else { AddColonMissingError(); } return(Children.Count > 0); }
void OnReset() { MinutesHigh.Play(); MinutesLow.Play(); Colon.Play(); SecondsHigh.Play(); SecondsLow.Play(); LateUpdate(); }
public override bool Parse(ItemFactory itemFactory, ITextProvider text, TokenStream tokens) { if (tokens.CurrentToken.TokenType == CssTokenType.Identifier && TextRange.CompareDecoded(tokens.CurrentToken.Start, tokens.CurrentToken.Length, text, "and", true)) { MediaCombineOperator = Children.AddCurrentAndAdvance(tokens, CssClassifierContextType.MediaCombineOperator); } if (tokens.CurrentToken.TokenType == CssTokenType.OpenFunctionBrace) { OpenFunctionBrace = Children.AddCurrentAndAdvance(tokens, CssClassifierContextType.FunctionBrace); ParseFeatureName(itemFactory, text, tokens); if (tokens.CurrentToken.TokenType == CssTokenType.Colon) { Colon = Children.AddCurrentAndAdvance(tokens, CssClassifierContextType.Punctuation); } while (tokens.CurrentToken.TokenType != CssTokenType.CloseFunctionBrace && tokens.CurrentToken.TokenType != CssTokenType.OpenCurlyBrace && !tokens.CurrentToken.IsScopeBlocker()) { ParseNextValue(itemFactory, text, tokens); } if (tokens.CurrentToken.TokenType == CssTokenType.CloseFunctionBrace) { CloseFunctionBrace = Children.AddCurrentAndAdvance(tokens, CssClassifierContextType.FunctionBrace); } else { OpenFunctionBrace.AddParseError(ParseErrorType.CloseFunctionBraceMissing, ParseErrorLocation.AfterItem); } if ((Colon != null && Children[Children.Count - 1] == Colon) || (Colon != null && CloseFunctionBrace != null && Children.IndexOf(Colon) + 1 == Children.IndexOf(CloseFunctionBrace))) { // There was nothing between the colon and close brace Colon.AddParseError(ParseErrorType.PropertyValueMissing, ParseErrorLocation.AfterItem); } } if (MediaCombineOperator != null && OpenFunctionBrace == null) { MediaCombineOperator.AddParseError(ParseErrorType.MediaExpressionExpected, ParseErrorLocation.AfterItem); } return(Children.Count > 0); }
private Node blockExpansion() { if (peek() is Colon) { Token token = expect(typeof(Colon)) ; Colon colon = (Colon)token; BlockNode blockNode = new BlockNode(); blockNode.setLineNumber(colon.getLineNumber()); blockNode.setFileName(filename); blockNode.getNodes().AddLast(parseExpr()); return(blockNode); } return(block()); }
/// <summary> /// Establece un automata donde contenedremos todas las gramaticas clases que se establecieron /// </summary> public Lenguaje() { //Establecemos una lista de las gramaticas que contiene el automata gramaticas[0] = new And(); gramaticas[1] = new Boolean_(); gramaticas[2] = new Cadena(); gramaticas[3] = new Chart(); gramaticas[4] = new Colon(); gramaticas[5] = new ComentarioUnaLinea(); gramaticas[6] = new ComentarioVariasLineas(); gramaticas[7] = new Comparacion(); gramaticas[8] = new Decimal_(); gramaticas[9] = new Desde(); gramaticas[10] = new Diferente(); gramaticas[11] = new Disminuir(); gramaticas[12] = new Division(); gramaticas[13] = new Entero(); gramaticas[14] = new Hacer(); gramaticas[15] = new Hasta(); gramaticas[16] = new Igual(); gramaticas[17] = new Incrementar(); gramaticas[18] = new Incremento(); gramaticas[19] = new Mayor(); gramaticas[20] = new MayorIgual(); gramaticas[21] = new Menor(); gramaticas[22] = new MenorIgual(); gramaticas[23] = new Mientras(); gramaticas[24] = new Multiplicacion(); gramaticas[25] = new Negacion(); gramaticas[26] = new Or(); gramaticas[27] = new ParentesisAbrir(); gramaticas[28] = new ParentesisCerrar(); gramaticas[29] = new Resta(); gramaticas[30] = new Si(); gramaticas[31] = new Sino(); gramaticas[32] = new Sino_Si(); gramaticas[33] = new Suma(); }
protected virtual Colon VisitColon(Colon node) { return(VisitSyntaxNode(node) as Colon); }
protected override Colon VisitColon(Colon node) { visitedColon = true; Assert.IsTrue(node.Value == ":"); return(base.VisitColon(node)); }
static void FunctionProcessor(StringBuilder stringBuilder, FunctionExpression expression, ShaderMetadata metadata) { // Write type stringBuilder.Append(expression.ConstituentSymbols[0].ToString()); // Write name stringBuilder.Append(" "); stringBuilder.Append(expression.ConstituentSymbols[1].ToString()); // Begin arguments stringBuilder.Append("("); // Write arguments ArgumentExpression argumentExpression = expression.ConstituentSymbols[3] as ArgumentExpression; if (argumentExpression != null && argumentExpression.ConstituentSymbols.Count > 0) { for (int i = 0; i < argumentExpression.ConstituentSymbols.Count; i += 3) { // Write type stringBuilder.Append(argumentExpression.ConstituentSymbols[i].ToString()); // Write name stringBuilder.Append(" "); stringBuilder.Append(argumentExpression.ConstituentSymbols[i + 1].ToString()); if (i + 3 < argumentExpression.ConstituentSymbols.Count) { stringBuilder.Append(", "); } } } // End arguments stringBuilder.Append(")"); // Checking has return semantic for entry point function only Colon doubleDotExpression = expression.ConstituentSymbols[5] as Colon; if (doubleDotExpression != null && metadata.EntryPoint == expression) { stringBuilder.Append(" : "); string returnSemantic = expression.ConstituentSymbols[6].ToString(); if (returnSemantic.StartsWith("POSITION", StringComparison.InvariantCulture)) { stringBuilder.Append(returnSemantic.Replace("POSITION", "SV_POSITION")); } if (returnSemantic.StartsWith("COLOR", StringComparison.InvariantCulture)) { stringBuilder.Append(returnSemantic.Replace("COLOR", "SV_TARGET")); } } // Begin statement block stringBuilder.Append(Environment.NewLine); stringBuilder.Append("{"); // Write statement block StatementBlockExpression statementBlockExpression = doubleDotExpression == null ? expression.ConstituentSymbols[6] as StatementBlockExpression : expression.ConstituentSymbols[8] as StatementBlockExpression; StatementBlockProcessor(stringBuilder, statementBlockExpression, metadata, 1); // End statement block stringBuilder.Append(Environment.NewLine); stringBuilder.Append("}"); }
public TryOutSpecialSigns(Color color) { colon = new Colon(color); point = new Point(color); }
public void ColonExceptionTest( ) { char result = Colon.Parse("+"); }
public void ColonTest( ) { char result = Colon.Parse(":"); Assert.AreEqual(':', result); }
void LateUpdate() { int secondsLeft = timer.GetSecondsLeft(); int seconds = secondsLeft % 60; int minutes = secondsLeft / 60; int sl = seconds % DigitMeshes.Length; int sh = (seconds / DigitMeshes.Length) % DigitMeshes.Length; int ml = minutes % DigitMeshes.Length; int mh = (minutes / DigitMeshes.Length) % DigitMeshes.Length; var mhs = MinutesHigh.shape; mhs.mesh = DigitMeshes[mh]; if (secondsLeft < 60 * 10) { if (MinutesHigh.isPlaying) { MinutesHigh.Stop(); } } else { if (!MinutesHigh.isPlaying) { MinutesHigh.Play(); } } var mls = MinutesLow.shape; mls.mesh = DigitMeshes[ml]; if (secondsLeft < 60) { if (MinutesLow.isPlaying) { MinutesLow.Stop(); } if (Colon.isPlaying) { Colon.Stop(); } } else { if (!MinutesLow.isPlaying) { MinutesLow.Play(); } if (!Colon.isPlaying) { Colon.Play(); } } var shs = SecondsHigh.shape; shs.mesh = DigitMeshes[sh]; if (secondsLeft < 10) { if (SecondsHigh.isPlaying) { SecondsHigh.Stop(); } } else { if (!SecondsHigh.isPlaying) { SecondsHigh.Play(); } } var sls = SecondsLow.shape; sls.mesh = DigitMeshes[sl]; System.Action <Color> SetColor = delegate(Color c) { var mhm = MinutesHigh.main; mhm.startColor = c; var mlm = MinutesLow.main; mlm.startColor = c; var shm = SecondsHigh.main; shm.startColor = c; var slm = SecondsLow.main; slm.startColor = c; var cm = Colon.main; cm.startColor = c; var sm = Skull.main; sm.startColor = c; }; if (timer.CurrentMode != Timer.Mode.Finished) { if (Skull.isPlaying) { Skull.Stop(); } } else { if (!Skull.isPlaying) { Skull.Play(); } } if (timer.CurrentMode == Timer.Mode.Talk) { var mhm = MinutesHigh.main; SetColor(new Color(1.0f, 1.0f, 1.0f, 1.0f)); } else if (timer.CurrentMode == Timer.Mode.Bonus) { SetColor(new Color(1.0f, 0.5f, 0.5f, 1.0f)); } else if (timer.CurrentMode == Timer.Mode.Questions) { SetColor(new Color(0.1f, 0.1f, 1.0f, 1.0f)); } else if (timer.CurrentMode == Timer.Mode.Finished) { MinutesHigh.Stop(); MinutesLow.Stop(); Colon.Stop(); SecondsHigh.Stop(); SecondsLow.Stop(); SetColor(new Color(1.0f, 1.0f, 1.0f, 1.0f)); } }