// ITaskpane Member

        public void OnConnection(COMObject application, NetOffice.OfficeApi._CustomTaskPane parentPane, object[] customArguments)
        {
            ParentPane = parentPane;
            LastParentPaneVisible = parentPane.Visible;
            commandPane1.OnConnection(application, parentPane, customArguments);
            propertyPane1.OnConnection(application, parentPane, customArguments);
            infoPane1.OnConnection(application, parentPane, customArguments);
        }
 public void OnConnection(COMObject application, NetOffice.OfficeApi._CustomTaskPane parentPane, object[] customArguments)
 {
     ApplicationHandler = new OfficeApplicationManager(application);
     AvailableProxy[] proxies = ApplicationHandler.GetAvailableProxies();
     if (proxies.Length > 0)
     {
         comboBoxTarget.DataSource = proxies;
         comboBoxTarget.SelectedIndex = 0;
     }
 }
        protected void CreateCompetitorListWorksheet(NetOffice.ExcelApi.Worksheet worksheet)
        {
            var competitors = _reporter.GetCompetitors()
                .OrderBy(x => x.LastName);

            var row = 1;
            worksheet.Name = "Competitor List";
            PrintWorksheetTitle("Competitor List", worksheet, row++);

            var startRow = row;
            PrintTableColumnNames(worksheet, Competitor.TableFullColumnNames(), row++);
            foreach (var competitor in competitors)
            {
                PrintTableColumnData(worksheet, competitor.TableFullRowData(), row++);
            }
            var endRow = row - 1;
            string firstCol = ExcelColumnFromNumber(1);
            string lastCol = ExcelColumnFromNumber(Competitor.TableFullColumnNames().Length);
            worksheet.Columns[firstCol + ":" + lastCol].AutoFit();

            var tableRange = worksheet.Range(
                worksheet.Cells[startRow, firstCol],
                worksheet.Cells[endRow, lastCol]);

            var table = worksheet.ListObjects.Add(
                NetOffice.ExcelApi.Enums.XlListObjectSourceType.xlSrcRange,
                tableRange,
                Type.Missing,
                NetOffice.ExcelApi.Enums.XlYesNoGuess.xlYes,
                Type.Missing);
            table.Name = "CompetitorList";
        }
		public NetOffice.OWC10Api.Enums.PivotFilterUpdateMemberStateEnum get_StateOf(NetOffice.OWC10Api.PivotMember member)
		{		
			object[] paramsArray = Invoker.ValidateParamsArray(member);
			object returnItem = Invoker.PropertyGet(this, "StateOf", paramsArray);
			int intReturnItem = NetRuntimeSystem.Convert.ToInt32(returnItem);
			return (NetOffice.OWC10Api.Enums.PivotFilterUpdateMemberStateEnum)intReturnItem;
		}
		public object get_NewDetailCell(NetOffice.OWC10Api.PivotDetailCell detailCell)
		{		
			object[] paramsArray = Invoker.ValidateParamsArray(detailCell);
			object returnItem = Invoker.PropertyGet(this, "NewDetailCell", paramsArray);
			COMObject newObject = NetOffice.Factory.CreateObjectFromComProxy(this,returnItem);
			return newObject;
		}
Exemple #6
0
		public NetOffice.VBIDEApi.ReferencesEvents get_ReferencesEvents(NetOffice.VBIDEApi.VBProject vBProject)
		{		
			object[] paramsArray = Invoker.ValidateParamsArray(vBProject);
			object returnItem = Invoker.PropertyGet(this, "ReferencesEvents", paramsArray);
			NetOffice.VBIDEApi.ReferencesEvents newObject = NetOffice.Factory.CreateKnownObjectFromComProxy(this,returnItem,NetOffice.VBIDEApi.ReferencesEvents.LateBindingApiWrapperType) as NetOffice.VBIDEApi.ReferencesEvents;
			return newObject;
		}
		public NetOffice.MSHTMLApi.IElementBehavior FindBehavior(string bstrBehavior, string bstrBehaviorUrl, NetOffice.MSHTMLApi.IElementBehaviorSite pSite)
		{
			object[] paramsArray = Invoker.ValidateParamsArray(bstrBehavior, bstrBehaviorUrl, pSite);
			object returnItem = Invoker.MethodReturn(this, "FindBehavior", paramsArray);
			NetOffice.MSHTMLApi.IElementBehavior newObject = NetOffice.Factory.CreateKnownObjectFromComProxy(this, returnItem,NetOffice.MSHTMLApi.IElementBehavior.LateBindingApiWrapperType) as NetOffice.MSHTMLApi.IElementBehavior;
			return newObject;
		}
