public void InitializeProtocolEditor( IKeyMode editedKeyMode ) { EditedKeyMode = editedKeyMode; ProtocolEditor = new VMProtocolEditor(); }
public VMProtocolEditorsProvider() { _availableProtocolEditors = new Dictionary<string, VMProtocolEditorWrapper>(); _availableProtocolHandlers = new Dictionary<string, Type>(); ProtocolEditor = new VMProtocolEditor(); }
public void CreateKeyCommand( string keyCommand, IKeyMode editedKeyMode ) { EditedKeyMode = editedKeyMode; ProtocolEditor = new VMProtocolEditor(); //not using the Split method in order to let a parameter use the ':' char int idx = keyCommand.IndexOf( ':' ); string protocol = keyCommand.Substring( 0, idx ); string parameter = keyCommand.Substring( idx + 1 ); ProtocolEditor.Wrapper = GetProtocolEditorWrapper( protocol ); SelectedProtocolEditorWrapper = ProtocolEditor.Wrapper; if( ProtocolEditor.Wrapper.IsValid ) { ProtocolEditor.ParameterManager = SelectedProtocolEditorWrapper.CreateParameterManager(); if( ProtocolEditor.ParameterManager == null ) throw new ArgumentNullException( String.Format( "Null value retrieved while trying to retrieve the IKeyCommandParameterManager for the KeyCommandTypeViewModel handling the protocol '{0}'", protocol ) ); ProtocolEditor.ParameterManager.Root = this; ProtocolEditor.ParameterManager.FillFromString( parameter ); } OnPropertyChanged( "ProtocolEditor" ); }