Ejemplo n.º 1
0
        public void Execute()
        {
            var persistance = new Persistance();

            var addSourceTmConfiguration = persistance.Load();
            if (addSourceTmConfiguration != null) return;

            persistance.Save(new AddSourceTmConfigurations() {Configurations = new List<AddSourceTmConfiguration>()});
        }
Ejemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            var persistance = new Persistance();

            _addSourceTmConfigurations = persistance.Load();

            var addSourceTmConfiguration =
                _addSourceTmConfigurations.Configurations.FirstOrDefault(x => x.ProviderUri == _providerUri);

            if (addSourceTmConfiguration == null)
            {
                addSourceTmConfiguration             = _addSourceTmConfigurations.Default;
                addSourceTmConfiguration.ProviderUri = _providerUri;
                _addSourceTmConfigurations.Configurations.Add(addSourceTmConfiguration);
            }
            else
            {
                _isUsed = true;
            }

            var dataAccess           = TmDataAccess.OpenConnection(addSourceTmConfiguration.ProviderUri);
            var existingCustomFields = dataAccess.GetCustomFields();

            var fileNameFields = new List <string>(existingCustomFields);

            fileNameFields.Insert(0, SelectCustomField);
            cmbFilenameFields.Items.AddRange(fileNameFields.ToArray());

            var fullPathFields = new List <string>(existingCustomFields);

            fullPathFields.Insert(0, SelectCustomField);
            cmbCompletePathField.Items.AddRange(fullPathFields.ToArray());

            var projectNameFields = new List <string>(existingCustomFields);

            projectNameFields.Insert(0, SelectCustomField);
            cmbProjectNameField.Items.AddRange(projectNameFields.ToArray());

            cmbFilenameFields.SelectedIndexChanged    += Boxes_SelectedIndexChanged;
            cmbCompletePathField.SelectedIndexChanged += Boxes_SelectedIndexChanged;
            cmbProjectNameField.SelectedIndexChanged  += Boxes_SelectedIndexChanged;

            SetConfigurationData(txtFilenameField, cmbFilenameFields, addSourceTmConfiguration.FileNameField);
            SetConfigurationData(txtCompletePathField, cmbCompletePathField, addSourceTmConfiguration.FullPathField);
            SetConfigurationData(txtProjectNameField, cmbProjectNameField, addSourceTmConfiguration.ProjectNameField);

            chkFullPath.Checked    = addSourceTmConfiguration.StoreFullPath;
            chkFileName.Checked    = addSourceTmConfiguration.StoreFilename;
            chkProjectName.Checked = addSourceTmConfiguration.StoreProjectName;
        }
Ejemplo n.º 3
0
        public void Execute()
        {
            var persistance = new Persistance();

            var addSourceTmConfiguration = persistance.Load();

            if (addSourceTmConfiguration != null)
            {
                return;
            }

            persistance.Save(new AddSourceTmConfigurations()
            {
                Configurations = new List <AddSourceTmConfiguration>()
            });
        }
Ejemplo n.º 4
0
        private void Init(Uri providerUri)
        {
            var builder
                = new SQLiteConnectionStringBuilder
                {
                SyncMode   = SynchronizationModes.Off,
                DataSource = _tmDatabasePath,
                Enlist     = false,
                Pooling    = false
                };

            _db = Database.OpenConnection(builder.ToString());

            var persistance = new Persistance();
            var addSourceTmConfigurations = persistance.Load();

            _addSourceTmConfiguration = addSourceTmConfigurations.Configurations.FirstOrDefault(x => x.ProviderUri == providerUri) ??
                                        addSourceTmConfigurations.Default;
        }
        protected override void OnLoad(EventArgs e)
        {
            var persistance = new Persistance();
            _addSourceTmConfigurations = persistance.Load();

            var addSourceTmConfiguration =
                _addSourceTmConfigurations.Configurations.FirstOrDefault(x => x.ProviderUri == _providerUri);
            if (addSourceTmConfiguration == null)
            {
                addSourceTmConfiguration = _addSourceTmConfigurations.Default;
                addSourceTmConfiguration.ProviderUri = _providerUri;
                _addSourceTmConfigurations.Configurations.Add(addSourceTmConfiguration);
            }
            else
            {
                _isUsed = true;
            }

            var dataAccess = TmDataAccess.OpenConnection(addSourceTmConfiguration.ProviderUri);
            var existingCustomFields = dataAccess.GetCustomFields();

            var fileNameFields = new List<string>(existingCustomFields);
            fileNameFields.Insert(0, SelectCustomField);
            cmbFilenameFields.Items.AddRange(fileNameFields.ToArray());

            var fullPathFields = new List<string>(existingCustomFields);
            fullPathFields.Insert(0, SelectCustomField);
            cmbCompletePathField.Items.AddRange(fullPathFields.ToArray());

            var projectNameFields = new List<string>(existingCustomFields);
            projectNameFields.Insert(0, SelectCustomField);
            cmbProjectNameField.Items.AddRange(projectNameFields.ToArray());

            SetConfigurationData(txtFilenameField, cmbFilenameFields, addSourceTmConfiguration.FileNameField);
            SetConfigurationData(txtCompletePathField, cmbCompletePathField, addSourceTmConfiguration.FullPathField);
            SetConfigurationData(txtProjectNameField, cmbProjectNameField, addSourceTmConfiguration.ProjectNameField);
            
            chkFullPath.Checked = addSourceTmConfiguration.StoreFullPath;
            chkFileName.Checked = addSourceTmConfiguration.StoreFilename;
            chkProjectName.Checked = addSourceTmConfiguration.StoreProjectName;
        }
Ejemplo n.º 6
0
        private void Init(Uri providerUri)
        {

            var builder
                = new SQLiteConnectionStringBuilder
                {
                    SyncMode = SynchronizationModes.Off,
                    DataSource = _tmDatabasePath,
                    Enlist = false,
                    Pooling = false
                };

            _db = Database.OpenConnection(builder.ToString());

            var persistance = new Persistance();
            var addSourceTmConfigurations = persistance.Load();

            _addSourceTmConfiguration = addSourceTmConfigurations.Configurations.FirstOrDefault(x => x.ProviderUri == providerUri) ??
                                           addSourceTmConfigurations.Default;

        }