private void TabItem_SelectionChanged(object sender, SelectionChangedEventArgs e) { var tabItem = ((sender as TabControl).SelectedItem) as TabItem; if (null == tabItem) { return; } if (tabItem.Name == "tabItemOrigin") { this.tabItemOrigin.IsSelected = true; this.CustomViewportViewModel.SelectedViewportItem = this.CustomViewportViewModel.SelectedViewportItemOrigin; } else if (tabItem.Name == "tabItemUser") { this.tabItemUser.IsSelected = true; this.CustomViewportViewModel.SelectedViewportItem = this.CustomViewportViewModel.SelectedViewportItemUser; } if (this.CustomViewportViewModel.SelectedViewportItem == null) { return; } using (var sr = new StreamReader(this.CustomViewportViewModel.SelectedViewportItem.CustomViewportLayoutXmlPath)) { var layout = new FilmLayout(sr.ReadToEnd(), this.CustomViewportViewModel.SelectedViewportItem.CustomViewportName); layout.LayoutType = this.CustomViewportViewModel.SelectedViewportItem.LayoutType; ActiveFilmLayout = layout; } }
public void CloneTest() { FilmLayout target = new FilmLayout(3, 2, "3x2"); //Clone FilmLayout FilmLayout actual; actual = target.Clone(); Assert.IsNotNull(actual); //Clone FilmLayout(layoutName, layoutXmlFileStream) string layoutXmlFileStream = "testXml"; target = target = new FilmLayout(layoutXmlFileStream); actual = target.Clone(); Assert.AreEqual(target.LayoutName, actual.LayoutName); Assert.AreEqual(target.LayoutXmlFileStream, actual.LayoutXmlFileStream); //Clone FilmLayout(layoutName, layoutRowsSize, layoutColumnsSize) int layoutRowsSize = 1; int layoutColumnsSize = 2; target = new FilmLayout(layoutRowsSize, layoutColumnsSize); actual = target.Clone(); Assert.AreEqual(target.LayoutName, actual.LayoutName); Assert.AreEqual(target.LayoutRowsSize, actual.LayoutRowsSize); Assert.AreEqual(target.LayoutColumnsSize, actual.LayoutColumnsSize); }
private void ApplySettingButtonClick(object sender, RoutedEventArgs e) { try { Logger.LogFuncUp(); if (PreWarning()) { return; } CustomCellLayout = new FilmLayout(CustomCellRows, CustomCellColumns) { LayoutType = LayoutTypeEnum.StandardLayout }; if (CustomCellLayout != null) { var eventArgs = new CustomCelllLayoutChangeEventArgs(CustomCellLayout); RaiseCustomCellLayoutChanged(this, eventArgs); } //Hide(); //WindowHostManagerWrapper.CloseSecondaryWindow(); this.CloseParentDialog(); Logger.LogFuncDown(); } catch (Exception ex) { Logger.LogFuncException(ex.Message + ex.StackTrace); } }
public void FilmLayoutConstructorTest3() { string layoutXmlFileStream = "testXml"; FilmLayout target = new FilmLayout(layoutXmlFileStream); Assert.IsNotNull(target); }
public void ToStringTest() { FilmLayout target = new FilmLayout(3, 2, "test"); string expected = "test"; string actual; actual = target.ToString(); Assert.AreEqual(expected, actual); }
public void FilmLayoutConstructorTest1() { int layoutRowsSize = 1; int layoutColumnsSize = 2; FilmLayout target = new FilmLayout(layoutRowsSize, layoutColumnsSize); Assert.IsNotNull(target); }
public void UpdateButtonStatus(int index, int row, int col) { if (row <= 0 || col <= 0 || row > FilmLayout.MaxRowCount || col > FilmLayout.MaxColCount) { return; } if (index > 0 && index <= _cellLayouts.Count) { _cellLayouts[index - 1] = new FilmLayout(row, col); } UpdateCellLayoutButton(index, row, col); }
public void SetFilmLayoutBetween(FilmLayout filmLayout, int startPageIndex, int endPageIndex) { if (startPageIndex > endPageIndex) { return; } for (int i = startPageIndex; i < endPageIndex; i++) { if (this[i].ViewportLayout != filmLayout) { this[i].ViewportLayout = filmLayout; } } }
public void CapturedFilmLayoutTest() { try { CustomViewportLayoutWindow target = new CustomViewportLayoutWindow(); // FilmLayout expected = null; // FilmLayout actual; target.CapturedFilmLayout = expected; actual = target.CapturedFilmLayout; Assert.AreEqual(expected, actual); //Assert.Inconclusive("Verify the correctness of this test method."); } catch (Exception) { } }
public void LayoutXmlFileStreamTest() { //PrivateType type = new PrivateType(typeof(FilmLayout)); //Class1为要测试的类。 //PrivateObject param0 = new PrivateObject(new FilmLayout(3, 2, "3x2"), type); //FilmLayout_Accessor target = new FilmLayout_Accessor(param0); //string expected = "test"; //string actual; //target.LayoutXmlFileStream = expected; //actual = target.LayoutXmlFileStream; //Assert.AreEqual(expected, actual); FilmLayout target = new FilmLayout(3, 2, "3x2"); string expected = "test"; string actual; target.LayoutXmlFileStream = expected; actual = target.LayoutXmlFileStream; Assert.AreEqual(expected, actual); }
public void LayoutTypeTest() { //PrivateType type = new PrivateType(typeof(FilmLayout)); //Class1为要测试的类。 //PrivateObject param0 = new PrivateObject(new FilmLayout(3, 2, "3x2"), type); //FilmLayout_Accessor target = new FilmLayout_Accessor(param0); //LayoutTypeEnum expected = new LayoutTypeEnum(); //LayoutTypeEnum actual; //target.LayoutType = expected; //actual = target.LayoutType; //Assert.AreEqual(expected, actual); FilmLayout target = new FilmLayout(3, 2, "3x2"); LayoutTypeEnum expected = new LayoutTypeEnum(); LayoutTypeEnum actual; target.LayoutType = expected; actual = target.LayoutType; Assert.AreEqual(expected, actual); }
private bool ApplytoDefaultLayout() { if (!FilmLayout.DefinedFilmRegionLayoutList.Any()) { return(false); } var defaultLayout = FilmLayout.DefinedFilmRegionLayoutList.First(); if (CustomCellColumns == 0 || CustomCellRows == 0) { return(false); } if (defaultLayout.LayoutColumnsSize == CustomCellColumns && defaultLayout.LayoutRowsSize == CustomCellRows) { return(true); } Environment.Instance.GetDefaultLayoutConfigure().WriteBackToDefaultLayout(CustomCellRows, CustomCellColumns); return(FilmLayout.RefreshDefaultLayout(CustomCellRows, CustomCellColumns)); }
private void customViewportListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (this.CustomViewportViewModel.SelectedViewportItem == null) { return; } using (var sr = new StreamReader(this.CustomViewportViewModel.SelectedViewportItem.CustomViewportLayoutXmlPath)) { var layout = new FilmLayout(sr.ReadToEnd(), this.CustomViewportViewModel.SelectedViewportItem.CustomViewportName); layout.LayoutType = this.CustomViewportViewModel.SelectedViewportItem.LayoutType; ActiveFilmLayout = layout; } e.Handled = true; } catch (Exception exp) { Logger.LogError("Exception in customViewportListBox_SelectionChanged: " + exp.Message); //throw; } }
public void CustomCellLayoutTest() { try { PrivateType type = new PrivateType(typeof(CustomCellLayoutWindow)); CustomCellLayoutWindow target = new CustomCellLayoutWindow(); // PrivateObject privateObj = new PrivateObject(target, type); //CustomCellLayoutWindow_Accessor target = new CustomCellLayoutWindow_Accessor(param0); // FilmLayout expected = null; // FilmLayout actual; //target.CustomCellLayout = expected; object[] myArgs = new object[] { expected }; //privateObj.Invoke("CustomCellLayout", myArgs); actual = target.CustomCellLayout; Assert.AreEqual(expected, actual); } catch (Exception) { return; } //Assert.Inconclusive("Verify the correctness of this test method."); }
public CustomViewportChangeEventArgs(FilmLayout customFilmViewport) { CustomFilmViewport = customFilmViewport; }
public void FilmLayoutConstructorTest2() { FilmLayout target = new FilmLayout(3, 2, "3x2"); Assert.IsNotNull(target); }
public FilmingLayoutCellModel(FilmingLayoutCell cell) { DisplayDatas = cell.Children.OfType <FilmingControlCell>().ToList().ConvertAll(c => c.Image.CurrentPage); Layout = new FilmLayout(cell.Rows, cell.Columns); }
public CustomCelllLayoutChangeEventArgs(FilmLayout customFilmLayout) { CustomFilmLayout = customFilmLayout; }