Exemple #8
0
		public NetOffice.VBIDEApi.VBProject Add(NetOffice.VBIDEApi.Enums.vbext_ProjectType type)
		{
			object[] paramsArray = Invoker.ValidateParamsArray(type);
			object returnItem = Invoker.MethodReturn(this, "Add", paramsArray);
			NetOffice.VBIDEApi.VBProject newObject = NetOffice.Factory.CreateKnownObjectFromComProxy(this, returnItem,NetOffice.VBIDEApi.VBProject.LateBindingApiWrapperType) as NetOffice.VBIDEApi.VBProject;
			return newObject;
		}
Exemple #9
0
 private void TestAddin_OnConnection(object Application, NetOffice.Tools.ext_ConnectMode ConnectMode, object AddInInst, ref Array custom)
 {
     Factory.Initialize();
     Office.COMAddIn addin = new Office.COMAddIn(null, AddInInst);
     addin.Object = this;
     addin.Dispose();
 }
Exemple #10
0
        private static NetOffice.ExcelApi.Range PutSampleData(NetOffice.ExcelApi.Worksheet workSheet)
        {
            workSheet.Cells[2, 2].Value = "Datum";
            workSheet.Cells[3, 2].Value = DateTime.Now.ToShortDateString();
            workSheet.Cells[4, 2].Value = DateTime.Now.ToShortDateString();
            workSheet.Cells[5, 2].Value = DateTime.Now.ToShortDateString();
            workSheet.Cells[6, 2].Value = DateTime.Now.ToShortDateString();

            workSheet.Cells[2, 3].Value = "Columns1";
            workSheet.Cells[3, 3].Value = 25;
            workSheet.Cells[4, 3].Value = 33;
            workSheet.Cells[5, 3].Value = 30;
            workSheet.Cells[6, 3].Value = 22;

            workSheet.Cells[2, 4].Value = "Column2";
            workSheet.Cells[3, 4].Value = 25;
            workSheet.Cells[4, 4].Value = 33;
            workSheet.Cells[5, 4].Value = 30;
            workSheet.Cells[6, 4].Value = 22;

            workSheet.Cells[2, 5].Value = "Column3";
            workSheet.Cells[3, 5].Value = 25;
            workSheet.Cells[4, 5].Value = 33;
            workSheet.Cells[5, 5].Value = 30;
            workSheet.Cells[6, 5].Value = 22;

            return workSheet.Range("$B2:$E6");
        }
Exemple #11
0
 /// <summary>
 /// returns the valid file extension for the instance. for example ".xls" or ".xlsx"
 /// </summary>
 /// <param name="application">the instance</param>
 /// <returns>the extension</returns>
 private static string GetDefaultExtension(NetOffice.ExcelApi.Application application)
 {
     double Version = Convert.ToDouble(application.Version, CultureInfo.InvariantCulture);
     if (Version >= 12.00)
         return ".xlsx";
     else
         return ".xls";
 }
		public Int32 Clone(out NetOffice.MSHTMLApi.IEnumRegisterWordA ppEnum)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(true);
			ppEnum = null;
			object[] paramsArray = Invoker.ValidateParamsArray(ppEnum);
			object returnItem = Invoker.MethodReturn(this, "Clone", paramsArray);
			ppEnum = (NetOffice.MSHTMLApi.IEnumRegisterWordA)paramsArray[0];
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
Exemple #13
0
		public Int32 CreateMarkupPointer(out NetOffice.MSHTMLApi.IMarkupPointer ppPointer)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(true);
			ppPointer = null;
			object[] paramsArray = Invoker.ValidateParamsArray(ppPointer);
			object returnItem = Invoker.MethodReturn(this, "CreateMarkupPointer", paramsArray);
			ppPointer = (NetOffice.MSHTMLApi.IMarkupPointer)paramsArray[0];
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
Exemple #14
0
		public Int32 GetActiveIMM(out NetOffice.MSHTMLApi.IActiveIMMApp ppActiveIMM)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(true);
			ppActiveIMM = null;
			object[] paramsArray = Invoker.ValidateParamsArray(ppActiveIMM);
			object returnItem = Invoker.MethodReturn(this, "GetActiveIMM", paramsArray);
			ppActiveIMM = (NetOffice.MSHTMLApi.IActiveIMMApp)paramsArray[0];
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
		public Int32 Current(out NetOffice.MSHTMLApi.ISegment ppISegment)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(true);
			ppISegment = null;
			object[] paramsArray = Invoker.ValidateParamsArray(ppISegment);
			object returnItem = Invoker.MethodReturn(this, "Current", paramsArray);
			ppISegment = (NetOffice.MSHTMLApi.ISegment)paramsArray[0];
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
Exemple #16
0
		public Int32 HrInitConverter(NetOffice.OfficeApi.IConverterApplicationPreferences pcap, out NetOffice.OfficeApi.IConverterPreferences ppcp, NetOffice.OfficeApi.IConverterUICallback pcuic)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(false,true,false);
			ppcp = null;
			object[] paramsArray = Invoker.ValidateParamsArray(pcap, ppcp, pcuic);
			object returnItem = Invoker.MethodReturn(this, "HrInitConverter", paramsArray);
			ppcp = (NetOffice.OfficeApi.IConverterPreferences)paramsArray[1];
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
Exemple #17
0
		public Int32 OwningDoc(out NetOffice.MSHTMLApi.IHTMLDocument2 ppDoc)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(true);
			ppDoc = null;
			object[] paramsArray = Invoker.ValidateParamsArray(ppDoc);
			object returnItem = Invoker.MethodReturn(this, "OwningDoc", paramsArray);
			ppDoc = (NetOffice.MSHTMLApi.IHTMLDocument2)paramsArray[0];
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
Exemple #18
0
 /// <summary>
 /// Creates an instance of the class
 /// </summary>
 /// <param name="owner">addin owner instance</param>
 /// <param name="isAutomation">host application is started for automation</param>
 protected internal CommonUtils(NetOffice.Tools.COMAddinBase owner, bool isAutomation)
 {
     if (null == owner)
         throw new ArgumentNullException("owner");
     Owner = owner;
     _ownerApplication = owner.AppInstance;
     _isAutomation = isAutomation;
     _headerCaptionLine = _headerCaptionLineDefault;
     _infos = new Infos(this);
 }
