Example #1
0
        private void checkSSIDPassword()
        {
            Excel.Application exApp = Globals.ThisAddIn.Application as Excel.Application;
            Excel.Workbook wb = exApp.ActiveWorkbook as Excel.Workbook;
            Channel ch = new Channel();

            if (!TokenStore.checkTokenInStore())
            {
                LoginForm frm = new LoginForm();
                frm.Show();
            }
            else
            {
                ch.setAuthToken(TokenStore.getTokenFromStore());
            }

            if (ch.checkSpreadSheetID(wb) == "0")
            {
                string id = ch.getSpreadSheetID(wb.Name.ToString());
                spreadSheetID = Convert.ToInt32(id);

                //write to wb property when a new ID is obtained
                Microsoft.Office.Core.DocumentProperties properties;
                properties = (Office.DocumentProperties)wb.CustomDocumentProperties;

                properties.Add("Excalibur ID", false,
                   Microsoft.Office.Core.MsoDocProperties.msoPropertyTypeString, id);
            }
            else
            {
                string id = ch.checkSpreadSheetID(wb);
                spreadSheetID = Convert.ToInt32(id);

            }
        }
Example #2
0
        private void InitializePermittedBroadcastsComboBox()
        {
            if (!TokenStore.checkTokenInStore())
            {
                LoginForm frm = new LoginForm();
                frm.Show();
            }
            else
            {
                ch.setAuthToken(TokenStore.getTokenFromStore());
            }

            JArray d = ch.getPermittedBroadcastsChannels();
            JArray datafeed = ch.getBroadcastsList(d);

            if (d.ToString() != "[]")
            {

                foreach (dynamic data in datafeed)
                {
                    broadcastComboBox.Items.Add(data.id.ToString() + "-" + data.description.ToString());
                }
            }
            else
            {
                broadcastComboBox.Items.Add("No channel in broadcast");
                //broadcastComboBox.SelectedIndex = 0;
            }
        }
Example #3
0
 public void onLoginButton(Office.IRibbonControl control)
 {
     LoginForm frm = new LoginForm();
     frm.Show();
 }
Example #4
0
        private void InitializeBroadCastComboBox()
        {
            if (!TokenStore.checkTokenInStore())
            {
                LoginForm frm = new LoginForm();
                frm.Show();
            }
            else
            {
                ch.setAuthToken(TokenStore.getTokenFromStore());
            }

            JArray d = ch.getAllBroadcastsChannels();

            if (d.ToString() == "[]")
            {
                broadcastComboBox.Items.Add("No broadcast available");

            }
            else
            {

                JArray datafeed = ch.getBroadcastsList(d);
                foreach (dynamic data in datafeed)
                {
                    broadcastComboBox.Items.Add(data.id.ToString() + "-" + data.description.ToString());
                }
            }
        }