public PermissionMaterialView()
        {
            _disposableContext = new DisposableContext(this);
            InitializeComponent();

            _editRowMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "EditRowMenuItem");
            _statusMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "StatusRowMenuItem");
            _removeMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "RemoveRowMenuItem");
            _extendMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "ExtendRowMenuItem");
            _insertExMenuItem =
                ((ContextMenu)RootGrid.Resources["ExDataGridMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "ExInsertMenuItem");
            _insertExRowMenuItem =
                ((ContextMenu)RootGrid.Resources["ExDataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "ExInsertRowMenuItem");
            _editExRowMenuItem =
                ((ContextMenu)RootGrid.Resources["ExDataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "ExEditRowMenuItem");
            _removeExRowMenuItem =
                ((ContextMenu)RootGrid.Resources["ExDataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "ExRemoveRowMenuItem");
        }
        public void IsEnlistedDisposable()
        {
            Action dispose = () => { };

            IDisposable first = dispose.ToDisposable();
            IDisposable second = dispose.ToDisposable();

            using (DisposableContext dc = new DisposableContext())
            {
                dc.Enlist(first);
                Assert.IsTrue(dc.IsEnlisted(first));

                using (DisposableContext dc2 = new DisposableContext())
                {
                    dc2.Enlist(second);

                    Assert.IsFalse(dc2.IsEnlisted(first));
                    Assert.IsTrue(dc2.IsEnlisted(second));
                }

                Assert.IsTrue(dc.IsEnlisted(first));
                Assert.IsTrue(dc.IsEnlisted(second));
                Assert.IsFalse(dc.IsEnlisted(dispose.ToDisposable()));
            }
        }
        public ActSelectionOfProbeView()
        {
            InitializeComponent();
            _disposableContext = new DisposableContext(this);


            _dataGridActSelectionOfProbeEditRowMenuItem   = this.GetMenuItem("DataGridActSelectionOfProbeGridRowMenu", "DataGridActSelectionOfProbeEditRowMenuItem");
            _dataGridActSelectionOfProbeStateRowMenuItem  = this.GetMenuItem("DataGridActSelectionOfProbeGridRowMenu", "DataGridActSelectionOfProbeStateRowMenuItem");
            _dataGridActSelectionOfProbeRemoveRowMenuItem = this.GetMenuItem("DataGridActSelectionOfProbeGridRowMenu", "DataGridActSelectionOfProbeRemoveRowMenuItem");

            _dataGridMakingSampleInsertRowMenuItem = this.GetMenuItem("DataGridMakingSampleDataGridRowMenu", "DataGridMakingSampleInsertRowMenuItem");
            _dataGridMakingSampleEditRowMenuItem   = this.GetMenuItem("DataGridMakingSampleDataGridRowMenu", "DataGridMakingSampleEditRowMenuItem");

            _dataGridMakingSamplePrintLabelRowMenuItem = this.GetMenuItem("DataGridMakingSampleDataGridRowMenu", "DataGridMakingSamplePrintLabelRowMenuItem");


            _dataGridMakingSampleRemoveRowMenuItem       = this.GetMenuItem("DataGridMakingSampleDataGridRowMenu", "DataGridMakingSampleRemoveRowMenuItem");
            _dataGridMakingSampleChangeStatusRowMenuItem = this.GetMenuItem("DataGridMakingSampleDataGridRowMenu", "DataGridMakingSampleChangeStatusRowMenuItem");

            _dataGridMakingSampleInsertMenuItem = this.GetMenuItem("DataGridMakingSampleDataGridMenu", "DataGridMakingSampleInsertSendMenuItem");


            _dataGridRequirementsInsertMenuItem    = this.GetMenuItem("DataGridRequirementsMenu", "DataGridRequirementsInsertMenuItem");
            _dataGridRequirementsInsertRowMenuItem = this.GetMenuItem("DataGridRequirementsRowMenu", "DataGridRequirementsInsertRowMenuItem");
            _dataGridRequirementsRemoveRowMenuItem = this.GetMenuItem("DataGridRequirementsRowMenu", "DataGridRequirementsRemoveRowMenuItem");
            _dataGridRequirementsEditRowMenuItem   = this.GetMenuItem("DataGridRequirementsRowMenu", "DataGridRequirementsEditRowMenuItem");
        }
Ejemplo n.º 4
0
        public WarehouseQualityCertificateView()
        {
            _disposableContext = new DisposableContext(this);
            InitializeComponent();

            _takeMaterialMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "TakeMaterialMenuItem");
            _removeMenuItem = ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                              .First(x => x.Name == "RemoveMenuItem");
        }
        public void Dispose_WhenHasEnlistent_DisposesEnlistment()
        {
            bool disposed = false;
            Action dispose = () => disposed = true;

            using (DisposableContext dc = new DisposableContext())
            {
                dc.Enlist(dispose.ToDisposable());
            }

            Assert.IsTrue(disposed);
        }
Ejemplo n.º 6
0
        public AttachedDocumentView()
        {
            _disposableContext = new DisposableContext(this);
            InitializeComponent();
            _removeMenuItem =
                ((ContextMenu)this.RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "RemoveRowMenuItem");
            _defaultImage = new BitmapImage(new Uri("/Assets/NoImage.png", UriKind.RelativeOrAbsolute));

            Loaded   += (sender, args) => ReBind();
            Unloaded += (sender, args) => _disposableObject.Dispose();
        }
        public PlanReceiptOrderView()
        {
            InitializeComponent();

            _groupStatusRowMenuItem = this.GetMenuItem("DataGridRowMenu", "SetGroupPersonalAccountPlanReceiptOrderRowMenuItem");
            _editRowMenuItem        = this.GetMenuItem("DataGridRowMenu", "EditRowMenuItem");
            _insertRowMenuItem      = this.GetMenuItem("DataGridRowMenu", "InsertRowMenuItem");
            _insertMenuItem         = this.GetMenuItem("DataGridMenu", "InsertMenuItem");
            _statusMenuItem         = this.GetMenuItem("DataGridRowMenu", "StatusRowMenuItem");
            _removeMenuItem         = this.GetMenuItem("DataGridRowMenu", "RemoveRowMenuItem");
            _disposableContext      = new DisposableContext(this);
        }
		public void Dispose_Sync()
		{
			var context = new Mock<SynchronizationContext>(MockBehavior.Strict);
			context.Setup(_ => _.Send(It.IsAny<SendOrPostCallback>(), It.IsAny<object>())).Callback((SendOrPostCallback c, object s) => c(s));

			var item = new Mock<IDisposable>(MockBehavior.Strict);
			item.Setup(_ => _.Dispose());

			var disposable = new DisposableContext(item.Object, context.Object);
			disposable.Dispose();

			context.Verify(_ => _.Send(It.IsAny<SendOrPostCallback>(), It.IsAny<object>()), Times.Once);
			item.Verify(_ => _.Dispose(), Times.Once);
		}
 public CuttingOrderSpecificationView()
 {
     InitializeComponent();
     _editRowMenuItem =
         ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
         .First(x => x.Name == "EditRowMenuItem");
     _insertRowMenuItem =
         ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
         .First(x => x.Name == "InsertRowMenuItem");
     _insertMenuItem =
         ((ContextMenu)RootGrid.Resources["DataGridMenu"]).Items.Cast <MenuItem>()
         .First(x => x.Name == "InsertMenuItem");
     _disposableContext = new DisposableContext(this);
 }
Ejemplo n.º 10
0
        public PlanCertificateView()
        {
            InitializeComponent();

            _changeStatusCertificate          = this.GetMenuItem("DataGridRowMenu", "ChangeStatusRowMenuItem");
            _insertMenuItem                   = this.GetMenuItem("DataGridMenu", "InsertMenuItem");
            _editRowMenuItem                  = this.GetMenuItem("DataGridRowMenu", "EditRowMenuItem");
            _insertRowMenuItem                = this.GetMenuItem("DataGridRowMenu", "InsertRowMenuItem");
            _removeRowMenuItem                = this.GetMenuItem("DataGridRowMenu", "RemoveRowMenuItem");
            _copyRowMenuItem                  = this.GetMenuItem("DataGridRowMenu", "CopyRowMenuItem");
            _personalAccountInsertRowMenuItem = this.GetMenuItem("SubDgRowMenu", "PersonalAccountInsertRowMenuItem");
            _personalAccountEditRowMenuItem   = this.GetMenuItem("SubDgRowMenu", "PersonalAccountEditRowMenuItem");
            _personalAccountInsertMenuItem    = this.GetMenuItem("SubDgMenu", "PersonalAccountInsertMenuItem");
            _personalAccountRemoveRowMenuItem = this.GetMenuItem("SubDgRowMenu", "PersonalAccountRemoveRowMenuItem");
            _personalAccountStatusRowMenuItem = this.GetMenuItem("SubDgRowMenu", "PersonalAccountStatusRowMenuItem");

            _disposableContext = new DisposableContext(this);
        }
Ejemplo n.º 11
0
        public DepartmentOrderView()
        {
            InitializeComponent();

            _editRowMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "EditRowMenuItem");
            _insertRowMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "InsertRowMenuItem");
            _insertMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "InsertMenuItem");
            _statusMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "StatusRowMenuItem");
            _removeMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "RemoveRowMenuItem");

            _disposableContext = new DisposableContext(this);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CuttingOrderView"/> class.
        /// </summary>
        public CuttingOrderView()
        {
            InitializeComponent();
            //_editRowMenuItem =
            //    ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast<MenuItem>()
            //                                                        .First(x => x.Name == "EditRowMenuItem");
            //_insertRowMenuItem =
            //    ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast<MenuItem>()
            //                                                        .First(x => x.Name == "InsertRowMenuItem");
            //_insertMenuItem =
            //    ((ContextMenu)RootGrid.Resources["DataGridMenu"]).Items.Cast<MenuItem>()
            //                                                     .First(x => x.Name == "InsertMenuItem");
            _detaileViewRowMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "DetaileViewRowMenuItem");

            _statusMenuItem =
                ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
                .First(x => x.Name == "StatusRowMenuItem");
            _disposableContext = new DisposableContext(this);

            DtGridCuttingOrders.MouseDoubleClick += DtGridCuttingOrders_MouseDoubleClick;
        }
Ejemplo n.º 13
0
 public ManufacturersCertificateView()
 {
     InitializeComponent();
     _disposableContext = new DisposableContext(this);
     _dealMenuItem      =
         ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
         .First(x => x.Name == "DealMenuItem");
     _takeMenuItem =
         ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
         .First(x => x.Name == "TakeMaterialMenuItem");
     _showMeTheScanMenuItem =
         ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
         .First(x => x.Name == "ShowMeTheScanMenuItem");
     _setStateMenuItem =
         ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
         .First(x => x.Name == "StatusRowMenuItem");
     _createPermissionMaterialMenuItem =
         ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
         .First(x => x.Name == "CreatePermissionMaterialMenuItem");
     _createActSelectionProbeMenuItem =
         ((ContextMenu)RootGrid.Resources["DataGridRowMenu"]).Items.Cast <MenuItem>()
         .First(x => x.Name == "CreateActSelectionProbeMenuItem");
 }
        public void DisposeHandlesExceptionsGracefully()
        {
            bool disposed = false;
            Action dispose = () => disposed = true;
            Action throwOnDispose = () => { Assert.IsFalse(disposed); throw new InvalidOperationException(); };

            try
            {
                using (DisposableContext dc = new DisposableContext())
                {
                    dc.Enlist(throwOnDispose.ToDisposable());
                    dc.Enlist(dispose.ToDisposable());
                }
            }
            catch (AggregateException ex)
            {
                Assert.IsTrue(disposed);
                Assert.AreEqual(1, ex.InnerExceptions.Count);

                Assert.IsAssignableFrom<InvalidOperationException>(ex.InnerExceptions[0]);
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="EditablePersonalAccountView"/> class.
 /// </summary>
 public EditablePersonalAccountView()
 {
     InitializeComponent();
     _disposableContext = new DisposableContext(this);
 }
        public void Current_WithNested_ReturnsCorrectInstance()
        {
            using (DisposableContext dc = new DisposableContext())
            {
                using(DisposableContext dc2 = new DisposableContext())
                    Assert.IsTrue(ReferenceEquals(dc2, DisposableContext.Current));

                Assert.IsTrue(ReferenceEquals(dc, DisposableContext.Current));
            }
        }
Ejemplo n.º 17
0
 public TestSheetsView()
 {
     InitializeComponent();
     _disposableContext = new DisposableContext(this);
 }
Ejemplo n.º 18
0
 public PrintTheDemandView()
 {
     disposableContext = new DisposableContext(this);
     InitializeComponent();
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AcatalogView"/> class.
 /// </summary>
 public AcatalogView()
 {
     InitializeComponent();
     _disposableContext = new DisposableContext(this);
     Loaded            += this.AcatalogViewLoaded;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="StatusPersonalAccountView"/> class.
 /// </summary>
 public StatusPersonalAccountView()
 {
     _disposableContext = new DisposableContext(this);
     InitializeComponent();
 }
Ejemplo n.º 21
0
 public LinkView()
 {
     InitializeComponent();
     _disposableContext = new DisposableContext(this);
     Initialize();
 }
 public PermissionMaterialFilterView()
 {
     InitializeComponent();
     _disposableContext = new DisposableContext(this);
 }
 public StatusPermissionMaterialUserView()
 {
     _disposableContext = new DisposableContext(this);
     InitializeComponent();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CuttingOrderDetailedView"/> class.
 /// </summary>
 public CuttingOrderDetailedView()
 {
     _disposableContext = new DisposableContext(this);
     InitializeComponent();
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StatusPlanCertificateView"/> class.
 /// </summary>
 public StatusPlanCertificateView()
 {
     _disposableContext = new DisposableContext(this);
     InitializeComponent();
 }
Ejemplo n.º 26
0
 public ManufacturersCertificateFilterView()
 {
     _disposableContext = new DisposableContext(this);
     InitializeComponent();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PermissionMaterialPageView"/> class.
 /// </summary>
 public PermissionMaterialPageView()
 {
     _disposableContext = new DisposableContext(this);
     InitializeComponent();
 }
 public EditableCuttingOrderSpecificationView()
 {
     _disposableContext = new DisposableContext(this);
     InitializeComponent();
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProFilterView"/> class.
 /// </summary>
 public CuttingOrderFilterView()
 {
     InitializeComponent();
     _disposableContext = new DisposableContext(this);
 }
 public EditDepartmentOrderView()
 {
     _disposableContext = new DisposableContext(this);
     InitializeComponent();
 }
 public EditablePermissionMaterialExtensionView()
 {
     InitializeComponent();
     _disposableContext = new DisposableContext(this);
 }
Ejemplo n.º 32
0
        public ContractView()
        {
            InitializeComponent();

            _disposableContext = new DisposableContext(this);
        }
Ejemplo n.º 33
0
 public DummyView()
 {
     disposableContext = new DisposableContext(this);
     InitializeComponent();
 }
 public SampleCertificationView()
 {
     InitializeComponent();
     _disposableContext = new DisposableContext(this);
 }
Ejemplo n.º 35
0
 public EditableActSelectionOfProbeDepartmentRequirementView()
 {
     InitializeComponent();
     _disposableContext = new DisposableContext(this);
 }