private void showPostSharpInstallStatus(IGacDll gacDll)
        {
            //if (gacDll.PostSharpHooks == PostSharpHookStatus.NotCalculated)
            if (PostSharpUtils.containsO2PostSharpHooks(gacDll.fullPath))
                gacDll.PostSharpHooks = PostSharpHookStatus.Installed;
            else
                gacDll.PostSharpHooks = PostSharpHookStatus.NotInstalled;
            switch (gacDll.PostSharpHooks)
            { 
                case PostSharpHookStatus.Installed:
                    lbPostSharpHooksState.Text = "YES";
                    lbPostSharpHooksState.ForeColor = Color.DarkGreen;
                    btInstallPostSharpHooks.Enabled = false;
                    btUnInstallPostSharpHooks.Enabled = true;
                    break;
                case PostSharpHookStatus.NotInstalled:
                    lbPostSharpHooksState.Text = "NO";
                    lbPostSharpHooksState.ForeColor = Color.DarkRed;
                    btInstallPostSharpHooks.Enabled = true;
                    btUnInstallPostSharpHooks.Enabled = false;
                    break;
                case PostSharpHookStatus.NotCalculated:
                    lbPostSharpHooksState.Text = "...";
                    lbPostSharpHooksState.ForeColor = Color.Black;
                    btInstallPostSharpHooks.Enabled = false;
                    btUnInstallPostSharpHooks.Enabled = false;
                    break;

            }
            
        }
Example #2
0
        private void showPostSharpInstallStatus(IGacDll gacDll)
        {
            //if (gacDll.PostSharpHooks == PostSharpHookStatus.NotCalculated)
            if (PostSharpUtils.containsO2PostSharpHooks(gacDll.fullPath))
            {
                gacDll.PostSharpHooks = PostSharpHookStatus.Installed;
            }
            else
            {
                gacDll.PostSharpHooks = PostSharpHookStatus.NotInstalled;
            }
            switch (gacDll.PostSharpHooks)
            {
            case PostSharpHookStatus.Installed:
                lbPostSharpHooksState.Text        = "YES";
                lbPostSharpHooksState.ForeColor   = Color.DarkGreen;
                btInstallPostSharpHooks.Enabled   = false;
                btUnInstallPostSharpHooks.Enabled = true;
                break;

            case PostSharpHookStatus.NotInstalled:
                lbPostSharpHooksState.Text        = "NO";
                lbPostSharpHooksState.ForeColor   = Color.DarkRed;
                btInstallPostSharpHooks.Enabled   = true;
                btUnInstallPostSharpHooks.Enabled = false;
                break;

            case PostSharpHookStatus.NotCalculated:
                lbPostSharpHooksState.Text        = "...";
                lbPostSharpHooksState.ForeColor   = Color.Black;
                btInstallPostSharpHooks.Enabled   = false;
                btUnInstallPostSharpHooks.Enabled = false;
                break;
            }
        }
Example #3
0
        private void testDllCopy(IGacDll iGacDll)
        {
            IISDeployment.kill_IIS_Process_W3wp();
            var tempDllLocation = iGacDll.fullPath + ".temp";

            if (File.Exists(iGacDll.fullPath) && false == File.Exists(tempDllLocation))
            {
                Files.MoveFile(iGacDll.fullPath, tempDllLocation);
                if (false == File.Exists(iGacDll.fullPath) && File.Exists(tempDllLocation))
                {
                    Files.MoveFile(tempDllLocation, iGacDll.fullPath);
                    if (File.Exists(iGacDll.fullPath) && false == File.Exists(tempDllLocation))
                    {
                        DI.log.debug("testDllCopy worked");
                    }
                    else
                    {
                        DI.log.error("in testDllCopy, restore failed");
                    }
                }
                else
                {
                    DI.log.error("in testDllCopy, move failed");
                }
            }
            else
            {
                DI.log.error("in testDllCopy, could not find gacDll or tempfile already exists");
            }
            if (File.Exists(iGacDll.fullPath) && File.Exists(tempDllLocation))
            {
                Files.deleteFile(tempDllLocation);
            }
        }
