/// <summary> /// The add item to collection. /// </summary> /// <param name="collection"> /// The collection. /// </param> /// <param name="sbExpression"> /// The sb expression. /// </param> private void AddItemToCollection(ObservableCollection<SBExpression> collection, SBExpression sbExpression) { lock (collection) { collection.Add(sbExpression); } }
/// <summary> /// The add expression to collection. /// </summary> /// <param name="parent"> /// The parent. /// </param> /// <param name="hookPoint"> /// The hook point. /// </param> /// <param name="expression"> /// The expression. /// </param> /// <param name="sysId"> /// The sys id. /// </param> internal void AddExpressionToCollection(DefinitionDescription parent, string hookPoint, string expression, string sysId = "") { // standard SB expression elements and therefore no need to try read the process, just add the element // var processDescription = new DefinitionDescription(string.Empty, expression, string.Empty) { Description = hookPoint }; var sbExpression = new SBExpression(parent.FileName, expression, SourceDefinition.Expression, sysId); // this.AddProcessToCollection(hookPoint, parent, processDescription); this.AddProcessToCollection(hookPoint, parent, sbExpression); }