Ejemplo n.º 1
0
        private static void SetThumbnailTitleAndIcon(UIElement content, IControlView activeView)
        {
            if (!_initialized)
            {
                throw new Exception("Not initialized");
            }
            TabbedThumbnail thumbnail = TaskbarManager.Instance.TabbedThumbnail.GetThumbnailPreview(content);

            if (thumbnail != null && activeView != null)
            {
                if (thumbnail.Title != activeView.Header)  //Title is not set yet or sth has changed
                {
                    thumbnail.Title   = activeView.Header;
                    thumbnail.Tooltip = activeView.HeaderToolTip;
                    var streamResourceInfo = Application.GetResourceStream(activeView.HeaderIcon);
                    if (streamResourceInfo != null)
                    {
                        Stream iconStream = streamResourceInfo.Stream;
                        var    bitmap     = new Bitmap(iconStream);
                        var    iconHandle = bitmap.GetHicon();
                        var    icon       = Icon.FromHandle(iconHandle);
                        thumbnail.SetWindowIcon(icon);
                    }
                    RefreshPreview((Frame)content);
                }
            }
        }
Ejemplo n.º 2
0
        public void ShowProgressDialog(IControlView view, string caption, string text)
        {
            frm = ProgressDlgFrm.Show(((Control)view).FindForm(), caption, text);

            frm.btnCancelar.Visible = suportsCancellation;
            frm.btnCancelar.Click  += frmProgresso_BtnCancelar_OnClick;
        }
        public void ShowProgressDialog(IControlView view, string caption, string text)
        {
            progressUC.TaskID = taskID;
            progressUC.Show();

            progressUC.CancelEnabled      = suportsCancellation;
            progressUC.CancelButtonClick += progressUC_CancelButton_Clicked;
        }
Ejemplo n.º 4
0
        public SourceControlViewViewModel(
            VBE vbe,
            RubberduckParserState state,
            ISourceControlProviderFactory providerFactory,
            IFolderBrowserFactory folderBrowserFactory,
            ISourceControlConfigProvider configService,
            [Named("changesView")] IControlView changesView,
            [Named("branchesView")] IControlView branchesView,
            [Named("unsyncedCommitsView")] IControlView unsyncedCommitsView,
            [Named("settingsView")] IControlView settingsView,
            ICodePaneWrapperFactory wrapperFactory,
            IMessageBox messageBox)
        {
            _vbe                  = vbe;
            _state                = state;
            _providerFactory      = providerFactory;
            _folderBrowserFactory = folderBrowserFactory;

            _state.StateChanged += _state_StateChanged;

            _configService  = configService;
            _config         = _configService.Create();
            _wrapperFactory = wrapperFactory;
            _messageBox     = messageBox;

            _initRepoCommand            = new DelegateCommand(_ => InitRepo());
            _openRepoCommand            = new DelegateCommand(_ => OpenRepo());
            _cloneRepoCommand           = new DelegateCommand(_ => ShowCloneRepoGrid());
            _publishRepoCommand         = new DelegateCommand(_ => ShowPublishRepoGrid());
            _refreshCommand             = new DelegateCommand(_ => Refresh());
            _dismissErrorMessageCommand = new DelegateCommand(_ => DismissErrorMessage());
            _showFilePickerCommand      = new DelegateCommand(_ => ShowFilePicker());
            _loginGridOkCommand         = new DelegateCommand(_ => CloseLoginGrid(), text => !string.IsNullOrEmpty((string)text));
            _loginGridCancelCommand     = new DelegateCommand(_ => CloseLoginGrid());

            _cloneRepoOkButtonCommand     = new DelegateCommand(_ => CloneRepo(), _ => !IsNotValidCloneRemotePath);
            _cloneRepoCancelButtonCommand = new DelegateCommand(_ => CloseCloneRepoGrid());

            _publishRepoOkButtonCommand     = new DelegateCommand(_ => PublishRepo(), _ => !IsNotValidPublishRemotePath);
            _publishRepoCancelButtonCommand = new DelegateCommand(_ => ClosePublishRepoGrid());

            TabItems = new ObservableCollection <IControlView>
            {
                changesView,
                branchesView,
                unsyncedCommitsView,
                settingsView
            };
            SetTab(SourceControlTab.Changes);

            Status = RubberduckUI.Offline;

            ListenForErrors();

            _fileSystemWatcher = new FileSystemWatcher();
        }
