예제 #1
0
        protected GameSettingsProfile(Guid id, string name, string color, GameSettingsProfileBase parent)
            : base(id, name, color)
        {
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }
            _parent = parent;

            //SetupRefresh();
        }
예제 #2
0
        static IEnumerable <IGetData> GetAllProfiles(GameSettingsProfileBase activeProfile)
        {
            if (!(activeProfile != null))
            {
                throw new NullReferenceException("activeProfile != null");
            }

            var profile = activeProfile;

            while (profile != null)
            {
                yield return(profile);

                profile = profile.Parent;
            }
        }
예제 #3
0
 public GameSettingsProfile(string name, string color, GameSettingsProfileBase parent)
     : this(Guid.NewGuid(), name, color, parent)
 {
 }
예제 #4
0
 public void OnDeserialized(StreamingContext context)
 {
     ActiveProfile = _profiles.FirstOrDefault(x => x.Id == ActiveProfileGuid);
 }