internal void SwitchActiveSource(SwitchRelationBooleanPropertyMessage message)
        {
            VmInstrument vmInstrument = this._Instruments.Single(i => i.Id == message.InstrumentId);

            vmInstrument.SourceRelations.Single(r => r.Id == message.NewRelationId).ApplyChangeToUI(message.PropertyName, true);
            vmInstrument.SourceRelations.Single(r => r.Id == message.OldRelationId).ApplyChangeToUI(message.PropertyName, false);
        }
 internal void Process(SwitchRelationBooleanPropertyMessage message)
 {
     VmQuotationManager.Instance.SwitchActiveSource(message);
 }
 internal void SwitchActiveSource(SwitchRelationBooleanPropertyMessage message)
 {
     VmInstrument vmInstrument = this._Instruments.Single(i => i.Id == message.InstrumentId);
     vmInstrument.SourceRelations.Single(r => r.Id == message.NewRelationId).ApplyChangeToUI(message.PropertyName, true);
     vmInstrument.SourceRelations.Single(r => r.Id == message.OldRelationId).ApplyChangeToUI(message.PropertyName, false);
 }
        private void SwitchActiveSource(int newSourceId)
        {
            double agio = 0;
            int oldSourceId = this._ActiveSource.Id;
            if (!this._Instrument.IsSwitchUseAgio.Value || this._AgioCalculator.CanSwith(oldSourceId, newSourceId, out agio))
            {
                this._Relations[oldSourceId].IsActive = false;
                this._Relations[newSourceId].IsActive = true;
                this._ActiveSource.ChangeSource(this._Relations[newSourceId]);
                this._Agio = agio;

                // Update database and notify Console
                int newRelationId = this._Relations[newSourceId].Id;
                int oldRelationId = this._Relations[oldSourceId].Id;
                DataAccess.QuotationData.SwitchActiveSource(newRelationId, oldRelationId);
                SwitchRelationBooleanPropertyMessage switchActiveSourceMessage = new SwitchRelationBooleanPropertyMessage()
                {
                    InstrumentId = this._Instrument.Id,
                    PropertyName = FieldSR.IsActive,
                    OldRelationId = oldRelationId,
                    NewRelationId = newRelationId
                };
                MainService.ClientManager.Dispatch(switchActiveSourceMessage);
                Logger.AddEvent(TraceEventType.Information, "SwitchActiveSource switched from {0} to {1}", oldRelationId, newSourceId);

                // write log
                WriteLogManager.WriteSourceChangeLog(LogManager.Instance.GetLogSourceChangeEntity(oldSourceId,newSourceId));
            }
        }
예제 #5
0
 public void SwitchDefaultSource(SwitchRelationBooleanPropertyMessage switchMessage)
 {
     this._ServiceProxy.BeginSwitchDefaultSource(switchMessage, delegate(IAsyncResult ar)
     {
         this._ServiceProxy.EndSwitchDefaultSource(ar);
     }, null);
 }
예제 #6
0
 private void Process(SwitchRelationBooleanPropertyMessage message)
 {
     this._QuotationMessageProcessor.Process(message);
 }