ActionButtonModel AddButton(ActionPanelModel panel, string text, Action action, Action <ActionButtonModel> conflictStateAction, Action <ActionButtonModel> noConflictStateAction)
        {
            var m = AddButton(panel, text, action);

            ConflictTurned   += () => conflictStateAction(m);
            NoConflictTurned += () => noConflictStateAction(m);
            return(m);
        }
        ActionButtonModel AddButton(ActionPanelModel panel, string text, Action action)
        {
            ActionButtonModel m = new ActionButtonModel();

            m.Text     = text;
            m.Clicked += action;
            panel.Add(m);
            return(m);
        }
        ActionButtonModel AddButton(ActionPanelModel panel, string text, Action action, double width, string pathData, bool filled)
        {
            ActionButtonModel m = AddButton(panel, text, action);

            m.Width      = width;
            m.FilledPath = filled;
            m.PathData   = Geometry.Parse(pathData);
            return(m);
        }
Beispiel #4
0
 void CreateManagers(ActionPanelModel localAM, ActionPanelModel remoteLeftAM, ActionPanelModel remoteRightAM)
 {
     ActionsManager = new ActionsManager();
     ActionsManager.LocalRepoPanel            = localAM;
     ActionsManager.RemoteRepoLeftGroupPanel  = remoteLeftAM;
     ActionsManager.RemoteRepoRightGroupPanel = remoteRightAM;
     TabManager = new TabManager(Data.MainWindowModel, localAM);
     TabManager.CommitRequested += Commit;
     TabManager.AbortRequested  += AbortMerge;
     TabManager.CanvasMouseDown += OnMouseDown;
     TabManager.CanvasMouseUp   += OnMouseUp;
     SubscribeActionsManager();
     CommitManager     = CommitManager.GetInstance();
     RepositoryManager = new RepositoryManager(_dataFolder);
     UserManager       = new UserManager(_dataFolder);
     StashingManager   = new StashingManager(_dataFolder);
     RemoteManager     = new RemoteManager(_dataFolder);
 }
Beispiel #5
0
        Program()
        {
            ActionPanelModel    localAM       = new ActionPanelModel();
            MainWindowViewModel mwvm          = InitializeMainWindow();
            ActionPanelModel    remoteLeftAM  = MainWindowModel.RemoteLeftPanelModel;
            ActionPanelModel    remoteRightAM = MainWindowModel.RemoteRightPanelModel;

            CreateManagers(localAM, remoteLeftAM, remoteRightAM);
            InitializeEventHandlers();
            InitializeState();
            LibGitService.GetInstance().RepositoryChanged += CheckConflicts;
            LibGitService.GetInstance().RepositoryChanged += () => Show(null);
            LibGitService.GetInstance().RepositoryChanged += () => ActionsManager.OnWorkTreeChanged(LibGitService.GetInstance().HasChanges);
            StashMenuViewModel wm = new StashMenuViewModel(StashingManager.StashMenu);

            mwvm.StashMenu              = wm;
            RepositoryManager.Opened   += m => MainWindowModel.RepoPath = m.RepositoryPath;
            MainWindowModel.RecentRepos = RepositoryManager.RecentRepos;
            RepositoryManager.Closed   += m => { MainWindowModel.RepoPath = ""; MainWindowModel.RecentRepos = RepositoryManager.RecentRepos; RemoteManager.Reset(); };
            RepositoryManager.RecentRepositoryChanged += () => MainWindowModel.RecentRepos = RepositoryManager.RecentRepos;
            UserManager.UsersChanged += () => MainWindowModel.OnUsersChanged();
        }
Beispiel #6
0
 void SubscribeModel(ActionPanelModel model)
 {
     model.Added += Added;
 }
Beispiel #7
0
 public ActionPanelViewModel(ActionPanelModel model)
 {
     Model = model;
     SubscribeModel(model);
 }
Beispiel #8
0
 public TabManager(MainWindowModel w, ActionPanelModel localAM)
 {
     ActionPanel     = localAM;
     MainWindowModel = w;
 }