Skip to content

Commit

Permalink
Remove Microsoft Visio from the solution #342
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefizso committed Aug 16, 2022
1 parent d1cce25 commit c51f6de
Show file tree
Hide file tree
Showing 522 changed files with 10 additions and 159,729 deletions.
246 changes: 0 additions & 246 deletions BuildTools/ReferenceAnalyzer/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,251 +292,6 @@ private static void ParseWordTypeEvents(XElement propertiesNode, LogAction func)

#endregion

#region Parse Visio

/// <summary>
/// Parse Visio Docu pages
/// </summary>
/// <param name="document">document to fill</param>
/// <param name="func">progress handler</param>
internal static void ParseVisio(XDocument document, LogAction func)
{
XElement VisioNode = new XElement("Visio");
(document.FirstNode as XElement).Add(VisioNode);
ParseVisioTypes(VisioNode, func);
ParseVisioEnums(VisioNode, func);
ParseVisioTypesMembers(VisioNode, func);
}

private static void ParseVisioTypes(XElement excelNode, LogAction func)
{
func("Parse Visio Types");

XElement rootNode = new XElement("Types");
excelNode.Add(rootNode);

int counter = 0;
string excelRootReferencePage = _rootAdress + _visioTypesRelative;
using (var client = new System.Net.WebClient())
{
string pageContent = DownloadPage(client, excelRootReferencePage);
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(pageContent);
var root = doc.DocumentNode;

var divNodes = root.Descendants("div").ToList();
foreach (var item in divNodes)
{
string className = item.GetAttributeValue("class", null);
if (className == "toclevel2")
{
string href = item.FirstChild.NextSibling.GetAttributeValue("href", null);
string name = item.FirstChild.NextSibling.GetAttributeValue("title", null);
if (null != href && null != name)
{
if (name.EndsWith(" Object", StringComparison.InvariantCultureIgnoreCase))
{
name = name.Substring(0, name.Length - " Object".Length);
rootNode.Add(new XElement("Type", new XElement("Name", name), new XElement("Link", _rootAdress + href)));
counter++;
}
}
}

}
}

func(String.Format("{0} Visio Types recieved", counter));
}

private static void ParseVisioEnums(XElement excelNode, LogAction func)
{
func("Parse Visio Enums");

XElement rootNode = new XElement("Enums");
excelNode.Add(rootNode);

int counter = 0;
string excelRootReferencePage = _rootAdress + _visioEnumsRelative;
using (var client = new System.Net.WebClient())
{
string pageContent = DownloadPage(client, excelRootReferencePage);
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(pageContent);
var root = doc.DocumentNode;

var divNodes = root.Descendants("div").ToList();
foreach (var item in divNodes)
{
string className = item.GetAttributeValue("class", null);
if (className == "toclevel2")
{
string href = item.FirstChild.NextSibling.GetAttributeValue("href", null);
string name = item.FirstChild.NextSibling.GetAttributeValue("title", null);
if (null != href && null != name)
{
name = name.Substring(0, name.Length - " Enumeration".Length);
rootNode.Add(new XElement("Enum", new XElement("Name", name), new XElement("Link", _rootAdress + href)));
counter++;
}
}

}

}

func(String.Format("{0} Visio Enums recieved", counter));
}

private static void ParseVisioTypesMembers(XElement typeNode, LogAction func)
{
func("Parse Visio Type Members");
foreach (XElement item in typeNode.Element("Types").Elements("Type"))
{
ParseOfficeTypeMembers(item, func);
}
}

