Ejemplo n.º 1
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;
 }
Ejemplo n.º 2
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();
            };
        }