private void prevbtn_Click(object sender, RoutedEventArgs e) { if (_isClipboard) { var clipboardScript = new PocoToDbClipboardScript(); Visibility = Visibility.Hidden; var win = Window.GetWindow(this); var homePage = (HomePage)(win); if (homePage != null) homePage.ContentArea.Content = clipboardScript; } else if(_isBrowse) { var outputScript = new OutputScriptForBrowse(); outputScript.ReAssignPocoObjectList(_exportMetadataList); Visibility = Visibility.Hidden; var win = Window.GetWindow(this); var homePage = (HomePage)(win); if (homePage != null) homePage.ContentArea.Content = outputScript; } }
private void prevbtn_Click(object sender, RoutedEventArgs e) { if (_isCheckedClipboard) { var clipScript = new ClipboardScript(); clipScript.ReAssignValues(); Visibility = Visibility.Hidden; var win = Window.GetWindow(this); var homePage = (HomePage)(win); if (homePage != null) homePage.Reviewpanelbl.FontWeight = FontWeights.Normal; var page = (HomePage)(win); if (page != null) page.Generatelbl.FontWeight = FontWeights.Bold; var homePage1 = (HomePage)(win); if (homePage1 != null) homePage1.ContentArea.Content = clipScript; } else if (_isBrowseChecked) { var outputScript = new OutputScriptForBrowse(); Visibility = Visibility.Hidden; var win = Window.GetWindow(this); var homePage = (HomePage)(win); if (homePage != null) homePage.Genrtescriptlbl.FontWeight = FontWeights.Normal; var page = (HomePage)(win); if (page != null) page.Reviewlbl.FontWeight = FontWeights.Bold; var homePage1 = (HomePage)(win); if (homePage1 != null) homePage1.ContentArea.Content = outputScript; } else { var generatedPoco = new ScriptsPoco(); Visibility = Visibility.Hidden; var win = Window.GetWindow(this); var homePage = (HomePage)(win); if (homePage != null) homePage.Reviewpanelbl.FontWeight = FontWeights.Normal; var page = (HomePage)(win); if (page != null) page.Generatelbl.FontWeight = FontWeights.Bold; var homePage1 = (HomePage)(win); if (homePage1 != null) homePage1.ContentArea.Content = generatedPoco; } }
/// <summary> /// This functions Generates Script as Selected option i.e, current Selection or As Single File Option. /// </summary> /// <param name="btnname"></param> private void GenerateScriptForTabsWithOptions(string btnname) { bool isDbToPoco = false; _namespaceName = NameSpaceNm.Text; var script = ((TextBox)(InputFilestab.SelectedContent)).Text.ToString(CultureInfo.InvariantCulture).ToLower(); ScriptReader.ReinitializeExportList(); var outputScript = new OutputScriptForBrowse(); if (btnname == "CurrentSelection") { if (_isPocoToDb) outputScript.GenerateCqlScriptForCurrentPocoClass(script, _isPocoToDb, null); else outputScript.GenerateScriptForCurrentFile(script, NameSpaceNm.Text); } if (btnname == "As Single File") { if (!_isPocoToDb) isDbToPoco = true; outputScript.SaveAsSingleFileOption(NameSpaceNm.Text, _filenames, isDbToPoco); } Visibility = Visibility.Hidden; var win = Window.GetWindow(this); var homePage = (HomePage)(win); if (homePage != null) homePage.Genrtescriptlbl.FontWeight = FontWeights.Normal; var page = (HomePage)(win); if (page != null) page.Reviewlbl.FontWeight = FontWeights.Bold; var homePage1 = (HomePage)(win); if (homePage1 != null) homePage1.ContentArea.Content = outputScript; }