public SelectFieldStrategy(TypeViewModel document, string typeName, string columnName, int row)
 {
     this.document   = document;
     this.columnName = columnName;
     this.row        = row;
     this.document.SelectedColumn    = this.columnName;
     this.document.SelectedItemIndex = this.row;
     this.document.PropertyChanged  += Document_PropertyChanged;
 }
Example #2
0
        public void OpenType(Authentication authentication, IType type)
        {
            var document = this.Items.OfType <TypeViewModel>().FirstOrDefault(item => item.Target == type);

            if (document == null)
            {
                document = new TypeViewModel(authentication, type);
                this.Items.Add(document);
            }
            var cancellation = new CancellationTokenSource();

            this.ActivateItemAsync(document, cancellation.Token);
        }
Example #3
0
        public void MoveToType(Authentication authentication, IType type, string columnName, int row)
        {
            var document = this.Items.OfType <TypeViewModel>().FirstOrDefault(item => item.Target == type);

            if (document == null)
            {
                document = new TypeViewModel(authentication, type);
                this.Items.Add(document);
            }
            var cancellation = new CancellationTokenSource();

            this.ActivateItemAsync(document, cancellation.Token);
            new SelectFieldStrategy(document, document.Source.TypeName, columnName, row);
        }