void Initialize()
	{
		if(mInitilized || mInitEnumerator != null)
			return;

		mInitEnumerator = Settings.Init<SerializedRoot>( );

		if(mInitEnumerator == null)
		{
			Debug.LogError(Settings.kLogPrefix + "Could not init Settings");
			return;
		}
		EditorUpdate.Run(() => {
			if(mInitEnumerator == null)
				return true;
			return !mInitEnumerator.MoveNext();
		},() => {


			mInitilized = true;
			mSettings = new SettingsProxy();
			mFieldRenderers = GetAllInstancesOfAllSubclassesOf(typeof(FieldRendererBase));
			mInitEnumerator = null;
		
		});


		
	}
示例#2
0
    void Initialize()
    {
        if (mInitilized || mInitEnumerator != null)
        {
            return;
        }

        mInitEnumerator = Settings.Init <SerializedRoot>( );

        if (mInitEnumerator == null)
        {
            Debug.LogError(Settings.kLogPrefix + "Could not init Settings");
            return;
        }
        EditorUpdate.Run(() => {
            if (mInitEnumerator == null)
            {
                return(true);
            }
            return(!mInitEnumerator.MoveNext());
        }, () => {
            mInitilized     = true;
            mSettings       = new SettingsProxy();
            mFieldRenderers = GetAllInstancesOfAllSubclassesOf(typeof(FieldRendererBase));
            mInitEnumerator = null;
        });
    }
示例#3
0
 public static dynamic GetTSObject(SettingsProxy dynObject)
 {
     if (dynObject is null)
     {
         return(null);
     }
     return(dynObject.teklaObject);
 }
