mirror of
https://github.com/greenshot/greenshot
synced 2025-07-30 11:40:40 -07:00
Added Directory.Build.targets, this seems to help to import the target correctly. Removed chocolatey package again, as this seems to be the more stable approach (let's see if the build runs...)
This commit is contained in:
parent
5f242a79c8
commit
6831505ead
24 changed files with 175 additions and 186 deletions
|
@ -18,6 +18,7 @@
|
|||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- ILLinker and single file settings -->
|
||||
|
@ -102,25 +103,10 @@
|
|||
</Tokens>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Acticate MSBuild.Community.Tasks to use the TemplateFile Task-->
|
||||
<ItemGroup Condition="$(MSBuildProjectName.Contains('Plugin'))">
|
||||
<!-- Add MSBuild.Community.Tasks to use the TemplateFile Task-->
|
||||
<ItemGroup Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')">
|
||||
<PackageReference Include="MSBuildTasks" Version="1.5.0.235" GeneratePathProperty="true" DevelopmentDependency="true" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition="Exists('$(PkgTools_MSBuildTasks)MSBuild.Community.Tasks.Targets')">
|
||||
<MSBuildTasksPath>$(PkgTools_MSBuildTasks)</MSBuildTasksPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="Exists('$(userprofile)\.nuget\packages\msbuildtasks\1.5.0.235\tools\MSBuild.Community.Tasks.Targets')">
|
||||
<MSBuildTasksPath>$(userprofile)\.nuget\packages\msbuildtasks\1.5.0.235\tools\</MSBuildTasksPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets')">
|
||||
<MSBuildTasksPath>$(MSBuildExtensionsPath)\MSBuildCommunityTasks\</MSBuildTasksPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildTasksPath)MSBuild.Community.Tasks.Targets" Condition="$(MSBuildProjectName.Contains('Plugin'))"/>
|
||||
|
||||
<Target Name="ProcessTemplates" BeforeTargets="PrepareForBuild" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')">
|
||||
<Message Text="Processing: $(ProjectDir)$(ProjectName).Credentials.template" Importance="high"/>
|
||||
<TemplateFile Template="$(ProjectDir)$(ProjectName).Credentials.template" OutputFilename="$(ProjectDir)$(ProjectName).Credentials.cs" Tokens="@(Tokens)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PostBuild" BeforeTargets="PostBuildEvent" Condition="$(MSBuildProjectName.Contains('Plugin')) And !$(MSBuildProjectName.Contains('Test')) And !$(MSBuildProjectName.Contains('Demo'))">
|
||||
<Exec Command="
|
||||
|
|
9
Directory.Build.targets
Normal file
9
Directory.Build.targets
Normal file
|
@ -0,0 +1,9 @@
|
|||
<Project>
|
||||
|
||||
<Import Project="$(PkgMSBuildTasks)\tools\MSBuild.Community.Tasks.Targets" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')"/>
|
||||
|
||||
<Target Name="ProcessTemplates" BeforeTargets="PrepareForBuild" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')">
|
||||
<Message Text="Processing: $(ProjectDir)$(ProjectName).Credentials.template" Importance="high"/>
|
||||
<TemplateFile Template="$(ProjectDir)$(ProjectName).Credentials.template" OutputFilename="$(ProjectDir)$(ProjectName).Credentials.cs" Tokens="@(Tokens)" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -18,15 +18,15 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using GreenshotConfluencePlugin;
|
||||
using GreenshotConfluencePlugin.confluence;
|
||||
using GreenshotPlugin.Core;
|
||||
using GreenshotPlugin.IniFile;
|
||||
|
||||
namespace Confluence {
|
||||
namespace GreenshotConfluencePlugin {
|
||||
public class Page {
|
||||
public Page(RemotePage page) {
|
||||
Id = page.id;
|
||||
|
|
|
@ -25,7 +25,6 @@ using System.Drawing;
|
|||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using Confluence;
|
||||
using GreenshotPlugin.Controls;
|
||||
using GreenshotPlugin.Core;
|
||||
using GreenshotPlugin.IniFile;
|
||||
|
@ -129,7 +128,7 @@ namespace GreenshotConfluencePlugin {
|
|||
bool openPage = (_page == null) && ConfluenceConfig.OpenPageAfterUpload;
|
||||
string filename = FilenameHelper.GetFilenameWithoutExtensionFromPattern(CoreConfig.OutputFileFilenamePattern, captureDetails);
|
||||
if (selectedPage == null) {
|
||||
ConfluenceUpload confluenceUpload = new ConfluenceUpload(filename);
|
||||
Forms.ConfluenceUpload confluenceUpload = new Forms.ConfluenceUpload(filename);
|
||||
bool? dialogResult = confluenceUpload.ShowDialog();
|
||||
if (dialogResult.HasValue && dialogResult.Value) {
|
||||
selectedPage = confluenceUpload.SelectedPage;
|
||||
|
|
|
@ -19,14 +19,14 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using Confluence;
|
||||
using GreenshotPlugin.Core;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using GreenshotConfluencePlugin.Forms;
|
||||
using GreenshotConfluencePlugin.Support;
|
||||
using GreenshotPlugin.IniFile;
|
||||
using GreenshotPlugin.Interfaces;
|
||||
using GreenshotPlugin.Interfaces.Plugin;
|
||||
using TranslationByMarkupExtension;
|
||||
|
||||
namespace GreenshotConfluencePlugin {
|
||||
/// <summary>
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace GreenshotConfluencePlugin {
|
|||
public class ConfluenceUtils {
|
||||
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ConfluenceUtils));
|
||||
|
||||
public static List<Confluence.Page> GetCurrentPages() {
|
||||
List<Confluence.Page> pages = new List<Confluence.Page>();
|
||||
public static List<Page> GetCurrentPages() {
|
||||
List<Page> pages = new List<Page>();
|
||||
Regex pageIdRegex = new Regex(@"pageId=(\d+)");
|
||||
Regex spacePageRegex = new Regex(@"\/display\/([^\/]+)\/([^#]+)");
|
||||
foreach(string browserurl in GetBrowserUrls()) {
|
||||
|
@ -50,7 +50,7 @@ namespace GreenshotConfluencePlugin {
|
|||
long pageId = long.Parse(pageIdMatch[0].Groups[1].Value);
|
||||
try {
|
||||
bool pageDouble = false;
|
||||
foreach(Confluence.Page page in pages) {
|
||||
foreach(Page page in pages) {
|
||||
if (page.Id == pageId) {
|
||||
pageDouble = true;
|
||||
LOG.DebugFormat("Skipping double page with ID {0}", pageId);
|
||||
|
@ -58,7 +58,7 @@ namespace GreenshotConfluencePlugin {
|
|||
}
|
||||
}
|
||||
if (!pageDouble) {
|
||||
Confluence.Page page = ConfluencePlugin.ConfluenceConnector.GetPage(pageId);
|
||||
Page page = ConfluencePlugin.ConfluenceConnector.GetPage(pageId);
|
||||
LOG.DebugFormat("Adding page {0}", page.Title);
|
||||
pages.Add(page);
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ namespace GreenshotConfluencePlugin {
|
|||
}
|
||||
try {
|
||||
bool pageDouble = false;
|
||||
foreach(Confluence.Page page in pages) {
|
||||
foreach(Page page in pages) {
|
||||
if (page.Title.Equals(title)) {
|
||||
LOG.DebugFormat("Skipping double page with title {0}", title);
|
||||
pageDouble = true;
|
||||
|
@ -90,7 +90,7 @@ namespace GreenshotConfluencePlugin {
|
|||
}
|
||||
}
|
||||
if (!pageDouble) {
|
||||
Confluence.Page page = ConfluencePlugin.ConfluenceConnector.GetPage(space, title);
|
||||
Page page = ConfluencePlugin.ConfluenceConnector.GetPage(space, title);
|
||||
LOG.DebugFormat("Adding page {0}", page.Title);
|
||||
pages.Add(page);
|
||||
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
<Window x:Class="GreenshotConfluencePlugin.ConfluenceConfigurationForm"
|
||||
<Window x:Class="GreenshotConfluencePlugin.Forms.ConfluenceConfigurationForm"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:gscp="clr-namespace:GreenshotConfluencePlugin"
|
||||
xmlns:l="clr-namespace:TranslationByMarkupExtension"
|
||||
xmlns:gsc="clr-namespace:GreenshotPlugin.Core;assembly=GreenshotPlugin"
|
||||
Title="{l:Translate plugin_settings}" SizeToContent="WidthAndHeight" ResizeMode="NoResize" Icon="/GreenshotConfluencePlugin;component/Images/Confluence.ico">
|
||||
xmlns:support="clr-namespace:GreenshotConfluencePlugin.Support"
|
||||
Title="{support:Translate plugin_settings}" SizeToContent="WidthAndHeight" ResizeMode="NoResize" Icon="/GreenshotConfluencePlugin;component/Images/Confluence.ico">
|
||||
<Window.Resources>
|
||||
<gscp:EnumDisplayer Type="{x:Type gsc:OutputFormat}" x:Key="outputFormats"/>
|
||||
</Window.Resources>
|
||||
|
||||
<StackPanel>
|
||||
<CheckBox IsChecked="{Binding IncludePersonSpaces}" Content="{l:Translate include_person_spaces}"/>
|
||||
<CheckBox IsChecked="{Binding OpenPageAfterUpload}" Content="{l:Translate open_page_after_upload}"/>
|
||||
<CheckBox IsChecked="{Binding CopyWikiMarkupForImageToClipboard}" Content="{l:Translate copy_wikimarkup}"/>
|
||||
<CheckBox IsChecked="{Binding IncludePersonSpaces}" Content="{support:Translate include_person_spaces}"/>
|
||||
<CheckBox IsChecked="{Binding OpenPageAfterUpload}" Content="{support:Translate open_page_after_upload}"/>
|
||||
<CheckBox IsChecked="{Binding CopyWikiMarkupForImageToClipboard}" Content="{support:Translate copy_wikimarkup}"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="{l:Translate label_url}" />
|
||||
<Label Content="{support:Translate label_url}" />
|
||||
<TextBox Text="{Binding Url}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="{l:Translate label_timeout}" />
|
||||
<Label Content="{support:Translate label_timeout}" />
|
||||
<TextBox Text="{Binding Timeout}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="{l:Translate upload_format}" />
|
||||
<Label Content="{support:Translate upload_format}" />
|
||||
<ComboBox ItemsSource="{Binding Source={StaticResource outputFormats},Path=DisplayNames}" SelectedValue="{Binding UploadFormat, Converter={StaticResource outputFormats}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button IsDefault="True" Content="{l:Translate OK}" Click="Button_OK_Click"/>
|
||||
<Button IsCancel="True" Content="{l:Translate CANCEL}"/>
|
||||
<Button IsDefault="True" Content="{support:Translate OK}" Click="Button_OK_Click"/>
|
||||
<Button IsCancel="True" Content="{support:Translate CANCEL}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Window>
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
using System.Windows;
|
||||
|
||||
namespace GreenshotConfluencePlugin {
|
||||
namespace GreenshotConfluencePlugin.Forms {
|
||||
/// <summary>
|
||||
/// Interaction logic for ConfluenceConfigurationForm.xaml
|
||||
/// </summary>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<Page x:Class="GreenshotConfluencePlugin.ConfluencePagePicker"
|
||||
<Page x:Class="GreenshotConfluencePlugin.Forms.ConfluencePagePicker"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Loaded="Page_Loaded">
|
||||
|
|
|
@ -19,10 +19,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using Confluence;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GreenshotConfluencePlugin {
|
||||
namespace GreenshotConfluencePlugin.Forms {
|
||||
/// <summary>
|
||||
/// Interaction logic for ConfluencePagePicker.xaml
|
||||
/// </summary>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page x:Class="GreenshotConfluencePlugin.ConfluenceSearch"
|
||||
<Page x:Class="GreenshotConfluencePlugin.Forms.ConfluenceSearch"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:l="clr-namespace:TranslationByMarkupExtension" Loaded="Page_Loaded">
|
||||
xmlns:support="clr-namespace:GreenshotConfluencePlugin.Support"
|
||||
Loaded="Page_Loaded">
|
||||
<Grid MaxHeight="500">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
|
@ -16,9 +17,9 @@
|
|||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="Space" />
|
||||
<ComboBox Grid.Row="0" Grid.Column="1" Name="SpaceComboBox" ItemsSource="{Binding Path=Spaces}" DisplayMemberPath="Name" SelectedValuePath="Key"/>
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="{l:Translate search_text}" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Name="searchText" Text="" KeyDown="SearchText_KeyDown" TextChanged="searchText_TextChanged"/>
|
||||
<Button Grid.Row="2" Grid.ColumnSpan="2" Name="Search" Content="{l:Translate search}" Click="Search_Click" IsEnabled="False"/>
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="{support:Translate search_text}" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Name="searchText" Text="" KeyDown="SearchText_KeyDown" TextChanged="SearchText_TextChanged"/>
|
||||
<Button Grid.Row="2" Grid.ColumnSpan="2" Name="Search" Content="{support:Translate search}" Click="Search_Click" IsEnabled="False"/>
|
||||
<ListView Grid.Row="3" Grid.ColumnSpan="2" Name="PageListView" SelectionMode="Single" ItemsSource="{Binding Path=Pages}" SelectionChanged="PageListView_SelectionChanged">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
|
|
|
@ -25,15 +25,15 @@ using System.Linq;
|
|||
using System.Windows;
|
||||
using GreenshotPlugin.IniFile;
|
||||
|
||||
namespace GreenshotConfluencePlugin {
|
||||
namespace GreenshotConfluencePlugin.Forms {
|
||||
public partial class ConfluenceSearch
|
||||
{
|
||||
private static readonly ConfluenceConfiguration ConfluenceConfig = IniConfig.GetIniSection<ConfluenceConfiguration>();
|
||||
private readonly ConfluenceUpload _confluenceUpload;
|
||||
|
||||
public IEnumerable<Confluence.Space> Spaces => _confluenceUpload.Spaces;
|
||||
public IEnumerable<Space> Spaces => _confluenceUpload.Spaces;
|
||||
|
||||
public ObservableCollection<Confluence.Page> Pages { get; } = new ObservableCollection<Confluence.Page>();
|
||||
public ObservableCollection<Page> Pages { get; } = new ObservableCollection<Page>();
|
||||
|
||||
public ConfluenceSearch(ConfluenceUpload confluenceUpload) {
|
||||
_confluenceUpload = confluenceUpload;
|
||||
|
@ -56,7 +56,7 @@ namespace GreenshotConfluencePlugin {
|
|||
|
||||
private void SelectionChanged() {
|
||||
if (PageListView.HasItems && PageListView.SelectedItems.Count > 0) {
|
||||
_confluenceUpload.SelectedPage = (Confluence.Page)PageListView.SelectedItem;
|
||||
_confluenceUpload.SelectedPage = (Page)PageListView.SelectedItem;
|
||||
} else {
|
||||
_confluenceUpload.SelectedPage = null;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ namespace GreenshotConfluencePlugin {
|
|||
SelectionChanged();
|
||||
}
|
||||
|
||||
private void searchText_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) {
|
||||
private void SearchText_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) {
|
||||
Search.IsEnabled = !string.IsNullOrEmpty(searchText.Text);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page x:Class="GreenshotConfluencePlugin.ConfluenceTreePicker"
|
||||
<Page x:Class="GreenshotConfluencePlugin.Forms.ConfluenceTreePicker"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:l="clr-namespace:TranslationByMarkupExtension"
|
||||
xmlns:support="clr-namespace:GreenshotConfluencePlugin.Support"
|
||||
Loaded="Page_Loaded">
|
||||
<Grid Width="500">
|
||||
<TreeView Name="ConfluenceTreeView" MaxHeight="500"
|
||||
|
@ -10,7 +10,7 @@
|
|||
VerticalAlignment="Top" HorizontalAlignment="Left" />
|
||||
<Border Name="ShowBusy" BorderBrush="Black" BorderThickness="1" Background="#80000000" Visibility="Visible">
|
||||
<TextBlock Margin="0" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
FontSize="18" FontWeight="Bold" Foreground="#7EFFFFFF" Text="{l:Translate loading}"/>
|
||||
FontSize="18" FontWeight="Bold" Foreground="#7EFFFFFF" Text="{support:Translate loading}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Page>
|
|
@ -27,10 +27,7 @@ using System.Windows.Controls;
|
|||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
|
||||
using Confluence;
|
||||
using Page = Confluence.Page;
|
||||
|
||||
namespace GreenshotConfluencePlugin {
|
||||
namespace GreenshotConfluencePlugin.Forms {
|
||||
/// <summary>
|
||||
/// Interaction logic for ConfluenceTreePicker.xaml
|
||||
/// </summary>
|
||||
|
@ -47,10 +44,10 @@ namespace GreenshotConfluencePlugin {
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void pageTreeViewItem_DoubleClick(object sender, MouseButtonEventArgs eventArgs) {
|
||||
private void PageTreeViewItem_DoubleClick(object sender, MouseButtonEventArgs eventArgs) {
|
||||
Log.Debug("spaceTreeViewItem_MouseLeftButtonDown is called!");
|
||||
TreeViewItem clickedItem = eventArgs.Source as TreeViewItem;
|
||||
if (!(clickedItem?.Tag is Page page)) {
|
||||
if (clickedItem?.Tag is not Page page) {
|
||||
return;
|
||||
}
|
||||
if (clickedItem.HasItems)
|
||||
|
@ -70,20 +67,20 @@ namespace GreenshotConfluencePlugin {
|
|||
Tag = childPage
|
||||
};
|
||||
clickedItem.Items.Add(pageTreeViewItem);
|
||||
pageTreeViewItem.PreviewMouseDoubleClick += pageTreeViewItem_DoubleClick;
|
||||
pageTreeViewItem.PreviewMouseLeftButtonDown += pageTreeViewItem_Click;
|
||||
pageTreeViewItem.PreviewMouseDoubleClick += PageTreeViewItem_DoubleClick;
|
||||
pageTreeViewItem.PreviewMouseLeftButtonDown += PageTreeViewItem_Click;
|
||||
}
|
||||
ShowBusy.Visibility = Visibility.Collapsed;
|
||||
}));
|
||||
}) { Name = "Loading childpages for confluence page " + page.Title }.Start();
|
||||
}
|
||||
|
||||
private void pageTreeViewItem_Click(object sender, MouseButtonEventArgs eventArgs) {
|
||||
private void PageTreeViewItem_Click(object sender, MouseButtonEventArgs eventArgs) {
|
||||
Log.Debug("pageTreeViewItem_PreviewMouseDoubleClick is called!");
|
||||
if (!(eventArgs.Source is TreeViewItem clickedItem)) {
|
||||
if (eventArgs.Source is not TreeViewItem clickedItem) {
|
||||
return;
|
||||
}
|
||||
Confluence.Page page = clickedItem.Tag as Confluence.Page;
|
||||
Page page = clickedItem.Tag as Page;
|
||||
_confluenceUpload.SelectedPage = page;
|
||||
if (page != null) {
|
||||
Log.Debug("Page selected: " + page.Title);
|
||||
|
@ -107,14 +104,14 @@ namespace GreenshotConfluencePlugin {
|
|||
|
||||
// Get homepage
|
||||
try {
|
||||
Confluence.Page page = _confluenceConnector.GetSpaceHomepage(space);
|
||||
Page page = _confluenceConnector.GetSpaceHomepage(space);
|
||||
TreeViewItem pageTreeViewItem = new TreeViewItem
|
||||
{
|
||||
Header = page.Title,
|
||||
Tag = page
|
||||
};
|
||||
pageTreeViewItem.PreviewMouseDoubleClick += pageTreeViewItem_DoubleClick;
|
||||
pageTreeViewItem.PreviewMouseLeftButtonDown += pageTreeViewItem_Click;
|
||||
pageTreeViewItem.PreviewMouseDoubleClick += PageTreeViewItem_DoubleClick;
|
||||
pageTreeViewItem.PreviewMouseLeftButtonDown += PageTreeViewItem_Click;
|
||||
spaceTreeViewItem.Items.Add(pageTreeViewItem);
|
||||
ConfluenceTreeView.Items.Add(spaceTreeViewItem);
|
||||
} catch (Exception ex) {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<Window x:Class="GreenshotConfluencePlugin.ConfluenceUpload"
|
||||
<Window x:Class="GreenshotConfluencePlugin.Forms.ConfluenceUpload"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:l="clr-namespace:TranslationByMarkupExtension"
|
||||
Title="{l:Translate upload_menu_item}" Height="640" Width="500" Icon="/GreenshotConfluencePlugin;component/Images/Confluence.ico">
|
||||
xmlns:support="clr-namespace:GreenshotConfluencePlugin.Support"
|
||||
Title="{support:Translate upload_menu_item}" Height="640" Width="500" Icon="/GreenshotConfluencePlugin;component/Images/Confluence.ico">
|
||||
<StackPanel>
|
||||
<TabControl>
|
||||
<TabItem Header="{l:Translate open_pages}" Name="PickerTab">
|
||||
<TabItem Header="{support:Translate open_pages}" Name="PickerTab">
|
||||
<Frame NavigationUIVisibility="Hidden" Content="{Binding Path=PickerPage}" Height="500"/>
|
||||
</TabItem>
|
||||
<TabItem Header="{l:Translate search_pages}" Name="SearchTab">
|
||||
<TabItem Header="{support:Translate search_pages}" Name="SearchTab">
|
||||
<Frame NavigationUIVisibility="Hidden" Content="{Binding Path=SearchPage}" Height="500"/>
|
||||
</TabItem>
|
||||
<TabItem Header="{l:Translate browse_pages}">
|
||||
<TabItem Header="{support:Translate browse_pages}">
|
||||
<Frame NavigationUIVisibility="Hidden" Content="{Binding Path=BrowsePage}" Height="500"/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
@ -23,12 +23,12 @@
|
|||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="{l:Translate filename}" />
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="{support:Translate filename}" />
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=Filename}" />
|
||||
</Grid>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Name="Upload" Content="{l:Translate upload}" IsDefault="True" IsEnabled="False" Click="Upload_Click" />
|
||||
<Button Name="Cancel" Content="{l:Translate CANCEL}" IsCancel="True" />
|
||||
<Button Name="Upload" Content="{support:Translate upload}" IsDefault="True" IsEnabled="False" Click="Upload_Click" />
|
||||
<Button Name="Cancel" Content="{support:Translate CANCEL}" IsCancel="True" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Window>
|
|
@ -18,23 +18,23 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace GreenshotConfluencePlugin {
|
||||
namespace GreenshotConfluencePlugin.Forms {
|
||||
/// <summary>
|
||||
/// Interaction logic for ConfluenceUpload.xaml
|
||||
/// </summary>
|
||||
public partial class ConfluenceUpload : Window {
|
||||
private Page _pickerPage;
|
||||
public Page PickerPage {
|
||||
private System.Windows.Controls.Page _pickerPage;
|
||||
public System.Windows.Controls.Page PickerPage {
|
||||
get {
|
||||
if (_pickerPage == null) {
|
||||
List<Confluence.Page> pages = ConfluenceUtils.GetCurrentPages();
|
||||
List<Page> pages = ConfluenceUtils.GetCurrentPages();
|
||||
if (pages != null && pages.Count > 0) {
|
||||
_pickerPage = new ConfluencePagePicker(this, pages);
|
||||
}
|
||||
|
@ -43,21 +43,19 @@ namespace GreenshotConfluencePlugin {
|
|||
}
|
||||
}
|
||||
|
||||
private Page _searchPage;
|
||||
public Page SearchPage {
|
||||
private System.Windows.Controls.Page _searchPage;
|
||||
public System.Windows.Controls.Page SearchPage {
|
||||
get { return _searchPage ??= new ConfluenceSearch(this); }
|
||||
}
|
||||
|
||||
private Page _browsePage;
|
||||
public Page BrowsePage {
|
||||
private System.Windows.Controls.Page _browsePage;
|
||||
public System.Windows.Controls.Page BrowsePage {
|
||||
get { return _browsePage ??= new ConfluenceTreePicker(this); }
|
||||
}
|
||||
|
||||
private Confluence.Page _selectedPage;
|
||||
public Confluence.Page SelectedPage {
|
||||
get {
|
||||
return _selectedPage;
|
||||
}
|
||||
private Page _selectedPage;
|
||||
public Page SelectedPage {
|
||||
get => _selectedPage;
|
||||
set {
|
||||
_selectedPage = value;
|
||||
Upload.IsEnabled = _selectedPage != null;
|
||||
|
@ -75,8 +73,8 @@ namespace GreenshotConfluencePlugin {
|
|||
}
|
||||
|
||||
private static DateTime _lastLoad = DateTime.Now;
|
||||
private static IList<Confluence.Space> _spaces;
|
||||
public IList<Confluence.Space> Spaces {
|
||||
private static IList<Space> _spaces;
|
||||
public IList<Space> Spaces {
|
||||
get {
|
||||
UpdateSpaces();
|
||||
while (_spaces == null) {
|
||||
|
|
|
@ -18,9 +18,12 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using System.Collections;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace GreenshotConfluencePlugin.Forms
|
||||
{
|
||||
/// <summary>
|
||||
/// This class is an implementation of the 'IComparer' interface.
|
||||
/// </summary>
|
||||
|
@ -107,3 +110,4 @@ public class ListViewColumnSorter : IComparer {
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace TranslationByMarkupExtension {
|
||||
namespace GreenshotConfluencePlugin.Support {
|
||||
public interface ITranslationProvider {
|
||||
/// <summary>
|
||||
/// Translates the specified key.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace TranslationByMarkupExtension
|
||||
namespace GreenshotConfluencePlugin.Support
|
||||
{
|
||||
public class LanguageChangedEventManager : WeakEventManager
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using GreenshotPlugin.Core;
|
||||
|
||||
namespace TranslationByMarkupExtension {
|
||||
namespace GreenshotConfluencePlugin.Support {
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace TranslationByMarkupExtension
|
||||
namespace GreenshotConfluencePlugin.Support
|
||||
{
|
||||
/// <summary>
|
||||
/// The Translate Markup extension returns a binding to a TranslationData
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
|
||||
namespace TranslationByMarkupExtension {
|
||||
namespace GreenshotConfluencePlugin.Support {
|
||||
public class TranslationData : IWeakEventListener, INotifyPropertyChanged {
|
||||
private readonly string _key;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
|
||||
namespace TranslationByMarkupExtension {
|
||||
namespace GreenshotConfluencePlugin.Support {
|
||||
public class TranslationManager {
|
||||
private static TranslationManager _translationManager;
|
||||
|
||||
|
|
|
@ -30,10 +30,6 @@ stages:
|
|||
steps:
|
||||
- task: NuGetToolInstaller@1
|
||||
|
||||
- powershell: |
|
||||
choco install msbuild.communitytasks
|
||||
displayName: 'Installing MSBuild community tasks'
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: NuGet restore
|
||||
inputs:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue