예제 #1
0
파일: SMSPhone.cs 프로젝트: TRSASC/Lab5
        public SMSPhone()
        {
            SMSButtonClicked = false;

            simCorp   = new SimCorpMobile(new ListViewOutput(MessageListView));
            MsgAdder += AddMsgToTextBox;
            simCorp.MsgStor.MsgAdded   += OnMsgAdded;
            simCorp.MsgStor.MsgRemoved += OnMsgRemoved;

            InitializeComponent();
            FormatItem defaultItem = new FormatItem("None", StringFormatter.FormatNone);

            FormatComboBox.Items.Add(defaultItem);
            FormatComboBox.Items.Add(new FormatItem("Start with DateTime", StringFormatter.FormatStartDateTime));
            FormatComboBox.Items.Add(new FormatItem("End with DateTime", StringFormatter.FormatEndDateTime));
            FormatComboBox.Items.Add(new FormatItem("Lowercase", StringFormatter.FormatLower));
            FormatComboBox.Items.Add(new FormatItem("Uppercase", StringFormatter.FormatUpper));
            FormatComboBox.SelectedItem = defaultItem;

            SenderComboBox.Items.Add(allSenderItem);
            SenderComboBox.SelectedItem = allSenderItem;
            OrAndCheckBox.Checked       = true;

            ChargeProgressBar.Value = simCorp.Battery.GetCurrentCharge();
            UpdProgBar          += OnChargeChanged;
            BatteryDischargeTask = new Task(() => { Discharge(); });
            BatteryDischargeTask.Start();
            simCorp.Battery.ChargeChanged += OnChargeLevelChanged;
        }
예제 #2
0
파일: SMSPhone.cs 프로젝트: TRSASC/Lab6
        public SMSPhone()
        {
            CallButtonClicked = false;

            simCorp    = new SimCorpMobile(new ListViewOutput(CallListView));
            CallAdder += AddCallToTextBox;
            simCorp.CallStor.CallAdded   += OnCallAdded;
            simCorp.CallStor.CallRemoved += OnCallRemoved;

            InitializeComponent();


            ChargeProgressBar.Value = simCorp.Battery.GetCurrentCharge();
            UpdProgBar          += OnChargeChanged;
            BatteryDischargeTask = new Task(() => { Discharge(); });
            BatteryDischargeTask.Start();
            simCorp.Battery.ChargeChanged += OnChargeLevelChanged;
        }