Пример #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            UploadFilesForm    uploadFilesForm   = new UploadFilesForm();
            IConnectorMainView connectorExplorer = uploadFilesForm as IConnectorMainView;

            ApplicationContext.SetApplicationManager(new GeneralConnectorManager(connectorExplorer));
            ConfigurationManager.GetInstance().DownloadAdministrationXml(RefreshControls);

            uploadFilesForm.Initialize(new string[] { e.Args[0].ToString() });
            uploadFilesForm.ShowDialog(null, Languages.Translate("Send To Office Connector"));
            this.Shutdown();
        }
Пример #2
0
        public void SaveToButton_OnAction(Office.IRibbonControl control)
        {
            UploadFilesForm uploadFilesForm = new UploadFilesForm();
            string          activeFilePath  = ApplicationContext.Current.EnsureSaved();

            if (string.IsNullOrEmpty(activeFilePath) == false)
            {
                if (activeFilePath.StartsWith("http", StringComparison.InvariantCultureIgnoreCase) == true)
                {
                    MessageBox.Show("You can only save local file to SharePoint");
                    return;
                }

                ApplicationContext.Current.CloseActiveDocument();
                IConnectorMainView connectorExplorer = uploadFilesForm as IConnectorMainView;
                uploadFilesForm.Initialize(new string[] { activeFilePath });
                uploadFilesForm.ShowDialog(null, "Send To Office Connector");
                //TODO: Open remotely
                //ApplicationContext.Current.OpenFile(activeFilePath);
            }
        }