Пример #1
0
 protected void SetParameterVariables(string key, float threshold, float thresholdBeginning, Color color, GetParameter getParameter)
 {
     this.key                = key;
     this.threshold          = threshold;
     this.thresholdBeginning = thresholdBeginning;
     gizmoColor              = color;
     this.getParameter       = getParameter;
 }
Пример #2
0
        public SavedParameter(string key, T value, GetParameter getter, SetParameter setter)
        {
            Assert.IsNotNull(setter);
            Assert.IsNotNull(getter);

            m_Key    = key;
            m_Loaded = false;
            m_Value  = value;
            m_Setter = setter;
            m_Getter = getter;
        }
Пример #3
0
 public ExternalParametersProvider()
 {
     GetParameter.Add(nameof(Document.Author), (name, pr) => GetDocument(pr).Author);
     GetParameter.Add(nameof(Document.Manager), (name, pr) => GetDocument(pr).Manager);
     GetParameter.Add(nameof(Document.Name), (name, pr) => GetDocument(pr).Name);
     GetParameter.Add(nameof(Document.Number), (name, pr) => GetDocument(pr).Number);
     GetParameter.Add(nameof(Document.State), (name, pr) => GetDocument(pr).State);
     GetParameter.Add(nameof(Document.Sum), (name, pr) => GetDocument(pr).Sum);
     GetParameter.Add(nameof(Document.AuthorId), (name, pr) => GetDocument(pr).AuthorId);
     GetParameter.Add(nameof(Document.ManagerId), (name, pr) => GetDocument(pr).ManagerId);
     GetParameter.Add(nameof(Document.StateName), (name, pr) => GetDocument(pr).StateName);
     GetParameter.Add(nameof(Document), (name, pr) => GetDocument(pr));
 }
    int GetCubeMaxParamter(GameObject[] Cubes, GetParameter getParamter)
    {
        float maxHeight  = 0.0f;
        int   cubeNumber = 0;

        for (int i = 0; i < Cubes.Length; i++)
        {
            float currentParameter = getParamter(Cubes [i]);
            if (currentParameter > maxHeight)
            {
                maxHeight  = currentParameter;
                cubeNumber = i + 1;
            }
        }
        return(cubeNumber);
    }
Пример #5
0
        public string FromParameter(string pathToParameter)
        {
            string result;
            var    parameter = new GetParameter().Run(pathToParameter);

            if (parameter == null)
            {
                Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Parameter '" + pathToParameter + " ' is null. Status cannot be determined.");
                result = "Unknown.";
            }
            else
            {
                result = parameter.ParameterState.ToString();
            }

            return(result);
        }
        /// <summary>
        /// Searches for the specified parameter reports whether it is existing
        /// </summary>
        /// <param name="pathToParameter">
        /// The path to the parameter
        /// </param>
        /// <returns>
        /// True if the parameter exists, false otherwise.
        /// </returns>
        public bool Run(string pathToParameter)
        {
            bool      result    = false;
            Parameter parameter = new GetParameter().Run(pathToParameter);

            if (parameter != null)
            {
                result = true;
                Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The parameter: " + pathToParameter + " exists.");
            }
            else
            {
                Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The parameter: " + pathToParameter + " does not exist.");
            }

            return(result);
        }
Пример #7
0
 public Parameter(string key, float threshold, float thresholdBeginning, Color color, GetParameter getParameter)
 {
     SetParameterVariables(key, threshold, thresholdBeginning, color, getParameter);
 }
Пример #8
0
 public Task <XtrfResult <Data.Services> > GetActive(GetParameter param = null)
 => Get <Data.Services>(new ExecuteParams($"/services/all", param));