Ejemplo n.º 1
0
        public override PluginSettings SetSettings(Guid channel, ISettingsHost settingsHost, PluginSettings settings)
        {
            AnalystSettings analystSettings;

            if (settings.generalSettings == null)
            {
                analystSettings          = new AnalystSettings();
                settings.generalSettings = analystSettings;
            }
            else
            {
                analystSettings = settings.generalSettings as AnalystSettings;
            }

            var window = new SettingsWindow();

            settingsHost.SetFramesHandler(window.OnNewFrameCame);

            window.tbDelay.Text = analystSettings.Delay.ToString();

            window.Closed += (snd, args) =>
            {
                int.TryParse(window.tbDelay.Text, out analystSettings.Delay);
            };

            window.ShowDialog();

            return(settings);
        }
Ejemplo n.º 2
0
        public void ReadSettings(ISettingsHost host)
        {
            _maxRisk = host.Get("myPosSizer._maxRisk", (double)0);
            //MessageBox.Show("ReadSettings:"+_maxRisk.ToString());

            ReadBasicSettings(host);
            _maxRisk = host.Get("myPosSizer._maxRisk", (double)0);
            //MessageBox.Show("ReadSettings 2:" + _maxRisk.ToString());
        }
Ejemplo n.º 3
0
        static TicksFiles()
        {
            ISettingsHost sh = Core.GetGlobal("SettingsHost") as ISettingsHost;

            if (sh != null)
            {
                dataDir = sh.Get("DataDir", string.Empty);
                if (dataDir == string.Empty)
                {
                    dataDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "OpenWealth");
                    sh.Set("DataDir", dataDir);
                }
                if (!Directory.Exists(dataDir))
                {
                    l.Debug("Создаю каталог для тиков " + dataDir);
                    Directory.CreateDirectory(dataDir);
                }
            }
        }
Ejemplo n.º 4
0
        public void WriteSettings(ISettingsHost host)
        {
            host.Set("myPosSizer._maxRisk", _maxRisk);
            //MessageBox.Show("WriteSettings:" + _maxRisk.ToString());

            WriteBasicSettings(host);
        }
Ejemplo n.º 5
0
 public Settings(ISettingsHost settingsHost)
 {
     this.SettingsHost = settingsHost;
 }
Ejemplo n.º 6
0
 public void WriteSettings(ISettingsHost host)
 {
     host.Set("FortsMicexCommissions.F", this.F);
     host.Set("FortsMicexCommissions.M", this.M);
 }
Ejemplo n.º 7
0
 public void ReadSettings(ISettingsHost host)
 {
     this.F = host.Get("FortsMicexCommissions.F", (double)1);
     this.M = host.Get("FortsMicexCommissions.M", (double)0);
 }