public ClassViewWindow(IAssemblyBrowser assemblyBrowser, ILanguageManager languageManager, ITranslatorManager translatorManager, IVisibilityConfiguration visibilityConfiguration)
        {
            this.Dock        = DockStyle.Fill;
            this.Multiline   = true;
            this.WordWrap    = false;
            this.ReadOnly    = true;
            this.Font        = new Font("Courier New", 9f);
            this.ScrollBars  = RichTextBoxScrollBars.Both;
            this.BorderStyle = BorderStyle.None;

            this.ContextMenu = new ContextMenu();
            this.ContextMenu.MenuItems.Add("Select &All", new EventHandler(this.SelectAll_Click)).Shortcut = Shortcut.CtrlA;
            this.ContextMenu.MenuItems.Add("-");
            this.ContextMenu.MenuItems.Add("&Copy", new EventHandler(this.Copy_Click)).Shortcut = Shortcut.CtrlC;

            this.assemblyBrowser = assemblyBrowser;

            if (this.assemblyBrowser != null)
            {
                this.assemblyBrowser.ActiveItemChanged += new EventHandler(this.AssemblyBrowser_ActiveItemChanged);
            }

            this.languageManager = languageManager;

            if (this.languageManager != null)
            {
                this.languageManager.ActiveLanguageChanged += new EventHandler(this.LanguageManager_ActiveLanguageChanged);
            }

            this.translatorManager       = translatorManager;
            this.visibilityConfiguration = visibilityConfiguration;
        }
Example #2
0
        void IPackage.Load(IServiceProvider serviceProvider)
        {
            this.serviceProvider   = serviceProvider;
            this.windowManager     = (IWindowManager)this.serviceProvider.GetService(typeof(IWindowManager));
            this.commandbarManager = (ICommandBarManager)this.serviceProvider.GetService(typeof(ICommandBarManager));

            // manage the search window
            this.windowManager.Windows.Add("SearchCodeWindow", this, "Code Search " + this.GetType().Assembly.GetName().Version.ToString());

            // load the resources
            System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
            Stream myStream = myAssembly.GetManifestResourceStream("Reflector.CodeSearch.Search.png");
            Bitmap img      = null;

            if (myStream != null)
            {
                img = new Bitmap(myStream);
            }

            // add the toolbar button
            evtSearch = new EventHandler(this.CodeSearchButton_Click);

            this.toolBarSeparator = commandbarManager.CommandBars["ToolBar"].Items.AddSeparator();
            this.toolBarButton    = commandbarManager.CommandBars["ToolBar"].Items.AddButton("Code Search", img, evtSearch);

            this.menuBarSeparator = commandbarManager.CommandBars["Tools"].Items.AddSeparator();
            this.menuBarButton    = commandbarManager.CommandBars["Tools"].Items.AddButton("Code Search", img, evtSearch);

            // init members
            this.assemblyBrowser         = (IAssemblyBrowser)serviceProvider.GetService(typeof(IAssemblyBrowser));
            this.languageManager         = (ILanguageManager)serviceProvider.GetService(typeof(ILanguageManager));
            this.translatorManager       = (ITranslatorManager)serviceProvider.GetService(typeof(ITranslatorManager));
            this.visibilityConfiguration = (IVisibilityConfiguration)serviceProvider.GetService(typeof(IVisibilityConfiguration));
        }
 public void Load(IServiceProvider serviceProvider)
 {
     this.windowManager = (IWindowManager)serviceProvider.GetService(typeof(IWindowManager));
     //this.windowManager.ShowMessage("Loading Perst!");
     this.assemblyManager = (IAssemblyManager)serviceProvider.GetService(typeof(IAssemblyManager));
     this.commandBarManager = (ICommandBarManager)serviceProvider.GetService(typeof(ICommandBarManager));
     this.translatorManager = (ITranslatorManager)serviceProvider.GetService(typeof(ITranslatorManager));
     this.translator = this.translatorManager.CreateDisassembler(null, null);
     this.separator = this.commandBarManager.CommandBars["Tools"].Items.AddSeparator();
     this.button = this.commandBarManager.CommandBars["Tools"].Items.AddButton("&Detect Modify Bug", new EventHandler(this.PerstListButton_Click));
 }
