示例#1
0
        public FontObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled)
        {
            AcId = id.ApartFromLast(FontExtension);

            _usingsCarsIds = ValuesStorage.GetStringList(KeyUsingsCarsIds).ToArray();
            IsUsed         = _usingsCarsIds.Any();
        }
 public TrackExtraLayoutObject(IFileAcManager manager, [NotNull] TrackObject parent, bool enabled, string fixedLocation)
         : base(manager, parent.Id, enabled) {
     _location = fixedLocation;
     MainTrackObject = parent;
     LayoutId = Path.GetFileName(fixedLocation) ?? "";
     IdWithLayout = $"{Id}/{LayoutId}";
 }
示例#3
0
        public TrackObject(IFileAcManager manager, string id, bool enabled)
                : base(manager, id, enabled) {
            InitializeLocationsOnce();

            try {
                var information = GetLayouts();
                if (information != null) {
                    _layoutLocation = information.MainLayout;
                    InitializeLocationsInner(_layoutLocation);

                    LayoutId = information.SimpleMainLayout ? null : Path.GetFileName(_layoutLocation);
                    IdWithLayout = information.SimpleMainLayout ? Id : $@"{Id}/{LayoutId}";
                    MultiLayouts = new BetterObservableCollection<TrackObjectBase>(
                            information.AdditionalLayouts.Select(x => {
                                var c = new TrackExtraLayoutObject(manager, this, enabled, x);
                                c.PropertyChanged += Configuration_PropertyChanged;
                                return c;
                            }).Prepend((TrackObjectBase)this));
                    return;
                }
            } catch (AcErrorException e) {
                AddError(e.AcError);
            }

            InitializeLocationsInner(Path.Combine(Location, "ui"));
            _layoutLocation = null;
            LayoutId = null;
            IdWithLayout = Id;
            MultiLayouts = null;
        }
示例#4
0
        public TrackObject(IFileAcManager manager, string id, bool enabled)
            : base(manager, id, enabled)
        {
            InitializeLocationsOnce();

            try {
                var information = GetLayouts();
                if (information != null)
                {
                    _layoutLocation = information.MainLayout;
                    InitializeLocationsInner(_layoutLocation);

                    LayoutId     = information.SimpleMainLayout ? null : Path.GetFileName(_layoutLocation);
                    IdWithLayout = information.SimpleMainLayout ? Id : $@"{Id}/{LayoutId}";
                    MultiLayouts = new BetterObservableCollection <TrackObjectBase>(
                        information.AdditionalLayouts.Select(x => {
                        var c              = new TrackExtraLayoutObject(manager, this, enabled, x);
                        c.PropertyChanged += Configuration_PropertyChanged;
                        return(c);
                    }).Prepend((TrackObjectBase)this));
                    return;
                }
            } catch (AcErrorException e) {
                AddError(e.AcError);
            }

            InitializeLocationsInner(Path.Combine(Location, "ui"));
            _layoutLocation = null;
            LayoutId        = null;
            IdWithLayout    = Id;
            MultiLayouts    = null;
        }
示例#5
0
 public CarObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled) {
     InitializeLocationsOnce();
     SkinsManager = new CarSkinsManager(Id, new InheritingAcDirectories(manager.Directories, SkinsDirectory), Skins_CollectionReady) {
         ScanWrapper = this
     };
     SkinsManager.Created += SkinsManager_Created;
 }
 public TrackExtraLayoutObject(IFileAcManager manager, [NotNull] TrackObject parent, bool enabled, string fixedLocation)
     : base(manager, parent.Id, enabled)
 {
     _location       = fixedLocation;
     MainTrackObject = parent;
     LayoutId        = Path.GetFileName(fixedLocation) ?? "";
     IdWithLayout    = $"{Id}/{LayoutId}";
 }
示例#7
0
 public ServerPresetObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled)
 {
     Sessions = new ChangeableObservableCollection <ServerSessionEntry>(new[] {
         new ServerSessionEntry("BOOK", ToolsStrings.Session_Booking, false, false),
         new ServerSessionEntry("PRACTICE", ToolsStrings.Session_Practice, true, true),
         new ServerSessionEntry("QUALIFY", ToolsStrings.Session_Qualification, true, true),
         new ServerRaceSessionEntry("RACE", ToolsStrings.Session_Race, true, true),
     });
 }
示例#8
0
 public CarObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled)
 {
     InitializeLocationsOnce();
     SkinsManager = new CarSkinsManager(Id, new InheritingAcDirectories(manager.Directories, SkinsDirectory), Skins_CollectionReady)
     {
         ScanWrapper = this
     };
     SkinsManager.Created += SkinsManager_Created;
 }
示例#9
0
 public KunosCareerObject(IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
     ChampionshipDrivers     = new BetterObservableCollection <ChampionshipDriverEntry>();
     ChampionshipDriversView = new BetterListCollectionView(ChampionshipDrivers)
     {
         CustomSort = this
     };
 }
示例#10
0
        public ServerPresetObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled)
        {
            SimpleSessions = new[] {
                new ServerSessionEntry("BOOK", ToolsStrings.Session_Booking, false, false),
                new ServerSessionEntry("PRACTICE", ToolsStrings.Session_Practice, true, true),
                new ServerQualificationSessionEntry("QUALIFY", ToolsStrings.Session_Qualification, true, true)
            };

            RaceSession = new ServerRaceSessionEntry("RACE", ToolsStrings.Session_Race, true, true);
            Sessions    = new ChangeableObservableCollection <ServerSessionEntry>(SimpleSessions.Append(RaceSession));
            Sessions.ItemPropertyChanged += OnSessionEntryPropertyChanged;
        }