Ejemplo n.º 5
0
        public object AddMenuItem(string text, string name, IControlView view, EventHandler eventHandler)
        {
            var menuStrip = (MenuStrip)FindMenuStrip(view);

            var menu = menuStrip.Items.Add(text, null, eventHandler);

            menu.Name = name;

            return(menu);
        }
        public ControlReportPresenter(IControlView view, IReportsService service, IReportManager reportManager)
        {
            ArgumentChecker.ThrowIfNull(view, "view");
            ArgumentChecker.ThrowIfNull(service, "repository");
            ArgumentChecker.ThrowIfNull(reportManager, "reportManager");

            this.view          = view;
            this.service       = service;
            this.reportManager = reportManager;
        }
Ejemplo n.º 7
0
            public DeviceListViewItem(IControlView device)
            {
                this.device = device;
                Name        = device.Name;
                Text        = device.Name;
                Group       = new ListViewGroup("ChartBuilder");

                SubItems.Add(new ListViewSubItem(this, "     " + "WPF Toolkit"));
                SubItems.Add(new ListViewSubItem(this, "     " + "Microsoft"));
            }
Ejemplo n.º 8
0
        void IControlView.Show()
        {
            IControlView view   = this;
            var          dpInfo = new DockPanelSmartPartInfo(view.Name, ProfileName);

            dpInfo.Icon = Properties.Resources.Device;
            var workspace = BundleRuntime.Instance.GetFirstOrDefaultService <IWorkspace>();

            workspace.Show(this, dpInfo);

            workspace.Activate(this);
        }
Ejemplo n.º 9
0
    void Start()
    {
        model = new NaC_Model();
        List <ICubeView> list = new List <ICubeView>();

        GetComponentsInChildren(false, list);
        main      = GetComponentInChildren <IControlView>();
        presenter = new NaC_Presenter(list, model, main);


        Cursor.visible   = true;
        Cursor.lockState = CursorLockMode.None;
    }
Ejemplo n.º 10
0
        public void AddTabPage(string text, IControlView controlView)
        {
            TabPage tabPage = new TabPage(text);

            tabPage.Padding = new Padding(3);
            tabPage.UseVisualStyleBackColor = true;

            ((Control)controlView).Dock = DockStyle.Fill;
            tabPage.Controls.Add((Control)controlView);

            tabControl1.TabPages.Add(tabPage);
            tabControl1.SelectedTab = tabPage;
//			tabPage.Focus();
        }
Ejemplo n.º 11
0
    public NaC_Presenter(List <ICubeView> boardView, INaC_Model boardModel, IControlView mainView)
    {
        model = boardModel;
        model.BoardUpdated += model_BoardUpdated;

        cubeViews = boardView;
        foreach (ICubeView view in cubeViews)
        {
            view.FieldUpdated += view_FieldUpdated;
            view.UpdateField(model.GetField(view.GetField().x, view.GetField().y));
        }

        main = mainView;
        main.ResetClicked += main_ResetClicked;
    }
