port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B7AB4BB3-6FFC-453E-928D-852A6FF8C508}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Aiwaz.Core</RootNamespace>
<AssemblyName>Aiwaz.Core</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</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>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="SlimDX, Version=2.0.8.42, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Extern\SlimDX\x86\SlimDX.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DeviceEnumerator\DeviceEnumerator.cs" />
<Compile Include="DeviceEnumerator\DisplayAdapter.cs" />
<Compile Include="DeviceEnumerator\DisplayMode.cs" />
<Compile Include="DeviceEnumerator\OutputDevice.cs" />
<Compile Include="Engine\Engine.cs" />
<Compile Include="Exception.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aiwaz.Common\Aiwaz.Common.csproj">
<Project>{0F7D7168-08C1-45AE-AAE3-80506939D7E6}</Project>
<Name>Aiwaz.Common</Name>
</ProjectReference>
<ProjectReference Include="..\Aiwaz.Contracts\Aiwaz.Contracts.csproj">
<Project>{DE4D6FE6-D1FB-41A1-8ABA-19635B8FFD7A}</Project>
<Name>Aiwaz.Contracts</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,144 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aiwaz.Contracts;
using SlimDX;
namespace Aiwaz.Core
{
public class DeviceEnumerator : IDisposable
{
private SlimDX.DXGI.Factory Factory;
internal SlimDX.Direct3D10.Device Device;
public bool HasEnumerated
{
get { return EnumeratedAdapters.Count > 0; }
}
public List<DisplayAdapter> EnumeratedAdapters { get; private set;}
public uint DesiredWidth = 0;
public uint DesiredHeight = 0;
public uint DesiredRefreshRate = 0;
public SlimDX.DXGI.Format DesiredFormat = SlimDX.DXGI.Format.Unknown;
public DeviceEnumerator(SlimDX.Direct3D10.Device argDevice)
{
Factory = new SlimDX.DXGI.Factory();
Device = argDevice;
EnumeratedAdapters = new List<DisplayAdapter>();
}
~DeviceEnumerator()
{
this.Dispose();
}
public bool TryEnumerate()
{
for (var i = 0; i < Factory.GetAdapterCount(); ++i)
{
SlimDX.DXGI.Adapter adapter = Factory.GetAdapter(i);
if (adapter.IsInterfaceSupported(typeof(SlimDX.Direct3D10.Device)))
{
DisplayAdapter displayAdapter = new DisplayAdapter(this, adapter);
if (displayAdapter.TryEnumerate())
EnumeratedAdapters.Add(displayAdapter);
else
adapter.Dispose();
}
else
adapter.Dispose();
}
return HasEnumerated;
}
public DisplayAdapter FindBestAdapter(bool argAllowToEnumerate)
{
if (argAllowToEnumerate && !this.TryEnumerate())
return null;
if (!HasEnumerated)
return null;
return EnumeratedAdapters.Last();
}
public OutputDevice FindBestOutput(bool argAllowToEnumerate)
{
if (argAllowToEnumerate && !this.TryEnumerate())
return null;
if (!HasEnumerated)
return null;
return EnumeratedAdapters.Last().FindBestOutput(argAllowToEnumerate);
}
public DisplayMode FindBestDisplayMode(bool argAllowToEnumerate)
{
if (argAllowToEnumerate && !this.TryEnumerate())
return null;
if (!HasEnumerated)
return null;
return EnumeratedAdapters.Last().FindBestDisplayMode(argAllowToEnumerate);
}
public virtual void Verbose()
{
if (!HasEnumerated)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Enumeration was not executed or no results available.");
return;
}
DisplayAdapter displayAdapter = this.FindBestAdapter(false);
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("Adapter: " + displayAdapter.Name);
Console.WriteLine("Dedicated System Memory: " + Math.Round(displayAdapter.DedicatedSystemMemory / 1024.0 / 1024.0, 0, MidpointRounding.AwayFromZero).ToString() + "MB");
Console.WriteLine("Dedicated Video Memory: " + Math.Round(displayAdapter.DedicatedVideoMemory / 1024.0 / 1024.0, 0, MidpointRounding.AwayFromZero).ToString() + "MB");
Console.WriteLine("Shared System Memory: " + Math.Round(displayAdapter.SharedSystemMemory / 1024.0 / 1024.0, 0, MidpointRounding.AwayFromZero).ToString() + "MB");
Console.WriteLine();
for (int i = 0; i < displayAdapter.OutputDevices.Count; ++i)
{
OutputDevice outputDevice = displayAdapter.OutputDevices[i];
if (i == 0)
Console.Write("Primary Output: ");
else
Console.Write("Secondary Output: ");
Console.WriteLine(outputDevice.Name);
DisplayMode displayMode = outputDevice.FindBestDisplayMode(false);
uint bpp = displayMode.Format.GetByteSize() * 8;
Console.WriteLine("Display: " + displayMode.Width.ToString() + "x" + displayMode.Height.ToString() + "x" + bpp.ToString() + " @" + displayMode.RefreshRate + "Hz");
Console.WriteLine();
}
}
#region IDisposable Members
public void Dispose()
{
if (Factory != null)
Factory.Dispose();
Factory = null;
if (EnumeratedAdapters != null)
foreach (var adapter in EnumeratedAdapters)
adapter.Dispose();
EnumeratedAdapters = null;
}
#endregion
}
}