Exemple #19
0
		public Int32 RemoteNext(Int32 cElt, out NetOffice.OWC10Api.IOleUndoUnit rgElt, out Int32 pcEltFetched)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(false,true,true);
			rgElt = null;
			pcEltFetched = 0;
			object[] paramsArray = Invoker.ValidateParamsArray(cElt, rgElt, pcEltFetched);
			object returnItem = Invoker.MethodReturn(this, "RemoteNext", paramsArray);
			rgElt = (NetOffice.OWC10Api.IOleUndoUnit)paramsArray[1];
			pcEltFetched = (Int32)paramsArray[2];
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
		public Int32 Next(Int32 celt, out NetOffice.VisioApi.IVAccelTable rgelt, out Int32 pceltFetched)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(false,true,true);
			rgelt = null;
			pceltFetched = 0;
			object[] paramsArray = Invoker.ValidateParamsArray(celt, rgelt, pceltFetched);
			object returnItem = Invoker.MethodReturn(this, "Next", paramsArray);
			rgelt = (NetOffice.VisioApi.IVAccelTable)paramsArray[1];
			pceltFetched = (Int32)paramsArray[2];
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
		public object GetProviderDetail(NetOffice.OfficeApi.Enums.EncryptionProviderDetail encprovdet)
		{
			object[] paramsArray = Invoker.ValidateParamsArray(encprovdet);
			object returnItem = Invoker.MethodReturn(this, "GetProviderDetail", paramsArray);
			if((null != returnItem) && (returnItem is MarshalByRefObject))
			{
				COMObject newObject = NetOffice.Factory.CreateObjectFromComProxy(this, returnItem);
				return newObject;
			}
			else
			{
				return  returnItem;
			}
		}
Exemple #22
0
		public object CoerceOper(object varoper, NetOffice.OWC10Api.Enums.AddinClientTypeEnum grbit)
		{
			object[] paramsArray = Invoker.ValidateParamsArray(varoper, grbit);
			object returnItem = Invoker.MethodReturn(this, "CoerceOper", paramsArray);
			if((null != returnItem) && (returnItem is MarshalByRefObject))
			{
				COMObject newObject = NetOffice.Factory.CreateObjectFromComProxy(this, returnItem);
				return newObject;
			}
			else
			{
				return  returnItem;
			}
		}