Example #4
0
 public void InstallPostSharpHook(IGacDll iGacDll, string typeToHook, string methodToHook)
 {
     if (false == PostSharpUtils.containsO2PostSharpHooks(iGacDll.fullPath))
     {
         IISDeployment.kill_IIS_Process_W3wp();
         BackupRestoreFiles.backup(iGacDll.fullPath);
         if (PostSharpExecution.InsertHooksAndRunPostSharpOnAssembly(iGacDll.fullPath, typeToHook, methodToHook))
         {
             DI.log.debug("PostSharp hooks installed on Gac Assembly: {0} (in {1})", iGacDll.name, iGacDll.fullPath);
         }
     }
     showGacAssemblyDetails(iGacDll, false);
     //throw new NotImplementedException();
 }
Example #5
0
        public void loadAndShowCirForAssembly(IGacDll gacDll)
        {
            O2Thread.mtaThread(
                () =>
            {
                gacDll.cirData = new CirData();
                //var assemblyToConvert = CecilUtils.getAssembly(gacDll.fullPath);

                new CirFactory().processAssemblyDefinition(gacDll.cirData, gacDll.fullPath);

                cirDataViewer.loadCirData(gacDll.cirData, true);
                cirDataViewer.showLoadedFunctions();
            });
        }
Example #6
0
/*        private void tvListOfGacAssemblies_AfterSelect(object sender, TreeViewEventArgs e)
 *      {
 *          if (tvListOfGacAssemblies.SelectedNode != null && tvListOfGacAssemblies.SelectedNode.Tag is IGacDll)
 *              showGacAssemblyDetails((IGacDll)tvListOfGacAssemblies.SelectedNode.Tag, cbLoadCirDataForSelectedAssembly.Checked);
 *      }*/

        public void showGacAssemblyDetails(IGacDll gacDll, bool loadCirDataForSelectedAssembly)
        {
            this.invokeOnThread(
                () =>
            {
                directoryOfSelectedAssembly.openDirectory(Path.GetDirectoryName(gacDll.fullPath));
                lbSelectedGacAssembly_name.Text     = gacDll.name;
                lbSelectedGacAssembly_version.Text  = gacDll.version;
                lbSelectedGacAssembly_fullPath.Text = gacDll.fullPath;
                showPostSharpInstallStatus(gacDll);
                if (loadCirDataForSelectedAssembly)
                {
                    loadAndShowCirForAssembly(gacDll);
                }
            });
        }
Example #7
0
 public void UnInstallPostSharpHook(IGacDll iGacDll)
 {
     if (false == BackupRestoreFiles.doesBackupExist(iGacDll.fullPath))
     {
         DI.log.error("Error in UnInstallPostSharpHook, could not find backup file for file: {0}", iGacDll.fullPath);
     }
     else
     {
         IISDeployment.kill_IIS_Process_W3wp();
         if (BackupRestoreFiles.restore(iGacDll.fullPath))
         {
             DI.log.debug("Gac Assembly uninstalled/restored: {0} (in {1})", iGacDll.name, iGacDll.fullPath);
         }
     }
     showGacAssemblyDetails(iGacDll, false);
     //throw new NotImplementedException();
 }
 private void gacBrowser__onGacDllSelected(IGacDll selectedDll)
 {
     showDependenciesForFile(selectedDll.fullPath);
 }
Example #9
0
 private void gacBrowser__onGacDllSelected(IGacDll selectedGacAssembly)
 {
     showGacAssemblyDetails(selectedGacAssembly, cbLoadCirDataForSelectedAssembly.Checked);
 }
        private void testDllCopy(IGacDll iGacDll)
        {
            IISDeployment.kill_IIS_Process_W3wp();
            var tempDllLocation = iGacDll.fullPath + ".temp";
            if (File.Exists(iGacDll.fullPath) && false == File.Exists(tempDllLocation))
            {
                Files.MoveFile(iGacDll.fullPath, tempDllLocation);
                if (false == File.Exists(iGacDll.fullPath) && File.Exists(tempDllLocation))
                {
                    Files.MoveFile(tempDllLocation, iGacDll.fullPath);
                    if (File.Exists(iGacDll.fullPath) && false == File.Exists(tempDllLocation))
                        DI.log.debug("testDllCopy worked");
                    else
                        DI.log.error("in testDllCopy, restore failed");
                }
                else
                    DI.log.error("in testDllCopy, move failed");

            }
            else
                DI.log.error("in testDllCopy, could not find gacDll or tempfile already exists");
            if (File.Exists(iGacDll.fullPath) && File.Exists(tempDllLocation))
                Files.deleteFile(tempDllLocation);
        }