View File

@@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aiwaz.Contracts;
using SlimDX;
namespace Aiwaz.Core
{
public class DisplayAdapter : IDisposable
{
private DeviceEnumerator deviceEnumerator;
public SlimDX.DXGI.Adapter Adapter { get; private set; }
public bool HasEnumerated
{
get { return OutputDevices.Count > 0; }
}
public long DedicatedSystemMemory
{
get { return Adapter.Description.DedicatedSystemMemory; }
}
public long DedicatedVideoMemory
{
get { return Adapter.Description.DedicatedVideoMemory; }
}
public long SharedSystemMemory
{
get { return Adapter.Description.SharedSystemMemory; }
}
public string Name
{
get { return Adapter.Description.Description; }
}
public List<OutputDevice> OutputDevices { get; private set; }
public DisplayAdapter(DeviceEnumerator argDeviceEnumerator, SlimDX.DXGI.Adapter argAdapter)
{
this.deviceEnumerator = argDeviceEnumerator;
this.Adapter = argAdapter;
this.OutputDevices = new List<OutputDevice>();
}
~DisplayAdapter()
{
this.Dispose();
}
public bool TryEnumerate()
{
for (var i = 0; i < Adapter.GetOutputCount(); ++i)
{
var output = Adapter.GetOutput(i);
OutputDevice device = new OutputDevice(deviceEnumerator, output);
if (device.TryEnumerate())
OutputDevices.Add(device);
else
output.Dispose();
}
return HasEnumerated;
}
public OutputDevice FindBestOutput(bool argAllowToEnumerate)
{
if (argAllowToEnumerate && !this.TryEnumerate())
return null;
if (!HasEnumerated)
return null;
return OutputDevices.Last();
}
public DisplayMode FindBestDisplayMode(bool argAllowToEnumerate)
{
if (argAllowToEnumerate && !this.TryEnumerate())
return null;
if (!HasEnumerated)
return null;
return OutputDevices.Last().FindBestDisplayMode(argAllowToEnumerate);
}
#region IDisposable Members
public void Dispose()
{
if (Adapter != null)
Adapter.Dispose();
Adapter = null;
if (OutputDevices != null)
foreach (var output in OutputDevices)
output.Dispose();
OutputDevices = null;
}
#endregion
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aiwaz.Contracts;
using SlimDX;
namespace Aiwaz.Core
{
public class DisplayMode
{
public int Width { get; protected set; }
public int Height { get; protected set; }
public int RefreshRate { get; protected set; }
public SlimDX.DXGI.Format Format { get; protected set; }
public DisplayMode(SlimDX.DXGI.ModeDescription description)
{
this.Width = description.Width;
this.Height = description.Height;
this.Format = description.Format;
this.RefreshRate = description.RefreshRate.Numerator == 0 ? 0 : (int)Math.Round(description.RefreshRate.Numerator / (double)description.RefreshRate.Denominator, 0, MidpointRounding.AwayFromZero);
}
}
}

View File

@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aiwaz.Contracts;
using SlimDX;
namespace Aiwaz.Core
{
public class OutputDevice : IDisposable
{
private SlimDX.DXGI.OutputDescription outputDesc;
private DeviceEnumerator deviceEnumerator;
public SlimDX.DXGI.Output Output { get; private set; }
public bool HasEnumerated
{
get { return DisplayModes.Count > 0; }
}
public List<DisplayMode> DisplayModes { get; private set; }
public string Name
{
get { return outputDesc.Name; }
}
public OutputDevice(DeviceEnumerator argDeviceEnumerator, SlimDX.DXGI.Output argOutput)
{
this.deviceEnumerator = argDeviceEnumerator;
this.Output = argOutput;
this.DisplayModes = new List<DisplayMode>();
}
~OutputDevice()
{
this.Dispose();
}
public bool TryEnumerate()
{
for ( int formatIndex = (int)deviceEnumerator.DesiredFormat;
formatIndex <= (deviceEnumerator.DesiredFormat == SlimDX.DXGI.Format.Unknown ? (int)SlimDX.DXGI.Format.B8G8R8X8_UNorm : (int)deviceEnumerator.DesiredFormat);
++formatIndex
)
{
var format = (SlimDX.DXGI.Format)formatIndex;
var flags = SlimDX.DXGI.DisplayModeEnumerationFlags.Scaling;
var displayModes = Output.GetDisplayModeList(format, flags);
if (displayModes.Count > 0)
{
foreach (var displayModeRaw in displayModes)
{
var keepDisplayMode = false;
var refreshRate = displayModeRaw.RefreshRate.Numerator == 0 ? 0 : (int)(displayModeRaw.RefreshRate.Numerator / displayModeRaw.RefreshRate.Denominator);
if ((deviceEnumerator.DesiredWidth == 0 || deviceEnumerator.DesiredWidth <= displayModeRaw.Width) &&
(deviceEnumerator.DesiredHeight == 0 || deviceEnumerator.DesiredHeight <= displayModeRaw.Height) &&
(deviceEnumerator.DesiredRefreshRate == 0 || deviceEnumerator.DesiredRefreshRate <= refreshRate) &&
(deviceEnumerator.DesiredFormat == SlimDX.DXGI.Format.Unknown || (int)deviceEnumerator.DesiredFormat == (int)displayModeRaw.Format))
{
if (deviceEnumerator.Device != null)
{
var supported = deviceEnumerator.Device.CheckFormatSupport(format);
if ((supported & SlimDX.Direct3D10.FormatSupport.FormatDisplaySupport) != 0)
keepDisplayMode = true;
}
else
keepDisplayMode = true;
}
if (keepDisplayMode)
DisplayModes.Add(new DisplayMode(displayModeRaw));
}
}
}
return HasEnumerated;
}
public DisplayMode FindBestDisplayMode(bool argAllowToEnumerate)
{
if (argAllowToEnumerate && !this.TryEnumerate())
return null;
if (!HasEnumerated)
return null;
return DisplayModes.Last();
}
#region IDisposable Members
public void Dispose()
{
if (Output != null)
Output.Dispose();
Output = null;
}
#endregion
}
}

View File

@@ -0,0 +1,178 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aiwaz.Contracts;
using Aiwaz.Common;
using SlimDX;
namespace Aiwaz.Core
{
public static class Engine
{
public static SlimDX.DXGI.Factory Factory { get; private set; }
public static SlimDX.Direct3D10.Device Device { get; private set; }
public static DeviceEnumerator DeviceEnumerator { get; private set; }
public static EngineStates EngineStates { get; private set; }
public static FileSystem FileSystem { get; private set; }
public static bool Initialized = false;
private static List<WeakReference> managedEngineDisposables;
private static Dictionary<string, WeakReference> managedNamedObjects;
public static void Initialize(DisplayAdapter adapter)
{
if (Initialized)
throw new OnlyOneInstanceAllowedException(typeof(Engine).Name);
managedEngineDisposables = new List<WeakReference>();
managedNamedObjects = new Dictionary<string, WeakReference>();
EngineStates = new EngineStates();
DeviceEnumerator = new DeviceEnumerator(null);
DeviceEnumerator.DesiredFormat = SlimDX.DXGI.Format.R8G8B8A8_UNorm;
FileSystem = new FileSystem();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Initializing engine.");
if (adapter == null)
{
if (!DeviceEnumerator.HasEnumerated && !DeviceEnumerator.TryEnumerate())
throw new InitializingFailedException(typeof(Engine).Name, "Failed to enumerate device.");
adapter = DeviceEnumerator.FindBestAdapter(false);
DeviceEnumerator.Verbose();
}
SlimDX.Direct3D10.DeviceCreationFlags deviceFlags = SlimDX.Direct3D10.DeviceCreationFlags.None;
#if DEBUG
// we want debug informations when we run a debug build
deviceFlags |= SlimDX.Direct3D10.DeviceCreationFlags.Debug;
#endif
// lets create the device now
Device = new SlimDX.Direct3D10.Device(adapter.Adapter, SlimDX.Direct3D10.DriverType.Hardware, deviceFlags);
if(Device == null)
throw new InitializingFailedException(typeof(Engine).Name, "Failed to create device.");
Factory = new SlimDX.DXGI.Factory();
if(Factory == null)
throw new InitializingFailedException(typeof(Engine).Name, "Failed to create GI factory.");
Console.WriteLine("Finished initializing engine.\n");
Initialized = true;
}
public static void RegisterEngineDisposable(IDisposable disposable)
{
if (!Initialized)
throw new InvalidOperationException("Engine not initialized!");
RemoveOrphanedObjects();
managedEngineDisposables.Add(new WeakReference(disposable));
}
public static bool UnregisterEngineDisposable(IDisposable disposable)
{
if (!Initialized)
throw new InvalidOperationException("Engine not initialized!");
RemoveOrphanedObjects();
var weak = managedEngineDisposables.FirstOrDefault(item => item.Target == disposable);
if (weak != null)
return managedEngineDisposables.Remove(weak);
return false;
}
public static bool ExistsName(string name)
{
foreach (var o in managedNamedObjects)
{
if (o.Key == name)
return true;
}
return false;
}
public static void RegisterNamedObject(string name, object item)
{
if (!Initialized)
throw new InvalidOperationException("Engine not initialized!");
RemoveOrphanedObjects();
managedNamedObjects.Add(name, new WeakReference(item));
}
public static void UnregisterNamedObject(string name)
{
if (!Initialized)
throw new InvalidOperationException("Engine not initialized!");
RemoveOrphanedObjects();
managedNamedObjects.Remove(name);
}
public static object FindNamedObject(string name)
{
if (!Initialized)
throw new InvalidOperationException("Engine not initialized!");
RemoveOrphanedObjects();
WeakReference result;
if (managedNamedObjects.TryGetValue(name, out result) && result.IsAlive)
return result.Target;
return null;
}
private static void RemoveOrphanedObjects()
{
int count = managedEngineDisposables.Count;
do
{
managedEngineDisposables.RemoveAll(item => item.IsAlive == false);
} while (count > managedEngineDisposables.Count);
}
public static void Uninitialize()
{
if (!Initialized)
throw new InvalidOperationException("Engine not initialized!");
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Uninitializing engine.");
while (managedEngineDisposables.Count > 0)
{
var weakDisposable = managedEngineDisposables.First();
if (weakDisposable.IsAlive && weakDisposable.Target is IDisposable)
((IDisposable)weakDisposable.Target).Dispose();
managedEngineDisposables.Remove(weakDisposable);
}
if (Device != null)
Device.Dispose();
Device = null;
if (Factory != null)
Factory.Dispose();
Factory = null;
if (DeviceEnumerator != null)
DeviceEnumerator.Dispose();
DeviceEnumerator = null;
if (FileSystem != null)
FileSystem.Dispose();
FileSystem = null;
}
}
}

View File

@@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Aiwaz.Core
{
public class InitializingFailedException : Exception
{
public InitializingFailedException()
: this(null, null)
{
}
public InitializingFailedException(string objectName)
: this(objectName, null)
{
}
public InitializingFailedException(string objectName, string reason)
{
string text = "";
if (string.IsNullOrEmpty(objectName) && string.IsNullOrEmpty(reason))
text = "Unable to initialize object.";
else if (string.IsNullOrEmpty(reason))
text = string.Format("Unable to initialize object '{0}'.", objectName);
else if (string.IsNullOrEmpty(objectName))
text = string.Format("Unable to initialize object. {0}", reason);
else
text = string.Format("Unable to initialize object '{0}'. {1}", objectName, reason);
if (string.IsNullOrEmpty(text))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(text);
}
}
}
public class UninitializingFailedException : Exception
{
public UninitializingFailedException()
: this(null, null)
{
}
public UninitializingFailedException(string objectName)
: this(objectName, null)
{
}
public UninitializingFailedException(string objectName, string reason)
{
string text = "";
if (string.IsNullOrEmpty(objectName) && string.IsNullOrEmpty(reason))
text = "Unable to uninitialize object.";
else if (string.IsNullOrEmpty(reason))
text = string.Format("Unable to uninitialize object '{0}'.", objectName);
else if (string.IsNullOrEmpty(objectName))
text = string.Format("Unable to uninitialize object. {0}", reason);
else
text = string.Format("Unable to uninitialize object '{0}'. {1}", objectName, reason);
if (string.IsNullOrEmpty(text))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(text);
}
}
}
public class OnlyOneInstanceAllowedException : Exception
{
public OnlyOneInstanceAllowedException()
: this(null, null)
{
}
public OnlyOneInstanceAllowedException(string objectName)
: this(objectName, null)
{
}
public OnlyOneInstanceAllowedException(string objectName, string reason)
{
string text = "";
if (string.IsNullOrEmpty(objectName) && string.IsNullOrEmpty(reason))
text = "Only one instance of this object could exist.";
else if (string.IsNullOrEmpty(reason))
text = string.Format("Only one instance of this object '{0}' could exist.", objectName);
else if (string.IsNullOrEmpty(objectName))
text = string.Format("Only one instance of this object could exist. {1}", reason);
else
text = string.Format("Only one instance of this object '{0}' could exist. {1}", objectName, reason);
if (string.IsNullOrEmpty(text))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(text);
}
}
}
public class ActionFailedException : Exception
{
public ActionFailedException()
: this("Action has failed.")
{
}
public ActionFailedException(string text)
: base(text)
{
if (string.IsNullOrEmpty(text))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(text);
}
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AiwazCore")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("AiwazCore")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
[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("cf679c7b-ebf8-4da3-9f46-97c7dbd88d69")]
// 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")]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
D:\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Core.dll
D:\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Core.pdb
D:\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Contracts.dll
D:\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Contracts.pdb
D:\Code\blu-flame.org\aiwaz\Aiwaz.Core\obj\Debug\ResolveAssemblyReference.cache
D:\Code\blu-flame.org\aiwaz\Aiwaz.Core\obj\Debug\Aiwaz.Core.dll
D:\Code\blu-flame.org\aiwaz\Aiwaz.Core\obj\Debug\Aiwaz.Core.pdb
D:\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Common.dll
D:\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Ionic.Zip.dll
D:\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Common.pdb
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Core.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Core.pdb
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Common.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Contracts.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\SlimDX.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Ionic.Zip.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Common.pdb
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\Aiwaz.Contracts.pdb
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\Debug\SlimDX.xml
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\obj\Debug\Aiwaz.Core.csprojResolveAssemblyReference.cache
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\obj\Debug\Aiwaz.Core.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\obj\Debug\Aiwaz.Core.pdb

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

View File

@@ -0,0 +1,12 @@
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\x86\Debug\Aiwaz.Core.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\x86\Debug\Aiwaz.Core.pdb
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\x86\Debug\Aiwaz.Common.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\x86\Debug\Aiwaz.Contracts.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\x86\Debug\SlimDX.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\x86\Debug\Ionic.Zip.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\x86\Debug\Aiwaz.Common.pdb
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\x86\Debug\Aiwaz.Contracts.pdb
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\bin\x86\Debug\SlimDX.xml
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\obj\x86\Debug\Aiwaz.Core.csprojResolveAssemblyReference.cache
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\obj\x86\Debug\Aiwaz.Core.dll
D:\Private\Frank\Code\blu-flame.org\aiwaz\Aiwaz.Core\obj\x86\Debug\Aiwaz.Core.pdb

Binary file not shown.

Binary file not shown.