mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Split into smaller projects, now uses plugins.
This commit is contained in:
parent
69913fa251
commit
b8c8f2a1b0
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents.DocumentEditorFeatures
|
namespace RainmeterStudio.Core.Documents.DocumentEditorFeatures
|
||||||
{
|
{
|
||||||
public interface ICustomDocumentTitleProvider
|
public interface ICustomDocumentTitleProvider
|
||||||
{
|
{
|
@ -2,9 +2,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents.DocumentEditorFeatures
|
namespace RainmeterStudio.Core.Documents.DocumentEditorFeatures
|
||||||
{
|
{
|
||||||
interface ISelectionPropertiesProvider
|
interface ISelectionPropertiesProvider
|
||||||
{
|
{
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents.DocumentEditorFeatures
|
namespace RainmeterStudio.Core.Documents.DocumentEditorFeatures
|
||||||
{
|
{
|
||||||
public interface IToolboxProvider
|
public interface IToolboxProvider
|
||||||
{
|
{
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents.DocumentEditorFeatures
|
namespace RainmeterStudio.Core.Documents.DocumentEditorFeatures
|
||||||
{
|
{
|
||||||
public interface IUndoSupport
|
public interface IUndoSupport
|
||||||
{
|
{
|
@ -1,5 +1,6 @@
|
|||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
namespace RainmeterStudio.Documents
|
|
||||||
|
namespace RainmeterStudio.Core.Documents
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a document template
|
/// Represents a document template
|
25
RainmeterStudio.Core/Documents/IDocumentEditor.cs
Normal file
25
RainmeterStudio.Core/Documents/IDocumentEditor.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
@ -2,9 +2,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents
|
namespace RainmeterStudio.Core.Documents
|
||||||
{
|
{
|
||||||
public interface IDocumentEditorFactory
|
public interface IDocumentEditorFactory
|
||||||
{
|
{
|
@ -2,9 +2,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Documents;
|
using RainmeterStudio.Core.Documents;
|
||||||
|
|
||||||
namespace RainmeterStudio.Model.Events
|
namespace RainmeterStudio.Core.Model.Events
|
||||||
{
|
{
|
||||||
public abstract class DocumentEventArgsBase : EventArgs
|
public abstract class DocumentEventArgsBase : EventArgs
|
||||||
{
|
{
|
@ -4,7 +4,7 @@ using System.ComponentModel;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace RainmeterStudio.Model
|
namespace RainmeterStudio.Core.Model
|
||||||
{
|
{
|
||||||
public interface IDocument : INotifyPropertyChanged
|
public interface IDocument : INotifyPropertyChanged
|
||||||
{
|
{
|
@ -3,9 +3,9 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using RainmeterStudio.Storage;
|
using RainmeterStudio.Core.Storage;
|
||||||
|
|
||||||
namespace RainmeterStudio.Model
|
namespace RainmeterStudio.Core.Model
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines a Rainmeter Studio project
|
/// Defines a Rainmeter Studio project
|
254
RainmeterStudio.Core/Model/Property.cs
Normal file
254
RainmeterStudio.Core/Model/Property.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace RainmeterStudio.Model
|
namespace RainmeterStudio.Core.Model
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reference to a file or folder
|
/// Reference to a file or folder
|
@ -5,7 +5,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace RainmeterStudio.Model
|
namespace RainmeterStudio.Core.Model
|
||||||
{
|
{
|
||||||
public class Tree<T> : IList<Tree<T>>
|
public class Tree<T> : IList<Tree<T>>
|
||||||
{
|
{
|
20
RainmeterStudio.Core/PluginExportAttribute.cs
Normal file
20
RainmeterStudio.Core/PluginExportAttribute.cs
Normal 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
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
36
RainmeterStudio.Core/Properties/AssemblyInfo.cs
Normal file
36
RainmeterStudio.Core/Properties/AssemblyInfo.cs
Normal 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")]
|
75
RainmeterStudio.Core/RainmeterStudio.Core.csproj
Normal file
75
RainmeterStudio.Core/RainmeterStudio.Core.csproj
Normal 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>
|
@ -2,9 +2,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents
|
namespace RainmeterStudio.Core.Storage
|
||||||
{
|
{
|
||||||
public interface IDocumentStorage
|
public interface IDocumentStorage
|
||||||
{
|
{
|
@ -4,9 +4,9 @@ using System.Collections.ObjectModel;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.Storage
|
namespace RainmeterStudio.Core.Storage
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A special type of tree that implements a very small subset of tree operations, and can be serialized
|
/// A special type of tree that implements a very small subset of tree operations, and can be serialized
|
@ -3,9 +3,9 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.Utils
|
namespace RainmeterStudio.Core.Utils
|
||||||
{
|
{
|
||||||
public static class DirectoryHelper
|
public static class DirectoryHelper
|
||||||
{
|
{
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace RainmeterStudio.Utils
|
namespace RainmeterStudio.Core.Utils
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Linq extensions
|
/// Linq extensions
|
@ -2,9 +2,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.Utils
|
namespace RainmeterStudio.Core.Utils
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extension methods for trees
|
/// Extension methods for trees
|
36
RainmeterStudio.SkinDesigner/Properties/AssemblyInfo.cs
Normal file
36
RainmeterStudio.SkinDesigner/Properties/AssemblyInfo.cs
Normal 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")]
|
@ -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>
|
51
RainmeterStudio.SkinDesigner/SkinDesigner.cs
Normal file
51
RainmeterStudio.SkinDesigner/SkinDesigner.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
RainmeterStudio.SkinDesigner/SkinDesignerControl.xaml
Normal file
13
RainmeterStudio.SkinDesigner/SkinDesignerControl.xaml
Normal 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>
|
@ -12,14 +12,14 @@ using System.Windows.Media.Imaging;
|
|||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents.Ini
|
namespace RainmeterStudio.SkinDesignerPlugin
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for IniSkinDesignerControl.xaml
|
/// Interaction logic for SkinDesignerControl.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class IniSkinDesignerControl : UserControl
|
public partial class SkinDesignerControl : Page
|
||||||
{
|
{
|
||||||
public IniSkinDesignerControl()
|
public SkinDesignerControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
37
RainmeterStudio.SkinDesigner/SkinDesignerFactory.cs
Normal file
37
RainmeterStudio.SkinDesigner/SkinDesignerFactory.cs
Normal 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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
47
RainmeterStudio.SkinDesigner/SkinDocument.cs
Normal file
47
RainmeterStudio.SkinDesigner/SkinDocument.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
57
RainmeterStudio.SkinDesigner/SkinMetadata.cs
Normal file
57
RainmeterStudio.SkinDesigner/SkinMetadata.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
32
RainmeterStudio.SkinDesigner/SkinStorage.cs
Normal file
32
RainmeterStudio.SkinDesigner/SkinStorage.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
32
RainmeterStudio.SkinDesigner/SkinTemplate.cs
Normal file
32
RainmeterStudio.SkinDesigner/SkinTemplate.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -61,6 +61,10 @@
|
|||||||
<WCFMetadata Include="Service References\" />
|
<WCFMetadata Include="Service References\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<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">
|
<ProjectReference Include="..\RainmeterStudio\RainmeterStudio.csproj">
|
||||||
<Project>{438d0136-4a27-4e4d-a617-fface4554236}</Project>
|
<Project>{438d0136-4a27-4e4d-a617-fface4554236}</Project>
|
||||||
<Name>RainmeterStudio</Name>
|
<Name>RainmeterStudio</Name>
|
||||||
|
@ -4,8 +4,8 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
using RainmeterStudio.Storage;
|
using RainmeterStudio.Storage;
|
||||||
using RainmeterStudio.Model;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.Tests.Storage
|
namespace RainmeterStudio.Tests.Storage
|
||||||
{
|
{
|
||||||
|
36
RainmeterStudio.TextEditor/Properties/AssemblyInfo.cs
Normal file
36
RainmeterStudio.TextEditor/Properties/AssemblyInfo.cs
Normal 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")]
|
@ -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>
|
@ -3,10 +3,10 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Model;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents.Text
|
namespace RainmeterStudio.TextEditorPlugin
|
||||||
{
|
{
|
||||||
public class TextDocument : IDocument
|
public class TextDocument : IDocument
|
||||||
{
|
{
|
@ -2,14 +2,16 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
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>
|
/// <summary>
|
||||||
/// A blank text document template
|
/// A blank text document template
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AutoRegister]
|
[PluginExport]
|
||||||
public class TextDocumentTemplate : DocumentTemplate
|
public class TextDocumentTemplate : DocumentTemplate
|
||||||
{
|
{
|
||||||
public TextDocumentTemplate()
|
public TextDocumentTemplate()
|
@ -3,9 +3,10 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
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
|
public class TextEditor : IDocumentEditor
|
||||||
{
|
{
|
@ -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="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
@ -12,7 +12,7 @@ using System.Windows.Media.Imaging;
|
|||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents.Text
|
namespace RainmeterStudio.TextEditorPlugin
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for TextEditorControl.xaml
|
/// Interaction logic for TextEditorControl.xaml
|
@ -3,12 +3,13 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Business;
|
using RainmeterStudio.Core;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Documents;
|
||||||
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents.Text
|
namespace RainmeterStudio.TextEditorPlugin
|
||||||
{
|
{
|
||||||
[AutoRegister]
|
[PluginExport]
|
||||||
public class TextEditorFactory : IDocumentEditorFactory
|
public class TextEditorFactory : IDocumentEditorFactory
|
||||||
{
|
{
|
||||||
public IDocumentEditor CreateEditor(IDocument document)
|
public IDocumentEditor CreateEditor(IDocument document)
|
@ -1,13 +1,15 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
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>
|
/// <summary>
|
||||||
/// Storage for text files
|
/// Storage for text files
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AutoRegister]
|
[PluginExport]
|
||||||
public class TextStorage : IDocumentStorage
|
public class TextStorage : IDocumentStorage
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
@ -7,11 +7,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "Common\Common.vcx
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Installer", "Installer\Installer.vcxproj", "{2FCFBFD2-2720-4BDD-B620-4BDD3DBB8D3D}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Installer", "Installer\Installer.vcxproj", "{2FCFBFD2-2720-4BDD-B620-4BDD3DBB8D3D}"
|
||||||
EndProject
|
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}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Library", "Library\Library.vcxproj", "{BE9D2400-7F1C-49D6-8498-5CE495491AD6}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A} = {6BE6F228-B741-4DA9-9FBC-E9F2A7BD483A}
|
|
||||||
{19312085-AA51-4BD6-BE92-4B6098CCA539} = {19312085-AA51-4BD6-BE92-4B6098CCA539}
|
{19312085-AA51-4BD6-BE92-4B6098CCA539} = {19312085-AA51-4BD6-BE92-4B6098CCA539}
|
||||||
{BC25C5DC-AEFB-49F9-8188-3C1B8C8929E6} = {BC25C5DC-AEFB-49F9-8188-3C1B8C8929E6}
|
{BC25C5DC-AEFB-49F9-8188-3C1B8C8929E6} = {BC25C5DC-AEFB-49F9-8188-3C1B8C8929E6}
|
||||||
{6D61FBE9-6913-4885-A95D-1A8C0C223D82} = {6D61FBE9-6913-4885-A95D-1A8C0C223D82}
|
{6D61FBE9-6913-4885-A95D-1A8C0C223D82} = {6D61FBE9-6913-4885-A95D-1A8C0C223D82}
|
||||||
@ -76,6 +73,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RainmeterStudio", "Rainmete
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RainmeterStudio.Tests", "RainmeterStudio.Tests\RainmeterStudio.Tests.csproj", "{845F4BD4-6822-4D92-9DDB-15FD18A47E5A}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RainmeterStudio.Tests", "RainmeterStudio.Tests\RainmeterStudio.Tests.csproj", "{845F4BD4-6822-4D92-9DDB-15FD18A47E5A}"
|
||||||
EndProject
|
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
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
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|Mixed Platforms.Build.0 = Release|Win32
|
||||||
{2FCFBFD2-2720-4BDD-B620-4BDD3DBB8D3D}.Release|Win32.ActiveCfg = Release|Win32
|
{2FCFBFD2-2720-4BDD-B620-4BDD3DBB8D3D}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{2FCFBFD2-2720-4BDD-B620-4BDD3DBB8D3D}.Release|x64.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|Any CPU.ActiveCfg = Debug|Win32
|
||||||
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Debug|Mixed Platforms.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
|
{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|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
{845F4BD4-6822-4D92-9DDB-15FD18A47E5A}.Release|Win32.ActiveCfg = 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
|
{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
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
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
|
EndGlobal
|
||||||
|
@ -4,10 +4,10 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Documents;
|
using RainmeterStudio.Core.Documents;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
using RainmeterStudio.Model.Events;
|
using RainmeterStudio.Core.Model.Events;
|
||||||
using RainmeterStudio.Utils;
|
using RainmeterStudio.Core.Storage;
|
||||||
|
|
||||||
namespace RainmeterStudio.Business
|
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>
|
/// <summary>
|
||||||
/// Registers a document editor factory
|
/// Registers a document editor factory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
104
RainmeterStudio/Business/PluginManager.cs
Normal file
104
RainmeterStudio/Business/PluginManager.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,8 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
|
using RainmeterStudio.Core.Storage;
|
||||||
using RainmeterStudio.Storage;
|
using RainmeterStudio.Storage;
|
||||||
|
|
||||||
namespace RainmeterStudio.Business
|
namespace RainmeterStudio.Business
|
||||||
|
@ -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; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -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
|
|
||||||
{
|
|
||||||
}*/
|
|
||||||
}
|
|
@ -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(); }
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
@ -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>
|
|
@ -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
|
|
||||||
{
|
|
||||||
|
|
||||||
}*/
|
|
||||||
}
|
|
@ -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.
|
|
@ -5,7 +5,8 @@ using System.Reflection;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using RainmeterStudio.Business;
|
using RainmeterStudio.Business;
|
||||||
using RainmeterStudio.Documents;
|
using RainmeterStudio.Core.Documents;
|
||||||
|
using RainmeterStudio.Core.Storage;
|
||||||
using RainmeterStudio.Storage;
|
using RainmeterStudio.Storage;
|
||||||
using RainmeterStudio.UI;
|
using RainmeterStudio.UI;
|
||||||
using RainmeterStudio.UI.Controller;
|
using RainmeterStudio.UI.Controller;
|
||||||
@ -21,12 +22,19 @@ namespace RainmeterStudio
|
|||||||
SplashScreen splash = new SplashScreen("Resources/splash.png");
|
SplashScreen splash = new SplashScreen("Resources/splash.png");
|
||||||
splash.Show(true);
|
splash.Show(true);
|
||||||
|
|
||||||
// Initialize managers
|
// Initialize project manager
|
||||||
ProjectStorage projectStorage = new ProjectStorage();
|
ProjectStorage projectStorage = new ProjectStorage();
|
||||||
ProjectManager projectManager = new ProjectManager(projectStorage);
|
ProjectManager projectManager = new ProjectManager(projectStorage);
|
||||||
|
|
||||||
|
// Initialize document manager
|
||||||
DocumentManager documentManager = new DocumentManager();
|
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
|
// Create & run app
|
||||||
var uiManager = new UIManager(projectManager, documentManager);
|
var uiManager = new UIManager(projectManager, documentManager);
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,7 +7,7 @@ using RainmeterStudio.Interop;
|
|||||||
|
|
||||||
namespace RainmeterStudio
|
namespace RainmeterStudio
|
||||||
{
|
{
|
||||||
class Rainmeter
|
class RainmeterContext
|
||||||
{
|
{
|
||||||
#region Imports
|
#region Imports
|
||||||
|
|
||||||
@ -19,17 +19,17 @@ namespace RainmeterStudio
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private static Rainmeter _instance = null;
|
private static RainmeterContext _instance = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the single instance of this class
|
/// Gets the single instance of this class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static Rainmeter Instance
|
public static RainmeterContext Instance
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_instance == null)
|
if (_instance == null)
|
||||||
_instance = new Rainmeter();
|
_instance = new RainmeterContext();
|
||||||
|
|
||||||
return _instance;
|
return _instance;
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ namespace RainmeterStudio
|
|||||||
|
|
||||||
#region Constructor, finalizer
|
#region Constructor, finalizer
|
||||||
|
|
||||||
private Rainmeter()
|
private RainmeterContext()
|
||||||
{
|
{
|
||||||
_handle = Rainmeter_Initialize();
|
_handle = Rainmeter_Initialize();
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ namespace RainmeterStudio
|
|||||||
throw new Exception("Failed to initialize native library.");
|
throw new Exception("Failed to initialize native library.");
|
||||||
}
|
}
|
||||||
|
|
||||||
~Rainmeter()
|
~RainmeterContext()
|
||||||
{
|
{
|
||||||
Rainmeter_Finalize(_handle);
|
Rainmeter_Finalize(_handle);
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,9 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace RainmeterStudio.Documents
|
namespace RainmeterStudio.Rainmeter.DataTypes
|
||||||
{
|
{
|
||||||
public class AutoRegisterAttribute : Attribute
|
public class Action
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
63
RainmeterStudio/Rainmeter/DataTypes/Bang.cs
Normal file
63
RainmeterStudio/Rainmeter/DataTypes/Bang.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
67
RainmeterStudio/Rainmeter/Group.cs
Normal file
67
RainmeterStudio/Rainmeter/Group.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,9 +3,9 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace RainmeterStudio.Model
|
namespace RainmeterStudio.Rainmeter
|
||||||
{
|
{
|
||||||
public class RainmeterConfig
|
public class Measure
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
15
RainmeterStudio/Rainmeter/Meter.cs
Normal file
15
RainmeterStudio/Rainmeter/Meter.cs
Normal 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)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
174
RainmeterStudio/Rainmeter/Section.cs
Normal file
174
RainmeterStudio/Rainmeter/Section.cs
Normal 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.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -35,9 +35,6 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="INIFileParser">
|
|
||||||
<HintPath>..\packages\ini-parser.2.1.1\lib\INIFileParser.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
@ -71,39 +68,17 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Compile Include="Business\DocumentManager.cs" />
|
<Compile Include="Business\DocumentManager.cs" />
|
||||||
|
<Compile Include="Business\PluginManager.cs" />
|
||||||
<Compile Include="Business\ProjectManager.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="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="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.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">
|
<Compile Include="Resources\Icons.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
@ -115,8 +90,6 @@
|
|||||||
<DependentUpon>Strings.resx</DependentUpon>
|
<DependentUpon>Strings.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Storage\ProjectStorage.cs" />
|
<Compile Include="Storage\ProjectStorage.cs" />
|
||||||
<Compile Include="Storage\SkinDirectory.cs" />
|
|
||||||
<Compile Include="Storage\SerializableTree.cs" />
|
|
||||||
<Compile Include="UI\Command.cs" />
|
<Compile Include="UI\Command.cs" />
|
||||||
<Compile Include="UI\Controller\IconProvider.cs" />
|
<Compile Include="UI\Controller\IconProvider.cs" />
|
||||||
<Compile Include="UI\Controller\ProjectController.cs" />
|
<Compile Include="UI\Controller\ProjectController.cs" />
|
||||||
@ -125,7 +98,6 @@
|
|||||||
<DependentUpon>CreateDocumentDialog.xaml</DependentUpon>
|
<DependentUpon>CreateDocumentDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="UI\Controller\DocumentController.cs" />
|
<Compile Include="UI\Controller\DocumentController.cs" />
|
||||||
<Compile Include="Model\Events\DocumentOpenedEventArgs.cs" />
|
|
||||||
<Compile Include="UI\Dialogs\CreateProjectDialog.xaml.cs">
|
<Compile Include="UI\Dialogs\CreateProjectDialog.xaml.cs">
|
||||||
<DependentUpon>CreateProjectDialog.xaml</DependentUpon>
|
<DependentUpon>CreateProjectDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -135,17 +107,6 @@
|
|||||||
<Compile Include="UI\UIManager.cs" />
|
<Compile Include="UI\UIManager.cs" />
|
||||||
<Compile Include="UI\ViewModel\DocumentTemplateViewModel.cs" />
|
<Compile Include="UI\ViewModel\DocumentTemplateViewModel.cs" />
|
||||||
<Compile Include="UI\ViewModel\ReferenceViewModel.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">
|
<Page Include="UI\Dialogs\CreateDocumentDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@ -206,7 +167,6 @@
|
|||||||
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<None Include="app.config" />
|
<None Include="app.config" />
|
||||||
<None Include="LICENSE" />
|
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
@ -265,6 +225,15 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\Icons\16\folder_project.png" />
|
<Resource Include="Resources\Icons\16\folder_project.png" />
|
||||||
</ItemGroup>
|
</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" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- 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.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
@ -4,7 +4,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.Storage
|
namespace RainmeterStudio.Storage
|
||||||
{
|
{
|
||||||
|
@ -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
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +1,4 @@
|
|||||||
using System;
|
using System.Windows;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Data;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Windows;
|
|
||||||
using RainmeterStudio.Business;
|
|
||||||
using RainmeterStudio.Documents.Text;
|
|
||||||
|
|
||||||
namespace RainmeterStudio.UI
|
namespace RainmeterStudio.UI
|
||||||
{
|
{
|
||||||
|
@ -1,15 +1,9 @@
|
|||||||
using System;
|
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;
|
||||||
using System.Windows.Input;
|
using RainmeterStudio.Business;
|
||||||
using System.Windows.Media.Imaging;
|
using RainmeterStudio.Core.Documents;
|
||||||
using RainmeterStudio.Documents;
|
using RainmeterStudio.Core.Model.Events;
|
||||||
|
using RainmeterStudio.UI.Dialogs;
|
||||||
|
|
||||||
namespace RainmeterStudio.UI.Controller
|
namespace RainmeterStudio.UI.Controller
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,7 @@ using System.Text;
|
|||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.UI.Controller
|
namespace RainmeterStudio.UI.Controller
|
||||||
{
|
{
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using RainmeterStudio.Business;
|
using RainmeterStudio.Business;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
using RainmeterStudio.UI.Dialogs;
|
using RainmeterStudio.UI.Dialogs;
|
||||||
|
|
||||||
namespace RainmeterStudio.UI.Controller
|
namespace RainmeterStudio.UI.Controller
|
||||||
|
@ -12,8 +12,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using RainmeterStudio.Business;
|
using RainmeterStudio.Business;
|
||||||
using RainmeterStudio.Documents;
|
using RainmeterStudio.Core.Documents;
|
||||||
using RainmeterStudio.Model;
|
|
||||||
|
|
||||||
namespace RainmeterStudio.UI.Dialogs
|
namespace RainmeterStudio.UI.Dialogs
|
||||||
{
|
{
|
||||||
|
@ -12,8 +12,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using RainmeterStudio.Business;
|
using RainmeterStudio.Business;
|
||||||
using RainmeterStudio.Documents;
|
using RainmeterStudio.Core.Documents;
|
||||||
using RainmeterStudio.Model;
|
|
||||||
|
|
||||||
namespace RainmeterStudio.UI.Dialogs
|
namespace RainmeterStudio.UI.Dialogs
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ using System.Windows.Media.Imaging;
|
|||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using RainmeterStudio.Business;
|
using RainmeterStudio.Business;
|
||||||
using RainmeterStudio.Model.Events;
|
using RainmeterStudio.Core.Model.Events;
|
||||||
using RainmeterStudio.Storage;
|
using RainmeterStudio.Storage;
|
||||||
using RainmeterStudio.UI.Controller;
|
using RainmeterStudio.UI.Controller;
|
||||||
using Xceed.Wpf.AvalonDock.Layout;
|
using Xceed.Wpf.AvalonDock.Layout;
|
||||||
|
@ -14,12 +14,12 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
using RainmeterStudio.Core.Model;
|
||||||
|
using RainmeterStudio.Core.Utils;
|
||||||
using RainmeterStudio.Interop;
|
using RainmeterStudio.Interop;
|
||||||
using RainmeterStudio.Model;
|
|
||||||
using RainmeterStudio.Storage;
|
using RainmeterStudio.Storage;
|
||||||
using RainmeterStudio.UI.Controller;
|
using RainmeterStudio.UI.Controller;
|
||||||
using RainmeterStudio.UI.ViewModel;
|
using RainmeterStudio.UI.ViewModel;
|
||||||
using RainmeterStudio.Utils;
|
|
||||||
|
|
||||||
namespace RainmeterStudio.UI
|
namespace RainmeterStudio.UI
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using RainmeterStudio.Documents;
|
using RainmeterStudio.Core.Documents;
|
||||||
using RainmeterStudio.Model;
|
|
||||||
using RainmeterStudio.UI.Controller;
|
using RainmeterStudio.UI.Controller;
|
||||||
|
|
||||||
namespace RainmeterStudio.UI.ViewModel
|
namespace RainmeterStudio.UI.ViewModel
|
||||||
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using RainmeterStudio.Model;
|
using RainmeterStudio.Core.Model;
|
||||||
|
|
||||||
namespace RainmeterStudio.UI.ViewModel
|
namespace RainmeterStudio.UI.ViewModel
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="AvalonDock" version="2.0.2000" targetFramework="net40" />
|
<package id="AvalonDock" version="2.0.2000" targetFramework="net40" />
|
||||||
<package id="ini-parser" version="2.1.1" targetFramework="net40" />
|
|
||||||
</packages>
|
</packages>
|
56
packages/ini-parser.2.1.1/README.md
vendored
56
packages/ini-parser.2.1.1/README.md
vendored
@ -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.
|
|
||||||
|
|
20
packages/ini-parser.2.1.1/content/LICENSE
vendored
20
packages/ini-parser.2.1.1/content/LICENSE
vendored
@ -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.
|
|
@ -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>
|
|
BIN
packages/ini-parser.2.1.1/lib/INIFileParser.dll
vendored
BIN
packages/ini-parser.2.1.1/lib/INIFileParser.dll
vendored
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository path="..\RainmeterEditor\packages.config" />
|
<repository path="..\RainmeterStudio\packages.config" />
|
||||||
</repositories>
|
</repositories>
|
Loading…
Reference in New Issue
Block a user