Example #1
0
 public static void LoadPlugin(string FileName, IMainForm Parent, bool ShowError)
 {
     try
     {
         Assembly pluginAssembly = Assembly.LoadFrom(FileName);
         Type[] types = pluginAssembly.GetTypes();
         foreach (Type type in types)
         {
             if (type.Name.Equals("Plugin"))
             {
                 IPlugin inst = (IPlugin)pluginAssembly.CreateInstance(type.FullName);
                 PluginType add = new PluginType(inst.Name, FileName, inst.Version);
                 if (!Plugins.Contains(add))
                 {
                     Plugins.Add(add);
                     inst.Initialize(Parent);
                     Parent.LoadPlugin(inst);
                 }
                 else if (ShowError) MessageBox.Show("This plugin is already loaded!", "Error");
                 pluginAssembly = null;
                 inst = null;
                 add = null;
                 return;
             }
         }
         if (ShowError) MessageBox.Show("This is not valid plugin!", "Error");
     }
     catch (Exception ex)
     {
         if (ShowError) MessageBox.Show(ex.Message, "Error");
     }
 }
		public void Setup()
		{
            mr = new MockRepository();
            form = new MainForm();
            sc = new ServiceContainer();
            loader = mr.StrictMock<ILoader>();
            dec = mr.StrictMock<IDecompiler>();
            sc = new ServiceContainer();
            uiSvc = new FakeShellUiService();
            host = mr.StrictMock<DecompilerHost>();
            memSvc = mr.StrictMock<ILowLevelViewService>();
            var mem = new MemoryArea(Address.Ptr32(0x10000), new byte[1000]);
            var imageMap = new SegmentMap(
                mem.BaseAddress,
                new ImageSegment("code", mem, AccessMode.ReadWriteExecute));
            var arch = mr.StrictMock<IProcessorArchitecture>();
            var platform = mr.StrictMock<IPlatform>();
            program = new Program(imageMap, arch, platform);
            project = new Project { Programs = { program } };

            browserSvc = mr.StrictMock<IProjectBrowserService>();

            sc.AddService<IDecompilerUIService>(uiSvc);
            sc.AddService(typeof(IDecompilerShellUiService), uiSvc);
            sc.AddService(typeof(IDecompilerService), new DecompilerService());
            sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService());
            sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
            sc.AddService(typeof(IProjectBrowserService), browserSvc);
            sc.AddService(typeof(ILowLevelViewService), memSvc);
            sc.AddService<ILoader>(loader);
            sc.AddService<DecompilerHost>(host);

            i = new TestInitialPageInteractor(sc, dec);

		}
Example #3
0
 public Browser(IMainForm aParent, string url)
 {
     parent = aParent;
     InitializeComponent();
     AfterInit();
     webBrowser1.Navigate(url);
 }
Example #4
0
        public RichToolTip(IMainForm mainForm)
        {
            EventManager.AddEventHandler(this, EventType.ApplyTheme);
            // panel
            toolTip = new Panel();
            toolTip.Location = new Point(0,0);
            toolTip.BackColor = SystemColors.Info;
            toolTip.ForeColor = SystemColors.InfoText;
            toolTip.BorderStyle = BorderStyle.FixedSingle;
            toolTip.Visible = false;
            (mainForm as Form).Controls.Add(toolTip);
            // text
            toolTipRTB = new RichTextBox();
            toolTipRTB.Font = PluginBase.Settings.DefaultFont;
            toolTipRTB.BackColor = SystemColors.Info;
            toolTipRTB.ForeColor = SystemColors.InfoText;
            toolTipRTB.BorderStyle = BorderStyle.None;
            toolTipRTB.ScrollBars = RichTextBoxScrollBars.None;
            toolTipRTB.DetectUrls = false;
            toolTipRTB.ReadOnly = true;
            toolTipRTB.WordWrap = false;
            toolTipRTB.Visible = true;
            toolTipRTB.Text = "";
            toolTip.Controls.Add(toolTipRTB);

            // rtf cache
            rtfCache = new Dictionary<String, String>();
            rtfCacheList = new List<String>();
        }
Example #5
0
		public FDMenus(IMainForm mainForm)
		{
			// modify the view menu
			CommandBarMenu viewMenu = mainForm.GetCBMenu("ViewMenu");
			View = new CommandBarButton("&Project Explorer");
			View.Image = Icons.Project.Img;
			viewMenu.Items.Add(View);

			// modify the tools menu - add a nice GUI classpath editor
			GlobalClasspaths = new CommandBarButton("&Global Classpaths...");
			GlobalClasspaths.Shortcut = Keys.F9 | Keys.Control;

			mainForm.IgnoredKeys.Add(GlobalClasspaths.Shortcut);

			CommandBarMenu toolsMenu = mainForm.GetCBMenu("ToolsMenu");
			toolsMenu.Items.AddSeparator();
			toolsMenu.Items.Add(GlobalClasspaths);

			ProjectMenu = new ProjectMenu();

			CommandBar mainMenu = mainForm.GetCBMainMenu();
			mainMenu.Items.Insert(5, ProjectMenu);

			RecentComboBox = RecentComboBox.Create();

			CommandBar toolBar = mainForm.GetCBToolbar();

			if (toolBar != null) // you might have turned off the toolbar
			{
				toolBar.Items.AddSeparator();
				toolBar.Items.Add(ProjectMenu.TestMovie);
				toolBar.Items.Add(RecentComboBox);
			}
		}
