private void UITearDown()
 {
     taskpaneHost = null;
     taskpaneView.DeleteView();
     Marshal.ReleaseComObject(taskpaneView);
     taskpaneView = null;
 }
        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();
            }
        }
Exemple #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());
        }
Exemple #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;
 }
Exemple #5
0
 private void RemoveLogPage()
 {
     logPageView.DeleteView();
     Marshal.ReleaseComObject(logPageView);
     logPageView = null;
     tpHost      = null;
 }
 private void UITeardown()
 {
     mTaskpaneHost = null;
     mTaskpaneView.DeleteView();
     Marshal.ReleaseComObject(mTaskpaneView);
     mTaskpaneView = null;
 }
 /// <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());
 }
Exemple #8
0
        /// <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;
        }
 public void AddTaskPane()
 {
     tpv = iSwApp.CreateTaskpaneView2("", "FTL VAME Explorer");
     tpv.ShowView();
     tph = tpv.AddControl("TestPane", "");
     tph.getSwApp(iSwApp);
     tph.getSwAddin(this);
 }
        private void AddWPFHostControl()
        {
            if (EleHost.Child != null)
            {
                DeBindToEleHost();
            }

            AddUIElement(this);

            TaskpaneView.DisplayWindowFromHandlex64(EleHost.Handle.ToInt64());
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #13
0
        /// <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);
        }
        public void Dispose()
        {
            TaskpaneView?.DeleteView();

            if (!this.EleHost.IsDisposed)
            {
                EleHost.Controls.Clear();
                EleHost.Child = null;
                EleHost.Dispose();
            }
        }
Exemple #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);
        }
Exemple #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;
        }
Exemple #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);
     }
 }
 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);
     }
 }
Exemple #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;
 }
 //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);
     }
 }
        public void RemoveTaskPane()
        {
            try
            {
                myTaskPaneHost = null;
                myTaskPaneView.DeleteView();
                Marshal.ReleaseComObject(myTaskPaneView);
                myTaskPaneView = null;

            }
            catch (Exception ex)
            {

            }
        }
Exemple #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();
            };
        }
Exemple #23
0
        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;
            }
        }
Exemple #24
0
        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();
              }
        }
 /// <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());
 }
 private void UISetup()
 {
     mTaskpaneView       = mSWApplication.CreateTaskpaneView2(string.Empty, "sauron: computer vision-ize your models");
     mTaskpaneHost       = (SWTaskpaneHost)mTaskpaneView.AddControl(SWTaskpaneHost.SWTASKPANE_PROGID, "");
     mTaskpaneHost.swApp = mSWApplication;
 }
Exemple #27
0
 private void UITearDown()
 {
     taskpaneHost = null;
       taskpaneView.DeleteView();
       Marshal.ReleaseComObject(taskpaneView);
       taskpaneView = null;
 }
Exemple #28
0
 private void LoadUI()
 {
     mTaskpaneView = swApp.CreateTaskpaneView2("", "Mpc Export Add-in");
     mTaskpaneHost = (TaskpaneHostUI)mTaskpaneView.AddControl(SWTASKPANE_PROGID, string.Empty);
     mTaskpaneHost.SetSwApp(swApp);
 }
Exemple #29
0
        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;
            }
        }
 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;
 }
 private void UISetup()
 {
     mTaskpaneView = mSWApplication.CreateTaskpaneView2(string.Empty, "Woo! My first SwAddin");
     mTaskpaneHost = (SWTaskpaneHost)mTaskpaneView.AddControl(SWTaskpaneHost.SWTASKPANE_PROGID, "");
     SWTaskpaneHost.mSWApplication = mSWApplication;
 }
 public void AddTaskPane()
 {
     tpv = iSwApp.CreateTaskpaneView2("", "FTL VAME Explorer");
     tpv.ShowView();
     tph = tpv.AddControl("TestPane", "");
     tph.getSwApp(iSwApp);
     tph.getSwAddin(this);
 }
 private void UITeardown()
 {
     mTaskpaneHost = null;
     mTaskpaneView.DeleteView();
     Marshal.ReleaseComObject(mTaskpaneView);
     mTaskpaneView = null;
 }
Exemple #34
0
 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;
 }