protected override string GenDateColumn(Item item, int counter, CodeGenProperties codeGenProperties) { string result = ""; Position labelPosition = FormsUtility.CalculateLabelPosition(item); var resourceName = "FMBExplorer.Templates.DateFormField.txt"; using (Stream stream = assembly.GetManifestResourceStream(resourceName)) using (StreamReader reader = new StreamReader(stream)) { string template = reader.ReadToEnd(); result = Engine.Razor.RunCompile(template, "dateFieldTemplateKey", null, new { ViewModelName = codeGenProperties.ViewModelName, EnabledPropertyName = codeGenProperties.EnabledPropertyName, Name = item.Name, CollectionViewSourceName = codeGenProperties.CollectionViewSourceName, BindingSource = codeGenProperties.BindingSource, Row = counter, TextBox_Name = "txb_" + item.ColumnName, FieldName = item.ColumnName, Width = item.WpfWidth, Height = item.WpfHeight, Prompt = item.Prompt, Left = item.WpfXPosition, LabelLeft = labelPosition.Left, LabelTop = labelPosition.Top, Top = item.WpfYPosition }); } return(result); }
private void OpenChallengeTheme_Button_Click(object sender, RoutedEventArgs e) { if (ImageBox_ChallengePreview.Source != null) { if (!FormsUtility.IsWindowOpen <Window>("Challenge Theme Template")) { Window win = new Window(); win.Title = "Challenge Theme Template"; win.SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Width = ImageBox_ChallengePreview.Source.Width; win.Height = ImageBox_ChallengePreview.Source.Height; DockPanel dockPanel = new DockPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, }; Image img = new Image(); img.UseLayoutRounding = true; img.Source = ImageBox_ChallengePreview.Source; dockPanel.Children.Add(img); win.Content = dockPanel; win.Show(); } else { FormsUtility.GetOpenedWindow <Window>("Challenge Theme Template").Focus(); } } }
private void Button_AESManager_Click(object sender, RoutedEventArgs e) { if (!FormsUtility.IsWindowOpen <Window>("AES Manager")) { new AESManager().Show(); } else { FormsUtility.GetOpenedWindow <Window>("AES Manager").Focus(); } }
private void MI_MergeImages_Click(object sender, RoutedEventArgs e) { if (!FormsUtility.IsWindowOpen <Window>("Images Merger")) { new FModel_ImagesMerger().Show(); } else { FormsUtility.GetOpenedWindow <Window>("Images Merger").Focus(); } }
private void MI_About_Click(object sender, RoutedEventArgs e) { if (!FormsUtility.IsWindowOpen <Window>("About")) { new FModel_About().Show(); } else { FormsUtility.GetOpenedWindow <Window>("About").Focus(); } }
private void MI_HexViewer_Click(object sender, RoutedEventArgs e) { if (!FormsUtility.IsWindowOpen <Window>("Hex Viewer")) { new HexViewer().Show(); } else { FormsUtility.GetOpenedWindow <Window>("Hex Viewer").Focus(); } }
private void MI_Search_Click(object sender, RoutedEventArgs e) { DebugHelper.WriteLine("FWindow: Search Files"); if (!FormsUtility.IsWindowOpen <Window>("Search")) { new FModel_SearchFiles().Show(); } else { FormsUtility.GetOpenedWindow <Window>("Search").Focus(); } }
private void MI_Change_Header(object sender, RoutedEventArgs e) { //DIFFERENCE MODE if (MI_DifferenceMode.IsChecked) { MI_LoadOnePAK.IsEnabled = false; MI_LoadAllPAKs.Header = "Load Difference"; MI_UpdateMode.IsEnabled = true; } if (!MI_DifferenceMode.IsChecked) { MI_LoadOnePAK.IsEnabled = true; MI_UpdateMode.IsEnabled = false; MI_UpdateMode.IsChecked = false; } //UPDATE MODE if (MI_UpdateMode.IsChecked) { MI_LoadAllPAKs.Header = "Load And Extract Difference"; MI_UpdateMode.IsEnabled = true; MI_Auto_Save_Images.IsChecked = true; //auto save images if (MI_DifferenceMode.IsChecked && MI_UpdateMode.IsChecked) { if (!FormsUtility.IsWindowOpen <Window>("Update Mode")) { new FModel_UpdateMode().Show(); } else { FormsUtility.GetOpenedWindow <Window>("Update Mode").Focus(); } } } if (!MI_UpdateMode.IsChecked) { MI_LoadAllPAKs.Header = "Load Difference"; MI_Auto_Save_Images.IsChecked = false; } //BOTH if (!MI_DifferenceMode.IsChecked && !MI_UpdateMode.IsChecked) { MI_LoadAllPAKs.Header = "Load All PAKs"; } }
private void treeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { if (e.NewValue is Block) { Block block = e.NewValue as Block; vm.selectedBlock = block; genCodeBtn.IsEnabled = true; CodeGenProperties codeGenProps = new CodeGenProperties(); codeGenProps.BindingSource = vm.selectedBlock.Name; codeGenProps.Name = vm.selectedBlock.Name; codeGenProps.CollectionViewSourceName = vm.selectedBlock.Name + "_ViewSource"; codeGenProps.EnabledPropertyName = vm.selectedBlock.Name + "_TxEnabled"; codeGenProps.ViewModelName = "ViewModel." + vm.selectedBlock.Name + "_VM"; codeGenProps.CodebehindNamespace = "Forms." + vm.selectedBlock.Name; codeGenProps.WindowName = vm.selectedBlock.Name + "_Window"; codeGenProps.EntityName = vm.selectedBlock.Name + "_V"; if (FormsUtility.IsGrid(vm.selectedBlock)) { codeGenProps.DataEntryStyle = CodeGenProperties.DataEntry.Grid; } else if (FormsUtility.IsForm(vm.selectedBlock)) { codeGenProps.DataEntryStyle = CodeGenProperties.DataEntry.Form; } else { codeGenProps.DataEntryStyle = CodeGenProperties.DataEntry.Simple; } vm.CodeGenProperties = codeGenProps; PropertyGrid1.SelectedObject = vm.CodeGenProperties; } else { vm.GeneratedCode = ""; vm.GeneratedXAML = ""; genCodeBtn.IsEnabled = false; } }
private void OpenImage_Button_Click(object sender, RoutedEventArgs e) { if (MergerPreview_Image.Source != null) { DebugHelper.WriteLine("Merger: Opening preview of the merged image"); if (!FormsUtility.IsWindowOpen <Window>("Merged Image")) { Window win = new Window(); win.Title = "Merged Image"; win.SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Width = MergerPreview_Image.Source.Width; win.Height = MergerPreview_Image.Source.Height; if (MergerPreview_Image.Source.Height > 1000) { win.WindowState = WindowState.Maximized; } DockPanel dockPanel = new DockPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, }; Image img = new Image(); img.UseLayoutRounding = true; img.Source = MergerPreview_Image.Source; dockPanel.Children.Add(img); win.Content = dockPanel; win.Show(); } else { FormsUtility.GetOpenedWindow <Window>("Merged Image").Focus(); } } }
private void Button_OpenImage_Click(object sender, RoutedEventArgs e) { if (ImageBox_Main.Source != null) { DebugHelper.WriteLine("FWindow: Opening image of " + FWindow.FCurrentAsset); if (!FormsUtility.IsWindowOpen <Window>(FWindow.FCurrentAsset)) { Window win = new Window(); win.Title = FWindow.FCurrentAsset; win.SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Width = ImageBox_Main.Source.Width; win.Height = ImageBox_Main.Source.Height; if (ImageBox_Main.Source.Height > 1000) { win.WindowState = WindowState.Maximized; } DockPanel dockPanel = new DockPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, }; Image img = new Image(); img.UseLayoutRounding = true; img.Source = ImageBox_Main.Source; dockPanel.Children.Add(img); win.Content = dockPanel; win.Show(); } else { FormsUtility.GetOpenedWindow <Window>(FWindow.FCurrentAsset).Focus(); } } }