Example #6
0
		public RichToolTip(IMainForm mainForm)
		{
			// panel
			toolTip = new Panel();
			toolTip.Location = new System.Drawing.Point(0,0);
            toolTip.BackColor = System.Drawing.SystemColors.Info;
            toolTip.ForeColor = System.Drawing.SystemColors.InfoText;
			toolTip.BorderStyle = BorderStyle.FixedSingle;
			toolTip.Visible = false;
			(mainForm as Form).Controls.Add(toolTip);
			// text
			toolTipRTB = new System.Windows.Forms.RichTextBox();
			toolTipRTB.Location = new System.Drawing.Point(2,1);
            toolTipRTB.BackColor = System.Drawing.SystemColors.Info;
            toolTipRTB.ForeColor = System.Drawing.SystemColors.InfoText;
			toolTipRTB.BorderStyle = BorderStyle.None;
			toolTipRTB.ScrollBars = RichTextBoxScrollBars.None;
            toolTipRTB.DetectUrls = false;
			toolTipRTB.ReadOnly = true;
			toolTipRTB.WordWrap = false;
			toolTipRTB.Visible = true;
			toolTipRTB.Text = "";
			toolTip.Controls.Add(toolTipRTB);

			// rtf cache
			rtfCache = new Dictionary<String, String>();
			rtfCacheList = new List<String>();
		}
        public XnaGame( IMainForm mainForm )
        {
            _mainForm = mainForm ;

            _drawSurface = _mainForm.GetHandle( ) ;

            Logger.Instance.log("Game1 creation started.");

            _graphics = new GraphicsDeviceManager( this )
                {
                    PreferredBackBufferWidth = 800,
                    PreferredBackBufferHeight = 600
                } ;

            Content.RootDirectory = "Content";

            _graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;

            _winform = (Form)Form.FromHandle(Window.Handle);

            _winform.VisibleChanged += game1VisibleChanged;
            _winform.Size = new Size(10, 10);

            Mouse.WindowHandle = _drawSurface;

            Size pictureBoxSize = _mainForm.CanvasSize ;

            ResizeBackBuffer( pictureBoxSize.Width, pictureBoxSize.Height ) ;

            _winform.Hide();
        }
Example #8
0
        public MainFormController(IMainForm mainForm)
        {
            MainForm = mainForm;
            EngineCache = new EngineCache();

            LoadSettings();
        }
Example #9
0
 public static void LoadLanguage(string aName, IMainForm parent, bool ShowError)
 {
     if (aName == "English")
     {
         Language = new LanguageBase();
         Settings.Settings.Language = "English";
         parent.ChangeLanguage();
         return;
     }
     try
     {
         Assembly pluginAssembly = Assembly.LoadFrom(Path + "\\Languages\\" + aName + ".dll");
         Type[] types = pluginAssembly.GetTypes();
         foreach (Type type in types)
         {
             if (type.Name.Equals("Language"))
             {
                 Language = (LanguageBase)pluginAssembly.CreateInstance(type.FullName);
             }
         }
         pluginAssembly = null;
     }
     catch (FileNotFoundException ex)
     {
         if (ShowError) MessageBox.Show(ex.Message, "Error");
         Language = new LanguageBase();
         Settings.Settings.Language = "English";
         parent.ChangeLanguage();
         return;
     }
     Settings.Settings.Language = aName;
     parent.ChangeLanguage();
 }
		public void Setup()
		{
            mr = new MockRepository();
            form = new MainForm();
            sc = new ServiceContainer();
            loader = mr.StrictMock<ILoader>();
            dec = mr.StrictMock<IDecompiler>();
            sc = new ServiceContainer();
            uiSvc = new FakeShellUiService();
            host = mr.StrictMock<DecompilerHost>();
            memSvc = mr.StrictMock<ILowLevelViewService>();
            var image = new LoadedImage(Address.Ptr32(0x10000), new byte[1000]);
            var imageMap = image.CreateImageMap();
            var arch = mr.StrictMock<IProcessorArchitecture>();
            arch.Stub(a => a.CreateRegisterBitset()).Return(new BitSet(32));
            arch.Replay();
            var platform = mr.StrictMock<Platform>(null, arch);
            arch.BackToRecord();
            program = new Program(image, imageMap, arch, platform);
            project = new Project { Programs = { program } };

            browserSvc = mr.StrictMock<IProjectBrowserService>();

            sc.AddService<IDecompilerUIService>(uiSvc);
            sc.AddService(typeof(IDecompilerShellUiService), uiSvc);
            sc.AddService(typeof(IDecompilerService), new DecompilerService());
            sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService());
            sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
            sc.AddService(typeof(IProjectBrowserService), browserSvc);
            sc.AddService(typeof(ILowLevelViewService), memSvc);
            sc.AddService<ILoader>(loader);

            i = new TestInitialPageInteractor(sc, dec);

		}
        public MainFormPresenter(IMainForm view)
        {
            _view = view;

              view.NewPlanClick += (s, e) => OnNewPlanClick();
              view.OpenPlanClick += (s, e) => OnOpenPlanClick();
              view.OpenSpecificPlanClick += (s, e) => LoadTrainingPlan(e);
              view.ClosePlanClick += (s, e) => OnClosePlanClick();
              view.AddWorkoutClick += (s, e) => OnAddWorkoutClick();
              view.EditWorkoutClick += (s, e) => OnEditWorkoutClick(e);
              view.DeleteWorkoutClick += (s, e) => OnDeleteWorkoutClick(e);
              view.ManageWorkoutsClick += (s, e) => OnManageWorkoutsClick();
              view.AddWorkoutCategoryClick += (s, e) => OnAddWorkoutCategoryClick();
              view.EditWorkoutCategoryClick += (s, e) => OnEditWorkoutCategoryClick(e);
              view.DeleteWorkoutCategoryClick += (s, e) => OnDeleteWorkoutCategoryClick(e);
              view.ManageWorkoutCategoriesClick += (s, e) => OnManageWorkoutCategoriesClick();
              view.ConfigurePacesClick += (s, e) => OnConfigurePacesClick();
              view.InfoClick += (s, e) => OnInfoClick();

              view.WeeklyPlanChanged += (s, e) => Data.UpdateTrainingPlan(e.Value);

              // automatically load last plan on startup
              var recentPlans = Misc.Default.LastTrainingPlans.Split(';');
              if (recentPlans.Length <= 0)
              {
            return;
              }
              LoadTrainingPlan(recentPlans[0]);
        }
 public PublicResultForm(QueryResult resultSet, MainForm owner)
 {
     InitializeComponent();
     FormsConn fc = new FormsConn(resultSet);
     imainForm = (IMainForm)fc;
     m_mainForm = owner;
 }
Example #13
0
 /// <summary>
 /// Activates if the sender is MainForm
 /// </summary>
 public static void Initialize(IMainForm sender)
 {
     if (sender.GetType().ToString() == "FlashDevelop.MainForm")
     {
         instance = sender;
     }
 }
