private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            taskPaneControl1 = new OutlookConnectorPane();
            IConnectorMainView connectorExplorer = ((System.Windows.Forms.Integration.ElementHost)taskPaneControl1.Controls[0]).Child as IConnectorMainView;

            ApplicationContext.SetApplicationManager(new OutlookConnectorManager(this.Application, connectorExplorer));

            ApplicationContext.Current.ConnectorExplorer.InitializedDate = new DateTime(DateTime.Now.Ticks);
            taskPaneValue = this.CustomTaskPanes.Add(taskPaneControl1, "Sobiens Office Connector");
            taskPaneValue.VisibleChanged      += new EventHandler(taskPaneValue_VisibleChanged);
            taskPaneValue.DockPositionChanged += new EventHandler(taskPaneValue_DockPositionChanged);
            taskPaneControl1.SizeChanged      += new EventHandler(taskPaneControl1_SizeChanged);
            taskPaneControl1.Resize           += new EventHandler(taskPaneControl1_Resize);

            ApplicationBaseState applicationState = StateManager.GetInstance().ConnectorState.GetApplicationState(ApplicationContext.Current.GetApplicationType());

            taskPaneValue.DockPosition = StateManager.GetInstance().GetMsoPaneDockPosition(applicationState.DockPosition);
            taskPaneControl1.Width     = applicationState.ConnectorWidth;
            taskPaneControl1.Height    = applicationState.ConnectorHeight;
            taskPaneValue.Visible      = applicationState.ConnectorOpen;

            inspectors = this.Application.Inspectors;
            inspectors.NewInspector += new Outlook.InspectorsEvents_NewInspectorEventHandler(inspectors_NewInspector);

            //this.Application.Inspectors.NewInspector += new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);
            //SetSPOCButton();

            foreach (Outlook.Inspector inspector in inspectors)
            {
                inspectors_NewInspector(inspector);
            }

            ConfigurationManager.GetInstance().DownloadAdministrationXml(RefreshControls);
        }
Example #2
0
        private void FoldersTreeView_ContextMenuOpening(object sender, ContextMenuEventArgs e)
        {
            TreeViewItem item = FindControls.FindParent <TreeViewItem>(e.OriginalSource as DependencyObject);

            if (item == null)
            {
                return;
            }

            TreeViewItem parentItem = item.Parent as TreeViewItem;

            if (parentItem == null)
            {
                parentItem = (TreeViewItem)((TreeView)item.Parent).Items[0];
            }

            Folder             folder            = item.Tag as Folder;
            Folder             parentFolder      = parentItem.Tag as Folder;
            SiteSetting        siteSetting       = ConfigurationManager.GetInstance().GetSiteSetting(folder.SiteSettingID);
            object             obj               = item.Tag;
            IConnectorMainView connectorExplorer = FindControls.FindParent <OutlookConnectorExplorer>(this);
            object             inspector         = connectorExplorer != null ? connectorExplorer.Inspector : null;

            ContextMenuManager.Instance.FillContextMenuItems(FoldersTreeView.ContextMenu, siteSetting, folder, inspector, parentFolder);
        }
        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();
        }
Example #4
0
        private void AddAllTaskPanes()
        {
            foreach (Word.Window window in this.Application.Windows)
            {
                CustomTaskPane ctp = this.CustomTaskPanes.SingleOrDefault(t => t.Window == window);
                if (ctp == null)
                {
                    WordConnectorPane taskPaneControl1 = new WordConnectorPane();

                    IConnectorMainView connectorExplorer = ((System.Windows.Forms.Integration.ElementHost)taskPaneControl1.Controls[0]).Child as IConnectorMainView;
                    ApplicationContext.SetApplicationManager(new WordConnectorManager(Application, connectorExplorer));

                    Microsoft.Office.Tools.CustomTaskPane taskPaneValue = this.CustomTaskPanes.Add(taskPaneControl1, "Sobiens Office Connector", window);
                    taskPaneValue.VisibleChanged += new EventHandler(taskPaneValue_VisibleChanged);
                }
            }
        }
Example #5
0
        private void LibraryContentDataGridView_ContextMenuOpening(object sender, ContextMenuEventArgs e)
        {
            ListView grid = sender as ListView;

            if (grid == null)
            {
                return;
            }
            DataRowView rowView = grid.SelectedItem as DataRowView;

            SiteSetting siteSetting = ConfigurationManager.GetInstance().GetSiteSetting(this.SelectedFolder.SiteSettingID);
            object      obj         = rowView != null ? ((OC_Datarow)rowView.Row).Tag : this.SelectedFolder;

            IConnectorMainView connectorExplorer = FindControls.FindParent <OutlookConnectorExplorer>(this);
            object             inspector         = connectorExplorer != null ? connectorExplorer.Inspector : null;

            ContextMenuManager.Instance.FillContextMenuItems(LibraryContentDataListView.ContextMenu, siteSetting, obj, inspector, SelectedFolder);
        }
Example #6
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);
            }
        }
 public GeneralConnectorManager(IConnectorMainView connectorExplorer)
 {
     this.ConnectorExplorer = connectorExplorer;
 }
 public WordConnectorManager(Word.Application application, IConnectorMainView connectorExplorer)
 {
     this.Application       = application;
     this.ConnectorExplorer = connectorExplorer;
 }
 public OutlookConnectorManager(Microsoft.Office.Interop.Outlook.Application application, IConnectorMainView connectorExplorer)
 {
     this.Application       = application;
     this.ConnectorExplorer = connectorExplorer;
 }
Example #10
0
 public ExcelConnectorManager(Excel.Application application, IConnectorMainView connectorExplorer)
 {
     this.Application       = application;
     this.ConnectorExplorer = connectorExplorer;
 }