コード例 #1
0
        protected virtual bool DeleteFunction(string key)
        {
            var existingFunction = FindFunction(key);

            if (existingFunction == null)
            {
                throw new ArgumentException($"Function having key {key} not found.");
            }

            return(TelemetryFunctions.Remove(existingFunction));
        }
コード例 #2
0
        protected virtual bool SaveFunction(IFunction function)
        {
            var functionsBuffer = TelemetryFunctions.ToList();

            functionsBuffer.Add(function);

            if (!FunctionsListIsValid(functionsBuffer))
            {
                return(false);
            }

            DeleteFunction(function);

            TelemetryFunctions.Add(function);

            return(true);
        }
コード例 #3
0
 protected virtual IList <IFunction> GetFunctions()
 {
     return(TelemetryFunctions.ToList());
 }
コード例 #4
0
 protected virtual IFunction GetFunction(string name)
 {
     return(TelemetryFunctions.FirstOrDefault(f => f.Name == name));
 }