Exemplo n.º 1
0
        public string ScriptingCodeServiceID(string login, string path, ScriptingType type)
        {
            if (type == ScriptingType.Signal)
            {
                lock (_userWorkingSignals)
                {
                    if (_userWorkingSignals.TryGetValue(login, out var list))
                    {
                        var signalService = list.FirstOrDefault(s => s.Signal.Name == path);
                        return(signalService?.ServiceID);
                    }
                    return(string.Empty);
                }
            }

            lock (_userWorkingIndicators)
            {
                if (_userWorkingIndicators.TryGetValue(login, out var list))
                {
                    var signalService = list.FirstOrDefault(s => s.Name == path);
                    return(signalService?.ServiceID);
                }
                return(string.Empty);
            }
        }
Exemplo n.º 2
0
 public void SciriptingAlert(List <string> alerts, ScriptingType type, string codeId, string login)
 {
     Send(new ScriptingAlertRequest
     {
         Login  = login,
         Alerts = alerts,
         CodeId = codeId,
         Type   = type
     });
 }
Exemplo n.º 3
0
        private void BindScriptTypeDropDown()
        {
            ScriptingType scriptType = new ScriptingType();

            System.Reflection.FieldInfo[] fields = typeof(ScriptingType).GetFields();
            for (int i = 0; i < fields.Length; i++)
            {
                ddScriptType.Items.Add(fields[i].GetValue(scriptType));
            }

            ddScriptType.SelectedIndex = 0;
        }
        public ScriptingSetupViewModel(IApplicationCore c, ScriptingType type)
        {
            Core           = c;
            _scriptingType = type;

            switch (_scriptingType)
            {
            case ScriptingType.Signal:
                Settings = new SignalSettings();
                break;

            case ScriptingType.Indicator:
                Settings = new IndicatorSettings();
                break;
            }

            Title = $"{Settings.ScriptType} Setup";

            OkCommand              = new RelayCommand(OkCommandExecute);
            CancelCommand          = new RelayCommand(CancelCommandExecute);
            RemoveParameterCommand = new RelayCommand <ScriptingParameter>(RemoveParameterExecute);
            AddSeriesCommand       = new RelayCommand(AddSeriesCommandExecute);
            RemoveSeriesCommand    = new RelayCommand <SeriesSettings>(RemoveSeriesCommandExecute);
        }
 public ScriptingSavedEventArgs(IEnumerable <ScriptingParameterBase> parameters, string name, ScriptingType scriptingType)
 {
     Parameters    = new List <ScriptingParameterBase>(parameters);
     Name          = name;
     ScriptingType = scriptingType;
 }