private static void ParseVisioTypeMembers(XElement typeNode, LogAction func)
{
XElement propsNode = new XElement("Properties");
XElement methodsNode = new XElement("Methods");
XElement eventsNode = new XElement("Events");
typeNode.Add(propsNode);
typeNode.Add(methodsNode);
typeNode.Add(eventsNode);

using (var client = new System.Net.WebClient())
{
string pageLink = typeNode.Element("Link").Value;
string pageContent = DownloadPage(client, pageLink);
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(pageContent);
var root = doc.DocumentNode;

var divNodes = root.Descendants("div").ToList();
foreach (var item in divNodes)
{
string className = item.GetAttributeValue("class", null);
if (className == "toclevel2")
{
string href = item.FirstChild.NextSibling.GetAttributeValue("href", null);
string name = item.FirstChild.NextSibling.GetAttributeValue("title", null);
if (null != href && null != name)
{
name = name.ToLower().Trim();
switch (name)
{
case "properties":
propsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href)));
ParseVisioTypeProperties(propsNode, func);
break;
case "methods":
methodsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href)));
ParseVisioTypeMethods(methodsNode, func);
break;
case "events":
eventsNode.Add(new XAttribute("Link", XmlConvert.EncodeName(_rootAdress + href)));
ParseVisioTypeEvents(eventsNode, func);
break;
default:
break;
}
}
}
}
}
}

private static void ParseVisioTypeProperties(XElement propertiesNode, LogAction func)
{
using (var client = new System.Net.WebClient())
{
string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value);
string pageContent = DownloadPage(client, pageLink);
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(pageContent);
var root = doc.DocumentNode;
var divNodes = root.Descendants("div").ToList();
foreach (var item in divNodes)
{
string className = item.GetAttributeValue("class", null);
if (className == "toclevel2")
{
string href = item.FirstChild.NextSibling.GetAttributeValue("href", null);
string name = item.FirstChild.NextSibling.GetAttributeValue("title", null);
if (null != href && null != name)
{
if (name.IndexOf(" ") > -1)
name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0];
propertiesNode.Add(new XElement("Property", new XElement("Name", name), new XElement("Link", _rootAdress + href)));
func("");
}
}
}
}
}

private static void ParseVisioTypeMethods(XElement propertiesNode, LogAction func)
{
using (var client = new System.Net.WebClient())
{
string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value);
string pageContent = DownloadPage(client, pageLink);
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(pageContent);
var root = doc.DocumentNode;
var divNodes = root.Descendants("div").ToList();
foreach (var item in divNodes)
{
string className = item.GetAttributeValue("class", null);
if (className == "toclevel2")
{
string href = item.FirstChild.NextSibling.GetAttributeValue("href", null);
string name = item.FirstChild.NextSibling.GetAttributeValue("title", null);
if (null != href && null != name)
{
if (name.IndexOf(" ") > -1)
name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0];
propertiesNode.Add(new XElement("Method", new XElement("Name", name), new XElement("Link", _rootAdress + href)));
func("");
}
}
}
}
}

private static void ParseVisioTypeEvents(XElement propertiesNode, LogAction func)
{
using (var client = new System.Net.WebClient())
{
string pageLink = XmlConvert.DecodeName(propertiesNode.Attribute("Link").Value);
string pageContent = DownloadPage(client, pageLink);
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(pageContent);
var root = doc.DocumentNode;
var divNodes = root.Descendants("div").ToList();
foreach (var item in divNodes)
{
string className = item.GetAttributeValue("class", null);
if (className == "toclevel2")
{
string href = item.FirstChild.NextSibling.GetAttributeValue("href", null);
string name = item.FirstChild.NextSibling.GetAttributeValue("title", null);
if (null != href && null != name)
{
if (name.IndexOf(" ") > -1)
name = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[0];
propertiesNode.Add(new XElement("Event", new XElement("Name", name), new XElement("Link", _rootAdress + href)));
func("");
}
}
}
}
}

#endregion

#region Parse Project

private static void ParseProjectTypes(XElement excelNode, LogAction func)
Expand Down Expand Up @@ -2023,7 +1778,6 @@ internal static XDocument ParseReference(LogAction func)
ParseOffice(document, func);
ParseOutlook(document, func);
ParsePowerPoint(document, func);
ParseVisio(document, func);
ParseWord(document, func);
func("Done!");

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

