public void btnWrite(IRibbonControl control) { if (_excel.ActiveWorkbook == null) { return; } if (_curproj == null || _curview == null) { return; } List <string> plst = _projects["id"] as List <string>; List <string> pname = _projects["name"] as List <string>; int i = plst.FindIndex(v => v.Equals(_curproj)); _curprojname = pname.ElementAt(i); List <string> vlst = _views["system_name"] as List <string>; List <string> vname = _views["human_name"] as List <string>; i = vlst.FindIndex(v => v.Equals(_curview)); _curviewname = vname.ElementAt(i); //_excel = new Application(null, ExcelDna.Integration.ExcelDnaUtil.Application); using (var controller = new ExcelController(_excel, _thisRibbon, _curproj, _curview, _curprojname, _curviewname)) { controller.WriteGH(false); } plst = null; pname = null; vlst = null; vname = null; }
public void btnValidator(IRibbonControl control) { //_excel = new Application(null, ExcelDna.Integration.ExcelDnaUtil.Application); if (_excel.ActiveWorkbook == null) { return; } using (var controller = new ExcelController(_excel, _thisRibbon, _curproj, _curview, _curprojname, _curviewname)) { controller.Validator(); } }
public void btnGetViewColumns(IRibbonControl control) { //_excel = new Application(null, ExcelDna.Integration.ExcelDnaUtil.Application); if (_excel.ActiveWorkbook == null) { return; } using (var controller = new ExcelController(_excel, _thisRibbon, _curproj, _curview, _curprojname, _curviewname, _properties)) { controller.GetViewColumns(); } }
public void btnLogin(IRibbonControl control) { //_excel = new Application(null, ExcelDna.Integration.ExcelDnaUtil.Application); using (var controller = new ExcelController(_excel, _thisRibbon, _curproj, _curview, _curprojname, _curviewname)) { controller.Login(); } string s = "Contacting server..."; string caption = "Getting Projects"; using (View.WaitingForm wf = new View.WaitingForm(caption, s)) { _projects = Projects.GetProjects(Utils.apiKey); } _thisRibbon.Invalidate(); }
/* * Original work Copyright(c) 2018-2021 COWI * * Copyright © COWI and individual contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * 1) Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3) Neither the name of COWI nor the names of its contributors may be used * to endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * * GlasshouseExcel may utilize certain third party software. Such third party software is copyrighted by their respective owners as indicated below. * Netoffice - MIT License - https://github.com/NetOfficeFw/NetOffice/blob/develop/LICENSE.txt * Excel DNA - zlib License - https://github.com/Excel-DNA/ExcelDna/blob/master/LICENSE.txt * RestSharp - Apache License - https://github.com/restsharp/RestSharp/blob/develop/LICENSE.txt * Newtonsoft - The MIT License (MIT) - https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md */ #endregion public void btnAbout(IRibbonControl control) { //_excel = new Application(null, ExcelDna.Integration.ExcelDnaUtil.Application); using (var controller = new ExcelController(_excel, _thisRibbon, _curproj, _curview, _curprojname, _curviewname)) { controller.About(); } }