Exemple #23
0
 public void OnConnection(NetOffice.OutlookApi.Application application, NetOffice.OfficeApi._CustomTaskPane parentPane, object[] customArguments)
 {
     InitializeTaskPane();
     Client = new TwitterTimer(this, Client_Error);
     Client.EnabledChanegd += new EnabledChangedEventHanlder(Client_EnabledChanegd);
     settingsPane.Initialize(Client);
     tweetGrid.DataSource = Client;
     button_Click(buttonMain, new EventArgs());
     if (Config.Enabled)
     {
         tweetGrid.Enabled = true;
         Client.Enabled = true;
     }
     else
     {
         tweetGrid.Enabled = false;
     }
 }
        protected void CreateCoachListWorksheet(NetOffice.ExcelApi.Worksheet worksheet)
        {
            var coaches = _reporter.GetCoaches()
                .OrderBy(x => x.SchoolName)
                .ThenBy(x => x.LastName);

            var row = 1;
            worksheet.Name = "Coach List";
            PrintWorksheetTitle("Coach List", worksheet, row++);

            PrintTableColumnNames(worksheet, Coach.TableColumnNames(), row++);
            foreach (var coach in coaches)
            {
                PrintTableColumnData(worksheet, coach.TableRowData(), row++);
            }
            string firstCol = ExcelColumnFromNumber(1);
            string lastCol = ExcelColumnFromNumber(Coach.TableColumnNames().Length);
            worksheet.Columns[firstCol + ":" + lastCol].AutoFit();
        }
Exemple #25
0
 public void OnAction(NetOffice.OfficeApi.IRibbonControl control)
 {
     try
     {
         switch (control.Id)
         {
             case "customButton1":
                 Utils.Dialog.ShowMessageBox("This is the first sample button. " + Application.FriendlyTypeName, "NetOfficeTools.SuperAddinCS4", DialogResult.None);
                 break;
             case "customButton2":
                 Utils.Dialog.ShowMessageBox("This is the second sample button. " + Application.FriendlyTypeName, "NetOfficeTools.SuperAddinCS4", DialogResult.None);
                 break;
             default:
                 Utils.Dialog.ShowMessageBox("Unkown Control Id: " + control.Id, "NetOfficeTools.SuperAddinCS4", DialogResult.None);
                 break;
         }
     }
     catch (Exception throwedException)
     {
         Utils.Dialog.ShowError(throwedException, "Unexpected state in SuperAddinCS4 OnAction");
     }
 }
Exemple #26
0
        public void OnAction(NetOffice.OfficeApi.IRibbonControl control)
        {
            try
            {
                switch (control.Id)
                {
                    case "customButton1":

                        MessageBox.Show("This is the first sample button. " + Application.FriendlyTypeName, "NetOfficeTools.SuperAddinCS4");
                        break;
                    case "customButton2":
                        MessageBox.Show("This is the second sample button." + Application.FriendlyTypeName, "NetOfficeTools.SuperAddinCS4");
                        break;
                    default:
                        MessageBox.Show("Unkown Control Id: " + control.Id, "NetOfficeTools.SuperAddinCS4");
                        break;
                }
            }
            catch (Exception throwedException)
            {
                string details = string.Format("{1}{1}Details:{1}{1}{0}", throwedException.Message, Environment.NewLine);
                MessageBox.Show("An error occured in OnAction." + details, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
		public Int32 MoveToContent(NetOffice.MSHTMLApi.IHTMLElement pIElement, Int32 fAtStart)
		{
			object[] paramsArray = Invoker.ValidateParamsArray(pIElement, fAtStart);
			object returnItem = Invoker.MethodReturn(this, "MoveToContent", paramsArray);
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
		public Int32 IsInsideURL(NetOffice.MSHTMLApi.IMarkupPointer pRight, out Int32 pfResult)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(false,true);
			pfResult = 0;
			object[] paramsArray = Invoker.ValidateParamsArray(pRight, pfResult);
			object returnItem = Invoker.MethodReturn(this, "IsInsideURL", paramsArray);
			pfResult = (Int32)paramsArray[1];
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
		public Int32 MoveUnitBounded(NetOffice.MSHTMLApi.Enums._MOVEUNIT_ACTION muAction, NetOffice.MSHTMLApi.IMarkupPointer pIBoundary)
		{
			object[] paramsArray = Invoker.ValidateParamsArray(muAction, pIBoundary);
			object returnItem = Invoker.MethodReturn(this, "MoveUnitBounded", paramsArray);
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}
		public Int32 MoveToMarkupPosition(NetOffice.MSHTMLApi.IMarkupContainer pContainer, Int32 lMP)
		{
			object[] paramsArray = Invoker.ValidateParamsArray(pContainer, lMP);
			object returnItem = Invoker.MethodReturn(this, "MoveToMarkupPosition", paramsArray);
			return NetRuntimeSystem.Convert.ToInt32(returnItem);
		}