private void ApplyBut_Click(object sender, RoutedEventArgs e)
{
string seltab = GetActiveTabName();
switch (seltab)
{
case "PathTab":
ApplyChanges();
break;
case "ColorsTab":
ApplyChanges();
break;
case "DefaultPkgTab":
SaveDefaultPackageList();
break;
case "UserPkgTab":
SaveUserPackageList();
break;
case "OthersTab":
ApplyChanges();
break;
case "ImageTab":
////refresh graphic image size, if modified.
//if (hasGraphicImageSizeEdited)
//{
// RefreshSyntaxGraphicSize();
// hasGraphicImageSizeEdited = false;
//}
ApplyChanges();
break;
case "AdvTab":
ApplyChanges();
break;
default:
MessageBox.Show("Wrong Tab Option Found!!");
break;
}
//18Sep2014//Set Decimal digit so that it can be used immediately after setting window closes
if (noofdecimals.Text != null && noofdecimals.Text.Length > 0)
{
CommandRequest rcmd = new CommandRequest();
//Call R function to get Decimal digit
rcmd.CommandSyntax = "BSkyGetDecimalDigitSetting()"; // Get Decimal Digit
object retres = analytics.ExecuteR(rcmd, true, false);
string rdeci = retres != null ? retres.ToString() : string.Empty;
//MessageBox.Show("RDeci: " + rdeci);
int res;
bool parsed = Int32.TryParse(rdeci, out res);
int decidigit = parsed ? res : 2;//is parsed successfully default will be res else default will be 2.
string deci = noofdecimals.Text!=null ? noofdecimals.Text:string.Empty ;
bool isSet= Int32.TryParse(deci, out decidigit);
//MessageBox.Show("Deci: " + deci);
//Call R function to set Decimal digit
rcmd.CommandSyntax = "BSkySetDecimalDigitSetting(decimalDigitSetting = " + decidigit + ")"; //Set Decimal Digit
retres = analytics.ExecuteR(rcmd, false, false);
}
//05Jul2015//Set scientific notaion flag in R
bool isSciNotation = (scientific.IsChecked == true);
if (true)
{
string CapBoolStr = (isSciNotation)?"TRUE": "FALSE";
CommandRequest rcmd = new CommandRequest();
//Call R function to set Scientific Notaion flag
rcmd.CommandSyntax = "BSkySetEngNotationSetting( " + CapBoolStr + ")"; //Set Scientific Notation
object retres = analytics.ExecuteR(rcmd, false, false);
}
//refresh graphic image size, if modified.
if (hasGraphicImageSizeEdited)
{
RefreshSyntaxGraphicSize();
hasGraphicImageSizeEdited = false;
}
this.Close();// close Options Window
}