Пример #1
0
        public void Initialize()
        {
            InitializeData();

            HTTPConfigurationProvider configurationProvider = new HTTPConfigurationProvider();
            _community = new Community(IsolatedStorageStorageStrategy.Load())
                .AddAsynchronousCommunicationStrategy(new BinaryHTTPAsynchronousCommunicationStrategy(configurationProvider))
                .Register<CorrespondenceModel>()
                .Subscribe(() => _attendee.Conference)
                .Subscribe(() => _individual)
                .Subscribe(() => _attendee.ScheduledSessions)
                ;

            Individual identity = _community.AddFact(new Individual(GetAnonymousUserId()));
            _attendee = identity.GetAttendee(CommonSettings.ConferenceID);
            configurationProvider.Individual = identity;

            // Synchronize whenever the user has something to send.
            _community.FactAdded += delegate
            {
                Synchronize();
            };

            // Synchronize when the network becomes available.
            System.Net.NetworkInformation.NetworkChange.NetworkAddressChanged += (sender, e) =>
            {
                if (NetworkInterface.GetIsNetworkAvailable())
                    Synchronize();
            };

            // And synchronize on startup or resume.
            Synchronize();

            //DataLoader.Load(conference);
        }
Пример #2
0
 public TrackDayViewModel(Attendee attendee, Track track, Day day, ImageCache imageCache)
 {
     _attendee = attendee;
     _track = track;
     _day = day;
     _imageCache = imageCache;
 }
Пример #3
0
 public ScheduleViewModel(SynchronizationService synchronizationService, Attendee attendee, ImageCache imageCache, SearchModel searchModel)
 {
     _synchronizationService = synchronizationService;
     _attendee = attendee;
     _imageCache = imageCache;
     _searchModel = searchModel;
 }
Пример #4
0
 public MainViewModel(Attendee attendee, SynchronizationService synhronizationService, ImageCache imageCache, SearchModel searchModel, Clock clock)
 {
     _attendee = attendee;
     _synhronizationService = synhronizationService;
     _imageCache = imageCache;
     _searchModel = searchModel;
     _clock = clock;
 }
Пример #5
0
        public TracksViewModel(Attendee attendee, ImageCache imageCache, SearchModel searchModel)
        {
            _attendee = attendee;
            _imageCache = imageCache;
            _searchModel = searchModel;

            _tracks = new DependentList<Track>(() =>
                from track in _attendee.Conference.Tracks
                orderby track.Name
                select track);
        }
Пример #6
0
        public SearchDayViewModel(Attendee attendee, Day day, ImageCache imageCache, SearchModel searchModel)
        {
            _attendee = attendee;
            _day = day;
            _imageCache = imageCache;
            _searchModel = searchModel;

            _matchingSessionPlaces = new DependentList<SessionPlace>(() =>
                _searchModel.SearchTerm == null || _searchModel.SearchTerm.Length < 3 ?
                    Enumerable.Empty<SessionPlace>() :
                    from time in _day.Times
                    from sessionPlace in time.AvailableSessions
                    where sessionPlace.Session.Matches(_searchModel.SearchTerm.ToLower())
                    select sessionPlace);
        }
Пример #7
0
 // Business constructor
 public Slot(
     Attendee attendee
     ,Time slotTime
     )
 {
     InitializeResults();
     _attendee = new PredecessorObj<Attendee>(this, GetRoleAttendee(), attendee);
     _slotTime = new PredecessorObj<Time>(this, GetRoleSlotTime(), slotTime);
 }
Пример #8
0
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                Attendee newFact = new Attendee(memento);

                return newFact;
            }
Пример #9
0
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                Attendee newFact = new Attendee(memento);

                // Create a memory stream from the memento data.
                using (MemoryStream data = new MemoryStream(memento.Data))
                {
                    using (BinaryReader output = new BinaryReader(data))
                    {
                        newFact._identifier = (string)_fieldSerializerByType[typeof(string)].ReadData(output);
                    }
                }

                return newFact;
            }
Пример #10
0
 // Fields
 // Results
 // Business constructor
 public IndividualAttendee(
     Individual individual
     ,Attendee attendee
     )
 {
     InitializeResults();
     _individual = new PredecessorObj<Individual>(this, GetRoleIndividual(), individual);
     _attendee = new PredecessorObj<Attendee>(this, GetRoleAttendee(), attendee);
 }
Пример #11
0
 public ScheduleDayViewModel(Day day, Attendee attendee, ImageCache imageCache)
 {
     _day = day;
     _attendee = attendee;
     _imageCache = imageCache;
 }
Пример #12
0
 public NoticesViewModel(Attendee attendee, ImageCache imageCache, Clock clock)
 {
     _attendee = attendee;
     _imageCache = imageCache;
     _clock = clock;
 }
Пример #13
0
 public SettingsViewModel(Individual individual, Attendee attendee)
 {
     _individual = individual;
     _attendee = attendee;
 }
Пример #14
0
 public ScheduleDayViewModel(DateTime date, Attendee attendee, ImageCache imageCache)
 {
     _date = date;
     _attendee = attendee;
     _imageCache = imageCache;
 }
Пример #15
0
 public SpeakerViewModel(Attendee attendee, Speaker speaker, ImageCache imageCache)
 {
     _attendee = attendee;
     _speaker = speaker;
     _imageCache = imageCache;
 }
Пример #16
0
 public TrackViewModel(Attendee attendee, Track track, ImageCache imageCache)
 {
     _attendee = attendee;
     _track = track;
     _imageCache = imageCache;
 }
Пример #17
0
 public SearchViewModel(Attendee attendee, ImageCache imageCache, SearchModel searchModel)
 {
     _attendee = attendee;
     _imageCache = imageCache;
     _searchModel = searchModel;
 }
Пример #18
0
 public ScheduleSlotViewModel(Attendee attendee, Time time, ImageCache imageCache)
 {
     _attendee = attendee;
     _time = time;
     _imageCache = imageCache;
 }
Пример #19
0
 // Fields
 // Results
 // Business constructor
 public AttendeeInactive(
     Attendee attendee
     )
 {
     _unique = Guid.NewGuid();
     InitializeResults();
     _attendee = new PredecessorObj<Attendee>(this, GetRoleAttendee(), attendee);
 }