Esempio n. 1
0
        public SimCorpMobile(IOutput output)
        {
            Output         = output;
            vModelName     = "SimCorp Mobile";
            vBattery       = new LiIonBattery(3000, 1500);
            vSpeaker       = new StereoSpeakerSystem(new RealSpeaker(2), new RealSpeaker(2), 40, this.Output);
            vSpeakerName   = nameof(StereoSpeakerSystem);
            vKeyBoard      = new TouchScreenKeyboard();
            vMicrophone    = new MobileMicrophone();
            vSimCard       = new DualSimCardSlot(SimCardTypes.MicroSimCard, SimCardTypes.NanoSimCard);
            vScreen        = new OLEDScreen(1280, 720, 280);
            vMainCamera    = new VideoCamera("Main", 13, true, true);
            vFrontalCamera = new VideoCamera("Frontal", 5, true, true);
            vCallStor      = new CallStorage();
            Contact contact1 = new Contact("Taras", new List <string> {
                "0633333333", "0966666666"
            });
            Contact contact2 = new Contact("Jeeves", "0674612131");
            Contact contact3 = new Contact("Wooster", "0503322189");

            vContactStor = new ContactStorage(new List <Contact> {
                contact1, contact2, contact3
            });
            CallGen = new CallGenerator(vContactStor);
            CallGen.CallReceived += OnCallReceived;
        }
        //----------------------------------------
        #region ** Initializing
        public MainWindow()
        {
            Language = System.Windows.Markup.XmlLanguage.GetLanguage(System.Globalization.CultureInfo.CurrentCulture.Name);

            InitializeComponent();

            // get data from the data base
            this.appointeesTableAdapter.Fill(dataSet.Appointees);
            this.appointmentsTableAdapter.Fill(dataSet.Appointments);

            // set mappings and DataSource for the ContactStorage
            ContactStorage cstorage = scheduler.DataStorage.ContactStorage;

            cstorage.Mappings.IndexMapping.MappingName = "EmployeeID";
            cstorage.Mappings.TextMapping.MappingName  = "FirstName";
            cstorage.DataMember = "Appointees";
            cstorage.DataSource = dataSet.Appointees;

            // set correct MenuCaption for contacts
            foreach (Contact cnt in scheduler.DataStorage.ContactStorage.Contacts)
            {
                C1NwindDataSet.AppointeesRow row = dataSet.Appointees.FindByEmployeeID((int)cnt.Key[0]);
                if (row != null)
                {
                    cnt.MenuCaption = row["FirstName"].ToString() + " " + row["LastName"].ToString();
                }
            }

            // set mappings and DataSource for the AppointmentStorage
            AppointmentStorage storage = scheduler.DataStorage.AppointmentStorage;

            storage.Mappings.AppointmentProperties.MappingName = "Properties";
            storage.Mappings.Body.MappingName      = "Body";
            storage.Mappings.End.MappingName       = "End";
            storage.Mappings.IdMapping.MappingName = "Id";
            storage.Mappings.Location.MappingName  = "Location";
            storage.Mappings.Start.MappingName     = "Start";
            storage.Mappings.Subject.MappingName   = "Subject";
            storage.DataMember = "Appointments";
            storage.DataSource = dataSet.Appointments;

            themeList.SelectedItem   = "Colorful";
            agendaRange.SelectedItem = "Week";

            Closing += MainWindow_Closing;
        }
Esempio n. 3
0
        public Window1()
        {
            Language = System.Windows.Markup.XmlLanguage.GetLanguage(System.Globalization.CultureInfo.CurrentCulture.Name);
            InitializeComponent();

            Scheduler.ReminderFire += new EventHandler <ReminderActionEventArgs>(scheduler_ReminderFire);

            Scheduler.GroupItems.CollectionChanged += new NotifyCollectionChangedEventHandler(GroupItems_CollectionChanged);

            // get data from the data base
            this.employeesTableAdapter.Fill(dataSet.Employees);
            this.customersTableAdapter.Fill(dataSet.Customers);
            this.appointmentsTableAdapter.Fill(dataSet.Appointments);

            // set mappings and DataSource for the AppointmentStorages
            AppointmentStorage storage = Scheduler.DataStorage.AppointmentStorage;

            storage.Mappings.AppointmentProperties.MappingName = "Properties";
            storage.Mappings.Body.MappingName              = "Description";
            storage.Mappings.End.MappingName               = "End";
            storage.Mappings.IdMapping.MappingName         = "AppointmentId";
            storage.Mappings.Location.MappingName          = "Location";
            storage.Mappings.Start.MappingName             = "Start";
            storage.Mappings.Subject.MappingName           = "Subject";
            storage.Mappings.OwnerIndexMapping.MappingName = "Owner";
            storage.DataSource = dataSet.Appointments;

            // set mappings and DataSource for the OwnerStorage
            ContactStorage ownerStorage = Scheduler.DataStorage.OwnerStorage;

            ((INotifyCollectionChanged)ownerStorage.Contacts).CollectionChanged += new NotifyCollectionChangedEventHandler(Owners_CollectionChanged);
            ownerStorage.Mappings.IndexMapping.MappingName = "EmployeeId";
            ownerStorage.Mappings.TextMapping.MappingName  = "FirstName";
            ownerStorage.DataSource = dataSet.Employees;

            // set mappings and DataSource for the ContactStorage
            ContactStorage cntStorage = Scheduler.DataStorage.ContactStorage;

            ((INotifyCollectionChanged)cntStorage.Contacts).CollectionChanged += new NotifyCollectionChangedEventHandler(Contacts_CollectionChanged);
            cntStorage.Mappings.IdMapping.MappingName   = "CustomerId";
            cntStorage.Mappings.TextMapping.MappingName = "CompanyName";
            cntStorage.DataSource = dataSet.Customers;

            btnDay.IsChecked        = true;
            Scheduler.StyleChanged += new System.EventHandler <RoutedEventArgs>(Scheduler_StyleChanged);
        }