コード例 #1
0
ファイル: Redbrick.cs プロジェクト: kcjuntunen/Redbrick-Addin
 private void UITearDown()
 {
     taskpaneHost = null;
     taskpaneView.DeleteView();
     Marshal.ReleaseComObject(taskpaneView);
     taskpaneView = null;
 }
コード例 #2
0
ファイル: Redbrick.cs プロジェクト: kcjuntunen/Redbrick-Addin
        private void UISetup()
        {
            try {
                Version cv  = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
                string  ver = cv.ToString();

                taskpaneView = swApp.CreateTaskpaneView2(Properties.Settings.Default.NetPath +
                                                         Properties.Settings.Default.Icon,
                                                         string.Format(Properties.Resources.Title, ver));

                taskpaneHost              = (SWTaskPaneHost)taskpaneView.AddControl(SWTaskPaneHost.SWTASKPANE_PROGID, string.Empty);
                taskpaneHost.OnRequestSW += new Func <SldWorks>(delegate { return(this.swApp); });

                bool result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Ok, "OK");
                result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Options, "Configuration");
                //result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Close, "Close");
                result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.RefreshIcon, "Refresh");
                result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.ArchiveIcon, "Archive PDF");
                result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.HelpIcon, "Usage Help");

                taskpaneView.TaskPaneToolbarButtonClicked += taskpaneView_TaskPaneToolbarButtonClicked;
                taskpaneHost.cookie = cookie;
                taskpaneHost.Start();
            } catch (Exception e) {
                RedbrickErr.ErrMsg em = new RedbrickErr.ErrMsg(e);
                em.ShowDialog();
            }
        }
コード例 #3
0
        /// <summary>创建TaskPane</summary>
        private void CreateWPFTaskPane()
        {
            if (_taskPane == null)
            {
                _taskPane = base.Application.Sw.CreateTaskpaneView2($@"{AssemblyPath}\TestRunner32.png", "TestRunner");
            }

            if (RunnerView == null)
            {
                RunnerView = new NUnitRunnerView()
                {
                    DataContext = (RunnerViewModel = new NUnitRunnerViewModel <ISldWorks>(base.Application.Sw))
                };
            }

            if (_host == null)
            {
                _host = new ElementHost()
                {
                    Child = RunnerView
                };
            }

            _taskPane.DisplayWindowFromHandlex64(_host.Handle.ToInt64());
        }
コード例 #4
0
 private void UISetup()
 {
     mTaskpaneView = mSWApplication.CreateTaskpaneView2(string.Empty, "Chrono::Engine tools");
     mTaskpaneHost = (SWTaskpaneHost)mTaskpaneView.AddControl(SWTaskpaneHost.SWTASKPANE_PROGID,"");
     mTaskpaneHost.mSWApplication = this.mSWApplication;
     mTaskpaneHost.mSWintegration = this;
 }
コード例 #5
0
 private void RemoveLogPage()
 {
     logPageView.DeleteView();
     Marshal.ReleaseComObject(logPageView);
     logPageView = null;
     tpHost      = null;
 }
コード例 #6
0
 private void UITeardown()
 {
     mTaskpaneHost = null;
     mTaskpaneView.DeleteView();
     Marshal.ReleaseComObject(mTaskpaneView);
     mTaskpaneView = null;
 }
コード例 #7
0
 /// <summary>
 /// Activates the application-level tab of the Task Pane view and makes the view visible.
 /// </summary>
 /// <returns>True if application-level tab of the Task Pane view is visible, false if not</returns>
 public bool ShowView()
 {
     if (EleHost.Child == null)
     {
         AddWPFHostControl();
     }
     return(TaskpaneView.ShowView());
 }
コード例 #8
0
ファイル: Addin.cs プロジェクト: blogharu/CS80Project
        /// <summary>
        /// Function Name: UnloadUI
        /// Description: Unloads the Add-ons UI from SolidWorks
        /// </summary>
        private void UnloadUI()
        {
            mMainUI = null;
            mTaskpaneView.DeleteView();
            Marshal.ReleaseComObject(mTaskpaneView);

            mTaskpaneView = null;
        }
コード例 #9
0
 public void AddTaskPane()
 {
     tpv = iSwApp.CreateTaskpaneView2("", "FTL VAME Explorer");
     tpv.ShowView();
     tph = tpv.AddControl("TestPane", "");
     tph.getSwApp(iSwApp);
     tph.getSwAddin(this);
 }
