示例#1
0
 public GumCommands()
 {
     GuiCommands       = new GuiCommands();
     FileCommands      = new FileCommands();
     Edit              = new EditCommands();
     WireframeCommands = new WireframeCommands();
 }
示例#2
0
        private void OnPruneClick(object sender, EventArgs e)
        {
            var remote = _remoteView.Remote;

            if (remote != null && !remote.IsDeleted)
            {
                GuiCommands.Prune(_remoteView, remote);
            }
        }
示例#3
0
        public bool TryPush()
        {
            Verify.State.IsTrue(View != null, "Controller is not attached to a view.");

            var forceOverwrite = View.ForceOverwrite.Value;
            var thinPack       = View.ThinPack.Value;
            var sendTags       = View.SendTags.Value;
            var branches       = View.References.Value;

            if (branches.Count == 0)
            {
                View.ErrorNotifier.NotifyError(View.References,
                                               new UserInputError(
                                                   Resources.ErrNoBranchesSelected,
                                                   Resources.ErrYouMustSelectBranchesToPush));
                return(false);
            }

            GuiCommandStatus status;

            switch (View.PushTo.Value)
            {
            case PushTo.Remote:
                var remote = View.Remote.Value;
                if (remote == null)
                {
                    View.ErrorNotifier.NotifyError(View.Remote,
                                                   new UserInputError(
                                                       Resources.ErrInvalidRemoteName,
                                                       Resources.ErrRemoteNameCannotBeEmpty));
                    return(false);
                }
                status = GuiCommands.Push(View as IWin32Window, remote, branches, forceOverwrite, thinPack, sendTags);
                break;

            case PushTo.Url:
                var url = View.Url.Value;
                if (string.IsNullOrWhiteSpace(url))
                {
                    View.ErrorNotifier.NotifyError(View.Url,
                                                   new UserInputError(
                                                       Resources.ErrInvalidUrl,
                                                       Resources.ErrUrlCannotBeEmpty));
                    return(false);
                }
                status = GuiCommands.Push(View as IWin32Window, Repository, url, branches, forceOverwrite, thinPack, sendTags);
                break;

            default:
                return(false);
            }
            return(status == GuiCommandStatus.Completed);
        }
示例#4
0
        /// <summary>Perform stash save.</summary>
        /// <returns>true if stash save succeeded.</returns>
        public bool Execute()
        {
            bool keepIndex        = KeepIndex;
            bool includeUntracked =
                GitFeatures.StashIncludeUntrackedOption.IsAvailableFor(_repository) &&
                IncludeUntrackedFiles;
            var message = Message;

            message = message == null ? string.Empty : message.Trim();

            if (GuiCommands.SaveStash(this, Repository.Stash, keepIndex, includeUntracked, message) == GuiCommandStatus.Faulted)
            {
                return(false);
            }
            return(true);
        }
示例#5
0
        public MainWindow()
        {
            Current.MainWindow = this;
            GuiCommands.Init(this);
            InitializeComponent();
            this.Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.ExolutioIcon);

            DiagramTabManager = new DiagramTabManager(this);
            ConfigurationManager.LoadConfiguration();

            this.Loaded        += MainWindow_Loaded;
            dockManager.Loaded += dockManager_Loaded;
            Current.RecentFile += OnRecentFile;
            ExolutioRibbon.FillRecent(ConfigurationManager.Configuration.RecentFiles, ConfigurationManager.Configuration.RecentDirectories);

            Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
        }
示例#6
0
        public bool TryClone()
        {
            Verify.State.IsTrue(View != null, "Controller is not attached to a view.");

            var url = View.Url.Value;

            if (!GitControllerUtility.ValidateUrl(url, View.Url, View.ErrorNotifier))
            {
                return(false);
            }
            var path = View.RepositoryPath.Value.Trim();

            if (!GitControllerUtility.ValidateAbsolutePath(path, View.RepositoryPath, View.ErrorNotifier))
            {
                return(false);
            }
            var remoteName = View.RemoteName.Value;

            if (!GitControllerUtility.ValidateRemoteName(remoteName, View.RemoteName, View.ErrorNotifier))
            {
                return(false);
            }
            url = url.Trim();
            bool   shallow  = View.ShallowClone.Value;
            int    depth    = shallow ? View.Depth.Value : -1;
            string template = View.UseTemplate.Value ? View.TemplatePath.Value.Trim() : null;

            if (!string.IsNullOrWhiteSpace(template) && !GitControllerUtility.ValidateAbsolutePath(template, View.TemplatePath, View.ErrorNotifier))
            {
                return(false);
            }

            bool bare       = View.Bare.Value;
            bool mirror     = bare && View.Mirror.Value;
            bool noCheckout = View.NoCheckout.Value;
            bool recursive  = View.Recursive.Value;

            var status = GuiCommands.Clone(View as IWin32Window,
                                           GitRepositoryProvider.GitAccessor,
                                           url, path, template, remoteName,
                                           shallow, depth, bare, mirror, recursive, noCheckout);

            return(status == GuiCommandStatus.Completed);
        }
示例#7
0
        public MainPage()
        {
            Current.MainWindow = this;
            GuiCommands.Init(this);
            InitializeComponent();
            InitializeRibbon();

            DiagramTabManager = new DiagramTabManager(this);


            this.Loaded += MainWindow_Loaded;
            //Current.ActiveDiagramChanged += Current_ActiveDiagramChanged;

            #if DEBUG
            #else
            ServerCommunication.ServerProjectListLoaded += ServerCommunication_ServerProjectListLoaded;
            ServerCommunication.GetServerProjects();
            #endif
        }
示例#8
0
 public void Initialize(MainWindow mainWindow)
 {
     GuiCommands.Initialize(mainWindow);
 }