> NetOffice is a set of libraries for building Microsoft Office Addins and automation of Microsoft Office applications.
Use NetOffice to extend and automate Microsoft Office applications: Excel, Word, Outlook, PowerPoint, Access and Visio.
Use NetOffice to extend and automate Microsoft Office applications: Excel, Word, Outlook, PowerPoint and Access.

:rotating_light: **Notice**: Use official packages with [__NetOfficeFw.*__ prefix](https://www.nuget.org/packages?q=NetOfficeFw). Using old 1.7.4 packages? [Learn how to migrate.](https://netoffice.io/migrate-notice/)

Expand Down
5 changes: 2 additions & 3 deletions RegAddin/RegAddin/Common/AddinRegAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RegAddin.Common
{
internal class AddinRegAnalyzer
{
public static string[] _multiRegisterIn = new string[] { "Excel", "Word", "Outlook", "PowerPoint", "Access", "Visio" };
public static string[] _multiRegisterIn = new string[] { "Excel", "Word", "Outlook", "PowerPoint", "Access" };

private static string _systemObject = "System.Object";

Expand All @@ -26,10 +26,9 @@ internal class AddinRegAnalyzer
"NetOffice.OutlookApi.Tools.COMAddin",
"NetOffice.PowerPointApi.Tools.COMAddin",
"NetOffice.AccessApi.Tools.COMAddin",
"NetOffice.VisioApi.Tools.COMAddin",
"NetOffice.OfficeApi.Tools.COMAddin"};

private static string[] _classKeys = new string[] { "Excel", "Word", "Outlook", "PowerPoint", "Access", "Visio"};
private static string[] _classKeys = new string[] { "Excel", "Word", "Outlook", "PowerPoint", "Access" };

private static string _multiClassName = "NetOffice.OfficeApi.Tools.COMAddin";

Expand Down
5 changes: 2 additions & 3 deletions RegAddin/RegAddin/RegFile/RegFileOperationHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private void WriteRegistryContentToLocalFileSystem(List<string> contentTable)
File.AppendAllText(Settings.RegFilePath, fullContent.ToString(), Encoding.Unicode);
}

public static string[] _multiRegisterIn = new string[] { "Excel", "Word", "Outlook", "PowerPoint", "Access", "Visio" };
public static string[] _multiRegisterIn = new string[] { "Excel", "Word", "Outlook", "PowerPoint", "Access" };

private string CreateRegistryFileContent(Assembly addinAssembly, IEnumerable<object> assemblyAttributes, SingletonSettings.RegisterMode mode,
Type addinClassType, IEnumerable<object> addinClassAttributes)
Expand Down Expand Up @@ -325,7 +325,6 @@ private string CreateRegistryFileContent(Assembly addinAssembly, IEnumerable<obj
"NetOffice.OutlookApi.Tools.COMAddin",
"NetOffice.PowerPointApi.Tools.COMAddin",
"NetOffice.AccessApi.Tools.COMAddin",
"NetOffice.VisioApi.Tools.COMAddin",
"NetOffice.OfficeApi.Tools.COMAddin"};

private string GetKeyName(Type addin)
Expand All @@ -350,7 +349,7 @@ private string GetKeyName(Type addin)
return _classKeys[index];
}

private static string[] _classKeys = new string[] { "Excel", "Word", "Outlook", "PowerPoint", "Access", "Visio" };
private static string[] _classKeys = new string[] { "Excel", "Word", "Outlook", "PowerPoint", "Access" };

private static string _officeRelatedKey = "Software\\Microsoft\\Office\\{0}\\Addins";