Example #4
0
 public void Load(IServiceProvider serviceProvider)
 {
     this.windowManager = (IWindowManager)serviceProvider.GetService(typeof(IWindowManager));
     //this.windowManager.ShowMessage("Loading Perst!");
     this.assemblyManager   = (IAssemblyManager)serviceProvider.GetService(typeof(IAssemblyManager));
     this.commandBarManager = (ICommandBarManager)serviceProvider.GetService(typeof(ICommandBarManager));
     this.translatorManager = (ITranslatorManager)serviceProvider.GetService(typeof(ITranslatorManager));
     this.translator        = this.translatorManager.CreateDisassembler(null, null);
     this.separator         = this.commandBarManager.CommandBars["Tools"].Items.AddSeparator();
     this.button            = this.commandBarManager.CommandBars["Tools"].Items.AddButton("&Detect Modify Bug", new EventHandler(this.PerstListButton_Click));
 }
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if ( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
				_assemblyBrowser = null;
				_assemblyManager  = null;
				_languageManager = null;
				_TranslatorManager  = null;
			}
			base.Dispose( disposing );
		}
Example #6
0
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (components != null)
         {
             components.Dispose();
         }
         _assemblyBrowser   = null;
         _assemblyManager   = null;
         _languageManager   = null;
         _TranslatorManager = null;
     }
     base.Dispose(disposing);
 }
        public void Load(IServiceProvider serviceProvider)
        {
            IAssemblyBrowser         assemblyBrowser         = (IAssemblyBrowser)serviceProvider.GetService(typeof(IAssemblyBrowser));
            ILanguageManager         languageManager         = (ILanguageManager)serviceProvider.GetService(typeof(ILanguageManager));
            ITranslatorManager       translatorManager       = (ITranslatorManager)serviceProvider.GetService(typeof(ITranslatorManager));
            IVisibilityConfiguration visibilityConfiguration = (IVisibilityConfiguration)serviceProvider.GetService(typeof(IVisibilityConfiguration));

            this.window = new ClassViewWindow(assemblyBrowser, languageManager, translatorManager, visibilityConfiguration);

            this.windowManager = (IWindowManager)serviceProvider.GetService(typeof(IWindowManager));
            this.windowManager.Windows.Add("ClassViewWindow", this.window, "Class View");

            this.commandBarManager = (ICommandBarManager)serviceProvider.GetService(typeof(ICommandBarManager));

            this.separator = commandBarManager.CommandBars["Tools"].Items.AddSeparator();
            this.button    = commandBarManager.CommandBars["Tools"].Items.AddButton("Class &View", new EventHandler(this.Button_Click));
        }
 public FileDisassemblerHelper(
     IAssemblyManager assemblyManager,
     ITranslatorManager TranslatorManager,
     ILanguageManager languageManager,
     int projectType,
     string outputDirectory,
     WriteLineDelegate writeLineDelegate,
     SetProgressBarDelegate setProgressBarDelegate)
 {
     _assemblyManager = assemblyManager;
     _TranslatorManager = TranslatorManager;
     _languageManager = languageManager;
     _projectType = projectType;
     _outputDirectory = outputDirectory;
     WriteLine += writeLineDelegate;
     SetProgressBar += setProgressBarDelegate;
 }
		public FileDisassemblerHelper(
			IAssemblyManager assemblyManager,
			ITranslatorManager TranslatorManager,
			ILanguageManager languageManager,
			int projectType,
			string outputDirectory,
			WriteLineDelegate writeLineDelegate,
			SetProgressBarDelegate setProgressBarDelegate, bool documentation, bool membersBody, bool publicOnly)
		{
			_assemblyManager = assemblyManager;
			_TranslatorManager = TranslatorManager;
			_languageManager = languageManager;
			_projectType = projectType;
			_outputDirectory = outputDirectory;
			this.documentation = documentation;
			this.membersBody = membersBody;
			this.publicOnly = publicOnly;
			WriteLine += writeLineDelegate;
			SetProgressBar += setProgressBarDelegate;
		}
Example #10
0
 public FileDisassemblerHelper(
     IAssemblyManager assemblyManager,
     ITranslatorManager TranslatorManager,
     ILanguageManager languageManager,
     int projectType,
     string outputDirectory,
     WriteLineDelegate writeLineDelegate,
     SetProgressBarDelegate setProgressBarDelegate, bool documentation, bool membersBody, bool publicOnly)
 {
     _assemblyManager   = assemblyManager;
     _TranslatorManager = TranslatorManager;
     _languageManager   = languageManager;
     _projectType       = projectType;
     _outputDirectory   = outputDirectory;
     this.documentation = documentation;
     this.membersBody   = membersBody;
     this.publicOnly    = publicOnly;
     WriteLine         += writeLineDelegate;
     SetProgressBar    += setProgressBarDelegate;
 }