public void login(string username) { var permission = ThisAddIn.getPermission(username); showTabForUser(username, permission); ThisAddIn.applyPermission(permission, username == Constants.root); this.SetUserLabel(username); CheckSheets(); //checkedListBox1.Items }
private void toggleButton1_Click(object sender, RibbonControlEventArgs e) { var taskpane = TaskPaneManager.GetTaskPane("A", "ERP Excel 助手", () => new TaskPaneControl()); taskpane.Visible = ((RibbonToggleButton)sender).Checked; var tpc = (TaskPaneControl)taskpane.Control; Dictionary <string, string> p = ThisAddIn.getPermission(Constants.guest); if (p != null) { tpc.login(Constants.guest); tpc.SetUserLabel(Constants.guest); } }
public void logout() { List <string> ranges = new List <string>(); ranges.Add("salesAllowEdit"); clearAllowEditRange(Globals.ThisAddIn.Application.ActiveWorkbook.Worksheets.Cast <Worksheet>().SingleOrDefault(w => w.Name == "订单输入"), ranges); ThisAddIn.applyPermission(ThisAddIn.getPermission(Constants.guest)); //Globals.ThisAddIn.Application.ActiveWorkbook.Unprotect(key); Globals.ThisAddIn.Application.ActiveWorkbook.Protect(Constants.key, true); Globals.ThisAddIn.Application.ActiveWorkbook.Save(); if (Globals.ThisAddIn.Application.ActiveWorkbook.ProtectStructure) { MessageBox.Show(Globals.ThisAddIn.Application.ActiveWorkbook.Name + " 退出登录成功"); } this.SetUserLabel(Constants.guest); removeDupTabs(); }
private void FooRibbon_Load(object sender, RibbonUIEventArgs e) { xlApplication = Globals.ThisAddIn.Application; ThisAddIn.SynchronizeUI(xlApplication.ActiveSheet); }
/// <summary> /// Receives the go ahead for displaying the sally lookup of the currently selected range. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Alex_AllowLookup(object sender, ThisAddIn.ProgressEventArgs e) { if (e.Click == true) { //MessageBox.Show("Click went through. Now attempting the lookup..."); //lookup_CurrentRange(); requestSallyFrame(); } }
internal SheetInfo() { model = Globals.ThisAddIn; }