Expand Down
1 change: 0 additions & 1 deletion Source/ClientApplication/ClientApplication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<ProjectReference Include="..\PowerPoint\PowerPointApi.csproj" />
<ProjectReference Include="..\Publisher\PublisherApi.csproj" />
<ProjectReference Include="..\VBIDE\VBIDEApi.csproj" />
<ProjectReference Include="..\Visio\VisioApi.csproj" />
<ProjectReference Include="..\Word\WordApi.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 0 additions & 6 deletions Source/NetOffice.sln
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSComctlLibApi", "MSComctlL
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSDATASRCApi", "MSDATASRC\MSDATASRCApi.csproj", "{9D83E8F2-4EFD-4A2E-88CE-9F5943620DB6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisioApi", "Visio\VisioApi.csproj", "{581B0DB6-8146-4729-9AE6-61B27F53B3E6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PublisherApi", "Publisher\PublisherApi.csproj", "{044A2BC3-7F84-4BEC-8B99-9E3432FAD88E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetOffice.Tests", "NetOffice.Tests\NetOffice.Tests.csproj", "{67372CD1-E220-44DA-AB36-F489A593923C}"
Expand Down Expand Up @@ -112,10 +110,6 @@ Global
{9D83E8F2-4EFD-4A2E-88CE-9F5943620DB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D83E8F2-4EFD-4A2E-88CE-9F5943620DB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D83E8F2-4EFD-4A2E-88CE-9F5943620DB6}.Release|Any CPU.Build.0 = Release|Any CPU
{581B0DB6-8146-4729-9AE6-61B27F53B3E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{581B0DB6-8146-4729-9AE6-61B27F53B3E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{581B0DB6-8146-4729-9AE6-61B27F53B3E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{581B0DB6-8146-4729-9AE6-61B27F53B3E6}.Release|Any CPU.Build.0 = Release|Any CPU
{044A2BC3-7F84-4BEC-8B99-9E3432FAD88E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{044A2BC3-7F84-4BEC-8B99-9E3432FAD88E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{044A2BC3-7F84-4BEC-8B99-9E3432FAD88E}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
1 change: 0 additions & 1 deletion Source/NetOffice/Factory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public static void Initialize()
TryLoadAssembly("OutlookApi.dll");
TryLoadAssembly("PowerPointApi.dll");
TryLoadAssembly("AccessApi.dll");
TryLoadAssembly("VisioApi.dll");

if (!_assemblyResolveEventConnected)
{
Expand Down
1 change: 0 additions & 1 deletion Source/NetOffice/KeyTokens.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ OutlookApi, Version=1.8.1.0, Culture=neutral, PublicKeyToken=b118031aaa1097f3
OWC10Api, Version=1.8.1.0, Culture=neutral, PublicKeyToken=a2b945645f1c78b9
PowerPointApi, Version=1.8.1.0, Culture=neutral, PublicKeyToken=f3aefb8851e52dd2
VBIDEApi, Version=1.8.1.0, Culture=neutral, PublicKeyToken=931cec8882205047
VisioApi, Version=1.8.1.0, Culture=neutral, PublicKeyToken=bfcd37a3a83f1609
WordApi, Version=1.8.1.0, Culture=neutral, PublicKeyToken=f66d74591aaf8089
PublisherApi, Version=1.8.1.0, Culture=neutral, PublicKeyToken=2133a4c2cfc56bf6
IExcelApi, Version=1.8.1.0, Culture=neutral, PublicKeyToken=c507a5667bd1b6bd
2 changes: 1 addition & 1 deletion Source/NetOffice/Loader/CurrentAppDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class CurrentAppDomain
private static readonly string[] _assemblyNames = new string[] {
"OfficeApi.dll", "ExcelApi.dll", "WordApi.dll",
"OutlookApi.dll", "PowerPointApi.dll", "AccessApi.dll",
"VisioApi.dll", "PublisherApi.dll",
"PublisherApi.dll",
"VBIDEApi.dll"
};
#endregion
Expand Down
Loading

0 comments on commit c51f6de

Please sign in to comment.