コード例 #10
0
        private void AddWPFHostControl()
        {
            if (EleHost.Child != null)
            {
                DeBindToEleHost();
            }

            AddUIElement(this);

            TaskpaneView.DisplayWindowFromHandlex64(EleHost.Handle.ToInt64());
        }
コード例 #11
0
        /// <summary>
        /// Create our Taskpane and inject our host UI
        /// </summary>
        private void LoadUI()
        {
            // Find location to our taskpane icon
            var imagePath = Path.Combine(Path.GetDirectoryName(typeof(TaskpaneIntegration).Assembly.CodeBase).Replace(@"file:\", string.Empty), "logo-small.png");

            // Create our Taskpane
            mTaskpaneView = mSolidWorksApplication.CreateTaskpaneView2(imagePath, "Woo! My first SwAddin");

            // Load our UI into the taskpane
            mTaskpaneHost = (TaskpaneHostUI)mTaskpaneView.AddControl(TaskpaneIntegration.SWTASKPANE_PROGID, string.Empty);
        }
コード例 #12
0
        /// <summary>
        /// Create our Taskpane and inject our HostUI
        /// </summary>
        private void LoadUI()
        {
            //Find location to our taskpane icon
            var imagePath = Path.Combine(Path.GetDirectoryName(typeof(StationBuilder3DAddIn).Assembly.CodeBase).Replace(@"file:\", string.Empty), "Options.bmp");

            //Create our Taskpane
            mTaskPaneView = mSolidWorksApplication.CreateTaskpaneView2(imagePath, "StationBuilder3DAddIn");

            //Load our UI into the taskpane
            stationBuilder3dHost = (StationBuilder3DHostUI)mTaskPaneView.AddControl(StationBuilder3DAddIn.SWTASKPANE_PROGID, string.Empty);
        }
コード例 #13
0
ファイル: Addin.cs プロジェクト: blogharu/CS80Project
        /// <summary>
        /// Function Name: LoadUI
        /// Description: Loads the UI to SolidWorks
        /// </summary>
        /// <returns>Returns success bolean</returns>
        private void LoadUI()
        {
            // Add add-ins icon
            var imagePath = Path.Combine(Path.GetDirectoryName(typeof(Addin).Assembly.CodeBase).Replace(@"file:\", ""), "logo-small.png");

            mTaskpaneView = swApp.CreateTaskpaneView2(imagePath, "CS80 Project");

            // Load UI
            mMainUI = (MainUI)mTaskpaneView.AddControl(Addin.SWTASKPANE_PROGID, string.Empty);
            mMainUI.setSolidWorksSingleton(this);
        }
コード例 #14
0
        public void Dispose()
        {
            TaskpaneView?.DeleteView();

            if (!this.EleHost.IsDisposed)
            {
                EleHost.Controls.Clear();
                EleHost.Child = null;
                EleHost.Dispose();
            }
        }
コード例 #15
0
        private void AddLogPage()
        {
            string[] img = { @"E:\ownCloud\Projects\Resources\20x.png", @"E:\ownCloud\Projects\Resources\32x.png",
                             @"E:\ownCloud\Projects\Resources\40x.png", @"E:\ownCloud\Projects\Resources\64x.png",
                             @"E:\ownCloud\Projects\Resources\96x.png", @"E:\ownCloud\Projects\Resources\128x.png" };

            logPageView = swApp.CreateTaskpaneView3(img, "Log Page");
            tpHost      = logPageView.AddControl(TP_PROGID, string.Empty);
            LogPage     = new wpfLogPage();
            tpHost.AddWpfControl(LogPage);
        }
コード例 #16
0
        /// <summary>
        /// Cleanup the taskpane when we disconnect/unload
        /// </summary>
        private void UnloadUI()
        {
            stationBuilder3dHost = null;

            //Remove taskpane view
            mTaskPaneView.DeleteView();

            // Release COM reference and cleanup memory
            Marshal.ReleaseComObject(mTaskPaneView);

            mTaskPaneView = null;
        }
コード例 #17
0
 private void UISetup()
 {
     try
     {
         string imagePath;
         imagePath     = @"\Resources\Theme.png";
         mTaskpaneView = SWApplication.CreateTaskpaneView2(imagePath, "3DSearch");
         mTaskpaneHost = (LittlePane)mTaskpaneView.AddControl(Loader.SWTASKPANE_PROGID, "");
     }
     catch (Exception e)
     {
         System.Windows.Forms.MessageBox.Show(e.Message);
     }
 }
コード例 #18
0
 private void UISetup()
 {
     try
     {
         string imagePath;
         imagePath     = @"\Resources\THeme.png";
         mTaskpaneView = SWApplication.CreateTaskpaneView2(imagePath, "AirVentsCAD");
         //bool res = mTaskpaneView.AddCustomButton(imagePath, "Just testing");
         mTaskpaneHost = (LittleTaskPane)mTaskpaneView.AddControl(Class1.SWTASKPANE_PROGID, "");
     }
     catch (Exception e)
     {
         System.Windows.Forms.MessageBox.Show(e.Message);
     }
 }
コード例 #19
0
 public void SupprimerTaskpane()
 {
     _OngletLog        = null;
     _OngletParametres = null;
     _OngletDessin     = null;
     _TaskpaneOngletLog.DeleteView();
     _TaskpaneOngletParametres.DeleteView();
     _TaskpaneOngletDessin.DeleteView();
     Marshal.ReleaseComObject(_TaskpaneOngletLog);
     Marshal.ReleaseComObject(_TaskpaneOngletParametres);
     Marshal.ReleaseComObject(_TaskpaneOngletDessin);
     _TaskpaneOngletLog        = null;
     _TaskpaneOngletParametres = null;
     _TaskpaneOngletDessin     = null;
 }
コード例 #20
0
 //UI method to add task pane and remove task pane
 public void AddTaskPane()
 {
     myTaskPaneView = iSwApp.CreateTaskpaneView2("", "Custom Property Pane");
     myTaskPaneHost = myTaskPaneView.AddControl("Compac_CustomProperty_TaskPane","");
      _objTaskPaneControl = (UserControl1)myTaskPaneView.GetControl();
     if (_objTaskPaneControl != null)
     {
         _objTaskPaneControl.swApp = iSwApp;
         //_objTaskPaneControl.Load += new EventHandler(_objTaskPaneControl_Load);
     }
     DataGridView gridView=(DataGridView)_objTaskPaneControl.Controls.Find("dataGridView1",true).FirstOrDefault();
     if(gridView!=null)
     {
         //this.tableTableAdapter.Fill(this.addInDataSet1.Table);
     }
 }
コード例 #21
0
        public void RemoveTaskPane()
        {
            try
            {
                myTaskPaneHost = null;
                myTaskPaneView.DeleteView();
                Marshal.ReleaseComObject(myTaskPaneView);
                myTaskPaneView = null;

            }
            catch (Exception ex)
            {

            }
        }
コード例 #22
0
        public void CreerTaskpane()
        {
            String     codeBase      = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
            UriBuilder uri           = new UriBuilder(codeBase);
            String     CheminDossier = Path.GetDirectoryName(Uri.UnescapeDataString(uri.Path));

            String CheminImageOngletLog       = Path.Combine(CheminDossier, "Icon_OngletLog." + ImageFormat.Bmp.ToString().ToLower());
            String CheminImageOngletParametre = Path.Combine(CheminDossier, "Icon_OngletParametre." + ImageFormat.Bmp.ToString().ToLower());
            String CheminImageOngletDessin    = Path.Combine(CheminDossier, "Icon_OngletDessin." + ImageFormat.Bmp.ToString().ToLower());

            Image ImgOngletLog       = "L".eConvertirEnBmp(18, 16);
            Image ImgOngletParametre = "P".eConvertirEnBmp(18, 16);
            Image ImgOngletDessin    = "D".eConvertirEnBmp(18, 16);

            ImgOngletLog.Save(CheminImageOngletLog, ImageFormat.Bmp);
            ImgOngletParametre.Save(CheminImageOngletParametre, ImageFormat.Bmp);
            ImgOngletDessin.Save(CheminImageOngletDessin, ImageFormat.Bmp);

            _TaskpaneOngletParametres = App.Sw.CreateTaskpaneView2(CheminImageOngletParametre, "Parametres");
            _TaskpaneOngletDessin     = App.Sw.CreateTaskpaneView2(CheminImageOngletDessin, "Dessin");
            _TaskpaneOngletLog        = App.Sw.CreateTaskpaneView2(CheminImageOngletLog, "Log");

            _OngletLog        = new OngletLog();
            _OngletParametres = new OngletParametres(App.Sw);
            _OngletDessin     = new OngletDessin(App.Sw);

            _TaskpaneOngletParametres.DisplayWindowFromHandlex64(_OngletParametres.Handle.ToInt64());
            _TaskpaneOngletDessin.DisplayWindowFromHandlex64(_OngletDessin.Handle.ToInt64());
            _TaskpaneOngletLog.DisplayWindowFromHandlex64(_OngletLog.Handle.ToInt64());

            App.Sw.ActiveDocChangeNotify      += _OngletParametres.ActiveDocChange;
            App.Sw.ActiveModelDocChangeNotify += _OngletParametres.ActiveDocChange;
            App.Sw.FileCloseNotify            += _OngletParametres.CloseDoc;

            App.Sw.ActiveDocChangeNotify      += _OngletDessin.ActiveDocChange;
            App.Sw.ActiveModelDocChangeNotify += _OngletDessin.ActiveDocChange;
            App.Sw.FileCloseNotify            += _OngletDessin.CloseDoc;

            App.Sw.ActiveDocChangeNotify      += _OngletParametres.Rechercher_Propriete_Modele;
            App.Sw.ActiveModelDocChangeNotify += _OngletParametres.Rechercher_Propriete_Modele;
            App.Sw.FileCloseNotify            += delegate(String nomFichier, int raison) { return(_OngletParametres.Rechercher_Propriete_Modele()); };

            WindowLog.Text += delegate(String t, Boolean Ajouter)
            {
                if (Ajouter)
                {
                    _OngletLog.Texte.AppendText(t + System.Environment.NewLine);
                }
                else
                {
                    _OngletLog.Texte.Text = t;
                }

                _OngletLog.Texte.SelectionStart = _OngletLog.Texte.TextLength;
                _OngletLog.Texte.ScrollToCaret();
                _OngletLog.Refresh();
            };

            WindowLog.Afficher += delegate()
            {
                _TaskpaneOngletLog.ShowView();
                _OngletLog.Refresh();
            };
        }
コード例 #23
0
ファイル: SwAddin.cs プロジェクト: digger1985/MyCode
        public void ModeChanged(object sender, EventArgs e)
        {
            if (IsEventsEnabled)
            {
                IsEventsEnabled = false;
                if (Properties.Settings.Default.CashModeAvailable && Properties.Settings.Default.KitchenModeAvailable)
                {
                    if (indicator != null)
                    {
                        indicator.DeleteView();
                        indicator = null;
                    }

                    Bitmap bitmap;
                    string bitmapPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\SWDocuments"; //���� � ����������
                    if (!Directory.Exists(bitmapPath + "\\"))
                        Directory.CreateDirectory(bitmapPath);

                    bitmapPath += "\\indicator.ind";

                    if (Properties.Settings.Default.CashModeOn && Properties.Settings.Default.KitchenModeOn)
                        bitmap = Furniture.Properties.Resources.GreenIndicator;
                    else
                        bitmap = Furniture.Properties.Resources.RedIndicator;

                    bitmap.Save(Path.GetFullPath(bitmapPath));

                    infoList.Items.Clear();
                    string status = Properties.Settings.Default.CashModeOn ? "���" : "����";
                    infoList.Items.Add("����� ���: " + status);
                    status = Properties.Settings.Default.KitchenModeOn ? "���" : "����";
                    infoList.Items.Add("����� ������: " + status);

                    if (File.Exists(bitmapPath))
                    {
                        indicator = _iSwApp.CreateTaskpaneView2(bitmapPath, "���������");
                        indicator.DisplayWindowFromHandle(infoList.Handle.ToInt32());
                    }

                    SwApp.ActivateTaskPane((int)swTaskPaneTab_e.swDesignLibrary);
                }
                IsEventsEnabled = true;
            }
        }
コード例 #24
0
ファイル: Redbrick.cs プロジェクト: kcjuntunen/Redbrick-Addin
        private void UISetup()
        {
            try {
            Version cv = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
            string ver = cv.ToString();

            taskpaneView = swApp.CreateTaskpaneView2(Properties.Settings.Default.NetPath +
            Properties.Settings.Default.Icon,
            string.Format(Properties.Resources.Title, ver));

            taskpaneHost = (SWTaskPaneHost)taskpaneView.AddControl(SWTaskPaneHost.SWTASKPANE_PROGID, string.Empty);
            taskpaneHost.OnRequestSW += new Func<SldWorks>(delegate { return this.swApp; });

            bool result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Ok, "OK");
            result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Options, "Configuration");
            //result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Close, "Close");
            result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.RefreshIcon, "Refresh");
            result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.ArchiveIcon, "Archive PDF");
            result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.HelpIcon, "Usage Help");

            taskpaneView.TaskPaneToolbarButtonClicked += taskpaneView_TaskPaneToolbarButtonClicked;
            taskpaneHost.cookie = cookie;
            taskpaneHost.Start();
              } catch (Exception e) {
            RedbrickErr.ErrMsg em = new RedbrickErr.ErrMsg(e);
            em.ShowDialog();
              }
        }
コード例 #25
0
 /// <summary>
 /// Hides the application-level tab on the Task Pane.
 /// </summary>
 /// <returns>True if the application-level tab is hidden, false if not</returns>
 public bool HideView()
 {
     DeBindToEleHost();
     return(TaskpaneView.HideView());
 }
コード例 #26
0
 private void UISetup()
 {
     mTaskpaneView       = mSWApplication.CreateTaskpaneView2(string.Empty, "sauron: computer vision-ize your models");
     mTaskpaneHost       = (SWTaskpaneHost)mTaskpaneView.AddControl(SWTaskpaneHost.SWTASKPANE_PROGID, "");
     mTaskpaneHost.swApp = mSWApplication;
 }
コード例 #27
0
ファイル: Redbrick.cs プロジェクト: kcjuntunen/Redbrick-Addin
 private void UITearDown()
 {
     taskpaneHost = null;
       taskpaneView.DeleteView();
       Marshal.ReleaseComObject(taskpaneView);
       taskpaneView = null;
 }
コード例 #28
0
 private void LoadUI()
 {
     mTaskpaneView = swApp.CreateTaskpaneView2("", "Mpc Export Add-in");
     mTaskpaneHost = (TaskpaneHostUI)mTaskpaneView.AddControl(SWTASKPANE_PROGID, string.Empty);
     mTaskpaneHost.SetSwApp(swApp);
 }
コード例 #29
0
ファイル: SwAddin.cs プロジェクト: digger1985/MyCode
        public void UpdateIndicator()
        {
            if (IsEventsEnabled)
            {
                IsEventsEnabled = false;
                if (!Properties.Settings.Default.CashModeAvailable)
                    if (Properties.Settings.Default.CashModeOn)
                        ChangeCashMode();

                if (!Properties.Settings.Default.KitchenModeAvailable)
                    if (Properties.Settings.Default.KitchenModeOn)
                        ChangeKitchenMode();

                if (!(Properties.Settings.Default.CashModeAvailable && Properties.Settings.Default.KitchenModeAvailable))
                {
                    if (indicator != null)
                    {
                        indicator.DeleteView();
                        indicator = null;
                    }
                }
                else
                {
                    IsEventsEnabled = true;
                    ModeChanged(null, null);
                    IsEventsEnabled = false;
                }

                IsEventsEnabled = true;
            }
        }
コード例 #30
0
 private void UISetup()
 {
     mTaskpaneView = mSWApplication.CreateTaskpaneView2(string.Empty, "Chrono::Engine tools");
     mTaskpaneHost = (SWTaskpaneHost)mTaskpaneView.AddControl(SWTaskpaneHost.SWTASKPANE_PROGID,"");
     mTaskpaneHost.mSWApplication = this.mSWApplication;
     mTaskpaneHost.mSWintegration = this;
 }
コード例 #31
0
 private void UISetup()
 {
     mTaskpaneView = mSWApplication.CreateTaskpaneView2(string.Empty, "Woo! My first SwAddin");
     mTaskpaneHost = (SWTaskpaneHost)mTaskpaneView.AddControl(SWTaskpaneHost.SWTASKPANE_PROGID, "");
     SWTaskpaneHost.mSWApplication = mSWApplication;
 }
コード例 #32
0
 public void AddTaskPane()
 {
     tpv = iSwApp.CreateTaskpaneView2("", "FTL VAME Explorer");
     tpv.ShowView();
     tph = tpv.AddControl("TestPane", "");
     tph.getSwApp(iSwApp);
     tph.getSwAddin(this);
 }
コード例 #33
0
 private void UITeardown()
 {
     mTaskpaneHost = null;
     mTaskpaneView.DeleteView();
     Marshal.ReleaseComObject(mTaskpaneView);
     mTaskpaneView = null;
 }
コード例 #34
0
ファイル: SwAddin.cs プロジェクト: renomike/CSharpAddin
 private void Taskpanesetup()
 {
     mTaskpaneView = iSwApp.CreateTaskpaneView2("C:\\Users\\thornm\\Desktop\\DEV\\CSharpAddin\\CSharpAddin\\IGTLOGO.bmp", "IGT Customizations");
     mTaskpaneHost = (SWTaskpaneHost)mTaskpaneView.AddControl(SWTaskpaneHost.SWTASKPANE_PROGID, "");
     mTaskpaneHost.iswapplication = iSwApp;
 }