Example #14
0
 public DocumentPage(IMainForm main_form, ActiveCodeFile file)
     : this(main_form, file.FileExtension)
 {
     InitializeComponent();
     UpdateFileName(file);
     ActiveFile = file;
     //this.ImageIndex = 0;
 }
Example #15
0
 public DocumentPage(IMainForm main_form, string fileExtension)
 {
     InitializeComponent();
     MainForm = main_form;
     Text = "NewFile";
     CreateTextBox(fileExtension);
     //this.ImageIndex = 0;
 }
Example #16
0
		public BuildActions(IMainForm mainForm)
		{
			this.mainForm = mainForm;
			this.missingClasspaths = new ArrayList();

			// setup FDProcess helper class
			fdProcess = new FDProcessRunner(mainForm);
		}
Example #17
0
        public WorkClass(IMainForm iMainForm, IReadWrite iReadWrite, IMessage iMessage)
        {
            _iMainForm = iMainForm;
            _iReadWrite = iReadWrite;
            _iMessage = iMessage;

            subscribeToAllEvent();
        }
Example #18
0
        public MainFormController(IMainForm form)
        {
            MainForm = form;

            MainForm.NodeCollapsing += MainForm_NodeCollapsing;
            MainForm.NodeExpanding += MainForm_NodeExpanding;
            MainForm.NodeSelected += MainForm_NodeSelected;
        }
Example #19
0
		public PluginUI(PluginMain pluginMain)
		{
			this.pluginMain = pluginMain;
			this.snippets = this.pluginMain.MainForm.MainSnippets;
			this.mainForm = this.pluginMain.MainForm;
			this.InitializeComponent();
			this.PopulateSnippetList();
		}
 public MainPresenter(IMainForm view)
 {
     _view = view;
     // Презентер подписывается на уведомления о событиях Представления
     _view.Download_file += new EventHandler<EventArgs>(OnDFile);
     _view.Update += new EventHandler<EventArgs>(UpdateView);
     //UpdateView();
 }
 public frmChangeDatabase(IMainForm parent, ISystemDataProvider systemDataProvider)
 {
     InitializeComponent();
     this.parent = parent;
     gvDatabases.TableElement.AlternatingRowColor = System.Drawing.Color.BlanchedAlmond;
     SystemDataProvider = systemDataProvider;
     LoadDatabases();
 }
Example #22
0
        public Presenter(IMainForm imainForm)
        {
            _iMainForm = imainForm;

            _iMainForm.DefineBaseSeriesAsTentMap += _imainForm_DefineBaseSeriesAsTentMap;
            _iMainForm.DefineBaseSeriesAsLorens += _imainForm_DefineBaseSeriesAsLorens;
            _iMainForm.FindMatch += _imainForm_FindMatch;
        }
Example #23
0
 public DocumentPage(IMainForm main_form)
 {
     InitializeComponent();
     MainForm = main_form;
     Text = "NewFile";
     CreateTextBox(string.Empty);
     //this.ImageIndex = 0;
 }
 public Storage(IMainForm mainForm, IValidation valid)
 {
 	
 	this.IMainForm = mainForm;
 	
 	this.Validation = valid;
 	
 }
Example #25
0
        public MainPresenter(IMainForm mainForm)
        {
            _mainForm = mainForm;

            _mainForm.ButtonStartClick += Start_Click;
            _mainForm.ButtonShowClick += Show_Click;
            
        }
 public SpentInDiffDaysView(IHistoryDataProvider historyDataProvider, IMainForm mainForm)
 {
     this.historyDataProvider = historyDataProvider;
     this.mainForm = mainForm;
     InitializeComponent();
     if(historyDataProvider!=null)
         this.daySpentDataGrid.DataSource = this.historyDataProvider.Data;
 }
     public Download (IMainForm mainForm, IStorage store)
     {
 		
         this.MainForm = mainForm;
 		
         this.Storage = store;
 		
     }
Example #28
0
		static public void Init(IMainForm mainForm)
		{
			Flex2Shell.mainForm = mainForm;
			if (!mainForm.MainSettings.HasKey(KEY_FLEX2SDK))
				mainForm.MainSettings.AddValue(KEY_FLEX2SDK, "c:\\flex_2_sdk");
			
			UpdateSettings();
		}
        IMainForm summonMainForm()
        {
            if (_mainForm == null)
            {
                _mainForm = ObjectFactory.GetInstance<IMainForm>();
            }

            return _mainForm;
        }
Example #30
0
 public void Setup()
 {
     mr = new MockRepository();
     form = new Form();
     form.IsMdiContainer = true;
     sc = new ServiceContainer();
     mainForm = new MainForm();
     svc = new DecompilerShellUiService(mainForm, null, null, null, sc);
 }
