Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair export files #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions Code/Blumind/Blumind.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,15 +10,15 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Blumind</RootNamespace>
<AssemblyName>Blumind</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ApplicationIcon>
</ApplicationIcon>
<StartupObject>
</StartupObject>
<StartupObject>Blumind.Program</StartupObject>
<Win32Resource>.\Resources\NativeResources.res</Win32Resource>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>hyfree.public.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand All @@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -48,14 +49,15 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup />
<ItemGroup>
<Reference Include="PdfSharp">
<HintPath>..\Library\PdfSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
Expand Down Expand Up @@ -995,7 +997,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Resources\windows_themes.xml" />
<None Include="hyfree.public.snk" />
<None Include="Resources\Images\add_topic.png" />
<None Include="Resources\Images\add_sub_topic.png" />
<None Include="Resources\Images\association.png" />
Expand Down Expand Up @@ -1223,7 +1224,11 @@
<None Include="Resources\Images\zoom_in.png" />
<None Include="Resources\Images\theme.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<PackageReference Include="System.Linq">
<Version>4.3.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
6 changes: 2 additions & 4 deletions Code/Blumind/Canvas/Svg/SvgGraphics.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using System.Xml;
using Blumind.Controls;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Blumind.Core;
using Blumind.Core.Documents;
using Blumind.Model;
Expand Down Expand Up @@ -61,8 +61,8 @@ public override bool Execute()
if (DragObjects.IsNullOrEmpty() || Target == null || DragDropMethod == DragTopicsMethod.None)
return false;

Parents = new Dictionary<ChartObject, object>();
Indices = new Dictionary<ChartObject, int>();
Parents = new System.Collections.Generic.Dictionary<ChartObject, object>();
Indices = new System.Collections.Generic.Dictionary<ChartObject, int>();

switch (DragDropMethod)
{
Expand Down
1 change: 0 additions & 1 deletion Code/Blumind/ChartControls/MindMap/Layouts/Layouter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
Expand Down
2 changes: 1 addition & 1 deletion Code/Blumind/Core/DotNet3/Linq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.Generic;
using System.Text;

namespace System.Linq
namespace System.Linq.Dynamic
{
static class Enumerable
{
Expand Down
73 changes: 49 additions & 24 deletions Code/Blumind/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Security.Principal;
using System.Text;
using System.Windows.Forms;
using Blumind.Canvas;
Expand All @@ -28,6 +30,11 @@ static class Program
[STAThread]
static void Main(params string[] args)
{
if (System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Count() > 1)
{
Console.WriteLine("ya existe la aplicación en ejecución");
return;
}
if (PreProcessApplicationArgs(args))
return;

Expand All @@ -53,31 +60,30 @@ static void Main(params string[] args)
RecentFilesManage.Default.Initialize();

Current_OpitonsChanged(null, EventArgs.Empty);

if (!IsUserAdministrator())
{
ProcessStartInfo proc = new ProcessStartInfo();
proc.UseShellExecute = true;
proc.WorkingDirectory = Environment.CurrentDirectory;
proc.FileName = Assembly.GetEntryAssembly().CodeBase;

foreach (string arg in args)
{
proc.Arguments += String.Format("\"{0}\" ", arg);
}

proc.Verb = "runas";

try
{
Process.Start(proc);
}
catch
{
Console.WriteLine("This application requires elevated credentials in order to operate correctly!");
}
}
#if DEBUG
// NotesWidget nw = new NotesWidget()
// {
// Remark = @"
//<P><STRONG>发布时间:<SPAN>2014年4月29日</SPAN> </STRONG></P>
//<DIV>
//<P>美国总统奥巴马8天4国的亚太之行,在今天画上句点。美国与日本、韩国、马来西亚以及<WBR>&shy;
//菲律宾等亚太盟国的关系是否更加紧密,亚太局势是否取得平衡?奥巴马极力推动的跨太平<WBR>&shy;洋伙伴协议TPP是否有所进展?
//而虽然不在奥巴马的访问行程之内,但正如中国外交部发<WBR>&shy;言人秦刚所说:&quot 你来,或者不来,我就在这里&quot,中国就像&quot房间里的大象&quot,
// 是美国与盟国即使不直接说<WBR>&shy;明白,却也无法视而不见的议题。奥巴马此行取得哪些成果?我们邀请到两位嘉宾来为我们<WBR>&shy;
// 解读。一位是香港亚洲周刊资深特派员纪硕鸣先生,另外一位是中国复旦大学美国研究中心<WBR>&shy;沈丁立教授。</P></DIV>"
// };
// var dlg = new RemarkDialog();
// dlg.ShowInTaskbar = true;
// dlg.Widget = nw;
// dlg.ShowDialog();

// dlg.Widget = new NotesWidget()
// {
// Remark = "abc"
// };

// dlg.ShowDialog();

MainForm = new MainForm(args);
Application.Run(MainForm);
#else
Expand Down Expand Up @@ -133,5 +139,24 @@ static void Current_OpitonsChanged(object sender, EventArgs e)

//D.Message(string.Format("Test: Options => {0}", Lang._("Options")));
}
static bool IsUserAdministrator()
{
bool isAdmin;
try
{
WindowsIdentity user = WindowsIdentity.GetCurrent();
WindowsPrincipal principal = new WindowsPrincipal(user);
isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator);
}
catch (UnauthorizedAccessException ex)
{
isAdmin = false;
}
catch (Exception ex)
{
isAdmin = false;
}
return isAdmin;
}
}
}
Loading