Skip to content

Commit

Permalink
Add management of a solution #582
Browse files Browse the repository at this point in the history
- dded a placeholder and serialization stuff
  • Loading branch information
mpostol committed Apr 27, 2021
1 parent 09ef6da commit 72719f6
Show file tree
Hide file tree
Showing 7 changed files with 288 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>UAOOI.SemanticData.SolutionConfiguration</AssemblyName>
<RootNamespace>UAOOI.SemanticData.SolutionConfiguration</RootNamespace>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:: convert the scheme DomainDescriptor.xsd to cs code
xsd.exe UAModelDesignerSolution.xsd /N:UAOOI.SemanticData.SolutionConfiguration.Serialization /c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xsd.exe ..\bin\Debug\UAOOI.SemanticData.SolutionConfiguration.dll /t:UAOOI.SemanticData.SolutionConfiguration.Serialization.UAModelDesignerSolution
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//__________________________________________________________________________________________________
//
// Copyright (C) 2021, Mariusz Postol LODZ POLAND.
//
// To be in touch join the community at GitHub: https://github.com/mpostol/OPC-UA-OOI/discussions
//__________________________________________________________________________________________________

using System;
using System.IO;
using System.Runtime.Serialization;

namespace UAOOI.SemanticData.SolutionConfiguration.Serialization
{
/// <summary>
/// Class UAModelDesignerSolution.
/// </summary>
public partial class UAModelDesignerSolution
{
/// <summary>
/// Creates an empty solution model.
/// </summary>
/// <returns>UAModelDesignerSolution.</returns>
internal static UAModelDesignerSolution CreateEmptyModel(string solutionName)
{
return new UAModelDesignerSolution()
{
Name = solutionName,
Projects = new UAModelDesignerProject[] { },
ServerDetails = UAModelDesignerSolutionServerDetails.CreateEmptyInstance()
};
}

[OnDeserialized()]
public void OnDeserialized(StreamingContext context)
{
ServerDetails = ServerDetails ?? UAModelDesignerSolutionServerDetails.CreateEmptyInstance();
}
}

/// <summary>
/// Class UAModelDesignerSolutionServerDetails - encapsulates details about the associated server configuration
/// </summary>
public partial class UAModelDesignerSolutionServerDetails
{
internal static UAModelDesignerSolutionServerDetails CreateEmptyInstance()
{
return new UAModelDesignerSolutionServerDetails() { codebase = string.Empty, configuration = string.Empty };
}
}

internal enum ResourceEntries { Token_ProjectFileName, DefaultCSVFileName, Project_FileDialogDefaultExt };

public partial class UAModelDesignerProject
{
internal static UAModelDesignerProject CreateEmpty(string name, Func<ResourceEntries, string> resource)
{
return new UAModelDesignerProject()
{
buildOutputDirectoryNameField = resource(ResourceEntries.Token_ProjectFileName),
cSVFileNameField = resource(ResourceEntries.DefaultCSVFileName),
fileNameField = Path.ChangeExtension(resource(ResourceEntries.Token_ProjectFileName), resource(ResourceEntries.Project_FileDialogDefaultExt)),
nameField = name,
ProjectIdentifier = Guid.NewGuid().ToString(),
};
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

//
// This source code was auto-generated by xsd, Version=4.6.1055.0.
//
namespace UAOOI.SemanticData.SolutionConfiguration.Serialization
{
using System.Xml.Serialization;


/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public partial class UAModelDesignerSolution {

private string nameField;

private UAModelDesignerProject[] projectsField;

private UAModelDesignerSolutionServerDetails serverDetailsField;

/// <remarks/>
public string Name {
get {
return this.nameField;
}
set {
this.nameField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("UAModelDesignerProject", IsNullable=false)]
public UAModelDesignerProject[] Projects {
get {
return this.projectsField;
}
set {
this.projectsField = value;
}
}

/// <remarks/>
public UAModelDesignerSolutionServerDetails ServerDetails {
get {
return this.serverDetailsField;
}
set {
this.serverDetailsField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName = "UAModelDesignerProject", AnonymousType=false)]
public partial class UAModelDesignerProject {

private string nameField;

private string cSVFileNameField;

private string buildOutputDirectoryNameField;

private string fileNameField;

private string projectIdentifierField;

/// <remarks/>
public string Name {
get {
return this.nameField;
}
set {
this.nameField = value;
}
}

/// <remarks/>
public string CSVFileName {
get {
return this.cSVFileNameField;
}
set {
this.cSVFileNameField = value;
}
}

/// <remarks/>
public string BuildOutputDirectoryName {
get {
return this.buildOutputDirectoryNameField;
}
set {
this.buildOutputDirectoryNameField = value;
}
}

/// <remarks/>
public string FileName {
get {
return this.fileNameField;
}
set {
this.fileNameField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string ProjectIdentifier {
get {
return this.projectIdentifierField;
}
set {
this.projectIdentifierField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class UAModelDesignerSolutionServerDetails {

private string codebaseField;

private string configurationField;

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string codebase {
get {
return this.codebaseField;
}
set {
this.codebaseField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string configuration {
get {
return this.configurationField;
}
set {
this.configurationField = value;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="UAModelDesignerSolution">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Name" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="Projects" type="ArrayOfUAModelDesignerProject" />
<xs:element minOccurs="0" maxOccurs="1" name="ServerDetails">
<xs:complexType>
<xs:attribute name="codebase" type="xs:string" />
<xs:attribute name="configuration" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="ArrayOfUAModelDesignerProject">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="UAModelDesignerProject">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Name" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="CSVFileName" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="BuildOutputDirectoryName" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="FileName" type="xs:string" />
</xs:sequence>
<xs:attribute name="ProjectIdentifier" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
7 changes: 7 additions & 0 deletions UAObjectOrientedInternet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Networking.DataLogger", "Ne
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Networking.DataLogger.UnitTest", "Networking\DataRepository\DataLogger.UnitTest\Networking.DataLogger.UnitTest.csproj", "{45BE72F2-3F5B-4D13-B931-0CA62F404D4C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SemanticData..SolutionConfiguration", "SemanticData\SolutionConfiguration\SemanticData..SolutionConfiguration.csproj", "{F0A5F968-A9E6-4B81-B5BB-DC05999467BA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -294,6 +296,10 @@ Global
{45BE72F2-3F5B-4D13-B931-0CA62F404D4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{45BE72F2-3F5B-4D13-B931-0CA62F404D4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{45BE72F2-3F5B-4D13-B931-0CA62F404D4C}.Release|Any CPU.Build.0 = Release|Any CPU
{F0A5F968-A9E6-4B81-B5BB-DC05999467BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0A5F968-A9E6-4B81-B5BB-DC05999467BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0A5F968-A9E6-4B81-B5BB-DC05999467BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0A5F968-A9E6-4B81-B5BB-DC05999467BA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -341,6 +347,7 @@ Global
{F7FDDDCC-58C7-44E0-8DE3-6A94E6222D03} = {20139208-1830-4DF2-A158-0C505DC05DF7}
{3781B8CA-3128-45DC-89C9-981740357630} = {20139208-1830-4DF2-A158-0C505DC05DF7}
{45BE72F2-3F5B-4D13-B931-0CA62F404D4C} = {20139208-1830-4DF2-A158-0C505DC05DF7}
{F0A5F968-A9E6-4B81-B5BB-DC05999467BA} = {AF01F501-9B19-4357-B8A7-4EFC782BF1AF}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9388D93E-9AA9-40EE-A0C6-F096265079B2}
Expand Down

0 comments on commit 72719f6

Please sign in to comment.