Exemplo n.º 1
0
 private void OnItemActivated(object sender, ItemEventArgs e)
 {
     var item = e.Item as ViewListItem;
     if(item != null)
     {
         WorkingEnvironment.ViewDockService.ShowView(item.DataContext.Guid);
     }
 }
Exemplo n.º 2
0
 private void OnItemActivated(object sender, ItemEventArgs e)
 {
     var desc = (e.Item as PropertyPageItem).DataContext;
     PropertyPage page;
     if(_activePage != null)
     {
         if(_activePage.Guid == desc.Guid) return;
     }
     if(!_propertyPages.TryGetValue(desc.Guid, out page))
     {
         page = desc.CreatePropertyPage(_environment);
         bool raiseElevatedChanged = false;
         if(page != null)
         {
             var elevated = page as IElevatedExecutableDialog;
             if(elevated != null)
             {
                 elevated.RequireElevationChanged += OnRequireElevationChanged;
                 if(!RequireElevation && elevated.RequireElevation)
                 {
                     raiseElevatedChanged = true;
                 }
             }
         }
         _propertyPages.Add(desc.Guid, page);
         if(raiseElevatedChanged)
         {
             RequireElevationChanged.Raise(this);
         }
     }
     if(page != null)
     {
         page.Dock = DockStyle.Fill;
         page.Parent = _pnlPageContainer;
         page.InvokeOnShown();
     }
     if(_activePage != null)
     {
         _activePage.Parent = null;
     }
     _activePage = page;
 }
Exemplo n.º 3
0
 private void OnFilesToClearItemActivated(object sender, ItemEventArgs e)
 {
     var item = e.Item as ITreeItemListItem;
     if(item != null)
     {
         Utility.OpenUrl(System.IO.Path.Combine(
             item.TreeItem.Repository.WorkingDirectory, item.TreeItem.RelativePath));
     }
 }
Exemplo n.º 4
0
 private void OnReferencesItemActivated(object sender, ItemEventArgs e)
 {
     if((e.Item is BranchListItem) || (e.Item is TagListItem))
     {
         ClickOk();
     }
 }
Exemplo n.º 5
0
 private void OnItemActivated(object sender, ItemEventArgs e)
 {
     var remote = ((CustomListBoxItem<Remote>)e.Item).DataContext;
     Gui.Environment.ViewDockService.ShowView(Guids.RemoteViewGuid, new RemoteViewModel(remote), true);
 }
Exemplo n.º 6
0
 private void OnRecentRepositoriesListItemActivated(object sender, ItemEventArgs e)
 {
     var item = e.Item as RecentRepositoryListItem;
     if(item != null)
     {
         if(WorkingEnvironment.OpenRepository(item.DataContext.Path))
         {
             if(_factory.CloseAfterRepositoryLoad)
             {
                 Close();
             }
         }
     }
 }
Exemplo n.º 7
0
 private void OnItemActivated(object sender, ItemEventArgs e)
 {
     if(e.Item is BranchListItem)
     {
         var branch = ((BranchListItem)e.Item).DataContext;
         Text = branch.Name;
         HideDropDown();
     }
     if(e.Item is RemoteBranchListItem)
     {
         var branch = ((RemoteBranchListItem)e.Item).DataContext;
         Text = branch.Name;
         HideDropDown();
     }
     else if(e.Item is TagListItem)
     {
         var tag = ((TagListItem)e.Item).DataContext;
         Text = tag.Name;
         HideDropDown();
     }
 }
Exemplo n.º 8
0
 private void OnItemActivated(object sender, ItemEventArgs e)
 {
     var b = ((BranchListItem)e.Item).DataContext;
     _selectedBranch = b;
     UpdateButton();
 }
Exemplo n.º 9
0
 private void OnUnstagedItemActivated(object sender, ItemEventArgs e)
 {
     var item = e.Item as TreeFileListItem;
     if(item != null)
     {
         try
         {
             using(this.ChangeCursor(Cursors.WaitCursor))
             {
                 item.DataContext.Stage();
             }
         }
         catch(GitException exc)
         {
             GitterApplication.MessageBoxService.Show(
                 this,
                 exc.Message,
                 Resources.ErrFailedToStage,
                 MessageBoxButton.Close,
                 MessageBoxIcon.Error);
         }
     }
 }
Exemplo n.º 10
0
 private void OnItemCheckedChanged(object sender, ItemEventArgs e)
 {
     var item = e.Item as IRevisionPointerListItem;
     if(item != null)
     {
         var reference = item.RevisionPointer as Reference;
         if(reference != null)
         {
             if(e.Item.IsChecked)
             {
                 _logOptions.AllowReference(reference);
             }
             else
             {
                 _logOptions.DisallowReference(reference);
             }
         }
     }
 }