/*        private void tvListOfGacAssemblies_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (tvListOfGacAssemblies.SelectedNode != null && tvListOfGacAssemblies.SelectedNode.Tag is IGacDll)
                showGacAssemblyDetails((IGacDll)tvListOfGacAssemblies.SelectedNode.Tag, cbLoadCirDataForSelectedAssembly.Checked);
        }*/

        public void showGacAssemblyDetails(IGacDll gacDll, bool loadCirDataForSelectedAssembly)
        {
            this.invokeOnThread(
                () =>
                {
                    directoryOfSelectedAssembly.openDirectory(Path.GetDirectoryName(gacDll.fullPath));
                    lbSelectedGacAssembly_name.Text = gacDll.name;
                    lbSelectedGacAssembly_version.Text = gacDll.version;
                    lbSelectedGacAssembly_fullPath.Text = gacDll.fullPath;
                    showPostSharpInstallStatus(gacDll);
                    if (loadCirDataForSelectedAssembly)
                    {
                        loadAndShowCirForAssembly(gacDll);
                    }
                });
        }
        public void InstallPostSharpHook(IGacDll iGacDll, string typeToHook, string methodToHook)
        {
            if (false == PostSharpUtils.containsO2PostSharpHooks(iGacDll.fullPath))
            {                
                IISDeployment.kill_IIS_Process_W3wp();                    
                BackupRestoreFiles.backup(iGacDll.fullPath);
                if (PostSharpExecution.InsertHooksAndRunPostSharpOnAssembly(iGacDll.fullPath, typeToHook, methodToHook))
                    DI.log.debug("PostSharp hooks installed on Gac Assembly: {0} (in {1})", iGacDll.name, iGacDll.fullPath);

            }
            showGacAssemblyDetails(iGacDll, false);
            //throw new NotImplementedException();
        }
 public void UnInstallPostSharpHook(IGacDll iGacDll)
 {
     if (false == BackupRestoreFiles.doesBackupExist(iGacDll.fullPath))
     {
         DI.log.error("Error in UnInstallPostSharpHook, could not find backup file for file: {0}", iGacDll.fullPath);
     }
     else
     {
         IISDeployment.kill_IIS_Process_W3wp();                    
         if (BackupRestoreFiles.restore(iGacDll.fullPath))
             DI.log.debug("Gac Assembly uninstalled/restored: {0} (in {1})", iGacDll.name, iGacDll.fullPath);
     } 
     showGacAssemblyDetails(iGacDll,false);
     //throw new NotImplementedException();
 }
        public void loadAndShowCirForAssembly(IGacDll gacDll)
        {
            O2Thread.mtaThread(
                () =>
                {
                    gacDll.cirData = new CirData();
                    //var assemblyToConvert = CecilUtils.getAssembly(gacDll.fullPath);

                    new CirFactory().processAssemblyDefinition(gacDll.cirData, gacDll.fullPath);
                                        
                    cirDataViewer.loadCirData(gacDll.cirData, true);
                    cirDataViewer.showLoadedFunctions();
                });
        }        
 private void gacBrowser__onGacDllSelected(IGacDll selectedDll)
 {
     showDependenciesForFile(selectedDll.FullPath);
 }
Example #16
0
 private void gacBrowser__onGacDllSelected(IGacDll selectedGacAssembly)
 {
     showGacAssemblyDetails(selectedGacAssembly, cbLoadCirDataForSelectedAssembly.Checked);
 }