public HomeWin() { colorItems = ViewHelper.NewColorItems; shapeItems = ViewHelper.NewShapeItems; this.Resources.Add("colorItems", colorItems); this.Resources.Add("shapeItems", shapeItems); modifyColorItems = ViewHelper.NewColorItems; modifyShapeItems = ViewHelper.NewShapeItems; this.Resources.Add("modifyColorItems", modifyColorItems); this.Resources.Add("modifyShapeItems", modifyShapeItems); InitializeComponent(); btnSearch.IsEnabled = false; rbtnPic.IsChecked = true; dlgOpenKeyPic = newOpenFileDialog(); dlgOpenKeyPic.Title = "请选择关键图"; dlgOpenPics = newOpenFileDialog(); dlgOpenPics.Title = "请选择多张图片进行导入"; dlgOpenPics.Multiselect = true; dlgOpenPicFolder = new System.Windows.Forms.FolderBrowserDialog(); dlgOpenPicFolder.Description = "请选择文件夹以导入其下的所有图片(JPG, PNG, BMP)"; dlgOpenPicFolder.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); //dlgOpenPicFolder.RootFolder = Environment.SpecialFolder.MyPictures; // It should be done by dependency injection here!! clothLibService = new ClothLibService(); clothSearchService = new ClothSearchService(); imageMatcher = ClothUtil.ImageMatcherInst; aDesc = new AlgorithmDesc(); // temp rbtnCombine.IsEnabled = false; txtModifyName.IsEnabled = false; //picNames = new List<string>(); isValid = RegisterUtil.VerifyLogin(); }
public MatchAlgorithmWin(AlgorithmDesc aDesc) { InitializeComponent(); this.aDesc = aDesc; // the first elements of these arrays are always the default ones. rLevels = new RecallLevel[] { RecallLevel.Default, RecallLevel.Recall1, RecallLevel.Recall2, RecallLevel.Recall3 }; aTypes = new AlgorithmType[] { AlgorithmType.Texture3, AlgorithmType.Texture2, AlgorithmType.Texture1, AlgorithmType.Color1 }; rbtns = new RadioButton[] { rbtnTexture3, rbtnTexture2, rbtnTexture1, rbtnColor1 }; cmbs = new ComboBox[] { cmbTexture3, cmbTexture2, cmbTexture1, cmbColor1 }; int rLevelIndex = 0; for (int i = 0; i < rLevels.Length; ++i) { if (aDesc.RLevel == rLevels[i]) { rLevelIndex = i; break; } } int aTypeIndex = 0; for (int i = 0; i < aTypes.Length; ++i) { if (aDesc.AType == aTypes[i]) { aTypeIndex = i; break; } } rbtns[aTypeIndex].IsChecked = true; cmbs[aTypeIndex].SelectedIndex = rLevelIndex; }