示例#11
0
 public CarSkinObject([NotNull] string carId, IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
     CarId       = carId;
     _nameFromId = new Lazy <string>(() => {
         var cut = Regex.Replace(Id, @"^\d\d?_", "");
         if (string.IsNullOrEmpty(cut))
         {
             cut = Id;
         }
         return(AcStringValues.NameFromId(cut));
     });
 }
示例#12
0
        public CarSetupObject(string carId, IFileAcManager manager, string id, bool enabled)
            : base(manager, id, enabled)
        {
            CarId = carId;

            foreach (var tyrePressure in TyresPressure)
            {
                tyrePressure.PropertyChanged += (sender, args) => {
                    if (args.PropertyName == nameof(tyrePressure.Value))
                    {
                        Changed = true;
                    }
                };
            }
        }
示例#13
0
 // ReSharper disable once NotNullMemberIsNotInitialized
 protected AcCommonObject(IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
     FileAcManager = manager;
 }
示例#14
0
 public WeatherObject(IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
     _temperatureDiapasonLazier = Lazier.Create(() => TemperatureDiapason == null ? null : Diapason.CreateDouble(TemperatureDiapason));
     _timeDiapasonLazier        = Lazier.Create(() => TimeDiapason == null ? null : Diapason.CreateTime(TimeDiapason));
 }
示例#15
0
 public CarObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled)
 {
     InitializeLocationsOnce();
     SkinsManager = InitializeSkins();
 }
示例#16
0
 protected AcCommonSingleFileObject(IFileAcManager manager, string id, bool enabled)
         : base(manager, id, enabled) { }
示例#17
0
 public PythonAppObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled)
 {
     AppIcon = Lazier.CreateAsync(TryToFindAppIconAsync);
     Windows = Lazier.CreateAsync(() => Task.Run(() => GetWindows().ToIReadOnlyListIfItIsNot()));
 }
示例#18
0
 public PpFilterObject(IFileAcManager manager, string id, bool enabled)
         : base(manager, id, enabled) { }
示例#19
0
 protected TrackObjectBase(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled)
 {
 }
示例#20
0
 public ShowroomObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled)
 {
 }
示例#21
0
 protected TrackObjectBase(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled) { }
示例#22
0
 public ServerPresetObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled) {}
示例#23
0
 protected AcIniObject(IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
 }
示例#24
0
 public KunosCareerEventObject(string kunosCareerId, KunosCareerObjectType type, IFileAcManager manager, string id, bool enabled)
         : base(manager, id, enabled) {
     KunosCareerId = kunosCareerId;
     EventNumber = FlexibleParser.ParseInt(id.Substring(@"event".Length)) - 1;
     KunosCareerType = type;
 }
示例#25
0
 public PythonAppObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled)
 {
 }
示例#26
0
 protected AcJsonObjectNew(IFileAcManager manager, string id, bool enabled)
         : base(manager, id, enabled) {
     Tags = new TagsCollection();
 }
示例#27
0
 public ReplayObject(IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
 }
示例#28
0
 public ReplayObject(IFileAcManager manager, string id, bool enabled)
         : base(manager, id, enabled) { }
 protected AcCommonSingleFileObject(IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
 }
示例#30
0
 public TrackSkinObject([NotNull] string carId, IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
     TrackId = carId;
 }
示例#31
0
 public ShowroomObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled) {}
示例#32
0
 public PpFilterObject(IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
 }
示例#33
0
        public FontObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled) {
            AcId = id.ApartFromLast(FontExtension);

            _usingsCarsIds = ValuesStorage.GetStringList(KeyUsingsCarsIds).ToArray();
            IsUsed = _usingsCarsIds.Any();
        }
示例#34
0
 public SpecialEventObject(IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
 }
示例#35
0
 public CarSkinObject(string carId, IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
     CarId = carId;
 }
示例#36
0
 protected AcIniObject(IFileAcManager manager, string id, bool enabled)
         : base(manager, id, enabled) {
 }
示例#37
0
 public CarSkinObject(string carId, IFileAcManager manager, string id, bool enabled)
         : base(manager, id, enabled) {
     CarId = carId;
 }
示例#38
0
 protected KunosEventObjectBase(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled) {}
示例#39
0
 public PythonAppObject(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled) {}
示例#40
0
 public KunosCareerEventObject(string kunosCareerId, KunosCareerObjectType type, IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
     KunosCareerId   = kunosCareerId;
     EventNumber     = FlexibleParser.ParseInt(id.Substring(@"event".Length)) - 1;
     KunosCareerType = type;
 }
示例#41
0
 public TrueTypeFontObject(IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
 }
示例#42
0
 protected AcJsonObjectNew(IFileAcManager manager, string id, bool enabled)
     : base(manager, id, enabled)
 {
     Tags = new TagsCollection();
 }
示例#43
0
 protected KunosEventObjectBase(IFileAcManager manager, string id, bool enabled) : base(manager, id, enabled)
 {
 }
示例#44
0
 // ReSharper disable once NotNullMemberIsNotInitialized
 protected AcCommonObject(IFileAcManager manager, string id, bool enabled)
         : base(manager, id, enabled) {
     FileAcManager = manager;
 }