public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { this.Window.BackgroundColor = UIColor.White; // Load the license serial number and key from the resource files string sn = GetIni(NSBundle.MainBundle.PathForResource("rdk_sn", "txt"), "SN"); string key = GetIni(NSBundle.MainBundle.PathForResource("rdk_key", "txt"), "Sign"); Console.WriteLine("sn {0}", sn); Console.WriteLine("key {0}", key); // Initialize the library var eRet = FSLibrary.Initialize(sn, key); if (FSErrorCode.Success != eRet) { string errMsg = "Invalid license"; UIAlertController alert = UIAlertController.Create("Check License", errMsg, UIAlertControllerStyle.Alert); alert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); UIWindow keyWindow = UIApplication.SharedApplication.KeyWindow; if (keyWindow == null) { keyWindow = UIApplication.SharedApplication.Windows[0]; keyWindow.MakeKeyAndVisible(); } UIViewController rootvc = keyWindow.RootViewController; rootvc.PresentViewController(alert, true, null); return(false); } return(true); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Load the license serial number and key from the resource files string sn = GetIni(NSBundle.MainBundle.PathForResource("rdk_sn", "txt"), "SN"); string key = GetIni(NSBundle.MainBundle.PathForResource("rdk_key", "txt"), "Sign"); // Initialize the library var eRet = FSLibrary.Init(sn, key); if (FSErrorCode.Success == eRet) { // Get the sample PDF file name from the bundle resources string pdfFileName = NSBundle.MainBundle.PathForResource("Sample", "pdf"); // Load the PDF document string pdfPassword = ""; var doc = FSPDFDoc.CreateFromFilePath(pdfFileName); if (FSErrorCode.Success == doc.Load(pdfPassword)) { // Create the view var view = new FSPDFViewCtrl(new CoreGraphics.CGRect( 0, 0, this.View.Frame.Size.Width, this.View.Frame.Size.Height)); view.SetDoc(doc); Add(view); } } }
private void btnSaveCastom_Click(object sender, EventArgs e) { FSLibrary state = new FSLibrary(); state.writeConfig(chkSelect.Checked, chkDisable.Checked, chkSort.Checked, chkMulti.Checked); this.Close(); //restart app Application.Restart(); Environment.Exit(0); }
private void CSFrom_Load(object sender, EventArgs e) { FSLibrary state = new FSLibrary(); state.loadConfig(); if (state != null) { chkDisable.Checked = state.state.isDisableMsg; chkSelect.Checked = state.state.isSelectSingle; chkSort.Checked = state.state.isSorting; chkMulti.Checked = state.state.isMulti; //if(chkMulti.Checked) chkSort.Checked = false; } this.Focus(); this.Activate(); }