示例#4
0
        private static void Main(string[] args)
        {
            var settingsProxy             = new SettingsProxy();
            var quickbaseConnectionString = settingsProxy.GetConnectionString(SettingsProxy.Databases.Quickbase);

            // gather creditors with out-of-sync status (SQL <=> QuickBase)
            var creditors = DBWrapper.ExecuteCommand(quickbaseConnectionString, cmd =>
            {
                cmd.CommandText = @"select 
					responseStatus.CreditorID
					, responseStatus.ResponseDate
					, responseStatus.RejectReasonID
					, responseStatus.RejectReasonComment
					, responseStatus.[Status Name] AttemptedStatus
					, sa.[Date Created] AttemptCreated
					, currentStatus.[**Creditor Status] CurrentStatus
					, cl.[Enrolled Client Name] ClientName
					, cr.[Account #] AccountNumber
					, cr.[Current Balance] CurrentBalance 
					, pro.[Creditor Name] CreditorName
					, sa.[Record ID#] SettlementAttemptId
				from
				(
					select cr.CreditorID, st.[Status Name], cr.ResponseDate, cr.RejectReasonID, cr.RejectReasonComment, row_number() over (partition by cr.CreditorID order by cr.ResponseDate desc) RowNum
					from CreditorResponse cr (nolock)
					join QB_Creditor_Status_Types st (nolock) on st.[Record ID#] = cr.CreditorStatusTypeID	
					where cr.ResponseDate > '9/16/2020'
				) responseStatus
				cross apply dbo.[udfQB_Creditor_**CreditorStatus](responseStatus.CreditorID) currentStatus
				join QB_Creditors cr (nolock) on cr.[Record ID#] = responseStatus.CreditorID
				join QB_COA_Creditor pro (nolock) on pro.[Record ID#] = cr.[Related Current Creditor Primary]
				join QB_Client cl (nolock) on cl.[Record ID#] = cr.[Related Client]
				join QB_Settlement_Attempt sa (nolock) on sa.[Record ID#] = currentStatus.[Max Settlement Attempt Record ID]
				where responseStatus.RowNum = 1
				and currentStatus.[**Creditor Status] in ('Offer Made Pending', 'Waiting for SIF')
				and responseStatus.ResponseDate > sa.[Date Created]
				order by cl.[Enrolled Client Name]"                ;

                return(cmd.ToList <Creditor>());
            });

            var client = new ServiceClient();

            foreach (var creditor in creditors)
            {
                Console.WriteLine($"Updating {creditor.CreditorName} (creditor ID {creditor.CreditorId}, attempt {creditor.SettlementAttemptId}) for client {creditor.ClientName} to status {creditor.AttemptedStatus}");

                var result = client.UpdateSettlementAttempt(new SettlementAttemptUpdate
                {
                    SettlementAttemptId = creditor.SettlementAttemptId,
                    CreditorStatusType  = creditor.AttemptedStatus.ToEnum <CreditorStatusType>(),
                    Notes = creditor.RejectReasonComment
                });
            }
        }
示例#5
0
        private IConfigurationRoot Initialize(string fileConfiguration, string envVariable = null)
        {
            string appsettingsFile;
            var    curDir = Environment.CurrentDirectory;

            try
            {
                appsettingsFile = File.ReadAllText(Path.Combine(curDir, $"{fileConfiguration}.json"));
            }
            catch (FileNotFoundException)
            {
                throw new ArgumentException($"Not find config file - {fileConfiguration}.json, path - {curDir}/");
            }

            var builder = new ConfigurationBuilder()
                          .SetBasePath(curDir)
                          .AddJsonFile($"{fileConfiguration}.json");

            var mainConf       = JsonConvert.DeserializeObject <SettingsProxy>(appsettingsFile);
            var buildConfigure = envVariable ?? mainConf.AppEnvironment;

            // если нашли доп. конфигурации
            if (!string.IsNullOrEmpty(buildConfigure))
            {
                SettingsProxy addtionalConf      = null;
                var           appsettingsFileAdd = Path.Combine(curDir, $"{fileConfiguration}.{buildConfigure}.json");
                if (File.Exists(appsettingsFileAdd))
                {
                    builder.AddJsonFile(appsettingsFileAdd);
                    addtionalConf = JsonConvert.DeserializeObject <SettingsProxy>(File.ReadAllText(appsettingsFileAdd));
                }

                //var secondConf = builder.Build();
                var confsPath            = string.IsNullOrEmpty(addtionalConf?.AppConfigsPath) ? mainConf.AppConfigsPath : addtionalConf.AppConfigsPath;
                var appConfigsAdditional = string.IsNullOrEmpty(addtionalConf?.AppConfigsAdditional) ? mainConf.AppConfigsAdditional : addtionalConf.AppConfigsAdditional;

                if (!string.IsNullOrEmpty(appConfigsAdditional))
                {
                    if (string.IsNullOrEmpty(confsPath))
                    {
                        throw new ArgumentNullException(nameof(mainConf.AppConfigsPath));
                    }

                    foreach (var item in appConfigsAdditional.Split(',').Select(x => x.Trim()))
                    {
                        builder.AddJsonFile(Path.Combine(confsPath, $"{item}.{buildConfigure}.json"));
                    }
                }
            }

            builder.AddEnvironmentVariables();

            return(builder.Build());
        }
示例#6
0
        public async Task <ActionResult> Index()
        {
            string        client   = ConfigurationManager.AppSettings["SettingsClient"];
            string        api      = ConfigurationManager.AppSettings["SettingsAPI"];
            string        pattern  = ConfigurationManager.AppSettings["SettingsPattern"];
            string        key      = ConfigurationManager.AppSettings["SettingsPrivateKey"];
            SettingsProxy service  = new SettingsProxy();
            var           settings = await service.GetSettings(client, api, pattern, key);

            return(View(settings));
            //return View(settings.Filter("Product"));
        }
示例#7
0
        public ControlBar()
        {
            InitializeComponent();

            path   = SettingsProxy.GetShowResourcesPath();
            filter = "*.png";

            SetLock(true);
            this.Loaded        += new RoutedEventHandler(ControlBar_Loaded);
            this.LayoutUpdated += new EventHandler(ControlBar_LayoutUpdated);
            Canvas.SetRight(pnlBar, Application.Current.MainWindow.ActualWidth);

            FileSystemWatcher watcher = new FileSystemWatcher(path, filter);

            watcher.Created            += new FileSystemEventHandler(watcher_Created);
            watcher.EnableRaisingEvents = true;
        }
        public static Settings SaveSettings(SettingsProxy settingsProxy)
        {
            Settings settings = GetItem(settingsProxy.Id);

            if (settings == null)
            {
                settings = new Settings();
                LocalContext.Instance.Settings.Add(settings);
            }
            settings.ControlType         = settingsProxy.ControlType;
            settings.DisplayTime         = settingsProxy.DisplayTime;
            settings.Interval            = settingsProxy.Interval;
            settings.PointsCount         = settingsProxy.PointsCount;
            settings.PointsSource        = settingsProxy.PointsSource;
            settings.SelectedListId      = settingsProxy.SelectedListId;
            settings.BackgroundColorArgb = settingsProxy.BackgroundColorArgb;
            LocalContext.Instance.SaveChanges();
            return(settings);
        }
 private void SettingsForm_Load(object sender, EventArgs e)
 {
     try
     {
         this.Cursor    = Cursors.WaitCursor;
         _settingsProxy = SettingsAdapter.GetSettings().FirstOrDefault();
         List <PointListProxy> lists = PointListAdapter.GetItems();
         pointListProxyBindingSource.DataSource = lists;
         if (_settingsProxy != null)
         {
             pointsSourceComboBox.SelectedItem = (PointsSource)_settingsProxy.PointsSource;
             countNumeric.Value               = _settingsProxy.PointsCount;
             listComboBox.SelectedItem        = (from qr in lists where qr.Id == _settingsProxy.SelectedListId select qr).FirstOrDefault();
             controlTypeComboBox.SelectedItem = (PointsSource)_settingsProxy.ControlType;
             displayTimeNumeric.Value         = _settingsProxy.DisplayTime;
             intervalNumeric.Value            = _settingsProxy.Interval;
             ColorButton.BackColor            = Color.FromArgb(_settingsProxy.BackgroundColorArgb);
             pathToDbTextBox.Text             = Properties.Settings.Default.PathToDatabase;
         }
         else
         {
             _settingsProxy = new SettingsProxy();
         }
     }
     catch (FileNotFoundException ioEx)
     {
         if (openFileDialog1.ShowDialog() == DialogResult.OK)
         {
             Properties.Settings.Default.PathToDatabase = openFileDialog1.FileName;
             Properties.Settings.Default.Save();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.StackTrace, ex.Message);
     }
     finally
     {
         this.Cursor = Cursors.Arrow;
     }
 }
示例#10
0
        public NaturalShowWindow()
        {
            InitializeComponent();

            NativeTouchDevice.RegisterEvents(this);
            TouchVisualizationAdorner.AddTouchVisualizations(this);

            path         = SettingsProxy.GetShowResourcesPath();
            showfile     = SettingsProxy.GetAbsoluteShowFile();
            showfiletemp = SettingsProxy.GetAbsoluteShowTempFile();
            SetupEvents();

            Init();

            saveTimer          = new DispatcherTimer();
            saveTimer.Interval = TimeSpan.FromMilliseconds(1000);
            saveTimer.Tick    += new EventHandler(saveTimer_Tick);
            saveTimer.Start();

            this.Closed += new EventHandler(NaturalShowWindow_Closed);
        }
        private async void SignalForm_Load(object sender, EventArgs e)
        {
            try
            {
                this.Cursor  = Cursors.WaitCursor;
                this._isBusy = true;
                //this.WindowState = FormWindowState.Maximized;
                //this.FormBorderStyle = FormBorderStyle.None;
                //this.TopMost = true;

                _settings      = SettingsAdapter.GetSettings()?.FirstOrDefault();
                _graphics      = this.CreateGraphics();
                this.BackColor = _settings.BackgroundColor;
                _graphics.Clear(_settings.BackgroundColor);
                if (_settings.PointsSource == (int)PointsSource.FromDatabase)
                {
                    _points = PointListAdapter.GetItemProxy(_settings.SelectedListId);
                }
                else
                {
                    _points = await this.CreatePoints();
                }
            }
            catch (FileNotFoundException ioEx)
            {
                MessageBox.Show("Please set database file in settings", ioEx.Message);
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace, ex.Message);
            }
            finally
            {
                this.Cursor  = Cursors.Arrow;
                this._isBusy = false;
            }
        }