예제 #1
0
 public override void EnterProperty([NotNull] DfmGrammarParser.PropertyContext context)
 {
     if (context.qualifiedIdent().GetText() == "BeforeSearch.Strings")
     {
         if (this.searchDescription != null)
         {
             this.searchDescription.BeforeSearchEventText = DfmParseUtils.GetTextPropValue(context);
         }
     }
 }
예제 #2
0
            public override void EnterProperty([NotNull] DfmGrammarParser.PropertyContext context)
            {
                if (context.qualifiedIdent().GetText() == "Events")
                {
                    foreach (var item in context.propertyValue().itemList().item())
                    {
                        var textProp = GetPropertyByName(item, "ISBLText");
                        if (textProp == null)
                        {
                            continue;
                        }

                        var text = DfmParseUtils.GetTextPropValue(textProp);

                        if (this.action != null)
                        {
                            this.action.CalculationText = text;
                        }
                        else
                        {
                            var typeProp = GetPropertyByName(item, "EventType");
                            var name     = typeProp?.propertyValue().GetText() ?? string.Empty;

                            if (!EventTitles.TryGetValue(name, out string title))
                            {
                                title = name;
                            }

                            var wizardEvent = new WizardEvent
                            {
                                Name            = name,
                                Title           = title,
                                CalculationText = text
                            };

                            if (this.step != null)
                            {
                                this.step.Events.Add(wizardEvent);
                            }
                            else if (this.wizard != null)
                            {
                                this.wizard.Events.Add(wizardEvent);
                            }
                        }
                    }
                }
            }
예제 #3
0
            public override void EnterObject([NotNull] DfmGrammarParser.ObjectContext context)
            {
                var objectType = context.type()?.GetText();

                if (objectType == null)
                {
                    return;
                }

                if (objectType.Equals("TSBWizard", StringComparison.OrdinalIgnoreCase))
                {
                    this.wizard = new Wizard();

                    var nameProp = GetPropertyByName(context, "Code");
                    if (nameProp != null)
                    {
                        this.wizard.Name = DfmParseUtils.GetTextPropValue(nameProp) ?? string.Empty;
                    }
                    else
                    {
                        this.wizard.Name = string.Empty;
                    }

                    var titleProp = GetPropertyByName(context, "Title");
                    if (titleProp != null)
                    {
                        this.wizard.Title = DfmParseUtils.GetTextPropValue(titleProp) ?? string.Empty;
                    }
                    else
                    {
                        this.wizard.Title = string.Empty;
                    }
                }
                else if (objectType.EndsWith("WizardStep", StringComparison.OrdinalIgnoreCase))
                {
                    this.step = new WizardStep();

                    var nameProp = GetPropertyByName(context, "StepName");
                    if (nameProp != null)
                    {
                        this.step.Name = DfmParseUtils.GetTextPropValue(nameProp) ?? string.Empty;
                    }
                    else
                    {
                        this.step.Name = string.Empty;
                    }

                    var titleProp = GetPropertyByName(context, "Title");
                    if (titleProp != null)
                    {
                        this.step.Title = DfmParseUtils.GetTextPropValue(titleProp) ?? string.Empty;
                    }
                    else
                    {
                        this.step.Title = string.Empty;
                    }
                }
                else if (objectType.Equals("TSBWizardAction", StringComparison.OrdinalIgnoreCase))
                {
                    this.action = new WizardStepAction();

                    var nameProp = GetPropertyByName(context, "ActionName");
                    if (nameProp != null)
                    {
                        this.action.Name = DfmParseUtils.GetTextPropValue(nameProp) ?? string.Empty;
                    }
                    else
                    {
                        this.action.Name = string.Empty;
                    }

                    var titleProp = GetPropertyByName(context, "Title");
                    if (titleProp != null)
                    {
                        this.action.Title = DfmParseUtils.GetTextPropValue(titleProp) ?? string.Empty;
                    }
                    else
                    {
                        this.action.Title = string.Empty;
                    }
                }
            }