Split into smaller projects, now uses plugins.

This commit is contained in:
Tiberiu Chibici 2014-08-12 16:33:13 +03:00
parent 69913fa251
commit b8c8f2a1b0
80 changed files with 1520 additions and 494 deletions

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Documents.DocumentEditorFeatures
namespace RainmeterStudio.Core.Documents.DocumentEditorFeatures
{
public interface ICustomDocumentTitleProvider
{

View File

@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Documents.DocumentEditorFeatures
namespace RainmeterStudio.Core.Documents.DocumentEditorFeatures
{
interface ISelectionPropertiesProvider
{

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Documents.DocumentEditorFeatures
namespace RainmeterStudio.Core.Documents.DocumentEditorFeatures
{
public interface IToolboxProvider
{

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Documents.DocumentEditorFeatures
namespace RainmeterStudio.Core.Documents.DocumentEditorFeatures
{
public interface IUndoSupport
{

View File

@ -1,5 +1,6 @@
using RainmeterStudio.Model;
namespace RainmeterStudio.Documents
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Core.Documents
{
/// <summary>
/// Represents a document template

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Core.Documents
{
/// <summary>
/// A document editor
/// </summary>
public interface IDocumentEditor
{
/// <summary>
/// Gets the document attached to this editor instance
/// </summary>
IDocument AttachedDocument { get; }
/// <summary>
/// Gets the UI control to display for this editor
/// </summary>
UIElement EditorUI { get; }
}
}

View File

@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Documents
namespace RainmeterStudio.Core.Documents
{
public interface IDocumentEditorFactory
{

View File

@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Documents;
using RainmeterStudio.Core.Documents;
namespace RainmeterStudio.Model.Events
namespace RainmeterStudio.Core.Model.Events
{
public abstract class DocumentEventArgsBase : EventArgs
{

View File

@ -4,7 +4,7 @@ using System.ComponentModel;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Model
namespace RainmeterStudio.Core.Model
{
public interface IDocument : INotifyPropertyChanged
{

View File

@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using RainmeterStudio.Storage;
using RainmeterStudio.Core.Storage;
namespace RainmeterStudio.Model
namespace RainmeterStudio.Core.Model
{
/// <summary>
/// Defines a Rainmeter Studio project

View File

@ -0,0 +1,254 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Core.Model
{
public interface IProperty : INotifyPropertyChanged
{
/// <summary>
/// Gets the name of the property
/// </summary>
string Name { get; }
/// <summary>
/// Gets or sets the value of the property
/// </summary>
object Value { get; set; }
/// <summary>
/// Gets the data type of the property
/// </summary>
Type Type { get; }
/// <summary>
/// Gets the children of this property
/// </summary>
ObservableCollection<IProperty> Children { get; }
}
/// <summary>
/// Represents a property
/// </summary>
public class Property : IProperty
{
#region Name property
/// <summary>
/// Gets the name of the property
/// </summary>
public virtual string Name { get; private set; }
#endregion
#region Value property
private object _value;
/// <summary>
/// Gets or sets the value of the property
/// </summary>
public virtual object Value
{
get
{
return _value;
}
set
{
// Test if type changed
bool typeChanged = (_value.GetType() != value.GetType());
// Set value
_value = value;
// Trigger event
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("Value"));
if (typeChanged)
PropertyChanged(this, new PropertyChangedEventArgs("Type"));
}
}
}
#endregion
#region Type property
/// <summary>
/// Gets the type of the property
/// </summary>
public virtual Type Type
{
get
{
return Value.GetType();
}
}
#endregion
#region Children property
/// <summary>
/// Gets the children of this property
/// </summary>
public ObservableCollection<IProperty> Children { get; private set; }
#endregion
#region Property changed event
/// <summary>
/// Triggered when a property changes
/// </summary>
public virtual event PropertyChangedEventHandler PropertyChanged;
#endregion
#region Constructors
/// <summary>
/// Initializes this property
/// </summary>
/// <param name="name">Name of the property</param>
public Property(string name)
{
Name = name;
Value = null;
Children = new ObservableCollection<IProperty>();
}
/// <summary>
/// Initializes this property
/// </summary>
/// <param name="name">Name of the property</param>
/// <param name="value">Value of the property</param>
public Property(string name, object value)
{
Name = name;
Value = value;
Children = new ObservableCollection<IProperty>();
}
#endregion
}
namespace Generic
{
/// <summary>
/// Generic property
/// </summary>
/// <typeparam name="T">Type of property</typeparam>
public class Property<T> : IProperty
{
#region Value property
private T _value;
/// <summary>
/// Gets or sets the value of this property
/// </summary>
public T Value
{
get
{
return _value;
}
set
{
// Set value
_value = value;
// Trigger event
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("Value"));
}
}
/// <summary>
/// Gets or sets the value of this property. Overriden from the generic property.
/// </summary>
/// <exception cref="InvalidCastException">Thrown if value is not of the right type.</exception>
object IProperty.Value
{
get
{
return _value;
}
set
{
this.Value = (T)value;
}
}
#endregion
#region Type property
/// <summary>
/// Gets the type of this property
/// </summary>
public Type Type
{
get
{
return typeof(T);
}
}
#endregion
#region Property changed event
/// <summary>
/// Triggered when a property changes
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
#endregion
#region Constructors
/// <summary>
/// Initializes this property
/// </summary>
/// <param name="name">Name of the property</param>
public Property(string name)
{
Name = name;
Value = default(T);
Children = new ObservableCollection<IProperty>();
}
/// <summary>
/// Initializes this property
/// </summary>
/// <param name="name">Name of the property</param>
/// <param name="value">Value of the property</param>
public Property(string name, T value)
{
Name = name;
Value = value;
Children = new ObservableCollection<IProperty>();
}
#endregion
/// <summary>
/// Gets the name of the property
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Gets the children of this property
/// </summary>
public ObservableCollection<IProperty> Children { get; private set; }
}
}
}

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace RainmeterStudio.Model
namespace RainmeterStudio.Core.Model
{
/// <summary>
/// Reference to a file or folder

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace RainmeterStudio.Model
namespace RainmeterStudio.Core.Model
{
public class Tree<T> : IList<Tree<T>>
{

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Core
{
/// <summary>
/// Exports a class
/// </summary>
/// <remarks>
/// This attribute should be used to export factories, templates etc.
/// If not used, these will have to be manually exported.
/// The class marked with this flag must have a default constructor!
/// </remarks>
[AttributeUsage(AttributeTargets.Class)]
public class PluginExportAttribute : Attribute
{
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RainmeterStudio.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RainmeterStudio.Core")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2a3ee1f8-6844-43d8-8af5-b3e1173462c2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1D2A4896-AF31-4E82-A84F-4E218067701F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RainmeterStudio.Core</RootNamespace>
<AssemblyName>RainmeterStudio.Core</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="PluginExportAttribute.cs" />
<Compile Include="Documents\DocumentEditorFeatures\ICustomDocumentTitleProvider.cs" />
<Compile Include="Documents\DocumentEditorFeatures\ISelectionPropertiesProvider.cs" />
<Compile Include="Documents\DocumentEditorFeatures\IToolboxProvider.cs" />
<Compile Include="Documents\DocumentEditorFeatures\IUndoSupport.cs" />
<Compile Include="Documents\DocumentTemplate.cs" />
<Compile Include="Documents\IDocumentEditor.cs" />
<Compile Include="Documents\IDocumentEditorFactory.cs" />
<Compile Include="Storage\IDocumentStorage.cs" />
<Compile Include="Model\Events\DocumentOpenedEventArgs.cs" />
<Compile Include="Model\IDocument.cs" />
<Compile Include="Model\Project.cs" />
<Compile Include="Model\Property.cs" />
<Compile Include="Model\Reference.cs" />
<Compile Include="Model\Tree.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Storage\SerializableTree.cs" />
<Compile Include="Utils\DirectoryHelper.cs" />
<Compile Include="Utils\LinqExtension.cs" />
<Compile Include="Utils\TreeExtensions.cs" />
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Documents
namespace RainmeterStudio.Core.Storage
{
public interface IDocumentStorage
{

View File

@ -4,9 +4,9 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Storage
namespace RainmeterStudio.Core.Storage
{
/// <summary>
/// A special type of tree that implements a very small subset of tree operations, and can be serialized

View File

@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Utils
namespace RainmeterStudio.Core.Utils
{
public static class DirectoryHelper
{

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Utils
namespace RainmeterStudio.Core.Utils
{
/// <summary>
/// Linq extensions

View File

@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Utils
namespace RainmeterStudio.Core.Utils
{
/// <summary>
/// Extension methods for trees

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RainmeterStudio.SkinDesigner")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RainmeterStudio.SkinDesigner")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d4aa7c80-76e6-484d-8766-7cd75f6d9e18")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E8BD25E9-3055-4688-9E83-ECF684EF30C6}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RainmeterStudio.SkinDesignerPlugin</RootNamespace>
<AssemblyName>RainmeterStudio.SkinDesignerPlugin</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\Plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\Plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SkinDesigner.cs" />
<Compile Include="SkinDesignerControl.xaml.cs">
<DependentUpon>SkinDesignerControl.xaml</DependentUpon>
</Compile>
<Compile Include="SkinDesignerFactory.cs" />
<Compile Include="SkinDocument.cs" />
<Compile Include="SkinMetadata.cs" />
<Compile Include="SkinStorage.cs" />
<Compile Include="SkinTemplate.cs" />
</ItemGroup>
<ItemGroup>
<Page Include="SkinDesignerControl.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RainmeterStudio.Core\RainmeterStudio.Core.csproj">
<Project>{1d2a4896-af31-4e82-a84f-4e218067701f}</Project>
<Name>RainmeterStudio.Core</Name>
</ProjectReference>
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.SkinDesignerPlugin
{
/// <summary>
/// Skin designer document editor
/// </summary>
public class SkinDesigner : IDocumentEditor
{
/// <summary>
/// Gets the document attached to this editor instance
/// </summary>
public SkinDocument AttachedDocument { get; private set; }
/// <summary>
/// Gets the document attached to this editor instance
/// </summary>
IDocument IDocumentEditor.AttachedDocument
{
get { return AttachedDocument; }
}
/// <summary>
/// Gets the UI control to display for this editor
/// </summary>
public SkinDesignerControl EditorUI { get; private set; }
/// <summary>
/// Gets the UI control to display for this editor
/// </summary>
UIElement IDocumentEditor.EditorUI
{
get { return EditorUI; }
}
/// <summary>
/// Initializes this editor
/// </summary>
/// <param name="document">The document</param>
public SkinDesigner(SkinDocument document)
{
AttachedDocument = document;
}
}
}

View File

@ -0,0 +1,13 @@
<Page x:Class="RainmeterStudio.SkinDesignerPlugin.SkinDesignerControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="SkinDesignerControl">
<Grid>
</Grid>
</Page>

View File

@ -12,14 +12,14 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace RainmeterStudio.Documents.Ini
namespace RainmeterStudio.SkinDesignerPlugin
{
/// <summary>
/// Interaction logic for IniSkinDesignerControl.xaml
/// Interaction logic for SkinDesignerControl.xaml
/// </summary>
public partial class IniSkinDesignerControl : UserControl
public partial class SkinDesignerControl : Page
{
public IniSkinDesignerControl()
public SkinDesignerControl()
{
InitializeComponent();
}

View File

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Core;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.SkinDesignerPlugin
{
/// <summary>
/// Skin designer factory
/// </summary>
[PluginExport]
public class SkinDesignerFactory : IDocumentEditorFactory
{
/// <summary>
/// Creates a new editor object
/// </summary>
/// <param name="document">Document to be edited by the editor</param>
/// <returns>A new document editor</returns>
public IDocumentEditor CreateEditor(IDocument document)
{
return new SkinDesigner(document as SkinDocument);
}
/// <summary>
/// Tests if this editor can edit this document type
/// </summary>
/// <param name="type">Document type</param>
/// <returns>True if the editor can edit the document type</returns>
public bool CanEdit(Type type)
{
return (type == typeof(SkinDocument));
}
}
}

View File

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.SkinDesignerPlugin
{
/// <summary>
/// Skin document
/// </summary>
public class SkinDocument : IDocument
{
private Reference _reference;
public Reference Reference
{
get
{
return _reference;
}
set
{
_reference = value;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("Reference"));
}
}
public bool IsDirty { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
public SkinMetadata Metadata { get; private set; }
/// <summary>
/// Initializes this skin document
/// </summary>
public SkinDocument()
{
IsDirty = false;
Metadata = new SkinMetadata();
}
}
}

View File

@ -0,0 +1,57 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Core.Model;
using RainmeterStudio.Core.Model.Generic;
namespace RainmeterStudio.SkinDesignerPlugin
{
public class SkinMetadata : Property
{
/// <summary>
/// Gets a property indicating the name of the skin
/// </summary>
public Property<string> SkinName { get; private set; }
/// <summary>
/// Gets a property indicating the author of the skin
/// </summary>
public Property<string> Author { get; private set; }
/// <summary>
/// Gets a property containing information about this skin (credits, usage instructions, setup etc)
/// </summary>
public Property<string> Information { get; private set; }
/// <summary>
/// Gets a property indicating the version of this skin
/// </summary>
public Property<Version> Version { get; private set; }
/// <summary>
/// Gets a property containing licensing information
/// </summary>
public Property<string> License { get; private set; }
/// <summary>
/// Initializes this metadata property
/// </summary>
public SkinMetadata() :
base("Metadata")
{
SkinName = new Property<string>("Name");
Author = new Property<string>("Author");
Information = new Property<string>("Information");
Version = new Property<Version>("Version");
License = new Property<string>("License");
Children.Add(SkinName);
Children.Add(Author);
Children.Add(Information);
Children.Add(Version);
Children.Add(License);
}
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Core.Model;
using RainmeterStudio.Core.Storage;
namespace RainmeterStudio.SkinDesignerPlugin
{
public class SkinStorage : IDocumentStorage
{
public IDocument Read(string path)
{
throw new NotImplementedException();
}
public void Write(string path, IDocument document)
{
throw new NotImplementedException();
}
public bool CanRead(string path)
{
throw new NotImplementedException();
}
public bool CanWrite(Type documentType)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.SkinDesignerPlugin
{
/// <summary>
/// Template of a skin which will be opened in the designer
/// </summary>
public class SkinTemplate : DocumentTemplate
{
/// <summary>
/// Initializes this skin template
/// </summary>
public SkinTemplate()
: base("Skin", "ini")
{
}
/// <summary>
/// Creates a new document using this template
/// </summary>
/// <returns>Newly created document</returns>
public override IDocument CreateDocument()
{
return new SkinDocument();
}
}
}

View File

@ -61,6 +61,10 @@
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RainmeterStudio.Core\RainmeterStudio.Core.csproj">
<Project>{1d2a4896-af31-4e82-a84f-4e218067701f}</Project>
<Name>RainmeterStudio.Core</Name>
</ProjectReference>
<ProjectReference Include="..\RainmeterStudio\RainmeterStudio.csproj">
<Project>{438d0136-4a27-4e4d-a617-fface4554236}</Project>
<Name>RainmeterStudio</Name>

View File

@ -4,8 +4,8 @@ using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RainmeterStudio.Storage;
using RainmeterStudio.Model;
using System.IO;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Tests.Storage
{

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RainmeterStudio.TextEditor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RainmeterStudio.TextEditor")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("61e147ab-2bdd-4f7a-a610-60617d7e31d3")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9A644478-2F1B-4145-8B31-6F8DBD42EC38}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RainmeterStudio.TextEditorPlugin</RootNamespace>
<AssemblyName>RainmeterStudio.TextEditorPlugin</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\Plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\Plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TextDocument.cs" />
<Compile Include="TextDocumentTemplate.cs" />
<Compile Include="TextEditor.cs" />
<Compile Include="TextEditorControl.xaml.cs">
<DependentUpon>TextEditorControl.xaml</DependentUpon>
</Compile>
<Compile Include="TextEditorFactory.cs" />
<Compile Include="TextStorage.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RainmeterStudio.Core\RainmeterStudio.Core.csproj">
<Project>{1d2a4896-af31-4e82-a84f-4e218067701f}</Project>
<Name>RainmeterStudio.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="TextEditorControl.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -3,10 +3,10 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
using System.ComponentModel;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Documents.Text
namespace RainmeterStudio.TextEditorPlugin
{
public class TextDocument : IDocument
{

View File

@ -2,14 +2,16 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
using RainmeterStudio.Core;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Documents.Text
namespace RainmeterStudio.TextEditorPlugin
{
/// <summary>
/// A blank text document template
/// </summary>
[AutoRegister]
[PluginExport]
public class TextDocumentTemplate : DocumentTemplate
{
public TextDocumentTemplate()

View File

@ -3,9 +3,10 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Documents.Text
namespace RainmeterStudio.TextEditorPlugin
{
public class TextEditor : IDocumentEditor
{

View File

@ -1,4 +1,4 @@
<UserControl x:Class="RainmeterStudio.Documents.Text.TextEditorControl"
<UserControl x:Class="RainmeterStudio.TextEditorPlugin.TextEditorControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

View File

@ -12,7 +12,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace RainmeterStudio.Documents.Text
namespace RainmeterStudio.TextEditorPlugin
{
/// <summary>
/// Interaction logic for TextEditorControl.xaml

View File

@ -3,12 +3,13 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using RainmeterStudio.Business;
using RainmeterStudio.Model;
using RainmeterStudio.Core;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Documents.Text
namespace RainmeterStudio.TextEditorPlugin
{
[AutoRegister]
[PluginExport]
public class TextEditorFactory : IDocumentEditorFactory
{
public IDocumentEditor CreateEditor(IDocument document)

View File

@ -1,13 +1,15 @@
using System;
using System.IO;
using RainmeterStudio.Model;
using RainmeterStudio.Core;
using RainmeterStudio.Core.Model;
using RainmeterStudio.Core.Storage;
namespace RainmeterStudio.Documents.Text
namespace RainmeterStudio.TextEditorPlugin
{
/// <summary>
/// Storage for text files
/// </summary>
[AutoRegister]
[PluginExport]
public class TextStorage : IDocumentStorage
{
/// <inheritdoc />

View File

@ -7,11 +7,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "Common\Common.vcx
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Installer", "Installer\Installer.vcxproj", "{2FCFBFD2-2720-4BDD-B620-4BDD3DBB8D3D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Language", "Language\Language.vcxproj", "{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Library", "Library\Library.vcxproj", "{BE9D2400-7F1C-49D6-8498-5CE495491AD6}"
ProjectSection(ProjectDependencies) = postProject
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A} = {6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}
{19312085-AA51-4BD6-BE92-4B6098CCA539} = {19312085-AA51-4BD6-BE92-4B6098CCA539}
{BC25C5DC-AEFB-49F9-8188-3C1B8C8929E6} = {BC25C5DC-AEFB-49F9-8188-3C1B8C8929E6}
{6D61FBE9-6913-4885-A95D-1A8C0C223D82} = {6D61FBE9-6913-4885-A95D-1A8C0C223D82}
@ -76,6 +73,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RainmeterStudio", "Rainmete
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RainmeterStudio.Tests", "RainmeterStudio.Tests\RainmeterStudio.Tests.csproj", "{845F4BD4-6822-4D92-9DDB-15FD18A47E5A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RainmeterStudio.SkinDesignerPlugin", "RainmeterStudio.SkinDesigner\RainmeterStudio.SkinDesignerPlugin.csproj", "{E8BD25E9-3055-4688-9E83-ECF684EF30C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RainmeterStudio.Core", "RainmeterStudio.Core\RainmeterStudio.Core.csproj", "{1D2A4896-AF31-4E82-A84F-4E218067701F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RainmeterStudio.TextEditorPlugin", "RainmeterStudio.TextEditor\RainmeterStudio.TextEditorPlugin.csproj", "{9A644478-2F1B-4145-8B31-6F8DBD42EC38}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8469BE7E-BCDB-4AA8-9541-719E8BFB19A7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{4CCE6052-F43E-4360-B3E2-C046C6C0D86C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RainmeterPlugins", "RainmeterPlugins", "{53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -112,20 +121,6 @@ Global
{2FCFBFD2-2720-4BDD-B620-4BDD3DBB8D3D}.Release|Mixed Platforms.Build.0 = Release|Win32
{2FCFBFD2-2720-4BDD-B620-4BDD3DBB8D3D}.Release|Win32.ActiveCfg = Release|Win32
{2FCFBFD2-2720-4BDD-B620-4BDD3DBB8D3D}.Release|x64.ActiveCfg = Release|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Debug|Any CPU.ActiveCfg = Debug|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Debug|Win32.ActiveCfg = Debug|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Debug|Win32.Build.0 = Debug|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Debug|x64.ActiveCfg = Debug|x64
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Debug|x64.Build.0 = Debug|x64
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Release|Any CPU.ActiveCfg = Release|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Release|Mixed Platforms.Build.0 = Release|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Release|Win32.ActiveCfg = Release|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Release|Win32.Build.0 = Release|Win32
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Release|x64.ActiveCfg = Release|x64
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}.Release|x64.Build.0 = Release|x64
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Debug|Any CPU.ActiveCfg = Debug|Win32
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Debug|Mixed Platforms.Build.0 = Debug|Win32
@ -528,8 +523,71 @@ Global
{845F4BD4-6822-4D92-9DDB-15FD18A47E5A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{845F4BD4-6822-4D92-9DDB-15FD18A47E5A}.Release|Win32.ActiveCfg = Release|Any CPU
{845F4BD4-6822-4D92-9DDB-15FD18A47E5A}.Release|x64.ActiveCfg = Release|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Debug|Win32.ActiveCfg = Debug|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Debug|x64.ActiveCfg = Debug|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Release|Any CPU.Build.0 = Release|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Release|Win32.ActiveCfg = Release|Any CPU
{E8BD25E9-3055-4688-9E83-ECF684EF30C6}.Release|x64.ActiveCfg = Release|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Debug|Win32.ActiveCfg = Debug|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Debug|x64.ActiveCfg = Debug|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Release|Any CPU.Build.0 = Release|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Release|Win32.ActiveCfg = Release|Any CPU
{1D2A4896-AF31-4E82-A84F-4E218067701F}.Release|x64.ActiveCfg = Release|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Debug|Win32.ActiveCfg = Debug|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Debug|x64.ActiveCfg = Debug|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Release|Any CPU.Build.0 = Release|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Release|Win32.ActiveCfg = Release|Any CPU
{9A644478-2F1B-4145-8B31-6F8DBD42EC38}.Release|x64.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{845F4BD4-6822-4D92-9DDB-15FD18A47E5A} = {8469BE7E-BCDB-4AA8-9541-719E8BFB19A7}
{E8BD25E9-3055-4688-9E83-ECF684EF30C6} = {4CCE6052-F43E-4360-B3E2-C046C6C0D86C}
{9A644478-2F1B-4145-8B31-6F8DBD42EC38} = {4CCE6052-F43E-4360-B3E2-C046C6C0D86C}
{EE8EC522-8430-4B46-86A3-D943D77F9E4B} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{F32FA418-8DF4-4E94-B92B-EBD502F5DC07} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{64FDEE97-6B7E-40E5-A489-ECA322825BC8} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{A221819D-4263-42AA-B22A-C022924842A7} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{2CFEC79A-E39E-4FFD-ABC2-C4A69DD1E44D} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{A2DD3CBE-B140-4892-A875-24107FA52518} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{EB48A04A-657E-41B8-B2F5-D47F8C30B2B4} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{C7FECFCD-E6C6-4F95-BB9A-E1762B043969} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{5344B52B-BAC3-479C-B41D-D465B8BDA1AD} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{C862B662-5CC6-4E79-B1B3-905E0B98D627} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{C30E7EB6-9655-4AF4-98AE-D6E6B14631AF} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{05203741-CD80-4060-8218-EC5D1120FE3E} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{C029E0CF-F203-41D0-9608-A3EA2CF0ED1F} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{4F8C4C09-431C-45C4-830B-32006E783C3A} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{17D3BD92-6F5D-438C-A89B-88F4CE06DB94} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{D10AB316-0F7A-4551-BE4F-385E04CCF1E8} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{6EBCA4DA-8CC7-42FE-8F45-878ABE165078} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{4640AB3A-5A8B-2DA0-980C-A70BCAB3A7F1} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{8B820B9F-C154-417C-A090-42198F2AF496} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{45A34285-56DD-4521-912B-3F884D36FA35} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{6D032D6B-7656-4743-B454-3388E2921EB0} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
{B9184DBA-C6B7-44FE-8BBD-0852DB22D2E4} = {53D952E0-CFD2-4EFF-BAD4-5969E760EFA1}
EndGlobalSection
EndGlobal

View File

@ -4,10 +4,10 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using RainmeterStudio.Documents;
using RainmeterStudio.Model;
using RainmeterStudio.Model.Events;
using RainmeterStudio.Utils;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Model;
using RainmeterStudio.Core.Model.Events;
using RainmeterStudio.Core.Storage;
namespace RainmeterStudio.Business
{
@ -67,61 +67,6 @@ namespace RainmeterStudio.Business
{
}
/// <summary>
/// Registers all classes with the auto register flag
/// </summary>
/// <remarks>We love linq</remarks>
public void PerformAutoRegister()
{
// Get all assemblies
AppDomain.CurrentDomain.GetAssemblies()
// Get all types
.SelectMany(assembly => assembly.GetTypes())
// Select only the classes
.Where(type => type.IsClass)
// That have the AutoRegister attribute
.Where(type => type.GetCustomAttributes(typeof(AutoRegisterAttribute), false).Length > 0)
// That implement any of the types that can be registered
.Where((type) =>
{
bool res = false;
res |= typeof(IDocumentEditorFactory).IsAssignableFrom(type);
res |= typeof(IDocumentStorage).IsAssignableFrom(type);
res |= typeof(DocumentTemplate).IsAssignableFrom(type);
return res;
})
// Obtain their default constructor
.Select(type => type.GetConstructor(new Type[0]))
// Invoke the default constructor
.Select(constructor => constructor.Invoke(new object[0]))
// Register
.ForEach(obj =>
{
// Try to register factory
var factory = obj as IDocumentEditorFactory;
if (factory != null)
RegisterEditorFactory(factory);
// Try to register as storage
var storage = obj as IDocumentStorage;
if (storage != null)
RegisterStorage(storage);
// Try to register as document template
var doctemplate = obj as DocumentTemplate;
if (doctemplate != null)
RegisterTemplate(doctemplate);
});
}
/// <summary>
/// Registers a document editor factory
/// </summary>

View File

@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using RainmeterStudio.Core;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Utils;
namespace RainmeterStudio.Business
{
/// <summary>
/// Manages RainmeterStudio plugins
/// </summary>
public class PluginManager
{
public delegate void RegisterMethod(object objectToRegister);
List<Assembly> _loadedPlugins = new List<Assembly>();
Dictionary<Type, RegisterMethod> _registerTypes = new Dictionary<Type,RegisterMethod>();
public PluginManager()
{
}
public void AddRegisterType(Type interfaceType, RegisterMethod method)
{
_registerTypes.Add(interfaceType, method);
}
public void LoadPlugins()
{
// Get "Plugins" folder path
var location = Assembly.GetExecutingAssembly().Location;
var pluginsPath = Path.Combine(Path.GetDirectoryName(location), "Plugins");
// Load all DLLs from "Plugins" folder
foreach (var file in Directory.EnumerateFiles(pluginsPath, "*.dll"))
LoadPlugin(file);
}
public void LoadPlugin(string file)
{
Assembly assembly = null;
// Try to load assembly
try
{
assembly = Assembly.LoadFile(file);
}
catch (Exception ex)
{
Debug.WriteLine("Failed to load assembly {0}: {1}", file, ex);
}
// Loaded, do initialization stuff
if (assembly != null)
{
_loadedPlugins.Add(assembly);
Initialize(assembly);
Debug.WriteLine("Loaded plugin: {0}", assembly.FullName);
}
}
private void Initialize(Assembly assembly)
{
// Register factories and stuff
assembly.GetTypes()
// Select only the classes
.Where(type => type.IsClass)
// That have the AutoRegister attribute
.Where(type => type.GetCustomAttributes(typeof(PluginExportAttribute), false).Length > 0)
// Perform register
.ForEach((type) =>
{
foreach (var pair in _registerTypes)
{
if (pair.Key.IsAssignableFrom(type))
{
var constructor = type.GetConstructor(new Type[0]);
var obj = constructor.Invoke(new object[0]);
pair.Value(obj);
}
}
});
}
public IEnumerable<Assembly> LoadedPlugins
{
get
{
return _loadedPlugins;
}
}
}
}

View File

@ -3,7 +3,8 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
using RainmeterStudio.Core.Storage;
using RainmeterStudio.Storage;
namespace RainmeterStudio.Business

View File

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using RainmeterStudio.Model;
namespace RainmeterStudio.Documents
{
public interface IDocumentEditor
{
IDocument AttachedDocument { get; }
UIElement EditorUI { get; }
}
}

View File

@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
namespace RainmeterStudio.Documents.Ini
{
/*public class IniDocument : IDocument
{
}*/
}

View File

@ -1,31 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
namespace RainmeterStudio.Documents.Ini
{
/*public class IniSkinDesigner : IDocumentEditor
{
public override IDocument Document
{
get { throw new NotImplementedException(); }
}
public override string Title
{
get { throw new NotImplementedException(); }
}
public override System.Windows.UIElement EditorUI
{
get { throw new NotImplementedException(); }
}
public override EventHandler SelectionChanged
{
get { throw new NotImplementedException(); }
}
}*/
}

View File

@ -1,11 +0,0 @@
<UserControl x:Class="RainmeterStudio.Documents.Ini.IniSkinDesignerControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
</Grid>
</UserControl>

View File

@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
namespace RainmeterStudio.Documents.Ini
{
/*public class IniSkinDesignerFactory : IDocumentEditorFactory
{
}*/
}

View File

@ -1,20 +0,0 @@
The MIT License (MIT)
Copyright (c) 2008 Ricardo Amores Hernández
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -5,7 +5,8 @@ using System.Reflection;
using System.Text;
using System.Windows;
using RainmeterStudio.Business;
using RainmeterStudio.Documents;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Storage;
using RainmeterStudio.Storage;
using RainmeterStudio.UI;
using RainmeterStudio.UI.Controller;
@ -21,12 +22,19 @@ namespace RainmeterStudio
SplashScreen splash = new SplashScreen("Resources/splash.png");
splash.Show(true);
// Initialize managers
// Initialize project manager
ProjectStorage projectStorage = new ProjectStorage();
ProjectManager projectManager = new ProjectManager(projectStorage);
// Initialize document manager
DocumentManager documentManager = new DocumentManager();
documentManager.PerformAutoRegister();
// Initialize plugin manager
PluginManager pluginManager = new PluginManager();
pluginManager.AddRegisterType(typeof(IDocumentStorage), obj => documentManager.RegisterStorage((IDocumentStorage)obj));
pluginManager.AddRegisterType(typeof(DocumentTemplate), obj => documentManager.RegisterTemplate((DocumentTemplate)obj));
pluginManager.AddRegisterType(typeof(IDocumentEditorFactory), obj => documentManager.RegisterEditorFactory((IDocumentEditorFactory)obj));
pluginManager.LoadPlugins();
// Create & run app
var uiManager = new UIManager(projectManager, documentManager);

View File

@ -1,52 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Model
{
public class Property : INotifyPropertyChanged
{
/// <summary>
/// Gets or sets the name of the property
/// </summary>
public string Name { get; private set; }
private object _value;
/// <summary>
/// Gets or sets the value of the property
/// </summary>
public object Value
{
get
{
return _value;
}
set
{
_value = value;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("Value"));
}
}
/// <summary>
/// Triggered when the value changes
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Initializes this property
/// </summary>
/// <param name="name">Name of the property</param>
/// <param name="value">Value of the property</param>
public Property(string name, object value = null)
{
Name = name;
Value = value;
}
}
}

View File

@ -7,7 +7,7 @@ using RainmeterStudio.Interop;
namespace RainmeterStudio
{
class Rainmeter
class RainmeterContext
{
#region Imports
@ -19,17 +19,17 @@ namespace RainmeterStudio
#endregion
private static Rainmeter _instance = null;
private static RainmeterContext _instance = null;
/// <summary>
/// Gets the single instance of this class
/// </summary>
public static Rainmeter Instance
public static RainmeterContext Instance
{
get
{
if (_instance == null)
_instance = new Rainmeter();
_instance = new RainmeterContext();
return _instance;
}
@ -39,7 +39,7 @@ namespace RainmeterStudio
#region Constructor, finalizer
private Rainmeter()
private RainmeterContext()
{
_handle = Rainmeter_Initialize();
@ -47,7 +47,7 @@ namespace RainmeterStudio
throw new Exception("Failed to initialize native library.");
}
~Rainmeter()
~RainmeterContext()
{
Rainmeter_Finalize(_handle);
}

View File

@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Documents
namespace RainmeterStudio.Rainmeter.DataTypes
{
public class AutoRegisterAttribute : Attribute
public class Action
{
}
}

View File

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Rainmeter.DataTypes
{
public abstract class Bang
{
/// <summary>
/// Argument info
/// </summary>
public class ArgumentInfo
{
public string Name { get; set; }
public Type DataType { get; set; }
public ArgumentInfo(string name, Type dataType)
{
Name = name;
DataType = dataType;
}
}
/// <summary>
/// Gets the function name of the bang
/// </summary>
public abstract string FunctionName { get; }
/// <summary>
/// Gets the list of arguments
/// </summary>
public abstract IEnumerable<ArgumentInfo> Arguments { get; }
/// <summary>
/// Executes the bang
/// </summary>
public void Execute(params object[] args)
{
}
/// <summary>
/// Gets the string representation of this bang
/// </summary>
/// <returns>String representation</returns>
public override string ToString()
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat("!{0}", FunctionName);
foreach (var arg in Arguments.Select(x => x.ToString()))
{
if (arg.Any(Char.IsWhiteSpace))
builder.AppendFormat(@" ""{0}""", arg);
else builder.AppendFormat(" {0}", arg);
}
return builder.ToString();
}
}
}

View File

@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace RainmeterStudio.Rainmeter
{
/// <summary>
/// Represents a group
/// </summary>
/// <remarks>
/// Skins, meters, and measures can be categorized into groups to allow
/// easier control with group bangs. For example, the !HideMeterGroup
/// bang may be used to hide multiple meters in a single bang (compared
/// to !HideMeter statements for each meter).
/// </remarks>
public abstract class Group
{
#region Imports
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern bool Group_BelongsToGroup(out bool result, Int32 handle, string group);
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern bool Group_Destroy(Int32 handle);
#endregion
/// <summary>
/// Gets or sets the associated handle of this object
/// </summary>
protected Int32 Handle { get; private set; }
/// <summary>
/// Tests if belongs to a group
/// </summary>
/// <param name="group">Group name</param>
/// <returns>True if belongs</returns>
public bool BelongsToGroup(string group)
{
bool result;
if (!Group_BelongsToGroup(out result, Handle, group))
throw new ExternalException("Belongs to group failed.");
return result;
}
/// <summary>
/// Initializes this group
/// </summary>
/// <param name="handle">The handle</param>
protected Group(Int32 handle)
{
Handle = handle;
}
/// <summary>
/// Finalizer
/// </summary>
~Group()
{
Group_Destroy(Handle);
}
}
}

View File

@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Model
namespace RainmeterStudio.Rainmeter
{
public class RainmeterConfig
public class Measure
{
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RainmeterStudio.Rainmeter
{
public abstract class Meter : Group
{
public Meter(int handle)
: base(handle)
{
}
}
}

View File

@ -0,0 +1,174 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace RainmeterStudio.Rainmeter
{
public abstract class Section : Group
{
#region Imports
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool Section_GetName(out string result, Int32 handle);
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool Section_GetOriginalName(out string result, Int32 handle);
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool Section_HasDynamicVariables(out bool result, Int32 handle);
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool Section_SetDynamicVariables(Int32 handle, bool value);
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool Section_ResetUpdateCounter(Int32 handle);
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool Section_GetUpdateCounter(out int result, Int32 handle);
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool Section_GetUpdateDivider(out int result, Int32 handle);
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool Section_GetOnUpdateAction(out string result, Int32 handle);
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool Section_DoUpdateAction(Int32 handle);
[DllImport("Rainmeter.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool Section_Destroy(Int32 handle);
#endregion
protected Section(Int32 handle)
: base(handle)
{
}
~Section()
{
Section_Destroy(Handle);
}
/// <summary>
/// Gets the name of the section
/// </summary>
public string Name
{
get
{
string name;
if (!Section_GetName(out name, Handle))
throw new ExternalException("Get name failed.");
return name;
}
}
/// <summary>
/// Gets the original name of the section
/// </summary>
public string OriginalName
{
get
{
string name;
if (!Section_GetOriginalName(out name, Handle))
throw new ExternalException("Get original name failed.");
return name;
}
}
/// <summary>
/// Gets a value indicating if this section has dynamic variables
/// </summary>
public bool HasDynamicVariables
{
get
{
bool result;
if (!Section_HasDynamicVariables(out result, Handle))
throw new ExternalException("Get dynamic variables has failed.");
return result;
}
set
{
if (!Section_SetDynamicVariables(Handle, value))
throw new ExternalException("Set dynamic variables has failed.");
}
}
/// <summary>
/// Resets the update counter
/// </summary>
public void ResetUpdateCounter()
{
if (!Section_ResetUpdateCounter(Handle))
throw new ExternalException("Reset update counter has failed.");
}
/// <summary>
/// Gets the update counter
/// </summary>
public int UpdateCounter
{
get
{
int result;
if (!Section_GetUpdateCounter(out result, Handle))
throw new ExternalException("Get update counter has failed.");
return result;
}
}
/// <summary>
/// Gets the update divider
/// </summary>
public int UpdateDivider
{
get
{
int result;
if (!Section_GetUpdateDivider(out result, Handle))
throw new ExternalException("Get update divider has failed.");
return result;
}
}
/// <summary>
/// Gets the update divider
/// </summary>
public string OnUpdateAction
{
get
{
string result;
if (!Section_GetOnUpdateAction(out result, Handle))
throw new ExternalException("Get on update action has failed.");
return result;
}
}
/// <summary>
/// Executes the update action
/// </summary>
public void DoUpdateAction()
{
if (!Section_DoUpdateAction(Handle))
throw new ExternalException("Do update action has failed.");
}
}
}

View File

@ -35,9 +35,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="INIFileParser">
<HintPath>..\packages\ini-parser.2.1.1\lib\INIFileParser.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
@ -71,39 +68,17 @@
<SubType>Designer</SubType>
</Page>
<Compile Include="Business\DocumentManager.cs" />
<Compile Include="Business\PluginManager.cs" />
<Compile Include="Business\ProjectManager.cs" />
<Compile Include="Documents\AutoRegisterAttribute.cs" />
<Compile Include="Documents\DocumentEditorFeatures\ICustomDocumentTitleProvider.cs" />
<Compile Include="Documents\DocumentEditorFeatures\ISelectionPropertiesProvider.cs" />
<Compile Include="Documents\DocumentEditorFeatures\IToolboxProvider.cs" />
<Compile Include="Documents\DocumentEditorFeatures\IUndoSupport.cs" />
<Compile Include="Documents\IDocumentEditor.cs" />
<Compile Include="Documents\IDocumentEditorFactory.cs" />
<Compile Include="Documents\IDocumentStorage.cs" />
<Compile Include="Documents\Text\TextDocument.cs" />
<Compile Include="Documents\Text\TextDocumentTemplate.cs" />
<Compile Include="Documents\Text\TextEditorControl.xaml.cs">
<DependentUpon>TextEditorControl.xaml</DependentUpon>
</Compile>
<Compile Include="Documents\Text\TextStorage.cs" />
<Compile Include="MainClass.cs" />
<Compile Include="Documents\DocumentTemplate_.cs" />
<Compile Include="Model\IDocument.cs" />
<Compile Include="Documents\Ini\IniDocument.cs" />
<Compile Include="Documents\Ini\IniSkinDesigner.cs" />
<Compile Include="Documents\Ini\IniSkinDesignerControl.xaml.cs">
<DependentUpon>IniSkinDesignerControl.xaml</DependentUpon>
</Compile>
<Compile Include="Documents\Ini\IniSkinDesignerFactory.cs" />
<Compile Include="Documents\Text\TextEditor.cs" />
<Compile Include="Documents\Text\TextEditorFactory.cs" />
<Compile Include="Interop\NativeLibrary.cs" />
<Compile Include="Model\Project.cs" />
<Compile Include="Model\Property.cs" />
<Compile Include="Model\RainmeterConfig.cs" />
<Compile Include="Model\Reference.cs" />
<Compile Include="Model\Tree.cs" />
<Compile Include="Rainmeter.cs" />
<Compile Include="Rainmeter\DataTypes\Action.cs" />
<Compile Include="Rainmeter\DataTypes\Bang.cs" />
<Compile Include="Rainmeter\Group.cs" />
<Compile Include="Rainmeter\Measure.cs" />
<Compile Include="Rainmeter\Meter.cs" />
<Compile Include="Rainmeter\Section.cs" />
<Compile Include="Resources\Icons.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@ -115,8 +90,6 @@
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<Compile Include="Storage\ProjectStorage.cs" />
<Compile Include="Storage\SkinDirectory.cs" />
<Compile Include="Storage\SerializableTree.cs" />
<Compile Include="UI\Command.cs" />
<Compile Include="UI\Controller\IconProvider.cs" />
<Compile Include="UI\Controller\ProjectController.cs" />
@ -125,7 +98,6 @@
<DependentUpon>CreateDocumentDialog.xaml</DependentUpon>
</Compile>
<Compile Include="UI\Controller\DocumentController.cs" />
<Compile Include="Model\Events\DocumentOpenedEventArgs.cs" />
<Compile Include="UI\Dialogs\CreateProjectDialog.xaml.cs">
<DependentUpon>CreateProjectDialog.xaml</DependentUpon>
</Compile>
@ -135,17 +107,6 @@
<Compile Include="UI\UIManager.cs" />
<Compile Include="UI\ViewModel\DocumentTemplateViewModel.cs" />
<Compile Include="UI\ViewModel\ReferenceViewModel.cs" />
<Compile Include="Utils\DirectoryHelper.cs" />
<Compile Include="Utils\LinqExtension.cs" />
<Compile Include="Utils\TreeExtensions.cs" />
<Page Include="Documents\Ini\IniSkinDesignerControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Documents\Text\TextEditorControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI\Dialogs\CreateDocumentDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -206,7 +167,6 @@
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="LICENSE" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@ -265,6 +225,15 @@
<ItemGroup>
<Resource Include="Resources\Icons\16\folder_project.png" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RainmeterStudio.Core\RainmeterStudio.Core.csproj">
<Project>{1d2a4896-af31-4e82-a84f-4e218067701f}</Project>
<Name>RainmeterStudio.Core</Name>
</ProjectReference>
</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.

View File

@ -4,7 +4,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Storage
{

View File

@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace RainmeterStudio.Storage
{
public static class SkinDirectory
{
private static string _path = null;
public static string Path
{
get
{
return "";
}
set
{
}
}
}
}

View File

@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using RainmeterStudio.Business;
using RainmeterStudio.Documents.Text;
using System.Windows;
namespace RainmeterStudio.UI
{

View File

@ -1,15 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RainmeterStudio.Business;
using RainmeterStudio.UI.Dialogs;
using RainmeterStudio.Model.Events;
using RainmeterStudio.Model;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using RainmeterStudio.Documents;
using RainmeterStudio.Business;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Model.Events;
using RainmeterStudio.UI.Dialogs;
namespace RainmeterStudio.UI.Controller
{

View File

@ -6,7 +6,7 @@ using System.Text;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.UI.Controller
{

View File

@ -1,14 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using Microsoft.Win32;
using RainmeterStudio.Business;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
using RainmeterStudio.UI.Dialogs;
namespace RainmeterStudio.UI.Controller

View File

@ -12,8 +12,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using RainmeterStudio.Business;
using RainmeterStudio.Documents;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Documents;
namespace RainmeterStudio.UI.Dialogs
{

View File

@ -12,8 +12,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using RainmeterStudio.Business;
using RainmeterStudio.Documents;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Documents;
namespace RainmeterStudio.UI.Dialogs
{

View File

@ -12,7 +12,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using RainmeterStudio.Business;
using RainmeterStudio.Model.Events;
using RainmeterStudio.Core.Model.Events;
using RainmeterStudio.Storage;
using RainmeterStudio.UI.Controller;
using Xceed.Wpf.AvalonDock.Layout;

View File

@ -14,12 +14,12 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using RainmeterStudio.Core.Model;
using RainmeterStudio.Core.Utils;
using RainmeterStudio.Interop;
using RainmeterStudio.Model;
using RainmeterStudio.Storage;
using RainmeterStudio.UI.Controller;
using RainmeterStudio.UI.ViewModel;
using RainmeterStudio.Utils;
namespace RainmeterStudio.UI
{

View File

@ -3,8 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using RainmeterStudio.Documents;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.UI.Controller;
namespace RainmeterStudio.UI.ViewModel

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.UI.ViewModel
{

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AvalonDock" version="2.0.2000" targetFramework="net40" />
<package id="ini-parser" version="2.1.1" targetFramework="net40" />
</packages>

View File

@ -1,56 +0,0 @@
# INI File Parser
A Mono-compatible .NET library for reading/writing INI data from IO streams, file streams, and strings.
[![Build Status](https://travis-ci.org/rickyah/ini-parser.png?branch=master)](https://travis-ci.org/rickyah/ini-parser)
## Installation
The library is published to [NuGet](https://www.nuget.org/packages/ini-parser/) and can be installed on the command-line from the directory containing your solution.
```bat
> nuget install ini-parser
```
Or, from the [Package Manager Console](http://docs.nuget.org/docs/start-here/using-the-package-manager-console) in Visual Studio
```powershell
PM> Install-Package ini-parser
```
Or from the [NuGet Package Manager](http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c) extension built available for most flavors of Visual Studio!
## Getting Started
INI data is stored in nested dictionaries, so accessing the value associated to a key in a section is straightforward. Load the data using one of the provided methods.
```csharp
var data = parser.ReadFile("Configuration.ini");
```
Retrieve the value for a key inside of a named section. Values are always retrieved as `string`s.
```csharp
var useFullScreen = data["UI"]["fullscreen"];
```
Modify the value in the dictionary, not the value retrieved, and save to a new file or overwrite.
```csharp
data["UI"]["fullscreen"] = "true";
parser.WriteFile("Configuration.ini", data);
```
See the [wiki](https://github.com/rickyah/ini-parser/wiki) for more usage examples.
## Contributing
Do you have an idea to improve this library, or did you happen to run into a bug. Please share your idea or the bug you found in the issues page, or even better: feel free to fork and [contribute](https://github.com/rickyah/ini-parser/wiki/Contributing) to this project!
## Version 2.0!
Since the INI format isn't really a "standard", this version introduces a simpler way to customize INI parsing:
* Pass a configuration object to an `IniParser`, specifying the behaviour of the parser. A default implementation is used if none is provided.
* Derive from `IniDataParser` and override the fine-grained parsing methods.

View File

@ -1,20 +0,0 @@
The MIT License (MIT)
Copyright (c) 2008 Ricardo Amores Hernández
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,17 +0,0 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>ini-parser</id>
<version>2.1.1</version>
<title>INI Parser</title>
<authors>Ricardo Amores Hernández</authors>
<owners>Ricardo Amores Hernández</owners>
<licenseUrl>https://github.com/rickyah/ini-parser/master/blob/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/rickyah/ini-parser</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A Mono compatible .NET open source library for managing data from an INI file format. Allows reading/writing INI data to and from I/O streams, file streams, and/or plain strings.</description>
<summary>A simple C# library for reading and writing INI files</summary>
<releaseNotes />
<tags>ini</tags>
</metadata>
</package>

Binary file not shown.

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\RainmeterEditor\packages.config" />
<repository path="..\RainmeterStudio\packages.config" />
</repositories>