Example #31
0
        public void Login(string username, string password)
        {
            //Contract.Requires(username.Contains("b"), "aaaa");
            IValidator usernameValidator = new UsernameValidator();
            IValidator passwordValidator = new PasswordValidator();


            try
            {
                if (usernameValidator.Validate(username) && passwordValidator.Validate(password))
                {
                    Customer  customer = _customerManager.Login(txtUsername.Text, txtPassword.Text);
                    IMainForm mainForm = MainForm.GetSingletonInstance();
                    this.Hide();
                    mainForm.Start(customer, this);
                }
            }
            catch (CustomerCouldNotFindException)
            {
                MessageBox.Show("Customer could not find!");
                txtUsername.Text = "";
                txtPassword.Text = "";
            }
            catch (UsernameValidationException ex)
            {
                MessageBox.Show(ex.Message_);
            }
            catch (PasswordValidationException)
            {
                MessageBox.Show("Invalid password!");
            }
            catch (WrongPasswordException)
            {
                MessageBox.Show("Wrong password! Please enter correct password.");
                txtPassword.Text = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public void InsertFile(IMainForm mainForm, Project project, string path,
                               string textToInsert)
        {
            bool isInjectionTarget = (project.UsesInjection &&
                                      path == project.GetAbsolutePath(project.InputPath));

            if (!project.IsLibraryAsset(path) && !isInjectionTarget)
            {
                string caption = "Insert Resource";
                string message = "In order to use this file in your project, "
                                 + "you must first embed it as a resource.  "
                                 + "Would you like to do this now?";

                DialogResult result = MessageBox.Show(owner, message, caption,
                                                      MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

                if (result == DialogResult.OK)
                {
                    ToggleLibraryAsset(project, new string[] { path });
                }
                else
                {
                    return;                     // cancel
                }
            }

            if (textToInsert == null)
            {
                textToInsert = project.GetAsset(path).ID;
            }

            if (mainForm.CurSciControl != null)
            {
                mainForm.CurSciControl.AddText(textToInsert.Length, textToInsert);
                mainForm.CurSciControl.Focus();
            }
            else
            {
                ErrorHandler.ShowInfo("You must have a document open to insert a resource string.");
            }
        }
Example #33
0
        public Presetner(IMainForm window, IMessager messager, Model model)
        {
            if (window == null)
            {
                throw new ArgumentNullException("window");
            }

            if (messager == null)
            {
                throw new ArgumentNullException("messager");
            }

            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            this._window   = window;
            this._messager = messager;
            this._model    = model;

            this._window.GetAvailableDevicesEventHandler += WindowGetAvailableDevicesEventHandler;
            this._window.KillFfmpegProcessEventHandler   += WindowKillFfmpegProcessEventHandler;

            this._window.AddNewConfig          += WindowAddNewConfig;
            this._window.CloneConfig           += WindowCloneConfig;
            this._window.UpdateConfig          += WindowUpdateConfig;
            this._window.RenameConfig          += WindowRenameConfig;
            this._window.RemoveConfig          += WindowRemoveConfig;
            this._window.SelectedConfigChanged += WindowSelectedConfigChanged;

            this._window.StartEventHandler += WindowStartEventHandler;
            this._window.StopEventHandler  += WindowStopEventHandler;
            this._window.MicrophoneVolumeChangeEventHandler += WindowMicrophoneVolumeChangeEventHandler;
            this._window.AudioInputChangeEventHandler       += WindowAudioInputChangeEventHandler;
            this._window.CaptreWindowEventHander            += CaptreWindowCaptreWindowEventHander;
            this._window.OnLoadEventHandler += WindowOnLoadEventHandler;

            this._model.WriteToWindowLogEvent += ModelWriteToWindowLogEvent;
            this._model.ShowErrorMessageEvent += ModelShowErrorMessageEvent;
        }
Example #34
0
        public bool SaveData()
        {
            bool newObject = false;

            if (_representedObject == null)
            {
                hMailServer.Settings        settings        = APICreator.Application.Settings;
                hMailServer.SSLCertificates sslCertificates = settings.SSLCertificates;

                _representedObject = sslCertificates.Add();

                Marshal.ReleaseComObject(settings);
                Marshal.ReleaseComObject(sslCertificates);

                newObject = true;
            }

            _representedObject.Name = textName.Text;

            _representedObject.CertificateFile = textCertificateFile.Text;
            _representedObject.PrivateKeyFile  = textPrivateKeyFile.Text;

            _representedObject.Save();


            // Refresh the node in the tree if the name has changed.
            IMainForm mainForm = Instances.MainForm;

            mainForm.RefreshCurrentNode(textName.Text);

            // Set the object to clean.
            DirtyChecker.SetClean(this);

            if (newObject)
            {
                SearchNodeText crit = new SearchNodeText(_representedObject.Name);
                mainForm.SelectNode(crit);
            }

            return(true);
        }
Example #35
0
 public static void LoadPlugin(string FileName, IMainForm Parent, bool ShowError)
 {
     try
     {
         Assembly pluginAssembly = Assembly.LoadFrom(FileName);
         Type[]   types          = pluginAssembly.GetTypes();
         foreach (Type type in types)
         {
             if (type.Name.Equals("Plugin"))
             {
                 IPlugin    inst = (IPlugin)pluginAssembly.CreateInstance(type.FullName);
                 PluginType add  = new PluginType(inst.Name, FileName, inst.Version);
                 if (!Plugins.Contains(add))
                 {
                     Plugins.Add(add);
                     inst.Initialize(Parent);
                     Parent.LoadPlugin(inst);
                 }
                 else if (ShowError)
                 {
                     MessageBox.Show("This plugin is already loaded!", "Error");
                 }
                 pluginAssembly = null;
                 inst           = null;
                 add            = null;
                 return;
             }
         }
         if (ShowError)
         {
             MessageBox.Show("This is not valid plugin!", "Error");
         }
     }
     catch (Exception ex)
     {
         if (ShowError)
         {
             MessageBox.Show(ex.Message, "Error");
         }
     }
 }
        public MainFormPresenter(IMainForm mainForm,
                                 Options options,
                                 IEnvironmentHelper environmentHelper,
                                 ICommandsContainer commandsContainer,
                                 IMessageHelper messageHelper,
                                 IFormFactory formFactory)
        {
            new MainMenuPresenter(mainForm.MainMenu, commandsContainer, options, formFactory);
            var filesViewPresenter = new FilesViewPresenter(mainForm.FilesView,
                                                            mainForm.ToolBar,
                                                            mainForm.AddressToolBar,
                                                            commandsContainer,
                                                            environmentHelper,
                                                            options,
                                                            messageHelper);

            commandsContainer.SetFilesViewPresenter(filesViewPresenter);
            commandsContainer.RefreshDirectoryCommand.Execute();
            new ToolBarPresenter(mainForm.ToolBar, commandsContainer);
            commandsContainer.ChangeLanguageCommand.Execute();
        }
Example #37
0
        public void Init(IMainForm form, IUserInfo user)
        {
            _Main = form;
            _User = user;

            StartUp = AppDomain.CurrentDomain.BaseDirectory;

            _Main.AddPluginView(this);

            LbResult.ItemsSource = _Files;

            var dvo = new AppDvo {
                os = "win10"
            };

            _List = new AppDao().List <AppDvo>(dvo);
            foreach (var item in _List)
            {
                item.Decode();
            }
        }
        public MainPresenter(IMainForm view, LocalStorage db)
        {
            _mainView                = view;
            view.AddEx              += AddExClick;
            view.SoldTickets        += SoldTicketsClick;
            view.SelectedTypeTicket += TypeTicketChanged;
            view.MainTable          += ExcursionChoice;
            view.ChangeEx           += ChangeExcursion;
            view.DeleteEx           += DeleteExcursion;
            view.SellTicket         += SellTicketClick;

            BindingList <string> TypeTickets = new BindingList <string>
            {
                db.TypeTickets[0].TicketName,
                db.TypeTickets[1].TicketName,
                db.TypeTickets[2].TicketName
            };

            view.TypeTickets            = TypeTickets;
            view.ScheduleExcursionItems = unitOfWork.RepositoryScheduleExcursionItem.GetAll();
        }
Example #39
0
 static public void CreateControl(IMainForm mainForm)
 {
     // panel
     toolTip             = new System.Windows.Forms.Panel();
     toolTip.Location    = new System.Drawing.Point(0, 0);
     toolTip.BackColor   = Color.LightGoldenrodYellow;
     toolTip.BorderStyle = BorderStyle.FixedSingle;
     toolTip.Visible     = false;
     (mainForm as Form).Controls.Add(toolTip);
     // text
     toolTipRTB             = new System.Windows.Forms.RichTextBox();
     toolTipRTB.Location    = new System.Drawing.Point(2, 1);
     toolTipRTB.BackColor   = Color.LightGoldenrodYellow;
     toolTipRTB.BorderStyle = BorderStyle.None;
     toolTipRTB.ScrollBars  = RichTextBoxScrollBars.None;
     toolTipRTB.ReadOnly    = true;
     toolTipRTB.WordWrap    = false;
     toolTipRTB.Visible     = true;
     toolTipRTB.Text        = "";
     toolTip.Controls.Add(toolTipRTB);
 }
Example #40
0
        public MainPresenter(ITerminalOptionDataCollector dataCollector, IMainForm mainForm, IDerivativesDataRender dataRender)
        {
            LOGGER.Info("MainPresenter creation...");

            this.dataCollector   = dataCollector;
            this.mainForm        = mainForm;
            this.dataRender      = dataRender;
            this.simulPosManager = new PositionManager();
            this.quikPosManager  = new PositionManager();

            simulPosManager.FixedPnL = Settings.Default.SimulFixedPnL;

            mainForm.OnStartUpClick                += MainFormOnStartUpClick;
            mainForm.OnPosUpdateButtonClick        += MainForm_OnPosUpdateButtonClick;
            mainForm.OnTotalResetPositionInfoClick += MainFormOnTotalResetSimulPositionInfoClick;
            mainForm.OnGetPosFromQuikClick         += MainForm_OnGetPosFromQuikClick;
            mainForm.OnActPosUpdateButtonClick     += MainForm_OnActPosUpdateButtonClick;


            LOGGER.Info("MainPresenter created.");
        }
        private void setup()
        {
            ObjectFactory factory = ObjectFactory.getInstance();

            mainform = factory.getMainForm();
            catalog  = factory.getCatalog();
            query    = (QueryBase)factory.create("query");
            conn     = (ConnectionBase)factory.create("connection");
            conn.setConnString(ProjectVariables.getConnectionString());
            query.setConnection(conn);

            if (setting == add_arg)//adding operation
            {
                button1.Text = "Add";
            }
            else
            {                 //updating opertaion
                button1.Text = "Update";
                setTextBoxes();
            }
        }
Example #42
0
 private static DummyCommand BuildFileCommands(IMainForm view)
 {
     return(new DummyCommand(MenuStrings.fileToolStripMenuItem_Text)
     {
         ChildrenCommands = new List <IToolbarCommand>
         {
             new NewCommand(view.ScriptingView.CodeEditorView, view.CustomFunctionsView.CustomFunctionsEditor),
             new OpenCommand(view.ScriptingView.CodeEditorView, view.CustomFunctionsView.CustomFunctionsEditor),
             null,
             new SaveCommand(view.ScriptingView.CodeEditorView, view.CustomFunctionsView.CustomFunctionsEditor),
             new SaveAsCommand(view.ScriptingView.CodeEditorView, view.CustomFunctionsView.CustomFunctionsEditor),
             null,
             new PrintCommand(view.ScriptingView.CodeEditorView, view.CustomFunctionsView.CustomFunctionsEditor,
                              view),
             new PrintPreviewCommand(view.ScriptingView.CodeEditorView,
                                     view.CustomFunctionsView.CustomFunctionsEditor, view),
             null,
             new ExitCommand()
         }
     });
 }
        public MainPresenter(IMainForm view)
        {
            _view = view;

            _model = new ServerModel();
            _model.PropertyChanged += _model_PropertyChanged;

            _model.LoadSetting();
            foreach (var cashier in _model.Сashiers)
            {
                cashier.PropertyChanged += Cashier_PropertyChanged;
            }

            if (_model.Listener != null)
            {
                _model.Listener.PropertyChanged += Listener_PropertyChanged;
                _mainTask = _model.Start();

                _view.ServerModel = _model;//DEBUG
            }
        }
Example #44
0
        public Controller(IMainForm view)
        {
            this.view = view;
            view.SourceCodeAnalyzeRequired += View_SourceCodeAnalyzeRequired;
            view.GrammarAnalyzeRequired    += View_GrammarAnalyzeRequired;
            view.OpenSourceCodeFileClick   += View_OpenSourceCodeFileClick;
            view.SaveFileClick             += View_SaveFileClick;
            view.BuildRequired             += View_BuildRequired;

            view.SetColorizer(new Colorizer <Lexeme>(new LexemePainter())
            {
                SourceFilter = x => x.Is(LexemeFlags.Reserved | LexemeFlags.TypeDefinition | LexemeFlags.Const),
                WordSelector = x => x.Body
            });

            fileManager = new FileManager();

            _lexicalAnalyzer = new LexicalAnalyzer();
            _syntaxAnalyzer  = new PDASyntaxAnalyzer(view.SetPDAOutput);
            _polizGenerator  = new PolizGenerator(_lexicalAnalyzer);
        }
Example #45
0
        public ProjectExplorerWindow(IServiceProvider serviceProvider)
        {
            InitializeComponent();

            this.dockPanel       = serviceProvider.GetService <IMainForm>().MainPanel;
            this.serviceProvider = serviceProvider;

            this.TabText = this.Text;

            //
            // This window is a singleton, so we never want it to be closed,
            // just hidden.
            //
            this.HideOnClose = true;

            this.vsToolStripExtender.SetStyle(
                this.toolStrip,
                VisualStudioToolStripExtender.VsVersion.Vs2015,
                this.vs2015LightTheme);

            this.treeView.Nodes.Add(this.rootNode);

            this.mainForm                = serviceProvider.GetService <IMainForm>();
            this.eventService            = serviceProvider.GetService <IEventService>();
            this.jobService              = serviceProvider.GetService <IJobService>();
            this.projectInventoryService = serviceProvider.GetService <ProjectInventoryService>();
            this.settingsRepository      = serviceProvider.GetService <ConnectionSettingsRepository>();
            this.authService             = serviceProvider.GetService <IAuthorizationAdapter>();
            this.remoteDesktopService    = serviceProvider.GetService <IRemoteDesktopService>();

            this.eventService.BindAsyncHandler <ProjectInventoryService.ProjectAddedEvent>(OnProjectAdded);
            this.eventService.BindHandler <ProjectInventoryService.ProjectDeletedEvent>(OnProjectDeleted);
            this.eventService.BindHandler <RemoteDesktopConnectionSuceededEvent>(OnRdpConnectionSucceeded);
            this.eventService.BindHandler <RemoteDesktopWindowClosedEvent>(OnRdpConnectionClosed);

            this.Commands = new CommandContainer <IProjectExplorerNode>(
                this,
                this.contextMenu.Items,
                this.serviceProvider);
        }
Example #46
0
        public bool SaveData()
        {
            bool newObject = false;

            if (_representedObject == null)
            {
                hMailServer.Application    app            = APICreator.Application;
                hMailServer.Settings       settings       = app.Settings;
                hMailServer.IncomingRelays IncomingRelays = settings.IncomingRelays;
                _representedObject = IncomingRelays.Add();

                newObject = true;

                Marshal.ReleaseComObject(settings);
                Marshal.ReleaseComObject(IncomingRelays);
            }

            _representedObject.Name = textName.Text;

            _representedObject.LowerIP = textLower.Text;
            _representedObject.UpperIP = textUpper.Text;

            _representedObject.Save();

            // Refresh the node in the tree if the name has changed.
            IMainForm mainForm = Instances.MainForm;

            mainForm.RefreshCurrentNode(textName.Text);

            // Set the object to clean.
            DirtyChecker.SetClean(this);

            if (newObject)
            {
                SearchNodeText crit = new SearchNodeText(_representedObject.Name);
                mainForm.SelectNode(crit);
            }

            return(true);
        }
Example #47
0
        protected MainFormPresenter(AtmManager atmManger, Session session, IMainForm view)
        {
            AtmManger = atmManger;
            Session   = session;
            View      = view;

            if (_isTimeUpdateSet == false)
            {
                _updateTimeThread = new Thread(() =>
                {
                    while (true)
                    {
                        UpdateTime();
                    }
                });
                _updateTimeThread.Start();

                _isTimeUpdateSet = true;
            }

            Initialize();
        }
Example #48
0
        private void EditSelectedItem()
        {
            ListView listView = GetListView();

            if (listView == null)
            {
                return;
            }

            if (listView.SelectedItems.Count == 0)
            {
                return;
            }

            string text = listView.SelectedItems[0].Text;

            // Jump to the sub node.
            IMainForm      mainForm = Instances.MainForm;
            SearchNodeText crit     = new SearchNodeText(text);

            mainForm.SelectNode(crit);
        }
Example #49
0
        public static void Initialize(IMainForm mainForm)
        {
            Icons.mainForm = mainForm;

            imageList                  = new ImageList();
            imageList.ColorDepth       = ColorDepth.Depth32Bit;
            imageList.ImageSize        = new Size(16, 16);
            imageList.TransparentColor = Color.Transparent;

            XmlFile             = Get("Icons.XmlFile.png");
            HiddenFolder        = Get("Icons.HiddenFolder.png");
            HiddenFile          = Get(156);
            Project             = Get(110);
            Classpath           = Get(27);
            Font                = Get(97);
            ImageResource       = Get("Icons.ImageResource.png");
            ActionScript        = Get("Icons.ActionscriptFile.png");
            SwfFile             = Get("Icons.SwfMovie.png");
            SwfFileHidden       = Get("Icons.SwfMovieHidden.png");
            Folder              = Get("Icons.Folder.png"); //Get(84);
            FolderCompile       = Get("Icons.FolderCompile.png");
            TextFile            = Get("Icons.TextFile.png");
            ActionScriptCompile = Get("Icons.ActionscriptCompile.png");
            HtmlFile            = Get("Icons.HtmlFile.png");
            AddFile             = Get("Icons.AddFile.png");
            OpenFile            = Get(1);
            EditFile            = Get(7);
            Cut        = Get(3);
            Copy       = Get(4);
            Paste      = Get(5);
            Delete     = Get(29);
            Options    = Get(132);
            NewProject = Get(111);
            GreenCheck = Get(21);
            Gear       = Get(66);
            Class      = Get("Icons.Class.png");
            Refresh    = Get(10);
            Debug      = Get(51);
        }
        public void Setup()
        {
            mr = new MockRepository();

            form = new MainForm();

            prog = new Program();
            prog.Architecture = new IntelArchitecture(ProcessorMode.Real);
            prog.Image        = new LoadedImage(Address.SegPtr(0xC00, 0), new byte[10000]);
            prog.ImageMap     = prog.Image.CreateImageMap();

            prog.ImageMap.AddSegment(Address.SegPtr(0x0C10, 0), "0C10", AccessMode.ReadWrite, 0);
            prog.ImageMap.AddSegment(Address.SegPtr(0x0C20, 0), "0C20", AccessMode.ReadWrite, 0);
            mapSegment1 = prog.ImageMap.Segments.Values[0];
            mapSegment2 = prog.ImageMap.Segments.Values[1];

            sc     = new ServiceContainer();
            decSvc = new DecompilerService();

            sc.AddService(typeof(IDecompilerService), decSvc);
            sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService());
            sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
            sc.AddService(typeof(IStatusBarService), new FakeStatusBarService());
            uiSvc  = AddService <IDecompilerShellUiService>();
            memSvc = AddService <ILowLevelViewService>();

            ILoader ldr = mr.StrictMock <ILoader>();

            ldr.Stub(l => l.LoadImageBytes("test.exe", 0)).Return(new byte[400]);
            ldr.Stub(l => l.LoadExecutable(
                         Arg <string> .Is.NotNull,
                         Arg <byte[]> .Is.NotNull,
                         Arg <Address> .Is.Null)).Return(prog);
            ldr.Replay();
            decSvc.Decompiler = new DecompilerDriver(ldr, new FakeDecompilerHost(), sc);
            decSvc.Decompiler.Load("test.exe");

            interactor = new LoadedPageInteractor(sc);
        }
Example #51
0
        public ReportPresenter(Connection conn, IReportParametersForm parameters, IMainForm mainForm, Report report)
        {
            this.conn                         = conn;
            this.parameters                   = parameters;
            this.mainForm                     = mainForm;
            this.report                       = report;
            parameters.OK                    += view_OK;
            this.worker                       = new BackgroundWorker();
            this.worker.DoWork               += new DoWorkEventHandler(OnExecuteReport);
            this.worker.RunWorkerCompleted   += new RunWorkerCompletedEventHandler(OnCompleteReport);
            this.worker.WorkerReportsProgress = true;

            var lf = new LoadingForm
            {
                WaitForThis = new Task(() =>
                {
                    InitExport();
                })
            };

            lf.ShowDialog();
        }
Example #52
0
        public bool SaveData()
        {
            bool newObject = false;

            if (representedObject == null)
            {
                hMailServer.Domain domain = APICreator.GetDomain(_domainID);

                hMailServer.Aliases aliases = domain.Aliases;
                representedObject = aliases.Add();
                newObject         = true;

                Marshal.ReleaseComObject(domain);
                Marshal.ReleaseComObject(aliases);
            }


            representedObject.Name   = textName.Text;
            representedObject.Value  = textValue.Text;
            representedObject.Active = checkEnabled.Checked;

            representedObject.Save();

            // Refresh the node in the tree if the name has changed.
            IMainForm mainForm = Instances.MainForm;

            mainForm.RefreshCurrentNode(representedObject.Name);

            // Set the object to clean.
            DirtyChecker.SetClean(this);

            if (newObject)
            {
                SearchNodeText crit = new SearchNodeText(representedObject.Name);
                mainForm.SelectNode(crit);
            }

            return(true);
        }
Example #53
0
        public CurseHunterPresenter(
            IMainForm viev,
            IFileManager fileManager,
            IMessageService service,
            IParserWorker <ParsData[]> parserWorker
            )
        {
            _viev               = viev;
            _fileManager        = fileManager;
            _mainMessageService = service;
            _parserWorker       = parserWorker;


            _parserWorker.OnComplitted += _parserWorker_OnComplitted;
            _parserWorker.OnNewData    += _parserWorker_OnNewData;

            _viev.StartParsClick     += _viev_StartParsClick;
            _viev.StopParsClick      += _viev_StopParsClick;
            _viev.ChangeCurentUrl    += _viev_ChangeCurentUrl;
            _viev.ChangeCurentFolder += _viev_ChangeCurentFolder;
            _viev.SaveAll            += _viev_SaveAll;
        }
        /// <summary>
        /// Start listening for new API request.
        /// </summary>
        /// <param name="ipAddress"></param>
        /// <param name="onConnectCallbackIn"></param>
        public void StartListening(IPAddress ipAddress, Action <Socket, string, IDevices, ILogger, IMainForm> onConnectCallbackIn, ILogger loggerIn, IDevices devicesIn, IMainForm mainFormIn)
        {
            if (ipAddress == null || onConnectCallbackIn == null)
            {
                return;
            }

            logger            = loggerIn;
            onConnectCallback = onConnectCallbackIn;
            devices           = devicesIn;
            mainForm          = mainFormIn;

            try
            {
                var localEndPoint = new IPEndPoint(ipAddress, 27272);
                listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

                listener.Bind(localEndPoint);
                listener.Listen(100);
                var endPoint = (IPEndPoint)listener.LocalEndPoint;
                if (endPoint != null)
                {
                    ip   = endPoint.Address?.ToString();
                    port = endPoint.Port;
                    logger.Log(string.Format("RestApi from {0}:{1}", ip, port));

                    while (true)
                    {
                        allDone.Reset();
                        listener.BeginAccept(new AsyncCallback(AcceptCallback), listener);
                        allDone.WaitOne();
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Log(ex, "RestApi.StartListening");
            }
        }
Example #55
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            DevExpress.UserSkins.BonusSkins.Register();
            DevExpress.Utils.AppearanceObject.DefaultFont = new Font("Segoe UI", 8);
            DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Office 2019 Colorful");
            DevExpress.Skins.SkinManager.EnableMdiFormSkins();
            //加载IOC容器
            IIocManager iocManager = AbpApplicationBuilderExtensions.UseAbp <ZtgeoGISDesktopMoudle>(new SplashScreenFormManager(),
                                                                                                    optionAction =>
            {
                optionAction.IocManager.IocContainer.AddFacility <LoggingFacility>(
                    f => f.UseAbpLog4Net().WithConfig("log4net.config")
                    );
            });
            //初始化界面
            IMainForm mainForm = iocManager.Resolve <IMainForm>();

            if (mainForm != null)
            {
                #region 全局异常处理
                Application.ThreadException += (object sender, ThreadExceptionEventArgs e) =>
                {
                    EventBus.Default.Trigger <UIExceptionEventData>(new UIExceptionEventData {
                        ThreadExceptionEventArgs = e
                    });
                };
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler((object sender, UnhandledExceptionEventArgs e) =>
                {
                    EventBus.Default.Trigger <NonUIExceptionEventData>(new NonUIExceptionEventData {
                        UnhandledExceptionEventArgs = e
                    });
                });
                #endregion
                Application.Run((Form)mainForm);
            }
        }
Example #56
0
        public Presenter(IMainForm v1, IAuthenticationForm v3, IProjectForm v2, IModel s)
        {
            _mainView           = v1;
            _projectView        = v2;
            _storage            = s;
            _authenticationForm = v3;

            _mainView.MainFormInitialized += () => initIssuesIssues();
            _mainView.CloseMainView       += () => StopThread();
            _mainView.ShowProjects        += () => ShowProjectsView();
            _mainView.NewIssue            += () => ShowNewIssueView();
            _mainView.showJournals        += () => OpenJournalsForm(_mainView.getSelectedIssueID());
            _mainView.ApplyFilter         += () => SendFilterQuery(_mainView.getFilter());
            _mainView.IssueUpdate         += () => OpenUpdateIssueView(_mainView.getSelectedIssueID());
            _mainView.NewProject          += () => ShowNewProjectView();

            _projectView.ShowProjects    += () => ShowProj();
            _projectView.ShowDetailsView += () => OpenProjDetailsForm(_projectView.getSelectedProjID());

            _authenticationForm.checkAuthentication += () => checkAuthentication(_authenticationForm.getLogin(), _authenticationForm.getPassword());
            _storage.AuthenticationPassed           += () => RunMV();
        }
Example #57
0
        public void Setup()
        {
            mr     = new MockRepository();
            form   = new MainForm();
            sc     = new ServiceContainer();
            loader = mr.StrictMock <ILoader>();
            dec    = mr.StrictMock <IDecompiler>();
            sc     = new ServiceContainer();
            uiSvc  = new FakeShellUiService();
            host   = mr.StrictMock <DecompilerHost>();
            memSvc = mr.StrictMock <ILowLevelViewService>();
            var image    = new LoadedImage(Address.Ptr32(0x10000), new byte[1000]);
            var imageMap = image.CreateImageMap();
            var arch     = mr.StrictMock <IProcessorArchitecture>();

            arch.Stub(a => a.CreateRegisterBitset()).Return(new BitSet(32));
            arch.Replay();
            var platform = mr.StrictMock <Platform>(null, arch);

            arch.BackToRecord();
            program = new Program(image, imageMap, arch, platform);
            project = new Project {
                Programs = { program }
            };

            browserSvc = mr.StrictMock <IProjectBrowserService>();

            sc.AddService <IDecompilerUIService>(uiSvc);
            sc.AddService(typeof(IDecompilerShellUiService), uiSvc);
            sc.AddService(typeof(IDecompilerService), new DecompilerService());
            sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService());
            sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
            sc.AddService(typeof(IProjectBrowserService), browserSvc);
            sc.AddService(typeof(ILowLevelViewService), memSvc);
            sc.AddService <ILoader>(loader);

            i = new TestInitialPageInteractor(sc, dec);
        }
        public void SetUp()
        {
            var hkcu = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default);

            hkcu.DeleteSubKeyTree(TestKeyPath, false);

            var mainForm = new TestMainForm();

            this.eventService = new EventService(mainForm);

            var registry = new ServiceRegistry();

            registry.AddSingleton <IProjectRepository>(new ProjectRepository(
                                                           hkcu.CreateSubKey(TestKeyPath),
                                                           eventService));
            registry.AddSingleton(new ToolWindowStateRepository(
                                      hkcu.CreateSubKey(TestKeyPath)));
            registry.AddSingleton(new ApplicationSettingsRepository(
                                      hkcu.CreateSubKey(TestKeyPath)));

            registry.AddSingleton <IMainForm>(mainForm);
            registry.AddSingleton <IJobService>(mainForm);
            registry.AddSingleton <IAuthorizationAdapter>(mainForm);
            registry.AddSingleton <IGlobalSessionBroker, GlobalSessionBroker>();

            registry.AddSingleton <IEventService>(this.eventService);

            this.exceptionDialog = new MockExceptionDialog();
            registry.AddSingleton <IExceptionDialog>(this.exceptionDialog);

            this.mainForm        = mainForm;
            this.serviceRegistry = registry;
            this.serviceProvider = registry;

            mainForm.Show();

            PumpWindowMessages();
        }
Example #59
0
        public bool SaveData()
        {
            bool newObject = false;

            if (representedObject == null)
            {
                hMailServer.Settings settings = APICreator.Application.Settings;
                hMailServer.Groups   groups   = settings.Groups;
                representedObject = groups.Add();

                Marshal.ReleaseComObject(settings);
                Marshal.ReleaseComObject(groups);

                newObject = true;
            }

            representedObject.Name = textName.Text;

            representedObject.Save();

            // Refresh the node in the tree if the name has changed.
            IMainForm mainForm = Instances.MainForm;

            mainForm.RefreshCurrentNode(textName.Text);

            // Set the object to clean.
            DirtyChecker.SetClean(this);

            if (newObject)
            {
                SearchNodeText crit = new SearchNodeText(representedObject.Name);
                mainForm.SelectNode(crit);
            }

            EnableDisable();

            return(true);
        }
Example #60
0
        public bool SaveData()
        {
            bool newObject = false;

            if (_representedObject == null)
            {
                hMailServer.SURBLServers surblServers = APICreator.SURBLServers;
                _representedObject = surblServers.Add();
                newObject          = true;

                Marshal.ReleaseComObject(surblServers);
            }

            _representedObject.Active = checkEnabled.Checked;

            _representedObject.DNSHost       = textDNSHost.Text;
            _representedObject.RejectMessage = textRejectionMessage.Text;
            _representedObject.Score         = textSpamScore.Number;

            _representedObject.Save();


            // Refresh the node in the tree if the name has changed.
            IMainForm mainForm = Instances.MainForm;

            mainForm.RefreshCurrentNode(null);

            // Set the object to clean.
            DirtyChecker.SetClean(this);

            if (newObject)
            {
                SearchNodeText crit = new SearchNodeText(_representedObject.DNSHost);
                mainForm.SelectNode(crit);
            }

            return(true);
        }