Beispiel #1
0
        public void AddNewProjectSync()
        {
            if (_selectedProjectGuidParsed == Guid.Empty)
            {
                return;
            }
            if (SyncProjects.All(x => x.ProjectGuid != _selectedProjectGuidParsed))
            {
                var existed = SyncProjects.FirstOrDefault(x => x.ProjectName == SelectedProject);
                if (existed != null)
                {
                    existed.ProjectGuid = _selectedProjectGuidParsed;
                    var control = SyncProjectControls.FirstOrDefault(x => x.Item.ProjectName == existed.ProjectName);
                    if (control != null)
                    {
                        control.Item = existed;
                    }
                }
                else
                {
                    SyncProjects.Add(new ProjectSyncItem
                    {
                        ProjectGuid = _selectedProjectGuidParsed,
                        ProjectName = SelectedProject
                    });
                }
            }

            SelectedProject     = null;
            SelectedProjectGuid = null;
            OnPropertyChanged(nameof(IsSaveEnabled));
        }
Beispiel #2
0
        private void MapSettings(Settings settings)
        {
            IsEnabled        = settings.IsEnabled;
            UnityProjectPath = settings.UnityProjectPath;
            foreach (var item in settings.ProjectSyncItems)
            {
                SyncProjects.Add(item);
            }
            Cache.Instance.ScanProjects.AddRange(SyncProjects.Select(x => new ProjectScanItem
            {
                ProjectGuid = x.ProjectGuid,
                ProjectName = x.ProjectName
            }));

            OnPropertyChanged(nameof(IsSaveEnabled));
        }