Ejemplo n.º 12
0
        public SourceControlViewViewModel(
            VBE vbe,
            ISourceControlProviderFactory providerFactory,
            IFolderBrowserFactory folderBrowserFactory,
            IConfigurationService <SourceControlConfiguration> configService,
            [Named("changesView")] IControlView changesView,
            [Named("branchesView")] IControlView branchesView,
            [Named("unsyncedCommitsView")] IControlView unsyncedCommitsView,
            [Named("settingsView")] IControlView settingsView,
            ICodePaneWrapperFactory wrapperFactory)
        {
            _vbe                  = vbe;
            _providerFactory      = providerFactory;
            _folderBrowserFactory = folderBrowserFactory;

            _configService  = configService;
            _config         = _configService.LoadConfiguration();
            _wrapperFactory = wrapperFactory;

            _initRepoCommand            = new DelegateCommand(_ => InitRepo());
            _openRepoCommand            = new DelegateCommand(_ => OpenRepo());
            _cloneRepoCommand           = new DelegateCommand(_ => ShowCloneRepoGrid());
            _refreshCommand             = new DelegateCommand(_ => Refresh());
            _dismissErrorMessageCommand = new DelegateCommand(_ => DismissErrorMessage());
            _showFilePickerCommand      = new DelegateCommand(_ => ShowFilePicker());
            _closeLoginGridCommand      = new DelegateCommand(_ => CloseLoginGrid());

            _cloneRepoOkButtonCommand     = new DelegateCommand(_ => CloneRepo(), _ => !IsNotValidRemotePath);
            _cloneRepoCancelButtonCommand = new DelegateCommand(_ => CloseCloneRepoGrid());

            TabItems = new ObservableCollection <IControlView>
            {
                changesView,
                branchesView,
                unsyncedCommitsView,
                settingsView
            };
            Status = RubberduckUI.Offline;

            ListenForErrors();
        }
Ejemplo n.º 13
0
 public virtual void AddControlViewAt(int index, IControlView view)
 {
     parentView.Controls.AddAt(index, (Control)view);
 }
Ejemplo n.º 14
0
 public virtual void AddControlView(IControlView view, object controlCollection)
 {
     ((ControlCollection)controlCollection).Add((Control)view);
 }
Ejemplo n.º 15
0
 public virtual void AddControlView(IControlView view)
 {
     parentView.Controls.Add((Control)view);
 }
Ejemplo n.º 16
0
 internal static WebControlHelper CreateLocalInstance(IControlView view)
 {
     return(new WebControlHelper(view));
 }
Ejemplo n.º 17
0
//		public static T Instance
//		{
//			get { return Nested.instance; }
//		}

        public static WebControlHelper CreateInstance(IControlView view)
        {
            return(Nested.CreateLocalInstance(view));
        }
Ejemplo n.º 18
0
 public idoController(IControlView view, IIdoModel model)
 {
     this.contView = view;
     this.model    = model;
 }
 public void RunWorkerWithProgressDialog(IBackgroundWork backgroundWork, IControlView view, string caption, string text)
 {
     RunWorker(backgroundWork);
     ShowProgressDialog(view, caption, text);
 }
Ejemplo n.º 20
0
 public virtual IControlHelper GetControlHelper(IControlView view)
 {
     return(new WinControlHelper(view));
 }
Ejemplo n.º 21
0
 public object FindMenuStrip(IControlView view)
 {
     return(WinControlFindHelper.FindControlOnChild <MenuStrip>((Control)view));
 }
Ejemplo n.º 22
0
 public object AddMenuItem(string text, string name, IControlView view)
 {
     return(AddMenuItem(text, name, view, null));
 }
Ejemplo n.º 23
0
 public void AddControlViewAt(int index, IControlView view)
 {
     parentView.Controls.Add((Control)view);
 }
Ejemplo n.º 24
0
 public virtual void AddControlViewAt(int index, IControlView view, object controlCollection)
 {
     ((ControlCollection)controlCollection).AddAt(index, (Control)view);
 }
Ejemplo n.º 25
0
 public virtual void RemoveControlView(IControlView view)
 {
     parentView.Controls.Remove((Control)view);
 }
Ejemplo n.º 26
0
 public virtual object FindControlByNameOrID(IControlView view, string name, bool searchAllChildren)
 {
     return(FindControlByNameOrID((Control)view, name, searchAllChildren));
 }
Ejemplo n.º 27
0
 private WebControlHelper(IControlView view)
 {
     parentView = (TemplateControl)view;
 }
Ejemplo n.º 28
0
 public T FindControlView <T>(IControlView view) where T : IControlView
 {
     return(WinControlFindHelper.FindControlOnChild <T>((Control)view));
 }
Ejemplo n.º 29
0
 public virtual void RemoveControlView(IControlView view, object controlCollection)
 {
     ((ControlCollection)controlCollection).Remove((Control)view);
 }
Ejemplo n.º 30
0
 public virtual T FindControlView <T>(IControlView view) where T : IControlView
 {
     return(FindControl <T>((Control)view));
 }