Compare commits

..

No commits in common. "master" and "osPrimitives" have entirely different histories.

423 changed files with 145810 additions and 69866 deletions

408
.gitignore vendored
View file

@ -1,398 +1,10 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
################################################################################
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################
/trunk/obj/Debug
/bin
/trunk/.vs/lsleditor/v15
/trunk/obj/Release
/lsl-editor-doc.xml
/trunk/lsleditor.csproj.user

184
Settings.StyleCop Normal file
View file

@ -0,0 +1,184 @@
<StyleCopSettings Version="105">
<GlobalSettings>
<StringProperty Name="Culture">en-GB</StringProperty>
</GlobalSettings>
<Parsers>
<Parser ParserId="StyleCop.CSharp.CsParser">
<ParserSettings>
<BooleanProperty Name="AnalyzeDesignerFiles">False</BooleanProperty>
</ParserSettings>
</Parser>
</Parsers>
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
<Rules>
<Rule Name="FileHeaderMustShowCopyright">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustContainFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveValidCompanyText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationHeadersMustNotContainBlankLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertyDocumentationMustHaveValue">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertyDocumentationMustHaveValueText">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustBeginWithACapitalLetter">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustEndWithAPeriod">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustMeetMinimumCharacterLength">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustBeSpelledCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
<Rules>
<Rule Name="UsingDirectivesMustBePlacedWithinNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustAppearInTheCorrectOrder">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeOrderedByAccess">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="StaticElementsMustAppearBeforeInstanceElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
<Rules>
<Rule Name="ElementMustBeginWithUpperCaseLetter">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FieldNamesMustNotUseHungarianNotation">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.LayoutRules">
<Rules>
<Rule Name="CurlyBracketsForMultiLineStatementsMustNotShareLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingCurlyBracketMustBeFollowedByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.SpacingRules">
<Rules>
<Rule Name="TabsMustNotBeUsed">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
<Rules>
<Rule Name="PrefixLocalCallsWithThis">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="CodeMustNotContainMultipleStatementsOnOneLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UseStringEmptyForEmptyStrings">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UseBuiltInTypeAlias">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules">
<Rules>
<Rule Name="FieldsMustBePrivate">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
</Analyzers>
</StyleCopSettings>

View file

@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD>

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,7 @@
<Modules>
<Module PersistentId="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ModuleId="mscorlib" />
<Module PersistentId="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ModuleId="System" />
<Module PersistentId="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" ModuleId="System.Drawing" />
<Module PersistentId="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ModuleId="System.Windows.Forms" />
<Module PersistentId="59468D25-6E68-4113-B740-C6EF4695045B" ModuleId="lsleditor" />
</Modules>

View file

@ -0,0 +1 @@
フマbル

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
s[/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
ワチ<EFBFBD>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
B•ae

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,667 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="LSLEditor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="lsleditor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="LSLEditor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="lsleditor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<LSLEditor.Properties.Settings>
<setting name="AvatarName" serializeAs="String">
<value>SecondLife Name</value>
</setting>
<setting name="BrowserInWindow" serializeAs="String">
<value>False</value>
</setting>
<setting name="AvatarKey" serializeAs="String">
<value />
</setting>
<setting name="RegionName" serializeAs="String">
<value>LSLEditor Island</value>
</setting>
<setting name="EmailServer" serializeAs="String">
<value>smtp.emailserver.tld</value>
</setting>
<setting name="EmailAddress" serializeAs="String">
<value>youraddress@yourdomain.tld</value>
</setting>
<setting name="ProxyServer" serializeAs="String">
<value />
</setting>
<setting name="ProxyUserid" serializeAs="String">
<value />
</setting>
<setting name="ProxyPassword" serializeAs="String">
<value />
</setting>
<setting name="BrowserLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="FindLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="BrowserSize" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="Help" serializeAs="String">
<value>http://www.lslwiki.net/lslwiki/wakka.php?wakka=</value>
</setting>
<setting name="LSLEditorLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="LSLEditorSize" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="RegionFPS" serializeAs="String">
<value>25</value>
</setting>
<setting name="SimulatorSize" serializeAs="String">
<value>0, 175</value>
</setting>
<setting name="SimulatorLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="RegionCorner" serializeAs="String">
<value>254464, 255232</value>
</setting>
<setting name="TabbedDocument" serializeAs="String">
<value>True</value>
</setting>
<setting name="SLColorScheme" serializeAs="String">
<value>False</value>
</setting>
<setting name="SL4SpacesIndent" serializeAs="String">
<value>False</value>
</setting>
<setting name="AutoWordSelection" serializeAs="String">
<value>False</value>
</setting>
<setting name="GotoLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="WikiSeperateBrowser" serializeAs="String">
<value>False</value>
</setting>
<setting name="BracketHighlight" serializeAs="String">
<value>224, 224, 224</value>
</setting>
<setting name="SolutionSize" serializeAs="String">
<value>175, 0</value>
</setting>
<setting name="CallUpgrade" serializeAs="String">
<value>True</value>
</setting>
<setting name="RecentFileMax" serializeAs="String">
<value>15</value>
</setting>
<setting name="CheckForUpdates" serializeAs="String">
<value>True</value>
</setting>
<setting name="CheckEveryDay" serializeAs="String">
<value>True</value>
</setting>
<setting name="CheckEveryWeek" serializeAs="String">
<value>False</value>
</setting>
<setting name="CheckDate" serializeAs="String">
<value>2010-01-01</value>
</setting>
<setting name="RecentProjectMax" serializeAs="String">
<value>15</value>
</setting>
<setting name="IndentCursorPlacement" serializeAs="String">
<value>False</value>
</setting>
<setting name="IndentFullAuto" serializeAs="String">
<value>True</value>
</setting>
<setting name="Indent" serializeAs="String">
<value>True</value>
</setting>
<setting name="SmtpUserid" serializeAs="String">
<value />
</setting>
<setting name="SmtpPassword" serializeAs="String">
<value />
</setting>
<setting name="SmtpAuth" serializeAs="String">
<value>PLAIN</value>
</setting>
<setting name="HelpOnline" serializeAs="String">
<value>True</value>
</setting>
<setting name="HelpOffline" serializeAs="String">
<value>False</value>
</setting>
<setting name="CVSEXE" serializeAs="String">
<value />
</setting>
<setting name="CVSROOT" serializeAs="String">
<value />
</setting>
<setting name="ProjectLocation" serializeAs="String">
<value />
</setting>
<setting name="DeleteOldFiles" serializeAs="String">
<value>False</value>
</setting>
<setting name="CodeCompletionUserVar" serializeAs="String">
<value>False</value>
</setting>
<setting name="CodeCompletion" serializeAs="String">
<value>True</value>
</setting>
<setting name="CommentCStyle" serializeAs="String">
<value>False</value>
</setting>
<setting name="SkipWarnings" serializeAs="String">
<value>False</value>
</setting>
<setting name="SingleQuote" serializeAs="String">
<value>False</value>
</setting>
<setting name="QuotesListVerbose" serializeAs="String">
<value>False</value>
</setting>
<setting name="CodeCompletionArguments" serializeAs="String">
<value>True</value>
</setting>
<setting name="IndentWarning" serializeAs="String">
<value>True</value>
</setting>
<setting name="IndentAutoCorrect" serializeAs="String">
<value>False</value>
</setting>
<setting name="SvnExe" serializeAs="String">
<value />
</setting>
<setting name="SvnUserid" serializeAs="String">
<value />
</setting>
<setting name="SvnPassword" serializeAs="String">
<value />
</setting>
<setting name="ShowSolutionExplorer" serializeAs="String">
<value>False</value>
</setting>
<setting name="WorkingDirectory" serializeAs="String">
<value />
</setting>
<setting name="XSecondLifeShard" serializeAs="String">
<value>Production</value>
</setting>
<setting name="AutoSaveOnDebug" serializeAs="String">
<value>False</value>
</setting>
<setting name="ToolTip" serializeAs="String">
<value>True</value>
</setting>
<setting name="HelpNewTab" serializeAs="String">
<value>True</value>
</setting>
<setting name="CodeCompletionAnimation" serializeAs="String">
<value>True</value>
</setting>
<setting name="ExampleNameNotecard" serializeAs="String">
<value>NoteCard.txt</value>
</setting>
<setting name="llGetScriptName" serializeAs="String">
<value>False</value>
</setting>
<setting name="StatesInGlobalFunctions" serializeAs="String">
<value>False</value>
</setting>
<setting name="ParcelName" serializeAs="String">
<value>LSLEditor parcel</value>
</setting>
<setting name="ParcelDescription" serializeAs="String">
<value>Description of LSLEditor parcel</value>
</setting>
<setting name="ParcelOwner" serializeAs="String">
<value>00000000-0000-0000-0000-000000000000</value>
</setting>
<setting name="ParcelGroup" serializeAs="String">
<value>00000000-0000-0000-0000-000000000000</value>
</setting>
<setting name="ParcelArea" serializeAs="String">
<value>512</value>
</setting>
<setting name="VersionControl" serializeAs="String">
<value>True</value>
</setting>
<setting name="VersionControlSVN" serializeAs="String">
<value>True</value>
</setting>
<setting name="OutputFormat" serializeAs="String">
<value>UTF-8</value>
</setting>
<setting name="ParcelID" serializeAs="String">
<value>00000000-0000-0000-0000-000000000000</value>
</setting>
<setting name="ParcelSeeAvatars" serializeAs="String">
<value>True</value>
</setting>
<setting name="ShowIncludeMetaData" serializeAs="String">
<value>True</value>
</setting>
<setting name="ExampleNameLSLI" serializeAs="String">
<value>default.lsli</value>
</setting>
</LSLEditor.Properties.Settings>
<lsleditor.Properties.Settings>
<setting name="AvatarName" serializeAs="String">
<value>SecondLife Name</value>
</setting>
<setting name="BrowserInWindow" serializeAs="String">
<value>False</value>
</setting>
<setting name="AvatarKey" serializeAs="String">
<value />
</setting>
<setting name="RegionName" serializeAs="String">
<value>LSLEditor Island</value>
</setting>
<setting name="EmailServer" serializeAs="String">
<value>smtp.emailserver.tld</value>
</setting>
<setting name="EmailAddress" serializeAs="String">
<value>youraddress@yourdomain.ext</value>
</setting>
<setting name="ProxyServer" serializeAs="String">
<value />
</setting>
<setting name="ProxyUserid" serializeAs="String">
<value />
</setting>
<setting name="ProxyPassword" serializeAs="String">
<value />
</setting>
<setting name="BrowserLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="FindLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="BrowserSize" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="Help" serializeAs="String">
<value>http://www.lslwiki.net/lslwiki/wakka.php?wakka=</value>
</setting>
<setting name="LSLEditorLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="LSLEditorSize" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="RegionFPS" serializeAs="String">
<value>25</value>
</setting>
<setting name="SimulatorSize" serializeAs="String">
<value>0, 175</value>
</setting>
<setting name="SimulatorLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="RegionCorner" serializeAs="String">
<value>254464, 255232</value>
</setting>
<setting name="TabbedDocument" serializeAs="String">
<value>True</value>
</setting>
<setting name="SLColorScheme" serializeAs="String">
<value>False</value>
</setting>
<setting name="SL4SpacesIndent" serializeAs="String">
<value>False</value>
</setting>
<setting name="AutoWordSelection" serializeAs="String">
<value>False</value>
</setting>
<setting name="GotoLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="WikiSeperateBrowser" serializeAs="String">
<value>False</value>
</setting>
<setting name="BracketHighlight" serializeAs="String">
<value>224, 224, 224</value>
</setting>
<setting name="SolutionSize" serializeAs="String">
<value>175, 0</value>
</setting>
<setting name="CallUpgrade" serializeAs="String">
<value>True</value>
</setting>
<setting name="RecentFileMax" serializeAs="String">
<value>15</value>
</setting>
<setting name="CheckForUpdates" serializeAs="String">
<value>True</value>
</setting>
<setting name="CheckEveryDay" serializeAs="String">
<value>True</value>
</setting>
<setting name="CheckEveryWeek" serializeAs="String">
<value>False</value>
</setting>
<setting name="CheckDate" serializeAs="String">
<value>2010-01-01</value>
</setting>
<setting name="RecentProjectMax" serializeAs="String">
<value>15</value>
</setting>
<setting name="IndentCursorPlacement" serializeAs="String">
<value>False</value>
</setting>
<setting name="IndentFullAuto" serializeAs="String">
<value>True</value>
</setting>
<setting name="Indent" serializeAs="String">
<value>True</value>
</setting>
<setting name="SmtpUserid" serializeAs="String">
<value />
</setting>
<setting name="SmtpPassword" serializeAs="String">
<value />
</setting>
<setting name="SmtpAuth" serializeAs="String">
<value>PLAIN</value>
</setting>
<setting name="HelpOnline" serializeAs="String">
<value>True</value>
</setting>
<setting name="HelpOffline" serializeAs="String">
<value>False</value>
</setting>
<setting name="CVSEXE" serializeAs="String">
<value />
</setting>
<setting name="CVSROOT" serializeAs="String">
<value />
</setting>
<setting name="ProjectLocation" serializeAs="String">
<value />
</setting>
<setting name="DeleteOldFiles" serializeAs="String">
<value>False</value>
</setting>
<setting name="CodeCompletionUserVar" serializeAs="String">
<value>False</value>
</setting>
<setting name="CodeCompletion" serializeAs="String">
<value>True</value>
</setting>
<setting name="CommentCStyle" serializeAs="String">
<value>False</value>
</setting>
<setting name="SkipWarnings" serializeAs="String">
<value>False</value>
</setting>
<setting name="SingleQuote" serializeAs="String">
<value>False</value>
</setting>
<setting name="QuotesListVerbose" serializeAs="String">
<value>False</value>
</setting>
<setting name="CodeCompletionArguments" serializeAs="String">
<value>True</value>
</setting>
<setting name="IndentWarning" serializeAs="String">
<value>True</value>
</setting>
<setting name="IndentAutoCorrect" serializeAs="String">
<value>False</value>
</setting>
<setting name="SvnExe" serializeAs="String">
<value />
</setting>
<setting name="SvnUserid" serializeAs="String">
<value />
</setting>
<setting name="SvnPassword" serializeAs="String">
<value />
</setting>
<setting name="ShowSolutionExplorer" serializeAs="String">
<value>False</value>
</setting>
<setting name="WorkingDirectory" serializeAs="String">
<value />
</setting>
<setting name="XSecondLifeShard" serializeAs="String">
<value>Production</value>
</setting>
<setting name="AutoSaveOnDebug" serializeAs="String">
<value>False</value>
</setting>
<setting name="ToolTip" serializeAs="String">
<value>True</value>
</setting>
<setting name="HelpNewTab" serializeAs="String">
<value>True</value>
</setting>
<setting name="CodeCompletionAnimation" serializeAs="String">
<value>True</value>
</setting>
<setting name="ExampleNameNotecard" serializeAs="String">
<value>NoteCard.txt</value>
</setting>
<setting name="llGetScriptName" serializeAs="String">
<value>False</value>
</setting>
<setting name="StatesInGlobalFunctions" serializeAs="String">
<value>False</value>
</setting>
<setting name="ParcelName" serializeAs="String">
<value>LSLEditor parcel</value>
</setting>
<setting name="ParcelDescription" serializeAs="String">
<value>Description of LSLEditor parcel</value>
</setting>
<setting name="ParcelOwner" serializeAs="String">
<value>00000000-0000-0000-0000-000000000000</value>
</setting>
<setting name="ParcelGroup" serializeAs="String">
<value>00000000-0000-0000-0000-000000000000</value>
</setting>
<setting name="ParcelArea" serializeAs="String">
<value>512</value>
</setting>
<setting name="VersionControl" serializeAs="String">
<value>True</value>
</setting>
<setting name="VersionControlSVN" serializeAs="String">
<value>True</value>
</setting>
<setting name="OutputFormat" serializeAs="String">
<value>UTF-8</value>
</setting>
</lsleditor.Properties.Settings>
</userSettings>
<applicationSettings>
<LSLEditor.Properties.Settings>
<setting name="ConfLSL" serializeAs="String">
<value>Resource.ConfLSL.xml</value>
</setting>
<setting name="ExampleName" serializeAs="String">
<value>new.lsl</value>
</setting>
<setting name="ReleaseNotes" serializeAs="String">
<value>ReleaseNotes.htm</value>
</setting>
<setting name="About" serializeAs="String">
<value>About.htm</value>
</setting>
<setting name="TabStops" serializeAs="String">
<value>4</value>
</setting>
<setting name="ToolTipDelay" serializeAs="String">
<value>100</value>
</setting>
<setting name="PathClipLength" serializeAs="String">
<value>60</value>
</setting>
<setting name="ExampleTemplate" serializeAs="String">
<value>default.lsl</value>
</setting>
<setting name="HelpOfflineFile" serializeAs="String">
<value>LSLEditorHelp.chm</value>
</setting>
<setting name="Example" serializeAs="String">
<value>
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}
touch_start(integer total_number)
{
llSay(0, "Touched: "+(string)total_number);
}
}
</value>
</setting>
<setting name="Examples" serializeAs="String">
<value>http://www.lsleditor.org/examples/</value>
</setting>
<setting name="Upload" serializeAs="String">
<value>http://www.lsleditor.org/uploadscript/</value>
</setting>
<setting name="ConfCSharp" serializeAs="String">
<value>Resource.ConfCSharp.xml</value>
</setting>
<setting name="ToolsOptions" serializeAs="String">
<value>Resource.ToolsOptions.xml</value>
</setting>
<setting name="ContactUrl" serializeAs="String">
<value>https://sourceforge.net/tracker/?group_id=319248</value>
</setting>
<setting name="DonateUrl" serializeAs="String">
<value>http://www.lsleditor.org/donate.htm</value>
</setting>
<setting name="Help2" serializeAs="String">
<value>http://wiki.secondlife.com/wiki/Special:Search?go=Go&amp;search=</value>
</setting>
<setting name="Help1" serializeAs="String">
<value>http://www.lslwiki.net/lslwiki/wakka.php?wakka=</value>
</setting>
<setting name="ForumLSLEditor" serializeAs="String">
<value>https://sourceforge.net/projects/lsleditor/forums</value>
</setting>
<setting name="qasite" serializeAs="String">
<value>http://metaversegames.net/questions/lsl</value>
</setting>
<setting name="svnloc" serializeAs="String">
<value />
</setting>
<setting name="Update" serializeAs="String">
<value>http://lsleditor.sourceforge.net/check4update.php</value>
</setting>
<setting name="UpdateManifest" serializeAs="String">
<value>http://lsleditor.sourceforge.net/update.php</value>
</setting>
<setting name="Update1" serializeAs="String">
<value>http://a-w-d.dyndns.org:8080/lsleditor/check4update.php</value>
</setting>
<setting name="UpdateManifest1" serializeAs="String">
<value>http://a-w-d.dyndns.org:8080/lsleditor/update.php</value>
</setting>
</LSLEditor.Properties.Settings>
<lsleditor.Properties.Settings>
<setting name="ConfLSL" serializeAs="String">
<value>Resource.ConfLSL.xml</value>
</setting>
<setting name="ExampleName" serializeAs="String">
<value>new.lsl</value>
</setting>
<setting name="ReleaseNotes" serializeAs="String">
<value>ReleaseNotes.htm</value>
</setting>
<setting name="About" serializeAs="String">
<value>About.htm</value>
</setting>
<setting name="TabStops" serializeAs="String">
<value>4</value>
</setting>
<setting name="ToolTipDelay" serializeAs="String">
<value>100</value>
</setting>
<setting name="PathClipLength" serializeAs="String">
<value>60</value>
</setting>
<setting name="ExampleTemplate" serializeAs="String">
<value>default.lsl</value>
</setting>
<setting name="HelpOfflineFile" serializeAs="String">
<value>LSLEditorHelp.chm</value>
</setting>
<setting name="Example" serializeAs="String">
<value>
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}
touch_start(integer total_number)
{
llSay(0, "Touched: "+(string)total_number);
}
}
</value>
</setting>
<setting name="Examples" serializeAs="String">
<value>http://www.lsleditor.org/examples/</value>
</setting>
<setting name="Upload" serializeAs="String">
<value>http://www.lsleditor.org/uploadscript/</value>
</setting>
<setting name="ConfCSharp" serializeAs="String">
<value>Resource.ConfCSharp.xml</value>
</setting>
<setting name="ToolsOptions" serializeAs="String">
<value>Resource.ToolsOptions.xml</value>
</setting>
<setting name="ContactUrl" serializeAs="String">
<value>https://sourceforge.net/tracker/?group_id=319248</value>
</setting>
<setting name="DonateUrl" serializeAs="String">
<value>http://www.lsleditor.org/donate.htm</value>
</setting>
<setting name="Help2" serializeAs="String">
<value>http://wiki.secondlife.com/wiki/Special:Search?go=Go&amp;search=</value>
</setting>
<setting name="Help1" serializeAs="String">
<value>http://www.lslwiki.net/lslwiki/wakka.php?wakka=</value>
</setting>
<setting name="ForumLSLEditor" serializeAs="String">
<value>https://sourceforge.net/projects/lsleditor/forums</value>
</setting>
<setting name="qasite" serializeAs="String">
<value>http://metaversegames.net/questions/lsl</value>
</setting>
<setting name="svnloc" serializeAs="String">
<value />
</setting>
<setting name="Update" serializeAs="String">
<value>http://lsleditor.sourceforge.net/check4update.php</value>
</setting>
<setting name="UpdateManifest" serializeAs="String">
<value>http://lsleditor.sourceforge.net/update.php</value>
</setting>
<setting name="Update1" serializeAs="String">
<value>http://a-w-d.dyndns.org:8080/lsleditor/check4update.php</value>
</setting>
<setting name="UpdateManifest1" serializeAs="String">
<value>http://a-w-d.dyndns.org:8080/lsleditor/update.php</value>
</setting>
</lsleditor.Properties.Settings>
</applicationSettings>
</configuration>

View file

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

File diff suppressed because it is too large Load diff

View file

@ -1,684 +0,0 @@
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
// This class is used to convert LSLI to LSL and the other way around.
// Created by Jasper Wiggerink
// 13-11-2017
// </summary>
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace LSLEditor.Helpers
{
class LSLIConverter
{
private EditForm editForm;
private const string BEGIN = "//#BEGIN";
private const string END = "//#END";
private const string INCLUDE = "//#include";
public const string EXPANDED_SUBEXT = ".expanded";
public const string LSL_EXT = ".lsl";
public const string LSLI_EXT = ".lsli";
public static List<string> validExtensions = new List<string>() { LSLI_EXT, LSL_EXT };
private const string INCLUDE_REGEX = "(\n|^)\\s*" + INCLUDE + "\\(\".*?\"\\).*";
private const string BEGIN_REGEX = "(\\s+|^)" + BEGIN;
private const string END_REGEX = "(\\s+|^)" + END;
private const string EMPTY_OR_WHITESPACE_REGEX = "^\\s*$";
private const string PATH_OF_INCLUDE_REGEX = "\".*?\"";
private const string EMPTY_SCRIPT = "// Empty script\n";
private List<string> implementedIncludes = new List<string>();
private int includeDepth = 0;
public LSLIConverter()
{
}
/// <summary>
/// Searches for a file with one of the validExtensions based on a name or path. Also searches in the IncludeDirectories
/// </summary>
/// <param name="file"></param>
/// <returns>File path</returns>
private static string SearchFile(string file)
{
// Search in optional include directories
foreach (string directory in Properties.Settings.Default.IncludeDirectories)
{
string pFile;
if (file.ToLower().Contains(directory.ToLower()))
{
pFile = file;
}
else
{
pFile = directory + file;
}
if (File.Exists(pFile))
{
return pFile;
}
if (Path.GetExtension(file) == "")
{
foreach (string extension in validExtensions)
{
if (file.Contains(directory))
{
pFile = file + extension;
}
else
{
pFile = directory + file + extension;
}
if (File.Exists(pFile))
{
return pFile;
}
}
}
}
// Search for file relative to the script
if (File.Exists(file))
{
return file;
}
if (Path.GetExtension(file) == "")
{
string pFile = "";
foreach (string extension in validExtensions)
{
pFile = file + extension;
if (File.Exists(pFile)) {
return pFile;
}
}
}
return "";
}
/// <summary>
/// Returns the path of the file
/// </summary>
/// <param name="pathOfInclude"></param>
/// <param name="pathOfScript"></param>
/// <returns></returns>
private string GetFilePath(string pathOfInclude, string pathOfScript)
{
// Step 1 (optional). Search from include directories
// Step 2. Search from relative path from script
string pathOfIncludeOriginal = pathOfInclude;
pathOfInclude = SearchFile(pathOfInclude);
if (pathOfInclude == "")
{
// If path is relative and no includedirectories
if (!Path.IsPathRooted(pathOfIncludeOriginal))
{
pathOfInclude = LSLIPathHelper.GetRelativePath(pathOfScript, Environment.CurrentDirectory) + pathOfIncludeOriginal;
}
else if (this.implementedIncludes.Count > 0) // If there are already includes, the relative path is already correct
{
pathOfInclude = Path.GetDirectoryName(this.implementedIncludes.LastOrDefault()) + '\\' + pathOfIncludeOriginal;
}
else
{
pathOfInclude = pathOfIncludeOriginal;
}
// If path is absolute it will stay the pathOfInclude
pathOfInclude = SearchFile(pathOfInclude);
}
return pathOfInclude;
}
/// <summary>
/// Finds all indexes of a value in a string
/// </summary>
/// <param name="str"></param>
/// <param name="value"></param>
/// <returns></returns>
public static List<int> AllIndexesOf(string str, string value)
{
if (!String.IsNullOrEmpty(value))
{
List<int> indexes = new List<int>();
for (int index = 0; ; index += value.Length)
{
index = str.IndexOf(value, index);
if (index == -1)
return indexes;
indexes.Add(index);
}
}
return null;
}
/// <summary>
/// Compares 2 paths and returns true if they are different, false if they're the same.
/// Warning: This doesn't compare extensions.
/// </summary>
/// <param name="pathOfInclude"></param>
/// <param name="pathOfScript"></param>
/// <returns></returns>
public static bool IsDifferentScript(string pathOfInclude, string pathOfScript)
{
string pathOfScriptNoExt = LSLIPathHelper.RemoveExpandedSubExtension(Path.GetFileNameWithoutExtension(pathOfScript));
string pathOfIncludeNoExt = LSLIPathHelper.RemoveExpandedSubExtension(Path.GetFileNameWithoutExtension(pathOfInclude));
// Compare paths
return !pathOfScriptNoExt.EndsWith(pathOfIncludeNoExt);
}
/// <summary>
/// This is a hack to get the correct line, since problems arose in WriteAfterLine when inserting index-based.
/// It checks for each occurance of lineBefore (when it's an include statement) if it has a BEGIN after it.
/// </summary>
/// <param name="lineBefore"></param>
/// <returns></returns>
private int GetCorrectIndexOfLine(string lineBefore, string context)
{
string trimmedLine = Regex.Replace(lineBefore, @"\s+", "");
string matchString = Regex.Match(trimmedLine, INCLUDE_REGEX).ToString();
// Tussen de één na laatste en de laatste moet de include statement staan, of na de laatste
int lastButOneNewLineIndex = lineBefore.TrimEnd('\n').LastIndexOf('\n') > -1 ? lineBefore.TrimEnd('\n').LastIndexOf('\n') : 0;
string lineBeforeAfterLastButOneNewLine = lineBefore.Substring(lastButOneNewLineIndex).TrimEnd('\n'); // Best variable name ever?
if (Regex.IsMatch(lineBefore.TrimEnd('\n'), INCLUDE_REGEX)
&& Regex.IsMatch(lineBeforeAfterLastButOneNewLine, INCLUDE_REGEX)) // Line before this line is an include statement, that means this is a BEGIN statement //lineBefore.TrimEnd('\n').EndsWith(matchString)
{
// Get all matches with this linebefore
List<int> allIndexes = AllIndexesOf(context, lineBefore);
foreach (int index in allIndexes)
{
// Check wether there is already a begin statement
string targetText = context.Substring(index + lineBefore.Length); // This is the text after lineBefore
targetText = Regex.Replace(targetText, @"\s+", "");
if (targetText.StartsWith(BEGIN)) // If the targetted text starts with BEGIN, then we should keep searching
{
continue;
} else
{
return index; // Found a free spot! Return the index
}
}
}
return context.LastIndexOf(lineBefore); // If the lineBefore is not an include statement, simply return the last index of it.
}
/// <summary>
/// Creates a new line in the context after another line
/// </summary>
/// <param name="context"></param>
/// <param name="newLine"></param>
/// <param name="lineBefore"></param>
/// <returns>Context with the new line</returns>
private StringBuilder WriteAfterLine(StringBuilder context, string newLine, string lineBefore)
{
string ctx = context.ToString();
int lastIndexOfLineBefore = GetCorrectIndexOfLine(lineBefore, ctx);
int includeIndex = lastIndexOfLineBefore + lineBefore.Length;
string hasSeperator = lineBefore.Substring(lineBefore.Length - 1, 1);
if (hasSeperator != "\n")
{
newLine = "\n" + newLine;
}
hasSeperator = newLine.Substring(newLine.Length - 1, 1);
if (hasSeperator != "\n")
{
newLine += "\n";
}
context.Insert(includeIndex, newLine);
return context;
}
/// <summary>
/// Shows an 'Oops...' messagebox with the message and verboses it.
/// </summary>
/// <param name="message"></param>
private void ShowError(string message)
{
if (!editForm.verboseQueue.Contains(message))
{
MessageBox.Show(message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
editForm.verboseQueue.Add(message);
}
}
/// <summary>
/// Returns the amount of tabs for an include depth
/// </summary>
/// <param name="includeDepth"></param>
/// <param name="OneLess"></param>
/// <returns></returns>
private string GetTabsForIncludeDepth(int includeDepth, bool OneLess = false)
{
string tabs = "";
if(OneLess && includeDepth != 0)
{
includeDepth--;
}
for(int i = 0; i < includeDepth; i++)
{
tabs += "\t";
}
return tabs;
}
/// <summary>
/// Returns the amount of tabs in front of an include statement
/// </summary>
/// <param name="includeLine"></param>
/// <returns></returns>
private string GetTabsForIndentedInclude(string includeLine, int includeDepth, bool isDebug = false)
{
if(includeLine.Contains('\t'))
{
int includeIndex = Regex.Match(includeLine, INCLUDE).Index;
string beforeInclude = includeLine.Substring(0, includeIndex);
if(beforeInclude.Contains('\n'))
{
// Last '\n' before includeIndex
int lastIndexNewLine = beforeInclude.LastIndexOf('\n');
beforeInclude = beforeInclude.Substring(lastIndexNewLine, beforeInclude.Length - lastIndexNewLine);
}
int tabCount = 0;
// Count the tabs between the start of the line and the begin of the include.
if (isDebug)
{
tabCount = beforeInclude.Count(f => f == '\t') - (includeDepth - 1); // The tabcount should be without the includeDepth, because this was already added.
} else
{
tabCount = beforeInclude.Count(f => f == '\t');
}
string tabs = "";
for (int i = 0; i < tabCount; i++)
{
tabs += "\t";
}
return tabs;
}
return "";
}
/// <summary>
/// Returns the amount of spaces in front of an include statement
/// </summary>
/// <param name="includeLine"></param>
/// <returns></returns>
private string GetSpacesForIndentedInclude(string includeLine, int includeDepth, bool isDebug = false)
{
if (includeLine.Contains(" "))
{
int includeIndex = Regex.Match(includeLine, INCLUDE).Index;
string beforeInclude = includeLine.Substring(0, includeIndex);
int spaceCount = 0;
// Count the space between the start of the line and the begin of the include.
if (isDebug)
{
// The spacecount should be without the includeDepth, because this was already added.
spaceCount = beforeInclude.Count(f => f == ' ') - (includeDepth - 1);
}
else
{
spaceCount = beforeInclude.Count(f => f == ' ');
}
string spaces = "";
for (int i = 0; i < spaceCount; i++)
{
spaces += " ";
}
return spaces;
}
return "";
}
/// <summary>
/// Returns the amount of tabs/spaces for an include script
/// </summary>
/// <param name="includeLine"></param>
/// <param name="includeDepth"></param>
/// <param name="OneLess"></param>
/// <returns></returns>
private string GetTabsForIncludeScript(string includeLine, int includeDepth, bool OneLess = false)
{
string includeDepthTabs = GetTabsForIncludeDepth(includeDepth, OneLess);
string indentedIncludeTabs = GetTabsForIndentedInclude(includeLine, includeDepth, true);
string spacesForIndentedInclude = GetSpacesForIndentedInclude(includeLine, includeDepth, true);
return includeDepthTabs + indentedIncludeTabs + spacesForIndentedInclude;
}
/// <summary>
/// Returns the line of the match within a context
/// </summary>
/// <param name="context"></param>
/// <param name="m"></param>
/// <returns></returns>
private string GetLineOfMatch(string context, Match m)
{
string contentAfterMatchValue = context.Substring(m.Index + m.Value.Length);
int indexOfNewLine = contentAfterMatchValue.IndexOf('\n') + m.Index + m.Value.Length + 1; // Index of the first occurence of \n after this match
return context.Substring(m.Index, indexOfNewLine - m.Index); // Get full line
}
/// <summary>
/// Inserts an included script and writes the expanded script for export.
/// </summary>
/// <param name="pathOfInclude"></param>
/// <param name="sb"></param>
/// <param name="line"></param>
/// <returns></returns>
private StringBuilder WriteExportScript(string pathOfInclude, StringBuilder sb, string includeLine)
{
string script = GetTabsForIndentedInclude(includeLine, includeDepth) + EMPTY_SCRIPT;
using (StreamReader sr = new StreamReader(pathOfInclude))
{
this.implementedIncludes.Add(Path.GetFullPath(pathOfInclude));
string scriptRaw = sr.ReadToEnd();
scriptRaw = GetTabsForIndentedInclude(includeLine, includeDepth) + scriptRaw.Replace("\n", "\n" + GetTabsForIndentedInclude(includeLine, includeDepth));
// If there are includes in the included script
if (Regex.IsMatch(scriptRaw, INCLUDE_REGEX))
{
// Then import these scripts too
script = ImportScripts(scriptRaw, pathOfInclude, false) + "\n";
}
else if (!Regex.IsMatch(scriptRaw, EMPTY_OR_WHITESPACE_REGEX))
{
script = scriptRaw + "\n";
}
}
this.WriteAfterLine(sb, script, includeLine);
string ctx = sb.ToString();
return new StringBuilder(ctx.Remove(ctx.IndexOf(includeLine.TrimStart('\n')), includeLine.TrimStart('\n').Length)); // Deletes the include statement
}
/// <summary>
/// Inserts an included script and writes it to the expanded script for debug.
/// </summary>
/// <param name="pathOfInclude"></param>
/// <param name="sb"></param>
/// <param name="line"></param>
/// <returns></returns>
private StringBuilder WriteDebugScript(string pathOfInclude, StringBuilder sb, string includeLine)
{
sb = this.WriteAfterLine(sb, GetTabsForIncludeScript(includeLine, includeDepth, true) + BEGIN, includeLine);
// Insert included script
string script = GetTabsForIncludeScript(includeLine, includeDepth) + EMPTY_SCRIPT;
using (StreamReader sr = new StreamReader(pathOfInclude))
{
this.implementedIncludes.Add(Path.GetFullPath(pathOfInclude));
string scriptRaw = sr.ReadToEnd();
scriptRaw = GetTabsForIncludeScript(includeLine, includeDepth) + scriptRaw.Replace("\n", "\n" + GetTabsForIncludeScript(includeLine, includeDepth));
// If there are includes in the included script
if (Regex.IsMatch(scriptRaw, INCLUDE_REGEX))
{
// Then import these scripts too
script = "\n" + ImportScripts(scriptRaw, pathOfInclude) + "\n";
}
else if (!Regex.IsMatch(scriptRaw, EMPTY_OR_WHITESPACE_REGEX))// Check if its not empty or whitespace
{
script = scriptRaw + "\n";
}
}
this.WriteAfterLine(sb, script, BEGIN + "\n");
this.WriteAfterLine(sb, GetTabsForIncludeScript(includeLine, includeDepth, true) + END, script);
return sb;
}
/// <summary>
/// Imports scripts from //#include statements
/// </summary>
/// <param name="strC">Sourcecode</param>
/// <param name="pathOfScript">Path of the source code of the script</param>
/// <returns>Sourcecode with imported scripts</returns>
private string ImportScripts(string strC, string pathOfScript, bool ShowBeginEnd = true)
{
if(!LSLIPathHelper.IsLSLI(pathOfScript))
{
// If it's not an LSLI script, it can't import a script
return strC;
}
StringBuilder sb = new StringBuilder(strC);
MatchCollection mIncludes = Regex.Matches(strC, INCLUDE_REGEX); // Find includes
foreach (Match m in mIncludes)
{
if (this.includeDepth == 0)
{
this.implementedIncludes = new List<string>();
}
includeDepth++;
string line = GetLineOfMatch(strC, m);
int lineNumber = strC.Take(m.Index + line.Length - 1).Count(c => c == '\n') + 1;
string pathOfIncludeOriginal = Regex.Match(line, PATH_OF_INCLUDE_REGEX).Value.Trim('"');
string pathOfInclude = pathOfIncludeOriginal;
string ext = Path.GetExtension(pathOfInclude).ToLower();
if ((validExtensions.Contains(ext) || ext == "") && IsDifferentScript(pathOfInclude, pathOfScript))
{
pathOfInclude = GetFilePath(pathOfInclude, pathOfScript);
if (pathOfInclude != "" && !this.implementedIncludes.Contains(Path.GetFullPath(pathOfInclude)))
{
if (!ShowBeginEnd)
{
sb = WriteExportScript(pathOfInclude, sb, line);
}
else
{
sb = WriteDebugScript(pathOfInclude, sb, line);
}
}
else if (pathOfInclude != "" && this.implementedIncludes.Contains(Path.GetFullPath(pathOfInclude)))
{
string message = "Error: Recursive include loop detected: \"" + Path.GetFullPath(pathOfInclude) +
"\". In script \""
+ Path.GetFileName(pathOfScript) + "\". Line " + lineNumber + ".";
ShowError(message);
} else
{
string relativeToPathOfScript = LSLIPathHelper.GetRelativePath(pathOfScript, Environment.CurrentDirectory);
string correctPath = Path.GetFullPath(relativeToPathOfScript) + pathOfIncludeOriginal;
string message = "Error: Unable to find file \"" + correctPath +
"\". In script \"" + Path.GetFileName(pathOfScript) + "\". Line " + lineNumber + ".";
ShowError(message);
}
}
includeDepth--;
if(this.implementedIncludes.Count > 0)
{
this.implementedIncludes.Remove(this.implementedIncludes.Last());
}
}
return sb.ToString();
}
/// <summary>
/// Removes included scripts
/// </summary>
/// <param name="strC">Sourcecode</param>
/// <returns>Sourcecode without imported scripts</returns>
private static string RemoveScripts(string strC)
{
StringBuilder sb = new StringBuilder(strC);
int indexOfFirstBeginStatement = -1;
uint depth = 0;
int readIndex = 0;
using (StringReader sr = new StringReader(strC))
{
int amountOfLines = strC.Split('\n').Length;
for (int i = 1; i < amountOfLines; i++)
{
string line = sr.ReadLine();
if (Regex.IsMatch(line, BEGIN_REGEX))
{
if (depth == 0)
{
indexOfFirstBeginStatement = readIndex;
}
depth++;
}
readIndex += line.Length + 1;
if (Regex.IsMatch(line, END_REGEX))
{
depth--;
if (depth == 0)
{
sb.Remove(indexOfFirstBeginStatement, (readIndex - indexOfFirstBeginStatement));
readIndex -= readIndex - indexOfFirstBeginStatement;
indexOfFirstBeginStatement = -1;
}
}
}
}
return sb.ToString();
}
/// <summary>
/// Call this to collapse LSL to LSLI
/// </summary>
/// <param name="editform"></param>
/// <returns>LSLI</returns>
public static string CollapseToLSLI(string source)
{
string sourceCode = RemoveScripts(source);
return sourceCode;
}
/// <summary>
/// Call this to collapse LSL to LSLI
/// </summary>
/// <param name="editform"></param>
/// <returns>LSLI</returns>
public string CollapseToLSLIFromEditform(EditForm editform)
{
this.editForm = editform;
return CollapseToLSLI(editform.SourceCode);
}
/// <summary>
/// Call this to collapse LSL to LSLI
/// </summary>
/// <param name="editform"></param>
/// <returns>LSLI</returns>
public static string CollapseToLSLIFromPath(string path)
{
string sourceCode = "";
using(StreamReader sr = new StreamReader(path))
{
sourceCode = sr.ReadToEnd();
}
return CollapseToLSLI(sourceCode);
}
/// <summary>
/// Call this to expand LSLI to LSL
/// </summary>
/// <param name="editForm"></param>
/// <returns>LSL</returns>
public string ExpandToLSL(EditForm editForm, bool ShowBeginEnd = true)
{
editForm.verboseQueue = new List<string>();
this.editForm = editForm;
string strC = editForm.SourceCode;
string fullPathName = editForm.FullPathName;
if (LSLIPathHelper.IsExpandedLSL(editForm.ScriptName))
{
// Collapse first, to ensure it is expanded showing or not showing begin/end.
strC = CollapseToLSLI(strC);
// Mimic LSLI file
fullPathName = LSLIPathHelper.CreateCollapsedPathAndScriptName(fullPathName);
}
string sourceCode = ImportScripts(strC, fullPathName, ShowBeginEnd);
return sourceCode;
}
}
}

View file

@ -1,270 +0,0 @@
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
// This class is used to help with paths and LSLI files.
// Created by Jasper Wiggerink
// 13-11-2017
// </summary>
using System;
using System.IO;
namespace LSLEditor.Helpers
{
static class LSLIPathHelper
{
public const string READONLY_TAB_EXTENSION = " (Read Only)";
public const string EXPANDED_TAB_EXTENSION = " (Expanded LSL)";
/// <summary>
/// Checks if a filename is LSLI
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
public static bool IsLSLI(string filename)
{
filename = TrimStarsAndWhiteSpace(filename);
return Path.GetExtension(filename).ToLower() == LSLIConverter.LSLI_EXT;
}
/// <summary>
/// Checks if a filename is an expanded LSL file
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
public static bool IsExpandedLSL(string filename)
{
filename = TrimStarsAndWhiteSpace(filename);
return filename.EndsWith(LSLIConverter.EXPANDED_SUBEXT + LSLIConverter.LSL_EXT);
}
/// <summary>
/// Creates a LSLI scriptname from a filename.
/// </summary>
/// <returns></returns>
public static string CreateCollapsedScriptName(string filename)
{
string nameCollapsed = RemoveDotInFrontOfFilename(Path.GetFileNameWithoutExtension(RemoveExpandedSubExtension(filename)) + LSLIConverter.LSLI_EXT);
return nameCollapsed;
}
/// <summary>
/// Removes only the last extension
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
private static string RemoveExtension(string filename)
{
filename = TrimStarsAndWhiteSpace(filename.Remove(filename.LastIndexOf(Path.GetExtension(filename))));
return filename;
}
/// <summary>
/// Removes the .expanded in a filename
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
public static string RemoveExpandedSubExtension(string filename)
{
if (filename.Contains(LSLIConverter.EXPANDED_SUBEXT))
{
return filename.Replace(LSLIConverter.EXPANDED_SUBEXT, "");
}
return filename;
}
/// <summary>
/// Creates a new path and name from the given filename.
/// E.g. turns path/to/file.expanded.lsl into path/to/file.lsli
/// </summary>
/// <returns></returns>
public static string CreateCollapsedPathAndScriptName(string filename)
{
return RemoveDotInFrontOfFilename(RemoveExtension(RemoveExpandedSubExtension(filename)) + LSLIConverter.LSLI_EXT);
}
/// <summary>
/// Creates a new path and name from the original path and name based on the editForm.
/// E.g. turns path/to/file.lsli into path/to/.file.expanded.lsl
/// </summary>
/// <returns></returns>
public static string CreateExpandedPathAndScriptName(string path)
{
if(path.Contains(LSLIConverter.EXPANDED_SUBEXT))
{
return PutDotInFrontOfFilename(RemoveExtension(path) + LSLIConverter.LSL_EXT);
} else
{
return PutDotInFrontOfFilename(RemoveExtension(path) + LSLIConverter.EXPANDED_SUBEXT + LSLIConverter.LSL_EXT);
}
}
/// <summary>
/// Creates an expanded scriptname out of the given filename.
/// </summary>
/// <returns></returns>
public static string CreateExpandedScriptName(string filename)
{
string nameExpanded = "";
if (filename != null)
{
nameExpanded = Path.GetFileNameWithoutExtension(filename) + LSLIConverter.EXPANDED_SUBEXT + LSLIConverter.LSL_EXT;
}
return PutDotInFrontOfFilename(TrimStarsAndWhiteSpace(nameExpanded));
}
/// <summary>
/// Puts dot in front of a filename, e.g. "path/file.lsl" to "path/.file.lsl"
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
private static string PutDotInFrontOfFilename(string filename)
{
int afterLastIndexOfSeperator = (filename.LastIndexOf('\\') > filename.LastIndexOf('/') ? filename.LastIndexOf('\\') : filename.LastIndexOf('/')) + 1;
if (filename.Substring(afterLastIndexOfSeperator, 1) == ".")
{
return filename;
}
filename = filename.Insert(afterLastIndexOfSeperator, ".");
return filename;
}
/// <summary>
/// If found, removes the dot in front of a filename.
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
public static string RemoveDotInFrontOfFilename(string filename)
{
int afterLastIndexOfSeperator = (filename.LastIndexOf('\\') > filename.LastIndexOf('/') ? filename.LastIndexOf('\\') : filename.LastIndexOf('/')) + 1;
if (filename.Substring(afterLastIndexOfSeperator, 1) != ".")
{
return filename;
}
filename = filename.Remove(afterLastIndexOfSeperator, 1);
return filename;
}
/// <summary>
/// "Hides" the file in the folder by setting it's attributes to "Hidden"
/// </summary>
/// <param name="path"></param>
public static void HideFile(string path)
{
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden);
}
/// <summary>
/// First checks if the file exists, then deletes it
/// </summary>
/// <param name="path"></param>
public static void DeleteFile(string path)
{
if (File.Exists(path))
{
File.Delete(path);
}
}
/// <summary>
/// Trims the "dirty" stars and whitespace in a string. E.g. "file*.lsl " to "file.lsl"
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string TrimStarsAndWhiteSpace(string str)
{
return str.Trim(' ').TrimEnd('*');
}
/// <summary>
/// Turns an expanded script name into a string to be displayed as the tab name
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static string GetExpandedTabName(string path)
{
if (path == null) return "";
return RemoveDotInFrontOfFilename(Path.GetFileNameWithoutExtension(RemoveExpandedSubExtension(path)) + LSLIConverter.LSLI_EXT + EXPANDED_TAB_EXTENSION);
}
/// <summary>
/// Turns a LSLI readonly script name into a string to be displayed as the tab name
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
public static string GetReadOnlyTabName(string filename)
{
if (filename == null) return "";
return CreateCollapsedPathAndScriptName(filename) + READONLY_TAB_EXTENSION;
}
/// <summary>
/// Creates a relative path between two paths
/// </summary>
/// <param name="filespec">The file or folder to create a relative path towards</param>
/// <param name="folder">The base folder</param>
/// <returns></returns>
public static string GetRelativePath(string filespec, string folder)
{
filespec = Path.GetFullPath(filespec).ToLower();
if (LSLIConverter.validExtensions.Contains(filespec.Substring(filespec.LastIndexOf("."))))
{
int lastIndexOfSeperator = filespec.LastIndexOf('\\') > filespec.LastIndexOf('/') ? filespec.LastIndexOf('\\') : filespec.LastIndexOf('/');
filespec = filespec.Remove(lastIndexOfSeperator);
}
Uri pathUri = new Uri(filespec);
if (!folder.EndsWith(Path.DirectorySeparatorChar.ToString()))
{
folder += Path.DirectorySeparatorChar;
}
Uri folderUri = new Uri(folder);
string relativePath = Uri.UnescapeDataString(folderUri.MakeRelativeUri(pathUri).ToString().Replace('/', Path.DirectorySeparatorChar));
if (relativePath.Substring(relativePath.Length - 3) != Path.DirectorySeparatorChar.ToString())
{
relativePath += Path.DirectorySeparatorChar;
}
return relativePath;
}
}
}

View file

@ -1,26 +0,0 @@
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LSLEditor.Helpers
{
internal static class StringCollectionExtension
{
internal static string[] ToArray(this StringCollection strings)
{
string[] ret = new string[strings.Count];
strings.CopyTo(ret, 0);
return ret;
}
internal static void set(this StringCollection strings, List<string> newList)
{
strings.Clear();
strings.AddRange(newList.ToArray());
}
}
}

View file

@ -1,213 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LSLEditor.Images {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Images {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Images() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LSLEditor.Images.Images", typeof(Images).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Class {
get {
object obj = ResourceManager.GetObject("Class", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap CloseActive {
get {
object obj = ResourceManager.GetObject("CloseActive", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap CloseDisabled {
get {
object obj = ResourceManager.GetObject("CloseDisabled", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap CloseInactive {
get {
object obj = ResourceManager.GetObject("CloseInactive", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Constants {
get {
object obj = ResourceManager.GetObject("Constants", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Enum {
get {
object obj = ResourceManager.GetObject("Enum", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Events {
get {
object obj = ResourceManager.GetObject("Events", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Functions {
get {
object obj = ResourceManager.GetObject("Functions", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap logo {
get {
object obj = ResourceManager.GetObject("logo", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Namespace {
get {
object obj = ResourceManager.GetObject("Namespace", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Properties {
get {
object obj = ResourceManager.GetObject("Properties", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SealedClass {
get {
object obj = ResourceManager.GetObject("SealedClass", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap States {
get {
object obj = ResourceManager.GetObject("States", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Unknown {
get {
object obj = ResourceManager.GetObject("Unknown", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Vars {
get {
object obj = ResourceManager.GetObject("Vars", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View file

@ -1,166 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Class" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>class.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CloseActive" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>close-active.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CloseDisabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>close-disabled.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CloseInactive" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>close-inactive.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Constants" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>constants.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Enum" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>enum.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Events" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>events.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Functions" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>functions.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>logo.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Namespace" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>namespace.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Properties" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>properties.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SealedClass" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>sealedclass.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="States" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>states.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Unknown" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>unknown.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Vars" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>vars.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -1,35 +0,0 @@
using LSLEditor.Solution;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LSLEditor.Images
{
public static class ImagesHelper
{
public enum ImageType
{
Class,
CloseActive,
CloseDisabled,
CloseInactive,
Constants,
Enum,
Events,
Functions,
logo,
Namespace,
Properties,
SealedClass,
States,
Unknown,
Vars
}
public static Bitmap getImageByType(this ImageType type)
{
return (Bitmap)typeof(Images).GetProperty(type.ToString()).GetValue(new Images());
}
}
}

View file

@ -1,17 +0,0 @@
using LSLEditor.Solution;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LSLEditor.ImagesSolutionExplorer
{
public static class ImagesHelper
{
public static Bitmap getImageByType(this SolutionExplorer.TypeSL type)
{
return (Bitmap)typeof(SolutionImages).GetProperty(type.ToString()).GetValue(new SolutionImages());
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

View file

@ -1,517 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LSLEditor.ImagesSolutionExplorer {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class SolutionImages {
public static readonly object lck = new object();
private static SolutionImages _def;
public static SolutionImages Default { get
{
if(_def == null)
{
lock (lck)
{
_def = new SolutionImages();
return _def;
}
}return _def;
}
}
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal SolutionImages() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LSLEditor.ImagesSolutionExplorer.SolutionImages", typeof(SolutionImages).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Animation {
get {
object obj = ResourceManager.GetObject("Animation", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Animations {
get {
object obj = ResourceManager.GetObject("Animations", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Body_Parts {
get {
object obj = ResourceManager.GetObject("Body_Parts", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Calling_Cards {
get {
object obj = ResourceManager.GetObject("Calling_Cards", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Clothes {
get {
object obj = ResourceManager.GetObject("Clothes", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Eyes {
get {
object obj = ResourceManager.GetObject("Eyes", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Folder {
get {
object obj = ResourceManager.GetObject("Folder", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Gesture {
get {
object obj = ResourceManager.GetObject("Gesture", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Gestures {
get {
object obj = ResourceManager.GetObject("Gestures", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Gloves {
get {
object obj = ResourceManager.GetObject("Gloves", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Hair {
get {
object obj = ResourceManager.GetObject("Hair", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Inventory {
get {
object obj = ResourceManager.GetObject("Inventory", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Jacket {
get {
object obj = ResourceManager.GetObject("Jacket", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Landmark {
get {
object obj = ResourceManager.GetObject("Landmark", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Landmarks {
get {
object obj = ResourceManager.GetObject("Landmarks", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Lost_And_Found {
get {
object obj = ResourceManager.GetObject("Lost_And_Found", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap LSLIScript {
get {
object obj = ResourceManager.GetObject("LSLIScript", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Notecard {
get {
object obj = ResourceManager.GetObject("Notecard", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Notecards {
get {
object obj = ResourceManager.GetObject("Notecards", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Object {
get {
object obj = ResourceManager.GetObject("Object", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Objects {
get {
object obj = ResourceManager.GetObject("Objects", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Pants {
get {
object obj = ResourceManager.GetObject("Pants", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Photo_Album {
get {
object obj = ResourceManager.GetObject("Photo_Album", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Prim {
get {
object obj = ResourceManager.GetObject("Prim", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Project {
get {
object obj = ResourceManager.GetObject("Project", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap question {
get {
object obj = ResourceManager.GetObject("question", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Script {
get {
object obj = ResourceManager.GetObject("Script", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Scripts {
get {
object obj = ResourceManager.GetObject("Scripts", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Shape {
get {
object obj = ResourceManager.GetObject("Shape", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Shirt {
get {
object obj = ResourceManager.GetObject("Shirt", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Shoes {
get {
object obj = ResourceManager.GetObject("Shoes", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Skin {
get {
object obj = ResourceManager.GetObject("Skin", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Skirt {
get {
object obj = ResourceManager.GetObject("Skirt", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Snapshot {
get {
object obj = ResourceManager.GetObject("Snapshot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Socks {
get {
object obj = ResourceManager.GetObject("Socks", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Solution {
get {
object obj = ResourceManager.GetObject("Solution", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Sound {
get {
object obj = ResourceManager.GetObject("Sound", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Sounds {
get {
object obj = ResourceManager.GetObject("Sounds", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Texture {
get {
object obj = ResourceManager.GetObject("Texture", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Textures {
get {
object obj = ResourceManager.GetObject("Textures", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Trash {
get {
object obj = ResourceManager.GetObject("Trash", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Underpants {
get {
object obj = ResourceManager.GetObject("Underpants", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Undershirt {
get {
object obj = ResourceManager.GetObject("Undershirt", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Unknown {
get {
object obj = ResourceManager.GetObject("Unknown", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View file

@ -1,253 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Animation" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>animation.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Animations" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>animations.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Body_Parts" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>body parts.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Calling_Cards" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>calling cards.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Clothes" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>clothes.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Eyes" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>eyes.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Folder" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>folder.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Gesture" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>gesture.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Gestures" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>gestures.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Gloves" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>gloves.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Hair" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>hair.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Inventory" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>inventory.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Jacket" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>jacket.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Landmark" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>landmark.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Landmarks" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>landmarks.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Lost_And_Found" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>lost and found.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LSLIScript" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>lsliscript.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Notecard" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>notecard.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Notecards" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>notecards.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Object" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>object.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Objects" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>objects.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pants" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>pants.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Photo_Album" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>photo album.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Prim" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>prim.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Project" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>project.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="question" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>question.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Script" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>script.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Scripts" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>scripts.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Shape" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>shape.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Shirt" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>shirt.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Shoes" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>shoes.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Skin" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>skin.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Skirt" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>skirt.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Snapshot" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>snapshot.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Socks" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>socks.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Solution" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>solution.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Sound" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>sound.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Sounds" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>sounds.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Texture" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>texture.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Textures" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>textures.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Trash" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>trash.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Underpants" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>underpants.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Undershirt" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>undershirt.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Unknown" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>unknown.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -1,74 +0,0 @@
namespace LSLEditor.Tools
{
partial class IncludeExportSettings
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBoxIncludeExportSettings = new System.Windows.Forms.GroupBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.groupBoxIncludeExportSettings.SuspendLayout();
this.SuspendLayout();
//
// groupBoxIncludeExportSettings
//
this.groupBoxIncludeExportSettings.Controls.Add(this.checkBox1);
this.groupBoxIncludeExportSettings.Location = new System.Drawing.Point(3, 3);
this.groupBoxIncludeExportSettings.Name = "groupBoxIncludeExportSettings";
this.groupBoxIncludeExportSettings.Size = new System.Drawing.Size(380, 64);
this.groupBoxIncludeExportSettings.TabIndex = 0;
this.groupBoxIncludeExportSettings.TabStop = false;
this.groupBoxIncludeExportSettings.Text = "Include export settings";
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(16, 28);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(184, 17);
this.checkBox1.TabIndex = 0;
this.checkBox1.Text = "Show include metadata on export";
this.checkBox1.UseVisualStyleBackColor = true;
//
// IncludeExportSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBoxIncludeExportSettings);
this.Name = "IncludeExportSettings";
this.Size = new System.Drawing.Size(386, 266);
this.groupBoxIncludeExportSettings.ResumeLayout(false);
this.groupBoxIncludeExportSettings.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBoxIncludeExportSettings;
private System.Windows.Forms.CheckBox checkBox1;
}
}

View file

@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace LSLEditor.Tools
{
public partial class IncludeExportSettings : UserControl, ICommit
{
public IncludeExportSettings()
{
InitializeComponent();
checkBox1.Checked = Properties.Settings.Default.ShowIncludeMetaData;
}
public void Commit()
{
Properties.Settings.Default.ShowIncludeMetaData = checkBox1.Checked;
}
}
}

View file

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -1,139 +0,0 @@
namespace LSLEditor.Tools
{
partial class ProjectIncludes
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBoxAddIncludeDir = new System.Windows.Forms.TextBox();
this.groupBoxIncludeDirs = new System.Windows.Forms.GroupBox();
this.buttonRemove = new System.Windows.Forms.Button();
this.buttonAddIncludeDir = new System.Windows.Forms.Button();
this.listBoxIncludeDirs = new System.Windows.Forms.ListBox();
this.buttonBrowseDirs = new System.Windows.Forms.Button();
this.labelIncludeDirs = new System.Windows.Forms.Label();
this.folderBrowserDialogSelectIncludeDir = new System.Windows.Forms.FolderBrowserDialog();
this.groupBoxIncludeDirs.SuspendLayout();
this.SuspendLayout();
//
// textBoxAddIncludeDir
//
this.textBoxAddIncludeDir.Location = new System.Drawing.Point(16, 40);
this.textBoxAddIncludeDir.Name = "textBoxAddIncludeDir";
this.textBoxAddIncludeDir.Size = new System.Drawing.Size(270, 20);
this.textBoxAddIncludeDir.TabIndex = 0;
this.textBoxAddIncludeDir.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxAddIncludeDir_KeyPress);
//
// groupBoxIncludeDirs
//
this.groupBoxIncludeDirs.Controls.Add(this.buttonRemove);
this.groupBoxIncludeDirs.Controls.Add(this.buttonAddIncludeDir);
this.groupBoxIncludeDirs.Controls.Add(this.listBoxIncludeDirs);
this.groupBoxIncludeDirs.Controls.Add(this.buttonBrowseDirs);
this.groupBoxIncludeDirs.Controls.Add(this.labelIncludeDirs);
this.groupBoxIncludeDirs.Location = new System.Drawing.Point(3, 3);
this.groupBoxIncludeDirs.Name = "groupBoxIncludeDirs";
this.groupBoxIncludeDirs.Size = new System.Drawing.Size(386, 266);
this.groupBoxIncludeDirs.TabIndex = 1;
this.groupBoxIncludeDirs.TabStop = false;
this.groupBoxIncludeDirs.Text = "Include directories";
//
// buttonRemove
//
this.buttonRemove.Location = new System.Drawing.Point(290, 229);
this.buttonRemove.Name = "buttonRemove";
this.buttonRemove.Size = new System.Drawing.Size(75, 23);
this.buttonRemove.TabIndex = 4;
this.buttonRemove.Text = "Remove";
this.buttonRemove.UseVisualStyleBackColor = true;
this.buttonRemove.Click += new System.EventHandler(this.buttonRemove_Click);
//
// buttonAddIncludeDir
//
this.buttonAddIncludeDir.Location = new System.Drawing.Point(331, 36);
this.buttonAddIncludeDir.Name = "buttonAddIncludeDir";
this.buttonAddIncludeDir.Size = new System.Drawing.Size(34, 23);
this.buttonAddIncludeDir.TabIndex = 3;
this.buttonAddIncludeDir.Text = "Add";
this.buttonAddIncludeDir.UseVisualStyleBackColor = true;
this.buttonAddIncludeDir.Click += new System.EventHandler(this.buttonAddIncludeDir_Click);
//
// listBoxIncludeDirs
//
this.listBoxIncludeDirs.FormattingEnabled = true;
this.listBoxIncludeDirs.HorizontalScrollbar = true;
this.listBoxIncludeDirs.Location = new System.Drawing.Point(13, 76);
this.listBoxIncludeDirs.Name = "listBoxIncludeDirs";
this.listBoxIncludeDirs.Size = new System.Drawing.Size(352, 147);
this.listBoxIncludeDirs.TabIndex = 2;
this.listBoxIncludeDirs.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listBoxIncludeDirs_KeyUp);
//
// buttonBrowseDirs
//
this.buttonBrowseDirs.Location = new System.Drawing.Point(292, 36);
this.buttonBrowseDirs.Name = "buttonBrowseDirs";
this.buttonBrowseDirs.Size = new System.Drawing.Size(32, 23);
this.buttonBrowseDirs.TabIndex = 1;
this.buttonBrowseDirs.Text = "...";
this.buttonBrowseDirs.UseVisualStyleBackColor = true;
this.buttonBrowseDirs.Click += new System.EventHandler(this.buttonBrowseDirs_Click);
//
// labelIncludeDirs
//
this.labelIncludeDirs.AutoSize = true;
this.labelIncludeDirs.Location = new System.Drawing.Point(14, 20);
this.labelIncludeDirs.Name = "labelIncludeDirs";
this.labelIncludeDirs.Size = new System.Drawing.Size(109, 13);
this.labelIncludeDirs.TabIndex = 0;
this.labelIncludeDirs.Text = "Add include directory:";
//
// ProjectIncludes
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.textBoxAddIncludeDir);
this.Controls.Add(this.groupBoxIncludeDirs);
this.Name = "ProjectIncludes";
this.Size = new System.Drawing.Size(392, 272);
this.groupBoxIncludeDirs.ResumeLayout(false);
this.groupBoxIncludeDirs.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBoxAddIncludeDir;
private System.Windows.Forms.GroupBox groupBoxIncludeDirs;
private System.Windows.Forms.Label labelIncludeDirs;
private System.Windows.Forms.Button buttonBrowseDirs;
private System.Windows.Forms.ListBox listBoxIncludeDirs;
private System.Windows.Forms.Button buttonAddIncludeDir;
private System.Windows.Forms.Button buttonRemove;
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialogSelectIncludeDir;
}
}

View file

@ -1,108 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using LSLEditor.Helpers;
namespace LSLEditor.Tools
{
public partial class ProjectIncludes : UserControl, ICommit
{
public ProjectIncludes()
{
InitializeComponent();
listBoxIncludeDirs.Items.Clear();
listBoxIncludeDirs.Items.AddRange(Properties.Settings.Default.IncludeDirectories.ToArray());
}
private bool AddToIncludeDirs(string path)
{
// Check if it can find the directory
if(Directory.Exists(path))
{
// Put directory seperator after path
path = path.LastOrDefault() == '\\' || path.LastOrDefault() == '/' ? path : path + '\\';
// Check if it's already in the settings
if(!Properties.Settings.Default.IncludeDirectories.Contains(path))
{
// Add to listbox
listBoxIncludeDirs.Items.Add(path);
return true;
}
} else
{
MessageBox.Show("The given directory was not found. \n\"" + path + "\"", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return false;
}
private bool RemoveFromIncludeDirs()
{
if(listBoxIncludeDirs.SelectedItem != null)
{
listBoxIncludeDirs.Items.Remove(listBoxIncludeDirs.SelectedItem);
return true;
}
return false;
}
public void Commit()
{
List<string> items = new List<string>();
// Add to settings
foreach(Object item in listBoxIncludeDirs.Items)
{
items.Add(item.ToString());
}
Properties.Settings.Default.IncludeDirectories.set(items);
}
private void buttonAddIncludeDir_Click(object sender, EventArgs e)
{
if(textBoxAddIncludeDir.Text != "")
{
AddToIncludeDirs(textBoxAddIncludeDir.Text);
}
}
private void textBoxAddIncludeDir_KeyPress(object sender, KeyPressEventArgs e)
{
if(e.KeyChar == (char)Keys.Enter)
{
if (textBoxAddIncludeDir.Text != "")
{
AddToIncludeDirs(textBoxAddIncludeDir.Text);
}
}
}
private void buttonBrowseDirs_Click(object sender, EventArgs e)
{
this.folderBrowserDialogSelectIncludeDir.RootFolder = Environment.SpecialFolder.MyComputer;
if (this.folderBrowserDialogSelectIncludeDir.ShowDialog(this) == DialogResult.OK)
{
AddToIncludeDirs(this.folderBrowserDialogSelectIncludeDir.SelectedPath);
}
}
private void buttonRemove_Click(object sender, EventArgs e)
{
RemoveFromIncludeDirs();
}
private void listBoxIncludeDirs_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete || e.KeyCode == Keys.Back)
{
RemoveFromIncludeDirs();
}
}
}
}

View file

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="folderBrowserDialogSelectIncludeDir.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -1,60 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Web References\org.lsleditor.www\Reference.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Web References\org.lsleditor.www\Reference.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<Compile Update="ImagesSolutionExplorer\SolutionImages.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>SolutionImages.resx</DependentUpon>
</Compile>
<Compile Update="Images\Images.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Images.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="ImagesSolutionExplorer\SolutionImages.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>SolutionImages.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Images\Images.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Images.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>

View file

@ -1,175 +1,175 @@
namespace LSLEditor
{
/// <summary>
/// About dialogue box form.
/// </summary>
public partial class About
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Container for LSLife picture.
/// </summary>
private System.Windows.Forms.PictureBox pictureBox1;
/// <summary>
/// Container to hold all the elements.
/// </summary>
private System.Windows.Forms.GroupBox groupBox1;
/// <summary>
/// OK Button.
/// </summary>
private System.Windows.Forms.Button button1;
/// <summary>
/// Web Browser.
/// </summary>
private System.Windows.Forms.WebBrowser webBrowser1;
/// <summary>
/// Link label.
/// </summary>
private System.Windows.Forms.LinkLabel linkLabel1;
/// <summary>
/// Version label.
/// </summary>
private System.Windows.Forms.Label label1;
/// <summary>
/// LSL Editor label.
/// </summary>
private System.Windows.Forms.Label label2;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">True if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null)) {
this.components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.webBrowser1 = new System.Windows.Forms.WebBrowser();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Image = global::LSLEditor.Properties.Resources.logo;
this.pictureBox1.Location = new System.Drawing.Point(16, 16);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(184, 80);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.webBrowser1);
this.groupBox1.Controls.Add(this.linkLabel1);
this.groupBox1.Controls.Add(this.pictureBox1);
this.groupBox1.Location = new System.Drawing.Point(16, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(320, 360);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "LSL-Editor";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(72, 112);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(16, 13);
this.label2.TabIndex = 4;
this.label2.Text = "...";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 112);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(45, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Version:";
//
// webBrowser1
//
this.webBrowser1.Location = new System.Drawing.Point(8, 128);
this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser1.Name = "webBrowser1";
this.webBrowser1.Size = new System.Drawing.Size(304, 224);
this.webBrowser1.TabIndex = 2;
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(16, 96);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(79, 13);
this.linkLabel1.TabIndex = 1;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "© 2006 — 2012";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// button1
//
this.button1.Location = new System.Drawing.Point(240, 376);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Ok";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// About
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(352, 410);
this.Controls.Add(this.button1);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "About";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "About";
this.Load += new System.EventHandler(this.About_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
}
}
namespace LSLEditor
{
/// <summary>
/// About dialogue box form.
/// </summary>
public partial class About
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Container for LSLife picture.
/// </summary>
private System.Windows.Forms.PictureBox pictureBox1;
/// <summary>
/// Container to hold all the elements.
/// </summary>
private System.Windows.Forms.GroupBox groupBox1;
/// <summary>
/// OK Button.
/// </summary>
private System.Windows.Forms.Button button1;
/// <summary>
/// Web Browser.
/// </summary>
private System.Windows.Forms.WebBrowser webBrowser1;
/// <summary>
/// Link label.
/// </summary>
private System.Windows.Forms.LinkLabel linkLabel1;
/// <summary>
/// Version label.
/// </summary>
private System.Windows.Forms.Label label1;
/// <summary>
/// LSL Editor label.
/// </summary>
private System.Windows.Forms.Label label2;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">True if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null)) {
this.components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.webBrowser1 = new System.Windows.Forms.WebBrowser();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Image = global::LSLEditor.Properties.Resources.logo;
this.pictureBox1.Location = new System.Drawing.Point(16, 16);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(184, 80);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.webBrowser1);
this.groupBox1.Controls.Add(this.linkLabel1);
this.groupBox1.Controls.Add(this.pictureBox1);
this.groupBox1.Location = new System.Drawing.Point(16, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(320, 360);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "LSL-Editor";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(72, 112);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(16, 13);
this.label2.TabIndex = 4;
this.label2.Text = "...";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 112);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(45, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Version:";
//
// webBrowser1
//
this.webBrowser1.Location = new System.Drawing.Point(8, 128);
this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser1.Name = "webBrowser1";
this.webBrowser1.Size = new System.Drawing.Size(304, 224);
this.webBrowser1.TabIndex = 2;
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(16, 96);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(79, 13);
this.linkLabel1.TabIndex = 1;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "© 2006 — 2012";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// button1
//
this.button1.Location = new System.Drawing.Point(240, 376);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Ok";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// About
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(352, 410);
this.Controls.Add(this.button1);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "About";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "About";
this.Load += new System.EventHandler(this.About_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
}
}

View file

@ -1,100 +1,100 @@
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
// About.cs
// Provides the code for the About dialogue
// </summary>
using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
namespace LSLEditor
{
/// <summary>
/// About dialogue box form.
/// </summary>
public partial class About : Form
{
/// <summary>
/// Initialises a new instance of the <see cref="About" /> class.
/// </summary>
/// <param name="parent">The parent form.</param>
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1642:ConstructorSummaryDocumentationMustBeginWithStandardText", Justification = "Reviewed.")]
public About(LSLEditorForm parent)
{
this.InitializeComponent();
this.Icon = parent.Icon;
string strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
this.label2.Text = strVersion;
}
/// <summary>
/// OK/Close button.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
/// <summary>
/// Link to SourceForge page.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(Properties.Settings.Default.ContactUrl);
}
/// <summary>
/// Loads the page.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void About_Load(object sender, EventArgs e)
{
string strExeFileName = Path.GetFileName(Assembly.GetExecutingAssembly().CodeBase);
this.webBrowser1.Navigate("res://" + strExeFileName + "/" + Properties.Settings.Default.About);
}
}
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
// About.cs
// Provides the code for the About dialogue
// </summary>
using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
namespace LSLEditor
{
/// <summary>
/// About dialogue box form.
/// </summary>
public partial class About : Form
{
/// <summary>
/// Initialises a new instance of the <see cref="About" /> class.
/// </summary>
/// <param name="parent">The parent form.</param>
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1642:ConstructorSummaryDocumentationMustBeginWithStandardText", Justification = "Reviewed.")]
public About(LSLEditorForm parent)
{
this.InitializeComponent();
this.Icon = parent.Icon;
string strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
this.label2.Text = strVersion;
}
/// <summary>
/// OK/Close button.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
/// <summary>
/// Link to SourceForge page.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(Properties.Settings.Default.ContactUrl);
}
/// <summary>
/// Loads the page.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void About_Load(object sender, EventArgs e)
{
string strExeFileName = Path.GetFileName(Assembly.GetExecutingAssembly().CodeBase);
this.webBrowser1.Navigate("res://" + strExeFileName + "/" + Properties.Settings.Default.About);
}
}
}

View file

@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

View file

@ -1,63 +1,63 @@
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
//
//
// </summary>
using System;
using System.IO;
// BZip2.Decompress(File.OpenRead("in"), File.Create("out"));
namespace LSLEditor.Decompressor
{
public sealed class BZip2
{
public static void Decompress(Stream inStream, Stream outStream)
{
using ( outStream ) {
using ( BZip2InputStream bzis = new BZip2InputStream(inStream) ) {
int ch = bzis.ReadByte();
while (ch != -1) {
outStream.WriteByte((byte)ch);
ch = bzis.ReadByte();
}
}
}
}
}
}
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
//
//
// </summary>
using System;
using System.IO;
// BZip2.Decompress(File.OpenRead("in"), File.Create("out"));
namespace LSLEditor.Decompressor
{
public sealed class BZip2
{
public static void Decompress(Stream inStream, Stream outStream)
{
using ( outStream ) {
using ( BZip2InputStream bzis = new BZip2InputStream(inStream) ) {
int ch = bzis.ReadByte();
while (ch != -1) {
outStream.WriteByte((byte)ch);
ch = bzis.ReadByte();
}
}
}
}
}
}

View file

@ -1,161 +1,161 @@
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
//
//
// </summary>
namespace LSLEditor.Decompressor
{
/// <summary>
/// Defines internal values for both compression and decompression
/// </summary>
public sealed class BZip2Constants
{
/// <summary>
/// Random numbers used to randomise repetitive blocks
/// </summary>
public readonly static int[] rNums = {
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
936, 638
};
/// <summary>
/// When multiplied by compression parameter (1-9) gives the block size for compression
/// 9 gives the best compresssion but uses the most memory.
/// </summary>
public const int baseBlockSize = 100000;
/// <summary>
/// Backend constant
/// </summary>
public const int MAX_ALPHA_SIZE = 258;
/// <summary>
/// Backend constant
/// </summary>
public const int MAX_CODE_LEN = 23;
/// <summary>
/// Backend constant
/// </summary>
public const int RUNA = 0;
/// <summary>
/// Backend constant
/// </summary>
public const int RUNB = 1;
/// <summary>
/// Backend constant
/// </summary>
public const int N_GROUPS = 6;
/// <summary>
/// Backend constant
/// </summary>
public const int G_SIZE = 50;
/// <summary>
/// Backend constant
/// </summary>
public const int N_ITERS = 4;
/// <summary>
/// Backend constant
/// </summary>
public const int MAX_SELECTORS = (2 + (900000 / G_SIZE));
/// <summary>
/// Backend constant
/// </summary>
public const int NUM_OVERSHOOT_BYTES = 20;
private BZip2Constants()
{
}
}
}
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
//
//
// </summary>
namespace LSLEditor.Decompressor
{
/// <summary>
/// Defines internal values for both compression and decompression
/// </summary>
public sealed class BZip2Constants
{
/// <summary>
/// Random numbers used to randomise repetitive blocks
/// </summary>
public readonly static int[] rNums = {
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
936, 638
};
/// <summary>
/// When multiplied by compression parameter (1-9) gives the block size for compression
/// 9 gives the best compresssion but uses the most memory.
/// </summary>
public const int baseBlockSize = 100000;
/// <summary>
/// Backend constant
/// </summary>
public const int MAX_ALPHA_SIZE = 258;
/// <summary>
/// Backend constant
/// </summary>
public const int MAX_CODE_LEN = 23;
/// <summary>
/// Backend constant
/// </summary>
public const int RUNA = 0;
/// <summary>
/// Backend constant
/// </summary>
public const int RUNB = 1;
/// <summary>
/// Backend constant
/// </summary>
public const int N_GROUPS = 6;
/// <summary>
/// Backend constant
/// </summary>
public const int G_SIZE = 50;
/// <summary>
/// Backend constant
/// </summary>
public const int N_ITERS = 4;
/// <summary>
/// Backend constant
/// </summary>
public const int MAX_SELECTORS = (2 + (900000 / G_SIZE));
/// <summary>
/// Backend constant
/// </summary>
public const int NUM_OVERSHOOT_BYTES = 20;
private BZip2Constants()
{
}
}
}

View file

@ -1,93 +1,93 @@
// IChecksum.cs - Interface to compute a data checksum
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
namespace LSLEditor.Decompressor
{
/// <summary>
/// Interface to compute a data checksum used by checked input/output streams.
/// A data checksum can be updated by one byte or with a byte array. After each
/// update the value of the current checksum can be returned by calling
/// <code>getValue</code>. The complete checksum object can also be reset
/// so it can be used again with new data.
/// </summary>
public interface IChecksum
{
/// <summary>
/// Returns the data checksum computed so far.
/// </summary>
long Value
{
get;
}
/// <summary>
/// Resets the data checksum as if no update was ever called.
/// </summary>
void Reset();
/// <summary>
/// Adds one byte to the data checksum.
/// </summary>
/// <param name = "value">
/// the data value to add. The high byte of the int is ignored.
/// </param>
void Update(int value);
/// <summary>
/// Updates the data checksum with the bytes taken from the array.
/// </summary>
/// <param name="buffer">
/// buffer an array of bytes
/// </param>
void Update(byte[] buffer);
/// <summary>
/// Adds the byte array to the data checksum.
/// </summary>
/// <param name = "buffer">
/// The buffer which contains the data
/// </param>
/// <param name = "offset">
/// The offset in the buffer where the data starts
/// </param>
/// <param name = "count">
/// the number of data bytes to add.
/// </param>
void Update(byte[] buffer, int offset, int count);
}
}
// IChecksum.cs - Interface to compute a data checksum
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
namespace LSLEditor.Decompressor
{
/// <summary>
/// Interface to compute a data checksum used by checked input/output streams.
/// A data checksum can be updated by one byte or with a byte array. After each
/// update the value of the current checksum can be returned by calling
/// <code>getValue</code>. The complete checksum object can also be reset
/// so it can be used again with new data.
/// </summary>
public interface IChecksum
{
/// <summary>
/// Returns the data checksum computed so far.
/// </summary>
long Value
{
get;
}
/// <summary>
/// Resets the data checksum as if no update was ever called.
/// </summary>
void Reset();
/// <summary>
/// Adds one byte to the data checksum.
/// </summary>
/// <param name = "value">
/// the data value to add. The high byte of the int is ignored.
/// </param>
void Update(int value);
/// <summary>
/// Updates the data checksum with the bytes taken from the array.
/// </summary>
/// <param name="buffer">
/// buffer an array of bytes
/// </param>
void Update(byte[] buffer);
/// <summary>
/// Adds the byte array to the data checksum.
/// </summary>
/// <param name = "buffer">
/// The buffer which contains the data
/// </param>
/// <param name = "offset">
/// The offset in the buffer where the data starts
/// </param>
/// <param name = "count">
/// the number of data bytes to add.
/// </param>
void Update(byte[] buffer, int offset, int count);
}
}

View file

@ -1,207 +1,207 @@
// StrangeCRC.cs - computes a crc used in the bziplib
//
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
namespace LSLEditor.Decompressor
{
/// <summary>
/// Bzip2 checksum algorithm
/// </summary>
public class StrangeCRC : IChecksum
{
readonly static uint[] crc32Table = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
};
int globalCrc;
/// <summary>
/// Initialise a default instance of <see cref="StrangeCRC"></see>
/// </summary>
public StrangeCRC()
{
Reset();
}
/// <summary>
/// Reset the state of Crc.
/// </summary>
public void Reset()
{
globalCrc = -1;
}
/// <summary>
/// Get the current Crc value.
/// </summary>
public long Value {
get {
return ~globalCrc;
}
}
/// <summary>
/// Update the Crc value.
/// </summary>
/// <param name="value">data update is based on</param>
public void Update(int value)
{
int temp = (globalCrc >> 24) ^ value;
if (temp < 0) {
temp = 256 + temp;
}
globalCrc = unchecked((int)((globalCrc << 8) ^ crc32Table[temp]));
}
/// <summary>
/// Update Crc based on a block of data
/// </summary>
public void Update(byte[] buffer)
{
if (buffer == null) {
throw new ArgumentNullException("buffer");
}
Update(buffer, 0, buffer.Length);
}
/// <summary>
/// Update Crc based on a portion of a block of data
/// </summary>
/// <param name="buffer">block of data</param>
/// <param name="offset">index of first byte to use</param>
/// <param name="count">number of bytes to use</param>
public void Update(byte[] buffer, int offset, int count)
{
if (buffer == null) {
throw new ArgumentNullException("buffer");
}
if ( offset < 0 )
{
#if COMPACT_FRAMEWORK_V10
throw new ArgumentOutOfRangeException("offset");
#else
throw new ArgumentOutOfRangeException("offset", "cannot be less than zero");
#endif
}
if ( count < 0 )
{
#if COMPACT_FRAMEWORK_V10
throw new ArgumentOutOfRangeException("count");
#else
throw new ArgumentOutOfRangeException("count", "cannot be less than zero");
#endif
}
if ( offset + count > buffer.Length )
{
throw new ArgumentOutOfRangeException("count");
}
for (int i = 0; i < count; ++i) {
Update(buffer[offset++]);
}
}
}
}
// StrangeCRC.cs - computes a crc used in the bziplib
//
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
namespace LSLEditor.Decompressor
{
/// <summary>
/// Bzip2 checksum algorithm
/// </summary>
public class StrangeCRC : IChecksum
{
readonly static uint[] crc32Table = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
};
int globalCrc;
/// <summary>
/// Initialise a default instance of <see cref="StrangeCRC"></see>
/// </summary>
public StrangeCRC()
{
Reset();
}
/// <summary>
/// Reset the state of Crc.
/// </summary>
public void Reset()
{
globalCrc = -1;
}
/// <summary>
/// Get the current Crc value.
/// </summary>
public long Value {
get {
return ~globalCrc;
}
}
/// <summary>
/// Update the Crc value.
/// </summary>
/// <param name="value">data update is based on</param>
public void Update(int value)
{
int temp = (globalCrc >> 24) ^ value;
if (temp < 0) {
temp = 256 + temp;
}
globalCrc = unchecked((int)((globalCrc << 8) ^ crc32Table[temp]));
}
/// <summary>
/// Update Crc based on a block of data
/// </summary>
public void Update(byte[] buffer)
{
if (buffer == null) {
throw new ArgumentNullException("buffer");
}
Update(buffer, 0, buffer.Length);
}
/// <summary>
/// Update Crc based on a portion of a block of data
/// </summary>
/// <param name="buffer">block of data</param>
/// <param name="offset">index of first byte to use</param>
/// <param name="count">number of bytes to use</param>
public void Update(byte[] buffer, int offset, int count)
{
if (buffer == null) {
throw new ArgumentNullException("buffer");
}
if ( offset < 0 )
{
#if COMPACT_FRAMEWORK_V10
throw new ArgumentOutOfRangeException("offset");
#else
throw new ArgumentOutOfRangeException("offset", "cannot be less than zero");
#endif
}
if ( count < 0 )
{
#if COMPACT_FRAMEWORK_V10
throw new ArgumentOutOfRangeException("count");
#else
throw new ArgumentOutOfRangeException("count", "cannot be less than zero");
#endif
}
if ( offset + count > buffer.Length )
{
throw new ArgumentOutOfRangeException("count");
}
for (int i = 0; i < count; ++i) {
Update(buffer[offset++]);
}
}
}
}

View file

@ -1,81 +1,81 @@
namespace LSLEditor
{
partial class Browser
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabControl1 = new System.Windows.Forms.TabControlExtended(this.components);
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.closeToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(112, 26);
//
// closeToolStripMenuItem
//
this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
this.closeToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
this.closeToolStripMenuItem.Text = "Close";
this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
//
// tabControl1
//
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(592, 366);
this.tabControl1.TabIndex = 1;
this.tabControl1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tabControl1_MouseDown);
//
// Browser
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(592, 366);
this.Controls.Add(this.tabControl1);
this.Name = "Browser";
this.Text = "Browser";
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControlExtended tabControl1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem;
}
namespace LSLEditor
{
partial class Browser
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabControl1 = new System.Windows.Forms.TabControlExtended(this.components);
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.closeToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(112, 26);
//
// closeToolStripMenuItem
//
this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
this.closeToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
this.closeToolStripMenuItem.Text = "Close";
this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
//
// tabControl1
//
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(592, 366);
this.tabControl1.TabIndex = 1;
this.tabControl1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tabControl1_MouseDown);
//
// Browser
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(592, 366);
this.Controls.Add(this.tabControl1);
this.Name = "Browser";
this.Text = "Browser";
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControlExtended tabControl1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem;
}
}

View file

@ -1,160 +1,160 @@
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
// Browser.cs
//
// </summary>
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
using LSLEditor.Docking;
namespace LSLEditor
{
public partial class Browser : DockContent
{
private LSLEditorForm lslEditorForm;
public Browser(LSLEditorForm lslEditorForm)
{
InitializeComponent();
this.Icon = lslEditorForm.Icon;
this.lslEditorForm = lslEditorForm;
// enables close buttons on tabs
this.tabControl1.SetDrawMode();
}
private void axWebBrowser1_StatusTextChanged(object sender, EventArgs e)
{
WebBrowser axWebBrowser1 = sender as WebBrowser;
ToolStripStatusLabel status = axWebBrowser1.Tag as ToolStripStatusLabel;
if (status != null) {
status.Text = axWebBrowser1.StatusText;
}
}
private void axWebBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
string strUrl = e.Url.ToString();
if (strUrl.EndsWith(".lsl")) {
e.Cancel = true;
if (MessageBox.Show("Import LSL script?", "Import script", MessageBoxButtons.OKCancel) != DialogResult.Cancel) {
WebBrowser axWebBrowser1 = sender as WebBrowser;
axWebBrowser1.Stop();
this.lslEditorForm.OpenFile(strUrl, Guid.NewGuid());
}
}
}
public void ShowWebBrowser(string strTabName, string strUrl)
{
WebBrowser axWebBrowser1 = null;
try {
if (!Properties.Settings.Default.HelpNewTab) {
TabPage tabPage = this.tabControl1.TabPages[0];
tabPage.Text = strTabName + " ";
axWebBrowser1 = tabPage.Controls[0] as WebBrowser;
}
} catch { }
if (axWebBrowser1 == null) {
TabPage tabPage = new TabPage(strTabName + " ");
tabPage.BackColor = Color.White;
axWebBrowser1 = new WebBrowser();
ToolStripStatusLabel toolStripStatusLabel1 = new ToolStripStatusLabel();
StatusStrip statusStrip1 = new StatusStrip();
statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripStatusLabel1 });
statusStrip1.Location = new System.Drawing.Point(0, 318);
statusStrip1.Name = "statusStrip1";
statusStrip1.Size = new System.Drawing.Size(584, 22);
statusStrip1.TabIndex = 0;
statusStrip1.Text = "statusStrip1";
toolStripStatusLabel1.Name = "toolStripStatusLabel1";
toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17);
toolStripStatusLabel1.Text = "toolStripStatusLabel1";
tabPage.Controls.Add(axWebBrowser1);
tabPage.Controls.Add(statusStrip1);
this.tabControl1.TabPages.Add(tabPage);
this.tabControl1.SelectedIndex = this.tabControl1.TabCount - 1;
// reference
axWebBrowser1.Tag = toolStripStatusLabel1;
axWebBrowser1.Dock = DockStyle.Fill;
axWebBrowser1.StatusTextChanged += new EventHandler(axWebBrowser1_StatusTextChanged);
axWebBrowser1.Navigating += new WebBrowserNavigatingEventHandler(axWebBrowser1_Navigating);
}
axWebBrowser1.Navigate(strUrl);
}
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
int intTabToClose = (int)this.contextMenuStrip1.Tag;
if (intTabToClose < this.tabControl1.TabCount) {
this.tabControl1.TabPages.RemoveAt(intTabToClose);
}
}
private void tabControl1_MouseDown(object sender, MouseEventArgs e)
{
TabControl tabControl = sender as TabControl;
if (tabControl != null) {
if (e.Button == MouseButtons.Right) {
for (int intI = 0; intI < tabControl.TabCount; intI++) {
Rectangle rt = tabControl.GetTabRect(intI);
if (e.X > rt.Left && e.X < rt.Right
&& e.Y > rt.Top && e.Y < rt.Bottom) {
this.contextMenuStrip1.Tag = intI;
this.contextMenuStrip1.Show(this.tabControl1, new Point(e.X, e.Y));
}
}
}
}
}
}
}
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
// Browser.cs
//
// </summary>
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
using LSLEditor.Docking;
namespace LSLEditor
{
public partial class Browser : DockContent
{
private LSLEditorForm lslEditorForm;
public Browser(LSLEditorForm lslEditorForm)
{
InitializeComponent();
this.Icon = lslEditorForm.Icon;
this.lslEditorForm = lslEditorForm;
// enables close buttons on tabs
this.tabControl1.SetDrawMode();
}
private void axWebBrowser1_StatusTextChanged(object sender, EventArgs e)
{
WebBrowser axWebBrowser1 = sender as WebBrowser;
ToolStripStatusLabel status = axWebBrowser1.Tag as ToolStripStatusLabel;
if (status != null) {
status.Text = axWebBrowser1.StatusText;
}
}
private void axWebBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
string strUrl = e.Url.ToString();
if (strUrl.EndsWith(".lsl")) {
e.Cancel = true;
if (MessageBox.Show("Import LSL script?", "Import script", MessageBoxButtons.OKCancel) != DialogResult.Cancel) {
WebBrowser axWebBrowser1 = sender as WebBrowser;
axWebBrowser1.Stop();
this.lslEditorForm.OpenFile(strUrl, Guid.NewGuid());
}
}
}
public void ShowWebBrowser(string strTabName, string strUrl)
{
WebBrowser axWebBrowser1 = null;
try {
if (!Properties.Settings.Default.HelpNewTab) {
TabPage tabPage = this.tabControl1.TabPages[0];
tabPage.Text = strTabName + " ";
axWebBrowser1 = tabPage.Controls[0] as WebBrowser;
}
} catch { }
if (axWebBrowser1 == null) {
TabPage tabPage = new TabPage(strTabName + " ");
tabPage.BackColor = Color.White;
axWebBrowser1 = new WebBrowser();
ToolStripStatusLabel toolStripStatusLabel1 = new ToolStripStatusLabel();
StatusStrip statusStrip1 = new StatusStrip();
statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripStatusLabel1 });
statusStrip1.Location = new System.Drawing.Point(0, 318);
statusStrip1.Name = "statusStrip1";
statusStrip1.Size = new System.Drawing.Size(584, 22);
statusStrip1.TabIndex = 0;
statusStrip1.Text = "statusStrip1";
toolStripStatusLabel1.Name = "toolStripStatusLabel1";
toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17);
toolStripStatusLabel1.Text = "toolStripStatusLabel1";
tabPage.Controls.Add(axWebBrowser1);
tabPage.Controls.Add(statusStrip1);
this.tabControl1.TabPages.Add(tabPage);
this.tabControl1.SelectedIndex = this.tabControl1.TabCount - 1;
// reference
axWebBrowser1.Tag = toolStripStatusLabel1;
axWebBrowser1.Dock = DockStyle.Fill;
axWebBrowser1.StatusTextChanged += new EventHandler(axWebBrowser1_StatusTextChanged);
axWebBrowser1.Navigating += new WebBrowserNavigatingEventHandler(axWebBrowser1_Navigating);
}
axWebBrowser1.Navigate(strUrl);
}
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
int intTabToClose = (int)this.contextMenuStrip1.Tag;
if (intTabToClose < this.tabControl1.TabCount) {
this.tabControl1.TabPages.RemoveAt(intTabToClose);
}
}
private void tabControl1_MouseDown(object sender, MouseEventArgs e)
{
TabControl tabControl = sender as TabControl;
if (tabControl != null) {
if (e.Button == MouseButtons.Right) {
for (int intI = 0; intI < tabControl.TabCount; intI++) {
Rectangle rt = tabControl.GetTabRect(intI);
if (e.X > rt.Left && e.X < rt.Right
&& e.Y > rt.Top && e.Y < rt.Bottom) {
this.contextMenuStrip1.Tag = intI;
this.contextMenuStrip1.Show(this.tabControl1, new Point(e.X, e.Y));
}
}
}
}
}
}
}

View file

@ -1,123 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
</root>

View file

@ -1,437 +1,437 @@
namespace LSLEditor.BugReport
{
partial class BugReportForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.button4 = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.listView1 = new System.Windows.Forms.ListView();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.panel1 = new System.Windows.Forms.Panel();
this.button3 = new System.Windows.Forms.Button();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.textBox5 = new System.Windows.Forms.TextBox();
this.splitter2 = new System.Windows.Forms.Splitter();
this.textBox4 = new System.Windows.Forms.TextBox();
this.splitter1 = new System.Windows.Forms.Splitter();
this.listView2 = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox1.SuspendLayout();
this.panel2.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.panel1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox3);
this.groupBox1.Controls.Add(this.panel2);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(3, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(8);
this.groupBox1.Size = new System.Drawing.Size(712, 330);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "report";
//
// textBox3
//
this.textBox3.AcceptsReturn = true;
this.textBox3.AcceptsTab = true;
this.textBox3.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox3.Location = new System.Drawing.Point(8, 160);
this.textBox3.Multiline = true;
this.textBox3.Name = "textBox3";
this.textBox3.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox3.Size = new System.Drawing.Size(696, 162);
this.textBox3.TabIndex = 4;
//
// panel2
//
this.panel2.Controls.Add(this.button4);
this.panel2.Controls.Add(this.label6);
this.panel2.Controls.Add(this.label5);
this.panel2.Controls.Add(this.label4);
this.panel2.Controls.Add(this.label3);
this.panel2.Controls.Add(this.label1);
this.panel2.Controls.Add(this.textBox1);
this.panel2.Controls.Add(this.listView1);
this.panel2.Controls.Add(this.textBox2);
this.panel2.Controls.Add(this.label2);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(8, 21);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(696, 139);
this.panel2.TabIndex = 6;
//
// button4
//
this.button4.Location = new System.Drawing.Point(312, 112);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(75, 24);
this.button4.TabIndex = 9;
this.button4.Text = "check all";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(0, 80);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(191, 13);
this.label6.TabIndex = 8;
this.label6.Text = "and will not be made public in any way!";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(0, 64);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(217, 13);
this.label5.TabIndex = 7;
this.label5.Text = "Uploaded files will only be used for bugfixing,";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(208, 8);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(98, 13);
this.label4.TabIndex = 6;
this.label4.Text = "Files to be included";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(0, 104);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(130, 13);
this.label3.TabIndex = 5;
this.label3.Text = "Description of the problem";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(0, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Name";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(40, 8);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(168, 20);
this.textBox1.TabIndex = 1;
//
// listView1
//
this.listView1.CheckBoxes = true;
this.listView1.Location = new System.Drawing.Point(312, 8);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(248, 104);
this.listView1.TabIndex = 3;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(40, 40);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(168, 20);
this.textBox2.TabIndex = 2;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(0, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Email";
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(8, 8);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(726, 402);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Controls.Add(this.panel1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(718, 376);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "New bug report";
this.tabPage1.UseVisualStyleBackColor = true;
//
// panel1
//
this.panel1.Controls.Add(this.button3);
this.panel1.Controls.Add(this.progressBar1);
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.button1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(3, 333);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(712, 40);
this.panel1.TabIndex = 0;
//
// button3
//
this.button3.Location = new System.Drawing.Point(504, 8);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 7;
this.button3.Text = "Close";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(8, 8);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(280, 23);
this.progressBar1.TabIndex = 0;
//
// button2
//
this.button2.Enabled = false;
this.button2.Location = new System.Drawing.Point(416, 8);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 6;
this.button2.Text = "Cancel";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(296, 8);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(112, 23);
this.button1.TabIndex = 5;
this.button1.Text = "Send bug report";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.textBox5);
this.tabPage2.Controls.Add(this.splitter2);
this.tabPage2.Controls.Add(this.textBox4);
this.tabPage2.Controls.Add(this.splitter1);
this.tabPage2.Controls.Add(this.listView2);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(718, 376);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Bug tracker";
this.tabPage2.UseVisualStyleBackColor = true;
//
// textBox5
//
this.textBox5.AcceptsReturn = true;
this.textBox5.AcceptsTab = true;
this.textBox5.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox5.Location = new System.Drawing.Point(267, 131);
this.textBox5.Multiline = true;
this.textBox5.Name = "textBox5";
this.textBox5.ReadOnly = true;
this.textBox5.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox5.Size = new System.Drawing.Size(448, 242);
this.textBox5.TabIndex = 10;
//
// splitter2
//
this.splitter2.Dock = System.Windows.Forms.DockStyle.Top;
this.splitter2.Location = new System.Drawing.Point(267, 128);
this.splitter2.Name = "splitter2";
this.splitter2.Size = new System.Drawing.Size(448, 3);
this.splitter2.TabIndex = 3;
this.splitter2.TabStop = false;
//
// textBox4
//
this.textBox4.AcceptsReturn = true;
this.textBox4.AcceptsTab = true;
this.textBox4.Dock = System.Windows.Forms.DockStyle.Top;
this.textBox4.Location = new System.Drawing.Point(267, 3);
this.textBox4.Multiline = true;
this.textBox4.Name = "textBox4";
this.textBox4.ReadOnly = true;
this.textBox4.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox4.Size = new System.Drawing.Size(448, 125);
this.textBox4.TabIndex = 9;
//
// splitter1
//
this.splitter1.Location = new System.Drawing.Point(264, 3);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(3, 370);
this.splitter1.TabIndex = 1;
this.splitter1.TabStop = false;
//
// listView2
//
this.listView2.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.listView2.ContextMenuStrip = this.contextMenuStrip1;
this.listView2.Dock = System.Windows.Forms.DockStyle.Left;
this.listView2.FullRowSelect = true;
this.listView2.HideSelection = false;
this.listView2.Location = new System.Drawing.Point(3, 3);
this.listView2.Name = "listView2";
this.listView2.Size = new System.Drawing.Size(261, 370);
this.listView2.TabIndex = 8;
this.listView2.UseCompatibleStateImageBehavior = false;
this.listView2.View = System.Windows.Forms.View.Details;
this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged);
//
// columnHeader1
//
this.columnHeader1.Text = "Number";
this.columnHeader1.Width = 85;
//
// columnHeader2
//
this.columnHeader2.Text = "Date/Time";
this.columnHeader2.Width = 145;
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.deleteToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(117, 26);
//
// deleteToolStripMenuItem
//
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
this.deleteToolStripMenuItem.Text = "Delete";
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// BugReportForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(742, 418);
this.Controls.Add(this.tabControl1);
this.Name = "BugReportForm";
this.Padding = new System.Windows.Forms.Padding(8);
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "LSLEditor bug report";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Splitter splitter2;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.ListView listView2;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.ColumnHeader columnHeader2;
}
namespace LSLEditor.BugReport
{
partial class BugReportForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.button4 = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.listView1 = new System.Windows.Forms.ListView();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.panel1 = new System.Windows.Forms.Panel();
this.button3 = new System.Windows.Forms.Button();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.textBox5 = new System.Windows.Forms.TextBox();
this.splitter2 = new System.Windows.Forms.Splitter();
this.textBox4 = new System.Windows.Forms.TextBox();
this.splitter1 = new System.Windows.Forms.Splitter();
this.listView2 = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox1.SuspendLayout();
this.panel2.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.panel1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox3);
this.groupBox1.Controls.Add(this.panel2);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(3, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(8);
this.groupBox1.Size = new System.Drawing.Size(712, 330);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "report";
//
// textBox3
//
this.textBox3.AcceptsReturn = true;
this.textBox3.AcceptsTab = true;
this.textBox3.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox3.Location = new System.Drawing.Point(8, 160);
this.textBox3.Multiline = true;
this.textBox3.Name = "textBox3";
this.textBox3.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox3.Size = new System.Drawing.Size(696, 162);
this.textBox3.TabIndex = 4;
//
// panel2
//
this.panel2.Controls.Add(this.button4);
this.panel2.Controls.Add(this.label6);
this.panel2.Controls.Add(this.label5);
this.panel2.Controls.Add(this.label4);
this.panel2.Controls.Add(this.label3);
this.panel2.Controls.Add(this.label1);
this.panel2.Controls.Add(this.textBox1);
this.panel2.Controls.Add(this.listView1);
this.panel2.Controls.Add(this.textBox2);
this.panel2.Controls.Add(this.label2);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(8, 21);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(696, 139);
this.panel2.TabIndex = 6;
//
// button4
//
this.button4.Location = new System.Drawing.Point(312, 112);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(75, 24);
this.button4.TabIndex = 9;
this.button4.Text = "check all";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(0, 80);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(191, 13);
this.label6.TabIndex = 8;
this.label6.Text = "and will not be made public in any way!";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(0, 64);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(217, 13);
this.label5.TabIndex = 7;
this.label5.Text = "Uploaded files will only be used for bugfixing,";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(208, 8);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(98, 13);
this.label4.TabIndex = 6;
this.label4.Text = "Files to be included";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(0, 104);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(130, 13);
this.label3.TabIndex = 5;
this.label3.Text = "Description of the problem";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(0, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Name";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(40, 8);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(168, 20);
this.textBox1.TabIndex = 1;
//
// listView1
//
this.listView1.CheckBoxes = true;
this.listView1.Location = new System.Drawing.Point(312, 8);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(248, 104);
this.listView1.TabIndex = 3;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(40, 40);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(168, 20);
this.textBox2.TabIndex = 2;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(0, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Email";
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(8, 8);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(726, 402);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Controls.Add(this.panel1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(718, 376);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "New bug report";
this.tabPage1.UseVisualStyleBackColor = true;
//
// panel1
//
this.panel1.Controls.Add(this.button3);
this.panel1.Controls.Add(this.progressBar1);
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.button1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(3, 333);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(712, 40);
this.panel1.TabIndex = 0;
//
// button3
//
this.button3.Location = new System.Drawing.Point(504, 8);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 7;
this.button3.Text = "Close";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(8, 8);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(280, 23);
this.progressBar1.TabIndex = 0;
//
// button2
//
this.button2.Enabled = false;
this.button2.Location = new System.Drawing.Point(416, 8);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 6;
this.button2.Text = "Cancel";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(296, 8);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(112, 23);
this.button1.TabIndex = 5;
this.button1.Text = "Send bug report";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.textBox5);
this.tabPage2.Controls.Add(this.splitter2);
this.tabPage2.Controls.Add(this.textBox4);
this.tabPage2.Controls.Add(this.splitter1);
this.tabPage2.Controls.Add(this.listView2);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(718, 376);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Bug tracker";
this.tabPage2.UseVisualStyleBackColor = true;
//
// textBox5
//
this.textBox5.AcceptsReturn = true;
this.textBox5.AcceptsTab = true;
this.textBox5.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox5.Location = new System.Drawing.Point(267, 131);
this.textBox5.Multiline = true;
this.textBox5.Name = "textBox5";
this.textBox5.ReadOnly = true;
this.textBox5.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox5.Size = new System.Drawing.Size(448, 242);
this.textBox5.TabIndex = 10;
//
// splitter2
//
this.splitter2.Dock = System.Windows.Forms.DockStyle.Top;
this.splitter2.Location = new System.Drawing.Point(267, 128);
this.splitter2.Name = "splitter2";
this.splitter2.Size = new System.Drawing.Size(448, 3);
this.splitter2.TabIndex = 3;
this.splitter2.TabStop = false;
//
// textBox4
//
this.textBox4.AcceptsReturn = true;
this.textBox4.AcceptsTab = true;
this.textBox4.Dock = System.Windows.Forms.DockStyle.Top;
this.textBox4.Location = new System.Drawing.Point(267, 3);
this.textBox4.Multiline = true;
this.textBox4.Name = "textBox4";
this.textBox4.ReadOnly = true;
this.textBox4.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox4.Size = new System.Drawing.Size(448, 125);
this.textBox4.TabIndex = 9;
//
// splitter1
//
this.splitter1.Location = new System.Drawing.Point(264, 3);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(3, 370);
this.splitter1.TabIndex = 1;
this.splitter1.TabStop = false;
//
// listView2
//
this.listView2.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.listView2.ContextMenuStrip = this.contextMenuStrip1;
this.listView2.Dock = System.Windows.Forms.DockStyle.Left;
this.listView2.FullRowSelect = true;
this.listView2.HideSelection = false;
this.listView2.Location = new System.Drawing.Point(3, 3);
this.listView2.Name = "listView2";
this.listView2.Size = new System.Drawing.Size(261, 370);
this.listView2.TabIndex = 8;
this.listView2.UseCompatibleStateImageBehavior = false;
this.listView2.View = System.Windows.Forms.View.Details;
this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged);
//
// columnHeader1
//
this.columnHeader1.Text = "Number";
this.columnHeader1.Width = 85;
//
// columnHeader2
//
this.columnHeader2.Text = "Date/Time";
this.columnHeader2.Width = 145;
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.deleteToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(117, 26);
//
// deleteToolStripMenuItem
//
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
this.deleteToolStripMenuItem.Text = "Delete";
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// BugReportForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(742, 418);
this.Controls.Add(this.tabControl1);
this.Name = "BugReportForm";
this.Padding = new System.Windows.Forms.Padding(8);
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "LSLEditor bug report";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Splitter splitter2;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.ListView listView2;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.ColumnHeader columnHeader2;
}
}

View file

@ -1,293 +1,294 @@
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
// BugReportForm.cs
//
// </summary>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
namespace LSLEditor.BugReport
{
public partial class BugReportForm : Form
{
private bool blnComplete;
private UploadBugReport ubr;
private LSLEditorForm parent;
public BugReportForm(LSLEditorForm parent)
{
InitializeComponent();
this.parent = parent;
this.Icon = parent.Icon;
this.textBox1.Text = Properties.Settings.Default.AvatarName;
this.textBox2.Text = Properties.Settings.Default.EmailAddress;
this.listView1.Columns.Add("ScriptName",this.listView1.Width-30);
foreach (Form form in parent.Children)
{
EditForm editForm = form as EditForm;
if (editForm == null || editForm.IsDisposed)
continue;
ListViewItem lvi = new ListViewItem(editForm.ScriptName);
lvi.Checked = false;
this.listView1.Items.Add(lvi);
}
ShowBugReportsList();
}
private void ShowBugReportsList()
{
if (Properties.Settings.Default.Bugreports == null)
return;
this.listView2.Items.Clear();
foreach (string Handle in Properties.Settings.Default.Bugreports)
{
long result;
if (!long.TryParse(Handle, out result))
continue;
result *= (long)1e7;
DateTime dateTime = new DateTime(result);
ListViewItem lvi = new ListViewItem(Handle);
lvi.SubItems.Add(dateTime.ToString());
lvi.Tag = Handle;
this.listView2.Items.Add(lvi);
}
}
//close
private void button3_Click(object sender, EventArgs e)
{
this.timer1.Stop();
if (ubr != null)
ubr.Stop();
this.Close();
}
// cancel
private void button2_Click(object sender, EventArgs e)
{
this.button2.Enabled = false;
this.timer1.Stop();
this.progressBar1.Value = 0;
if (ubr != null)
ubr.Stop();
this.button1.Enabled = true;
}
private void button1_Click(object sender, EventArgs e)
{
string strMessage = this.textBox3.Text.Trim();
if (strMessage == "")
{
MessageBox.Show("The bug report is empty(?!), it is not send!", "Bug report", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
ubr = new UploadBugReport();
this.button1.Enabled = false;
this.button2.Enabled = true;
this.blnComplete = false;
this.timer1.Start();
ubr.OnComplete += new UploadBugReport.UploadCompleteHandler(ubr_OnComplete);
List<UploadBugReport.FileToUpload> list = new List<UploadBugReport.FileToUpload>();
StringBuilder sb = new StringBuilder();
Properties.Settings.Default.AvatarName = this.textBox1.Text;
Properties.Settings.Default.EmailAddress = this.textBox2.Text;
sb.AppendFormat("Version: {0} {1}\r\n",
this.parent.Text,
Assembly.GetExecutingAssembly().GetName().Version.ToString());
sb.AppendFormat("Name: {0}\r\n", this.textBox1.Text);
sb.AppendFormat("Email: {0}\r\n\r\n", this.textBox2.Text);
sb.Append(this.textBox3.Text);
list.Add(new UploadBugReport.FileToUpload("bugreport.txt", sb.ToString()));
foreach (ListViewItem lvi in this.listView1.Items)
{
if (!lvi.Checked)
continue;
string strScriptName = lvi.Text;
string strBody = null;
foreach (Form form in parent.Children)
{
EditForm editForm = form as EditForm;
if (editForm == null || editForm.IsDisposed)
continue;
if (editForm.ScriptName == strScriptName)
strBody = editForm.SourceCode;
}
if(strBody != null)
list.Add(new UploadBugReport.FileToUpload(strScriptName, strBody));
}
ubr.UploadAsync(list, this.progressBar1);
}
void ubr_OnComplete(object sender, UploadBugReport.UploadCompleteEventArgs e)
{
if(e.TotalBytes == -1)
MessageBox.Show("There is something wrong. Your bug report has not been sent!!", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
else
MessageBox.Show("Your bug report has been sent (" + e.TotalBytes + " bytes)", "Ready", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.blnComplete = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (this.blnComplete)
{
this.timer1.Stop();
this.button1.Enabled = true;
this.button2.Enabled = false;
this.progressBar1.Value = 0;
this.textBox3.Clear();
ShowBugReportsList();
this.tabControl1.SelectedIndex = 1;
}
if (ubr != null)
{
if (!ubr.blnRunning)
{
this.button1.Enabled = true;
this.timer1.Stop();
}
}
}
private void listView2_SelectedIndexChanged(object sender, EventArgs e)
{
/*if (this.listView2.SelectedItems.Count == 0)
return;
ListViewItem lvi = this.listView2.SelectedItems[0];
string Handle = lvi.Tag.ToString();
Service1 service1 = new Service1();
service1.GetStatusCompleted += new GetStatusCompletedEventHandler(service1_GetStatusCompleted);
service1.GetStatusAsync(Handle, Handle);*/
}
/*
void service1_GetStatusCompleted(object sender, GetStatusCompletedEventArgs e)
{
/*this.textBox5.Clear();
string Handle = e.UserState.ToString();
if (e.Error != null)
{
this.textBox4.Text = "Bug report [" + Handle + "] not available (at this time)";
return;
}
string strResult = e.Result;
if (strResult == null)
{
this.textBox5.Text = "Bug report [" + Handle + "] does not exist (anymore)";
return;
}
this.textBox5.Text = strResult.Replace("\n", "\r\n");
Service1 service1 = new Service1();
service1.GetBugReportCompleted += new GetBugReportCompletedEventHandler(service1_GetBugReportCompleted);
service1.GetBugReportAsync(Handle, Handle);
}
void service1_GetBugReportCompleted(object sender, GetBugReportCompletedEventArgs e)
{
this.textBox4.Clear();
string Handle = e.UserState.ToString();
if (e.Error != null)
{
this.textBox4.Text = "Bug report [" + Handle + "] not available (at this time)";
return;
}
string strResult = e.Result;
if (strResult == null)
{
this.textBox4.Text = "Bug report [" + Handle + "] does not extist (anymore)";
return;
}
this.textBox4.Text = strResult.Replace("\n", "\r\n");
}*/
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.listView2.SelectedItems.Count == 0)
return;
if (MessageBox.Show("Delete " + this.listView2.SelectedItems.Count + " bugreports?", "Delete Bugreports", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
{
for(int intI=0; intI<this.listView2.SelectedItems.Count;intI++)
{
ListViewItem lvi = this.listView2.SelectedItems[intI];
string Handle = lvi.Tag.ToString();
Properties.Settings.Default.Bugreports.Remove(Handle);
}
this.textBox4.Clear();
this.textBox5.Clear();
}
ShowBugReportsList();
}
private void button4_Click(object sender, EventArgs e)
{
if (this.button4.Text.Contains("uncheck"))
{
foreach (ListViewItem lvi in this.listView1.Items)
lvi.Checked = false;
this.button4.Text = "check all";
}
else
{
foreach (ListViewItem lvi in this.listView1.Items)
lvi.Checked = true;
this.button4.Text = "uncheck all";
}
}
}
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
// BugReportForm.cs
//
// </summary>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using LSLEditor.org.lsleditor.www;
namespace LSLEditor.BugReport
{
public partial class BugReportForm : Form
{
private bool blnComplete;
private UploadBugReport ubr;
private LSLEditorForm parent;
public BugReportForm(LSLEditorForm parent)
{
InitializeComponent();
this.parent = parent;
this.Icon = parent.Icon;
this.textBox1.Text = Properties.Settings.Default.AvatarName;
this.textBox2.Text = Properties.Settings.Default.EmailAddress;
this.listView1.Columns.Add("ScriptName",this.listView1.Width-30);
foreach (Form form in parent.Children)
{
EditForm editForm = form as EditForm;
if (editForm == null || editForm.IsDisposed)
continue;
ListViewItem lvi = new ListViewItem(editForm.ScriptName);
lvi.Checked = false;
this.listView1.Items.Add(lvi);
}
ShowBugReportsList();
}
private void ShowBugReportsList()
{
if (Properties.Settings.Default.Bugreports == null)
return;
this.listView2.Items.Clear();
foreach (string Handle in Properties.Settings.Default.Bugreports)
{
long result;
if (!long.TryParse(Handle, out result))
continue;
result *= (long)1e7;
DateTime dateTime = new DateTime(result);
ListViewItem lvi = new ListViewItem(Handle);
lvi.SubItems.Add(dateTime.ToString());
lvi.Tag = Handle;
this.listView2.Items.Add(lvi);
}
}
//close
private void button3_Click(object sender, EventArgs e)
{
this.timer1.Stop();
if (ubr != null)
ubr.Stop();
this.Close();
}
// cancel
private void button2_Click(object sender, EventArgs e)
{
this.button2.Enabled = false;
this.timer1.Stop();
this.progressBar1.Value = 0;
if (ubr != null)
ubr.Stop();
this.button1.Enabled = true;
}
private void button1_Click(object sender, EventArgs e)
{
string strMessage = this.textBox3.Text.Trim();
if (strMessage == "")
{
MessageBox.Show("The bug report is empty(?!), it is not send!", "Bug report", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
ubr = new UploadBugReport();
this.button1.Enabled = false;
this.button2.Enabled = true;
this.blnComplete = false;
this.timer1.Start();
ubr.OnComplete += new UploadBugReport.UploadCompleteHandler(ubr_OnComplete);
List<UploadBugReport.FileToUpload> list = new List<UploadBugReport.FileToUpload>();
StringBuilder sb = new StringBuilder();
Properties.Settings.Default.AvatarName = this.textBox1.Text;
Properties.Settings.Default.EmailAddress = this.textBox2.Text;
sb.AppendFormat("Version: {0} {1}\r\n",
this.parent.Text,
Assembly.GetExecutingAssembly().GetName().Version.ToString());
sb.AppendFormat("Name: {0}\r\n", this.textBox1.Text);
sb.AppendFormat("Email: {0}\r\n\r\n", this.textBox2.Text);
sb.Append(this.textBox3.Text);
list.Add(new UploadBugReport.FileToUpload("bugreport.txt", sb.ToString()));
foreach (ListViewItem lvi in this.listView1.Items)
{
if (!lvi.Checked)
continue;
string strScriptName = lvi.Text;
string strBody = null;
foreach (Form form in parent.Children)
{
EditForm editForm = form as EditForm;
if (editForm == null || editForm.IsDisposed)
continue;
if (editForm.ScriptName == strScriptName)
strBody = editForm.SourceCode;
}
if(strBody != null)
list.Add(new UploadBugReport.FileToUpload(strScriptName, strBody));
}
ubr.UploadAsync(list, this.progressBar1);
}
void ubr_OnComplete(object sender, UploadBugReport.UploadCompleteEventArgs e)
{
if(e.TotalBytes == -1)
MessageBox.Show("There is something wrong. Your bug report has not been sent!!", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
else
MessageBox.Show("Your bug report has been sent (" + e.TotalBytes + " bytes)", "Ready", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.blnComplete = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (this.blnComplete)
{
this.timer1.Stop();
this.button1.Enabled = true;
this.button2.Enabled = false;
this.progressBar1.Value = 0;
this.textBox3.Clear();
ShowBugReportsList();
this.tabControl1.SelectedIndex = 1;
}
if (ubr != null)
{
if (!ubr.blnRunning)
{
this.button1.Enabled = true;
this.timer1.Stop();
}
}
}
private void listView2_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.listView2.SelectedItems.Count == 0)
return;
ListViewItem lvi = this.listView2.SelectedItems[0];
string Handle = lvi.Tag.ToString();
Service1 service1 = new Service1();
service1.GetStatusCompleted += new GetStatusCompletedEventHandler(service1_GetStatusCompleted);
service1.GetStatusAsync(Handle, Handle);
}
void service1_GetStatusCompleted(object sender, GetStatusCompletedEventArgs e)
{
this.textBox5.Clear();
string Handle = e.UserState.ToString();
if (e.Error != null)
{
this.textBox4.Text = "Bug report [" + Handle + "] not available (at this time)";
return;
}
string strResult = e.Result;
if (strResult == null)
{
this.textBox5.Text = "Bug report [" + Handle + "] does not exist (anymore)";
return;
}
this.textBox5.Text = strResult.Replace("\n", "\r\n");
Service1 service1 = new Service1();
service1.GetBugReportCompleted += new GetBugReportCompletedEventHandler(service1_GetBugReportCompleted);
service1.GetBugReportAsync(Handle, Handle);
}
void service1_GetBugReportCompleted(object sender, GetBugReportCompletedEventArgs e)
{
this.textBox4.Clear();
string Handle = e.UserState.ToString();
if (e.Error != null)
{
this.textBox4.Text = "Bug report [" + Handle + "] not available (at this time)";
return;
}
string strResult = e.Result;
if (strResult == null)
{
this.textBox4.Text = "Bug report [" + Handle + "] does not extist (anymore)";
return;
}
this.textBox4.Text = strResult.Replace("\n", "\r\n");
}
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.listView2.SelectedItems.Count == 0)
return;
if (MessageBox.Show("Delete " + this.listView2.SelectedItems.Count + " bugreports?", "Delete Bugreports", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
{
for(int intI=0; intI<this.listView2.SelectedItems.Count;intI++)
{
ListViewItem lvi = this.listView2.SelectedItems[intI];
string Handle = lvi.Tag.ToString();
Properties.Settings.Default.Bugreports.Remove(Handle);
}
this.textBox4.Clear();
this.textBox5.Clear();
}
ShowBugReportsList();
}
private void button4_Click(object sender, EventArgs e)
{
if (this.button4.Text.Contains("uncheck"))
{
foreach (ListViewItem lvi in this.listView1.Items)
lvi.Checked = false;
this.button4.Text = "check all";
}
else
{
foreach (ListViewItem lvi in this.listView1.Items)
lvi.Checked = true;
this.button4.Text = "uncheck all";
}
}
}
}

View file

@ -1,129 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>100, 17</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>42</value>
</metadata>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>100, 17</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>42</value>
</metadata>
</root>

View file

@ -1,219 +1,218 @@
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
//
//
// </summary>
using System;
using System.IO;
using System.Text;
using System.Drawing;
using System.Text.RegularExpressions;
using System.Threading;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Windows.Forms;
namespace LSLEditor.BugReport
{
class UploadBugReport
{
public struct FileToUpload
{
public string FileName;
public string Body;
public string Path;
public FileToUpload(string FileName, string Body)
{
this.FileName = FileName;
this.Body = Body;
this.Path = null;
}
}
public class UploadCompleteEventArgs : EventArgs
{
public int TotalBytes;
public UploadCompleteEventArgs(int intTotal)
{
this.TotalBytes = intTotal;
}
}
public bool blnRunning;
public delegate void UploadCompleteHandler(object sender, UploadCompleteEventArgs e);
public event UploadCompleteHandler OnComplete;
private Thread thread;
private ProgressBar progressbar;
private List<FileToUpload> list;
public void UploadAsync(List<FileToUpload> list, ProgressBar progressbar)
{
this.list = list;
this.progressbar = progressbar;
this.blnRunning = true;
thread = new Thread(new ThreadStart(Worker));
thread.IsBackground = true;
thread.Name = "Worker";
thread.Start();
}
public void Stop()
{
this.blnRunning = false;
if (thread != null)
{
thread.Join(1000);
thread = null;
}
}
private void Worker()
{
int intTotal = 0;
try
{
//org.lsleditor.www.Service1 webservice = new org.lsleditor.www.Service1();
/*
string Handle = webservice.Open();
if (Handle == null)
{
MessageBox.Show("Can't get an upload handle", "Oops...");
this.blnRunning = false;
return;
}
if (Properties.Settings.Default.Bugreports == null)
Properties.Settings.Default.Bugreports = new StringCollection();
Properties.Settings.Default.Bugreports.Add(Handle);
// Properties.Settings.Default.Save();
int intNumber = 0;
foreach (FileToUpload file in this.list)
{
string strFileName = string.Format("{0}-{1}", intNumber, file.FileName);
if (file.Path == null)
{
intTotal += Upload(Handle, strFileName, Encoding.ASCII.GetBytes(file.Body));
}
else
{
intTotal += Upload(Handle, strFileName, file.Path);
}
intNumber++;
}*/
}
catch
{
intTotal = -1;
}
if (this.blnRunning)
if (OnComplete != null)
OnComplete(this, new UploadCompleteEventArgs(intTotal));
this.blnRunning = false;
}
private delegate void SetValueDelegate(int intValue);
private void SetMaximum(int intMaximum)
{
if (this.progressbar.InvokeRequired)
{
this.progressbar.Invoke(new SetValueDelegate(SetMaximum), new object[] { intMaximum });
}
else
{
this.progressbar.Maximum = intMaximum;
}
}
private void SetValue(int intValue)
{
if (this.progressbar.InvokeRequired)
{
this.progressbar.Invoke(new SetValueDelegate(SetValue), new object[] { intValue });
}
else
{
this.progressbar.Value = intValue;
}
}
private int Upload(string Handle, string FileName, byte[] buffer)
{
/*org.lsleditor.www.Service1 webservice = new org.lsleditor.www.Service1();
if (Handle == null)
return 0;
SetMaximum(buffer.Length);
int intOffset = 0;
int intTotal = 0;
byte[] smallbuffer = new byte[1024];
while (this.blnRunning)
{
int intLength = Math.Min(smallbuffer.Length, buffer.Length - intOffset);
if (intLength <= 0)
break;
Array.Copy(buffer, intOffset, smallbuffer, 0, intLength);
intOffset += intLength;
string strError = webservice.Write(Handle, FileName, smallbuffer, intLength);
if (strError != null)
{
MessageBox.Show("Error:" + strError, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
}
intTotal += intLength;
SetValue(intTotal);
}
return intTotal;*/
return 0;
}
private int Upload(string Handle, string FileName, string strPath)
{
FileStream fs = new FileStream(strPath, FileMode.Open, FileAccess.Read);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, (int)fs.Length);
fs.Close();
return Upload(Handle, FileName, buffer);
}
}
}
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
//
//
// </summary>
using System;
using System.IO;
using System.Text;
using System.Drawing;
using System.Text.RegularExpressions;
using System.Threading;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Windows.Forms;
namespace LSLEditor.BugReport
{
class UploadBugReport
{
public struct FileToUpload
{
public string FileName;
public string Body;
public string Path;
public FileToUpload(string FileName, string Body)
{
this.FileName = FileName;
this.Body = Body;
this.Path = null;
}
}
public class UploadCompleteEventArgs : EventArgs
{
public int TotalBytes;
public UploadCompleteEventArgs(int intTotal)
{
this.TotalBytes = intTotal;
}
}
public bool blnRunning;
public delegate void UploadCompleteHandler(object sender, UploadCompleteEventArgs e);
public event UploadCompleteHandler OnComplete;
private Thread thread;
private ProgressBar progressbar;
private List<FileToUpload> list;
public void UploadAsync(List<FileToUpload> list, ProgressBar progressbar)
{
this.list = list;
this.progressbar = progressbar;
this.blnRunning = true;
thread = new Thread(new ThreadStart(Worker));
thread.IsBackground = true;
thread.Name = "Worker";
thread.Start();
}
public void Stop()
{
this.blnRunning = false;
if (thread != null)
{
thread.Join(1000);
thread = null;
}
}
private void Worker()
{
int intTotal = 0;
try
{
org.lsleditor.www.Service1 webservice = new org.lsleditor.www.Service1();
string Handle = webservice.Open();
if (Handle == null)
{
MessageBox.Show("Can't get an upload handle", "Oops...");
this.blnRunning = false;
return;
}
if (Properties.Settings.Default.Bugreports == null)
Properties.Settings.Default.Bugreports = new StringCollection();
Properties.Settings.Default.Bugreports.Add(Handle);
// Properties.Settings.Default.Save();
int intNumber = 0;
foreach (FileToUpload file in this.list)
{
string strFileName = string.Format("{0}-{1}", intNumber, file.FileName);
if (file.Path == null)
{
intTotal += Upload(Handle, strFileName, Encoding.ASCII.GetBytes(file.Body));
}
else
{
intTotal += Upload(Handle, strFileName, file.Path);
}
intNumber++;
}
}
catch
{
intTotal = -1;
}
if (this.blnRunning)
if (OnComplete != null)
OnComplete(this, new UploadCompleteEventArgs(intTotal));
this.blnRunning = false;
}
private delegate void SetValueDelegate(int intValue);
private void SetMaximum(int intMaximum)
{
if (this.progressbar.InvokeRequired)
{
this.progressbar.Invoke(new SetValueDelegate(SetMaximum), new object[] { intMaximum });
}
else
{
this.progressbar.Maximum = intMaximum;
}
}
private void SetValue(int intValue)
{
if (this.progressbar.InvokeRequired)
{
this.progressbar.Invoke(new SetValueDelegate(SetValue), new object[] { intValue });
}
else
{
this.progressbar.Value = intValue;
}
}
private int Upload(string Handle, string FileName, byte[] buffer)
{
org.lsleditor.www.Service1 webservice = new org.lsleditor.www.Service1();
if (Handle == null)
return 0;
SetMaximum(buffer.Length);
int intOffset = 0;
int intTotal = 0;
byte[] smallbuffer = new byte[1024];
while (this.blnRunning)
{
int intLength = Math.Min(smallbuffer.Length, buffer.Length - intOffset);
if (intLength <= 0)
break;
Array.Copy(buffer, intOffset, smallbuffer, 0, intLength);
intOffset += intLength;
string strError = webservice.Write(Handle, FileName, smallbuffer, intLength);
if (strError != null)
{
MessageBox.Show("Error:" + strError, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
}
intTotal += intLength;
SetValue(intTotal);
}
return intTotal;
}
private int Upload(string Handle, string FileName, string strPath)
{
FileStream fs = new FileStream(strPath, FileMode.Open, FileAccess.Read);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, (int)fs.Length);
fs.Close();
return Upload(Handle, FileName, buffer);
}
}
}

View file

@ -1,93 +1,93 @@
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
//
//
// </summary>
using System; // bitconvertor
using System.IO;
using System.IO.Compression;
using System.Security.Cryptography;
namespace LSLEditor.Decompressor
{
public class MD5Verify
{
public static string ComputeHash(string strFile)
{
MD5CryptoServiceProvider csp = new MD5CryptoServiceProvider();
FileStream stream = File.OpenRead(strFile);
byte[] hash = csp.ComputeHash(stream);
stream.Close();
return BitConverter.ToString(hash).Replace("-", "").ToLower();
}
}
public sealed class Gzip
{
public static void Decompress(Stream inStream, Stream outStream)
{
using (outStream)
{
using (GZipStream zipStream = new GZipStream(inStream, CompressionMode.Decompress))
{
int ch = zipStream.ReadByte();
while (ch != -1)
{
outStream.WriteByte((byte)ch);
ch = zipStream.ReadByte();
}
}
}
}
}
public sealed class Zip
{
public static void Decompress(Stream inStream, Stream outStream)
{
ZipEntry zipEntry = ZipEntry.Read(inStream);
inStream.Close();
using (outStream)
{
zipEntry.Extract(outStream);
}
}
}
}
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
//
//
// </summary>
using System; // bitconvertor
using System.IO;
using System.IO.Compression;
using System.Security.Cryptography;
namespace LSLEditor.Decompressor
{
public class MD5Verify
{
public static string ComputeHash(string strFile)
{
MD5CryptoServiceProvider csp = new MD5CryptoServiceProvider();
FileStream stream = File.OpenRead(strFile);
byte[] hash = csp.ComputeHash(stream);
stream.Close();
return BitConverter.ToString(hash).Replace("-", "").ToLower();
}
}
public sealed class Gzip
{
public static void Decompress(Stream inStream, Stream outStream)
{
using (outStream)
{
using (GZipStream zipStream = new GZipStream(inStream, CompressionMode.Decompress))
{
int ch = zipStream.ReadByte();
while (ch != -1)
{
outStream.WriteByte((byte)ch);
ch = zipStream.ReadByte();
}
}
}
}
}
public sealed class Zip
{
public static void Decompress(Stream inStream, Stream outStream)
{
ZipEntry zipEntry = ZipEntry.Read(inStream);
inStream.Close();
using (outStream)
{
zipEntry.Extract(outStream);
}
}
}
}

View file

@ -1,367 +1,367 @@
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
//
//
// </summary>
using System;
namespace LSLEditor.Decompressor
{
public class ZipEntry
{
private const int ZipEntrySignature = 0x04034b50;
private const int ZipEntryDataDescriptorSignature = 0x08074b50;
private DateTime _LastModified;
private string _FileName;
private Int16 _VersionNeeded;
private Int16 _BitField;
private Int16 _CompressionMethod;
private Int32 _CompressedSize;
private Int32 _UncompressedSize;
private Int32 _LastModDateTime;
private Int32 _Crc32;
private byte[] _Extra;
private byte[] __filedata;
private byte[] _FileData
{
get
{
if (__filedata == null)
{
}
return __filedata;
}
}
private System.IO.MemoryStream _UnderlyingMemoryStream;
private System.IO.Compression.DeflateStream _CompressedStream;
private System.IO.Compression.DeflateStream CompressedStream
{
get
{
if (_CompressedStream == null)
{
_UnderlyingMemoryStream = new System.IO.MemoryStream();
bool LeaveUnderlyingStreamOpen = true;
_CompressedStream = new System.IO.Compression.DeflateStream(_UnderlyingMemoryStream,
System.IO.Compression.CompressionMode.Compress,
LeaveUnderlyingStreamOpen);
}
return _CompressedStream;
}
}
private static bool ReadHeader(System.IO.Stream s, ZipEntry ze)
{
int signature = Shared.ReadSignature(s);
// return null if this is not a local file header signature
if (SignatureIsNotValid(signature))
{
s.Seek(-4, System.IO.SeekOrigin.Current);
return false;
}
byte[] block = new byte[26];
int n = s.Read(block, 0, block.Length);
if (n != block.Length) return false;
int i = 0;
ze._VersionNeeded = (short)(block[i++] + block[i++] * 256);
ze._BitField = (short)(block[i++] + block[i++] * 256);
ze._CompressionMethod = (short)(block[i++] + block[i++] * 256);
ze._LastModDateTime = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
// the PKZIP spec says that if bit 3 is set (0x0008), then the CRC, Compressed size, and uncompressed size
// come directly after the file data. The only way to find it is to scan the zip archive for the signature of
// the Data Descriptor, and presume that that signature does not appear in the (compressed) data of the compressed file.
if ((ze._BitField & 0x0008) != 0x0008)
{
ze._Crc32 = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
ze._CompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
ze._UncompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
}
else
{
// the CRC, compressed size, and uncompressed size are stored later in the stream.
// here, we advance the pointer.
i += 12;
}
Int16 filenameLength = (short)(block[i++] + block[i++] * 256);
Int16 extraFieldLength = (short)(block[i++] + block[i++] * 256);
block = new byte[filenameLength];
n = s.Read(block, 0, block.Length);
ze._FileName = Shared.StringFromBuffer(block, 0, block.Length);
ze._Extra = new byte[extraFieldLength];
n = s.Read(ze._Extra, 0, ze._Extra.Length);
// transform the time data into something usable
ze._LastModified = Shared.PackedToDateTime(ze._LastModDateTime);
// actually get the compressed size and CRC if necessary
if ((ze._BitField & 0x0008) == 0x0008)
{
long posn = s.Position;
long SizeOfDataRead = Shared.FindSignature(s, ZipEntryDataDescriptorSignature);
if (SizeOfDataRead == -1) return false;
// read 3x 4-byte fields (CRC, Compressed Size, Uncompressed Size)
block = new byte[12];
n = s.Read(block, 0, block.Length);
if (n != 12) return false;
i = 0;
ze._Crc32 = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
ze._CompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
ze._UncompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
if (SizeOfDataRead != ze._CompressedSize)
throw new Exception("Data format error (bit 3 is set)");
// seek back to previous position, to read file data
s.Seek(posn, System.IO.SeekOrigin.Begin);
}
return true;
}
private static bool SignatureIsNotValid(int signature)
{
return (signature != ZipEntrySignature);
}
public static ZipEntry Read(System.IO.Stream s)
{
ZipEntry entry = new ZipEntry();
if (!ReadHeader(s, entry)) return null;
entry.__filedata = new byte[entry._CompressedSize];
int n = s.Read(entry._FileData, 0, entry._FileData.Length);
if (n != entry._FileData.Length)
{
throw new Exception("badly formatted zip file.");
}
// finally, seek past the (already read) Data descriptor if necessary
if ((entry._BitField & 0x0008) == 0x0008)
{
s.Seek(16, System.IO.SeekOrigin.Current);
}
return entry;
}
public void Extract(System.IO.Stream s)
{
using (System.IO.MemoryStream memstream = new System.IO.MemoryStream(_FileData))
{
System.IO.Stream input = null;
try
{
if (this._CompressedSize == this._UncompressedSize)
{
input = memstream;
}
else
{
input = new System.IO.Compression.DeflateStream(memstream, System.IO.Compression.CompressionMode.Decompress);
}
System.IO.Stream output = null;
try
{
output = s;
byte[] bytes = new byte[4096];
int n;
n = 1; // anything non-zero
while (n != 0)
{
n = input.Read(bytes, 0, bytes.Length);
if (n > 0)
{
output.Write(bytes, 0, n);
}
}
}
finally
{
// we only close the output stream if we opened it.
if (output != null)
{
output.Close();
output.Dispose();
}
}
}
finally
{
// we only close the output stream if we opened it.
// we cannot use using() here because in some cases we do not want to Dispose the stream!
if ((input != null) && (input != memstream))
{
input.Close();
input.Dispose();
}
}
}
}
}
class Shared
{
protected internal static string StringFromBuffer(byte[] buf, int start, int maxlength)
{
int i;
char[] c = new char[maxlength];
for (i = 0; (i < maxlength) && (i < buf.Length) && (buf[i] != 0); i++)
{
c[i] = (char)buf[i]; // System.BitConverter.ToChar(buf, start+i*2);
}
string s = new System.String(c, 0, i);
return s;
}
protected internal static int ReadSignature(System.IO.Stream s)
{
int n = 0;
byte[] sig = new byte[4];
n = s.Read(sig, 0, sig.Length);
if (n != sig.Length) throw new Exception("Could not read signature - no data!");
int signature = (((sig[3] * 256 + sig[2]) * 256) + sig[1]) * 256 + sig[0];
return signature;
}
protected internal static long FindSignature(System.IO.Stream s, int SignatureToFind)
{
long startingPosition = s.Position;
int BATCH_SIZE = 1024;
byte[] targetBytes = new byte[4];
targetBytes[0] = (byte)(SignatureToFind >> 24);
targetBytes[1] = (byte)((SignatureToFind & 0x00FF0000) >> 16);
targetBytes[2] = (byte)((SignatureToFind & 0x0000FF00) >> 8);
targetBytes[3] = (byte)(SignatureToFind & 0x000000FF);
byte[] batch = new byte[BATCH_SIZE];
int n = 0;
bool success = false;
do
{
n = s.Read(batch, 0, batch.Length);
if (n != 0)
{
for (int i = 0; i < n; i++)
{
if (batch[i] == targetBytes[3])
{
s.Seek(i - n, System.IO.SeekOrigin.Current);
int sig = ReadSignature(s);
success = (sig == SignatureToFind);
if (!success) s.Seek(-3, System.IO.SeekOrigin.Current);
break; // out of for loop
}
}
}
else break;
if (success) break;
} while (true);
if (!success)
{
s.Seek(startingPosition, System.IO.SeekOrigin.Begin);
return -1; // or throw?
}
// subtract 4 for the signature.
long bytesRead = (s.Position - startingPosition) - 4;
// number of bytes read, should be the same as compressed size of file
return bytesRead;
}
protected internal static DateTime PackedToDateTime(Int32 packedDateTime)
{
Int16 packedTime = (Int16)(packedDateTime & 0x0000ffff);
Int16 packedDate = (Int16)((packedDateTime & 0xffff0000) >> 16);
int year = 1980 + ((packedDate & 0xFE00) >> 9);
int month = (packedDate & 0x01E0) >> 5;
int day = packedDate & 0x001F;
int hour = (packedTime & 0xF800) >> 11;
int minute = (packedTime & 0x07E0) >> 5;
int second = packedTime & 0x001F;
DateTime d = System.DateTime.Now;
try { d = new System.DateTime(year, month, day, hour, minute, second, 0); }
catch
{
Console.Write("\nInvalid date/time?:\nyear: {0} ", year);
Console.Write("month: {0} ", month);
Console.WriteLine("day: {0} ", day);
Console.WriteLine("HH:MM:SS= {0}:{1}:{2}", hour, minute, second);
}
return d;
}
protected internal static Int32 DateTimeToPacked(DateTime time)
{
UInt16 packedDate = (UInt16)((time.Day & 0x0000001F) | ((time.Month << 5) & 0x000001E0) | (((time.Year - 1980) << 9) & 0x0000FE00));
UInt16 packedTime = (UInt16)((time.Second & 0x0000001F) | ((time.Minute << 5) & 0x000007E0) | ((time.Hour << 11) & 0x0000F800));
return (Int32)(((UInt32)(packedDate << 16)) | packedTime);
}
}
}
// <copyright file="gpl-2.0.txt">
// ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden.
// The code was donated on 2010-04-28 by Alphons van der Heijden to Brandon 'Dimentox Travanti' Husbands &
// Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
//
// The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// the community would be stuck with crappy editors.
//
// The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other
// License"), formally executed by you and The LSLEditor Group.
// Terms of the GPL can be found in the gplv2.txt document.
//
// GPLv2 Header
// ************
// LSLEditor, a External editor for the LSL Language.
// Copyright (C) 2010 The LSLEditor Group.
//
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// ********************************************************************************************************************
// The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// Software.
// ********************************************************************************************************************
// </copyright>
//
// <summary>
//
//
// </summary>
using System;
namespace LSLEditor.Decompressor
{
public class ZipEntry
{
private const int ZipEntrySignature = 0x04034b50;
private const int ZipEntryDataDescriptorSignature = 0x08074b50;
private DateTime _LastModified;
private string _FileName;
private Int16 _VersionNeeded;
private Int16 _BitField;
private Int16 _CompressionMethod;
private Int32 _CompressedSize;
private Int32 _UncompressedSize;
private Int32 _LastModDateTime;
private Int32 _Crc32;
private byte[] _Extra;
private byte[] __filedata;
private byte[] _FileData
{
get
{
if (__filedata == null)
{
}
return __filedata;
}
}
private System.IO.MemoryStream _UnderlyingMemoryStream;
private System.IO.Compression.DeflateStream _CompressedStream;
private System.IO.Compression.DeflateStream CompressedStream
{
get
{
if (_CompressedStream == null)
{
_UnderlyingMemoryStream = new System.IO.MemoryStream();
bool LeaveUnderlyingStreamOpen = true;
_CompressedStream = new System.IO.Compression.DeflateStream(_UnderlyingMemoryStream,
System.IO.Compression.CompressionMode.Compress,
LeaveUnderlyingStreamOpen);
}
return _CompressedStream;
}
}
private static bool ReadHeader(System.IO.Stream s, ZipEntry ze)
{
int signature = Shared.ReadSignature(s);
// return null if this is not a local file header signature
if (SignatureIsNotValid(signature))
{
s.Seek(-4, System.IO.SeekOrigin.Current);
return false;
}
byte[] block = new byte[26];
int n = s.Read(block, 0, block.Length);
if (n != block.Length) return false;
int i = 0;
ze._VersionNeeded = (short)(block[i++] + block[i++] * 256);
ze._BitField = (short)(block[i++] + block[i++] * 256);
ze._CompressionMethod = (short)(block[i++] + block[i++] * 256);
ze._LastModDateTime = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
// the PKZIP spec says that if bit 3 is set (0x0008), then the CRC, Compressed size, and uncompressed size
// come directly after the file data. The only way to find it is to scan the zip archive for the signature of
// the Data Descriptor, and presume that that signature does not appear in the (compressed) data of the compressed file.
if ((ze._BitField & 0x0008) != 0x0008)
{
ze._Crc32 = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
ze._CompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
ze._UncompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
}
else
{
// the CRC, compressed size, and uncompressed size are stored later in the stream.
// here, we advance the pointer.
i += 12;
}
Int16 filenameLength = (short)(block[i++] + block[i++] * 256);
Int16 extraFieldLength = (short)(block[i++] + block[i++] * 256);
block = new byte[filenameLength];
n = s.Read(block, 0, block.Length);
ze._FileName = Shared.StringFromBuffer(block, 0, block.Length);
ze._Extra = new byte[extraFieldLength];
n = s.Read(ze._Extra, 0, ze._Extra.Length);
// transform the time data into something usable
ze._LastModified = Shared.PackedToDateTime(ze._LastModDateTime);
// actually get the compressed size and CRC if necessary
if ((ze._BitField & 0x0008) == 0x0008)
{
long posn = s.Position;
long SizeOfDataRead = Shared.FindSignature(s, ZipEntryDataDescriptorSignature);
if (SizeOfDataRead == -1) return false;
// read 3x 4-byte fields (CRC, Compressed Size, Uncompressed Size)
block = new byte[12];
n = s.Read(block, 0, block.Length);
if (n != 12) return false;
i = 0;
ze._Crc32 = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
ze._CompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
ze._UncompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256;
if (SizeOfDataRead != ze._CompressedSize)
throw new Exception("Data format error (bit 3 is set)");
// seek back to previous position, to read file data
s.Seek(posn, System.IO.SeekOrigin.Begin);
}
return true;
}
private static bool SignatureIsNotValid(int signature)
{
return (signature != ZipEntrySignature);
}
public static ZipEntry Read(System.IO.Stream s)
{
ZipEntry entry = new ZipEntry();
if (!ReadHeader(s, entry)) return null;
entry.__filedata = new byte[entry._CompressedSize];
int n = s.Read(entry._FileData, 0, entry._FileData.Length);
if (n != entry._FileData.Length)
{
throw new Exception("badly formatted zip file.");
}
// finally, seek past the (already read) Data descriptor if necessary
if ((entry._BitField & 0x0008) == 0x0008)
{
s.Seek(16, System.IO.SeekOrigin.Current);
}
return entry;
}
public void Extract(System.IO.Stream s)
{
using (System.IO.MemoryStream memstream = new System.IO.MemoryStream(_FileData))
{
System.IO.Stream input = null;
try
{
if (this._CompressedSize == this._UncompressedSize)
{
input = memstream;
}
else
{
input = new System.IO.Compression.DeflateStream(memstream, System.IO.Compression.CompressionMode.Decompress);
}
System.IO.Stream output = null;
try
{
output = s;
byte[] bytes = new byte[4096];
int n;
n = 1; // anything non-zero
while (n != 0)
{
n = input.Read(bytes, 0, bytes.Length);
if (n > 0)
{
output.Write(bytes, 0, n);
}
}
}
finally
{
// we only close the output stream if we opened it.
if (output != null)
{
output.Close();
output.Dispose();
}
}
}
finally
{
// we only close the output stream if we opened it.
// we cannot use using() here because in some cases we do not want to Dispose the stream!
if ((input != null) && (input != memstream))
{
input.Close();
input.Dispose();
}
}
}
}
}
class Shared
{
protected internal static string StringFromBuffer(byte[] buf, int start, int maxlength)
{
int i;
char[] c = new char[maxlength];
for (i = 0; (i < maxlength) && (i < buf.Length) && (buf[i] != 0); i++)
{
c[i] = (char)buf[i]; // System.BitConverter.ToChar(buf, start+i*2);
}
string s = new System.String(c, 0, i);
return s;
}
protected internal static int ReadSignature(System.IO.Stream s)
{
int n = 0;
byte[] sig = new byte[4];
n = s.Read(sig, 0, sig.Length);
if (n != sig.Length) throw new Exception("Could not read signature - no data!");
int signature = (((sig[3] * 256 + sig[2]) * 256) + sig[1]) * 256 + sig[0];
return signature;
}
protected internal static long FindSignature(System.IO.Stream s, int SignatureToFind)
{
long startingPosition = s.Position;
int BATCH_SIZE = 1024;
byte[] targetBytes = new byte[4];
targetBytes[0] = (byte)(SignatureToFind >> 24);
targetBytes[1] = (byte)((SignatureToFind & 0x00FF0000) >> 16);
targetBytes[2] = (byte)((SignatureToFind & 0x0000FF00) >> 8);
targetBytes[3] = (byte)(SignatureToFind & 0x000000FF);
byte[] batch = new byte[BATCH_SIZE];
int n = 0;
bool success = false;
do
{
n = s.Read(batch, 0, batch.Length);
if (n != 0)
{
for (int i = 0; i < n; i++)
{
if (batch[i] == targetBytes[3])
{
s.Seek(i - n, System.IO.SeekOrigin.Current);
int sig = ReadSignature(s);
success = (sig == SignatureToFind);
if (!success) s.Seek(-3, System.IO.SeekOrigin.Current);
break; // out of for loop
}
}
}
else break;
if (success) break;
} while (true);
if (!success)
{
s.Seek(startingPosition, System.IO.SeekOrigin.Begin);
return -1; // or throw?
}
// subtract 4 for the signature.
long bytesRead = (s.Position - startingPosition) - 4;
// number of bytes read, should be the same as compressed size of file
return bytesRead;
}
protected internal static DateTime PackedToDateTime(Int32 packedDateTime)
{
Int16 packedTime = (Int16)(packedDateTime & 0x0000ffff);
Int16 packedDate = (Int16)((packedDateTime & 0xffff0000) >> 16);
int year = 1980 + ((packedDate & 0xFE00) >> 9);
int month = (packedDate & 0x01E0) >> 5;
int day = packedDate & 0x001F;
int hour = (packedTime & 0xF800) >> 11;
int minute = (packedTime & 0x07E0) >> 5;
int second = packedTime & 0x001F;
DateTime d = System.DateTime.Now;
try { d = new System.DateTime(year, month, day, hour, minute, second, 0); }
catch
{
Console.Write("\nInvalid date/time?:\nyear: {0} ", year);
Console.Write("month: {0} ", month);
Console.WriteLine("day: {0} ", day);
Console.WriteLine("HH:MM:SS= {0}:{1}:{2}", hour, minute, second);
}
return d;
}
protected internal static Int32 DateTimeToPacked(DateTime time)
{
UInt16 packedDate = (UInt16)((time.Day & 0x0000001F) | ((time.Month << 5) & 0x000001E0) | (((time.Year - 1980) << 9) & 0x0000FE00));
UInt16 packedTime = (UInt16)((time.Second & 0x0000001F) | ((time.Minute << 5) & 0x000007E0) | ((time.Hour << 11) & 0x0000F800));
return (Int32)(((UInt32)(packedDate << 16)) | packedTime);
}
}
}

View file

@ -1,142 +1,142 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace LSLEditor.Docking
{
internal class DockAreasEditor : UITypeEditor
{
private class DockAreasEditorControl : System.Windows.Forms.UserControl
{
private CheckBox checkBoxFloat;
private CheckBox checkBoxDockLeft;
private CheckBox checkBoxDockRight;
private CheckBox checkBoxDockTop;
private CheckBox checkBoxDockBottom;
private CheckBox checkBoxDockFill;
private DockAreas m_oldDockAreas;
public DockAreas DockAreas
{
get
{
DockAreas dockAreas = 0;
if (checkBoxFloat.Checked)
dockAreas |= DockAreas.Float;
if (checkBoxDockLeft.Checked)
dockAreas |= DockAreas.DockLeft;
if (checkBoxDockRight.Checked)
dockAreas |= DockAreas.DockRight;
if (checkBoxDockTop.Checked)
dockAreas |= DockAreas.DockTop;
if (checkBoxDockBottom.Checked)
dockAreas |= DockAreas.DockBottom;
if (checkBoxDockFill.Checked)
dockAreas |= DockAreas.Document;
if (dockAreas == 0)
return m_oldDockAreas;
else
return dockAreas;
}
}
public DockAreasEditorControl()
{
checkBoxFloat = new CheckBox();
checkBoxDockLeft = new CheckBox();
checkBoxDockRight = new CheckBox();
checkBoxDockTop = new CheckBox();
checkBoxDockBottom = new CheckBox();
checkBoxDockFill = new CheckBox();
SuspendLayout();
checkBoxFloat.Appearance = Appearance.Button;
checkBoxFloat.Dock = DockStyle.Top;
checkBoxFloat.Height = 24;
checkBoxFloat.Text = Strings.DockAreaEditor_FloatCheckBoxText;
checkBoxFloat.TextAlign = ContentAlignment.MiddleCenter;
checkBoxFloat.FlatStyle = FlatStyle.System;
checkBoxDockLeft.Appearance = System.Windows.Forms.Appearance.Button;
checkBoxDockLeft.Dock = System.Windows.Forms.DockStyle.Left;
checkBoxDockLeft.Width = 24;
checkBoxDockLeft.FlatStyle = FlatStyle.System;
checkBoxDockRight.Appearance = System.Windows.Forms.Appearance.Button;
checkBoxDockRight.Dock = System.Windows.Forms.DockStyle.Right;
checkBoxDockRight.Width = 24;
checkBoxDockRight.FlatStyle = FlatStyle.System;
checkBoxDockTop.Appearance = System.Windows.Forms.Appearance.Button;
checkBoxDockTop.Dock = System.Windows.Forms.DockStyle.Top;
checkBoxDockTop.Height = 24;
checkBoxDockTop.FlatStyle = FlatStyle.System;
checkBoxDockBottom.Appearance = System.Windows.Forms.Appearance.Button;
checkBoxDockBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
checkBoxDockBottom.Height = 24;
checkBoxDockBottom.FlatStyle = FlatStyle.System;
checkBoxDockFill.Appearance = System.Windows.Forms.Appearance.Button;
checkBoxDockFill.Dock = System.Windows.Forms.DockStyle.Fill;
checkBoxDockFill.FlatStyle = FlatStyle.System;
this.Controls.AddRange(new Control[] {
checkBoxDockFill,
checkBoxDockBottom,
checkBoxDockTop,
checkBoxDockRight,
checkBoxDockLeft,
checkBoxFloat});
Size = new System.Drawing.Size(160, 144);
BackColor = SystemColors.Control;
ResumeLayout();
}
public void SetStates(DockAreas dockAreas)
{
m_oldDockAreas = dockAreas;
if ((dockAreas & DockAreas.DockLeft) != 0)
checkBoxDockLeft.Checked = true;
if ((dockAreas & DockAreas.DockRight) != 0)
checkBoxDockRight.Checked = true;
if ((dockAreas & DockAreas.DockTop) != 0)
checkBoxDockTop.Checked = true;
if ((dockAreas & DockAreas.DockTop) != 0)
checkBoxDockTop.Checked = true;
if ((dockAreas & DockAreas.DockBottom) != 0)
checkBoxDockBottom.Checked = true;
if ((dockAreas & DockAreas.Document) != 0)
checkBoxDockFill.Checked = true;
if ((dockAreas & DockAreas.Float) != 0)
checkBoxFloat.Checked = true;
}
}
private DockAreasEditor.DockAreasEditorControl m_ui = null;
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
{
if (m_ui == null)
m_ui = new DockAreasEditor.DockAreasEditorControl();
m_ui.SetStates((DockAreas)value);
IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService));
edSvc.DropDownControl(m_ui);
return m_ui.DockAreas;
}
}
}
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace LSLEditor.Docking
{
internal class DockAreasEditor : UITypeEditor
{
private class DockAreasEditorControl : System.Windows.Forms.UserControl
{
private CheckBox checkBoxFloat;
private CheckBox checkBoxDockLeft;
private CheckBox checkBoxDockRight;
private CheckBox checkBoxDockTop;
private CheckBox checkBoxDockBottom;
private CheckBox checkBoxDockFill;
private DockAreas m_oldDockAreas;
public DockAreas DockAreas
{
get
{
DockAreas dockAreas = 0;
if (checkBoxFloat.Checked)
dockAreas |= DockAreas.Float;
if (checkBoxDockLeft.Checked)
dockAreas |= DockAreas.DockLeft;
if (checkBoxDockRight.Checked)
dockAreas |= DockAreas.DockRight;
if (checkBoxDockTop.Checked)
dockAreas |= DockAreas.DockTop;
if (checkBoxDockBottom.Checked)
dockAreas |= DockAreas.DockBottom;
if (checkBoxDockFill.Checked)
dockAreas |= DockAreas.Document;
if (dockAreas == 0)
return m_oldDockAreas;
else
return dockAreas;
}
}
public DockAreasEditorControl()
{
checkBoxFloat = new CheckBox();
checkBoxDockLeft = new CheckBox();
checkBoxDockRight = new CheckBox();
checkBoxDockTop = new CheckBox();
checkBoxDockBottom = new CheckBox();
checkBoxDockFill = new CheckBox();
SuspendLayout();
checkBoxFloat.Appearance = Appearance.Button;
checkBoxFloat.Dock = DockStyle.Top;
checkBoxFloat.Height = 24;
checkBoxFloat.Text = Strings.DockAreaEditor_FloatCheckBoxText;
checkBoxFloat.TextAlign = ContentAlignment.MiddleCenter;
checkBoxFloat.FlatStyle = FlatStyle.System;
checkBoxDockLeft.Appearance = System.Windows.Forms.Appearance.Button;
checkBoxDockLeft.Dock = System.Windows.Forms.DockStyle.Left;
checkBoxDockLeft.Width = 24;
checkBoxDockLeft.FlatStyle = FlatStyle.System;
checkBoxDockRight.Appearance = System.Windows.Forms.Appearance.Button;
checkBoxDockRight.Dock = System.Windows.Forms.DockStyle.Right;
checkBoxDockRight.Width = 24;
checkBoxDockRight.FlatStyle = FlatStyle.System;
checkBoxDockTop.Appearance = System.Windows.Forms.Appearance.Button;
checkBoxDockTop.Dock = System.Windows.Forms.DockStyle.Top;
checkBoxDockTop.Height = 24;
checkBoxDockTop.FlatStyle = FlatStyle.System;
checkBoxDockBottom.Appearance = System.Windows.Forms.Appearance.Button;
checkBoxDockBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
checkBoxDockBottom.Height = 24;
checkBoxDockBottom.FlatStyle = FlatStyle.System;
checkBoxDockFill.Appearance = System.Windows.Forms.Appearance.Button;
checkBoxDockFill.Dock = System.Windows.Forms.DockStyle.Fill;
checkBoxDockFill.FlatStyle = FlatStyle.System;
this.Controls.AddRange(new Control[] {
checkBoxDockFill,
checkBoxDockBottom,
checkBoxDockTop,
checkBoxDockRight,
checkBoxDockLeft,
checkBoxFloat});
Size = new System.Drawing.Size(160, 144);
BackColor = SystemColors.Control;
ResumeLayout();
}
public void SetStates(DockAreas dockAreas)
{
m_oldDockAreas = dockAreas;
if ((dockAreas & DockAreas.DockLeft) != 0)
checkBoxDockLeft.Checked = true;
if ((dockAreas & DockAreas.DockRight) != 0)
checkBoxDockRight.Checked = true;
if ((dockAreas & DockAreas.DockTop) != 0)
checkBoxDockTop.Checked = true;
if ((dockAreas & DockAreas.DockTop) != 0)
checkBoxDockTop.Checked = true;
if ((dockAreas & DockAreas.DockBottom) != 0)
checkBoxDockBottom.Checked = true;
if ((dockAreas & DockAreas.Document) != 0)
checkBoxDockFill.Checked = true;
if ((dockAreas & DockAreas.Float) != 0)
checkBoxFloat.Checked = true;
}
}
private DockAreasEditor.DockAreasEditorControl m_ui = null;
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
{
if (m_ui == null)
m_ui = new DockAreasEditor.DockAreasEditorControl();
m_ui.SetStates((DockAreas)value);
IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService));
edSvc.DropDownControl(m_ui);
return m_ui.DockAreas;
}
}
}

View file

@ -1,304 +1,304 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics.CodeAnalysis;
namespace LSLEditor.Docking
{
public class DockContent : Form, IDockContent
{
public DockContent()
{
m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
//Suggested as a fix by bensty regarding form resize
this.ParentChanged += new EventHandler(DockContent_ParentChanged);
}
//Suggested as a fix by bensty regarding form resize
private void DockContent_ParentChanged(object Sender, EventArgs e)
{
if (this.Parent != null)
this.Font = this.Parent.Font;
}
private DockContentHandler m_dockHandler = null;
[Browsable(false)]
public DockContentHandler DockHandler
{
get { return m_dockHandler; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_AllowEndUserDocking_Description")]
[DefaultValue(true)]
public bool AllowEndUserDocking
{
get { return DockHandler.AllowEndUserDocking; }
set { DockHandler.AllowEndUserDocking = value; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_DockAreas_Description")]
[DefaultValue(DockAreas.DockLeft|DockAreas.DockRight|DockAreas.DockTop|DockAreas.DockBottom|DockAreas.Document|DockAreas.Float)]
public DockAreas DockAreas
{
get { return DockHandler.DockAreas; }
set { DockHandler.DockAreas = value; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_AutoHidePortion_Description")]
[DefaultValue(0.25)]
public double AutoHidePortion
{
get { return DockHandler.AutoHidePortion; }
set { DockHandler.AutoHidePortion = value; }
}
[Localizable(true)]
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_TabText_Description")]
[DefaultValue(null)]
private string m_tabText = null;
public string TabText
{
get { return m_tabText; }
set { DockHandler.TabText = m_tabText = value; }
}
private bool ShouldSerializeTabText()
{
return (m_tabText != null);
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_CloseButton_Description")]
[DefaultValue(true)]
public bool CloseButton
{
get { return DockHandler.CloseButton; }
set { DockHandler.CloseButton = value; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_CloseButtonVisible_Description")]
[DefaultValue(true)]
public bool CloseButtonVisible
{
get { return DockHandler.CloseButtonVisible; }
set { DockHandler.CloseButtonVisible = value; }
}
[Browsable(false)]
public DockPanel DockPanel
{
get { return DockHandler.DockPanel; }
set { DockHandler.DockPanel = value; }
}
[Browsable(false)]
public DockState DockState
{
get { return DockHandler.DockState; }
set { DockHandler.DockState = value; }
}
[Browsable(false)]
public DockPane Pane
{
get { return DockHandler.Pane; }
set { DockHandler.Pane = value; }
}
[Browsable(false)]
public bool IsHidden
{
get { return DockHandler.IsHidden; }
set { DockHandler.IsHidden = value; }
}
[Browsable(false)]
public DockState VisibleState
{
get { return DockHandler.VisibleState; }
set { DockHandler.VisibleState = value; }
}
[Browsable(false)]
public bool IsFloat
{
get { return DockHandler.IsFloat; }
set { DockHandler.IsFloat = value; }
}
[Browsable(false)]
public DockPane PanelPane
{
get { return DockHandler.PanelPane; }
set { DockHandler.PanelPane = value; }
}
[Browsable(false)]
public DockPane FloatPane
{
get { return DockHandler.FloatPane; }
set { DockHandler.FloatPane = value; }
}
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
protected virtual string GetPersistString()
{
return GetType().ToString();
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_HideOnClose_Description")]
[DefaultValue(false)]
public bool HideOnClose
{
get { return DockHandler.HideOnClose; }
set { DockHandler.HideOnClose = value; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_ShowHint_Description")]
[DefaultValue(DockState.Unknown)]
public DockState ShowHint
{
get { return DockHandler.ShowHint; }
set { DockHandler.ShowHint = value; }
}
[Browsable(false)]
public bool IsActivated
{
get { return DockHandler.IsActivated; }
}
public bool IsDockStateValid(DockState dockState)
{
return DockHandler.IsDockStateValid(dockState);
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_TabPageContextMenu_Description")]
[DefaultValue(null)]
public ContextMenuStrip TabPageContextMenu
{
get { return DockHandler.TabPageContextMenu; }
set { DockHandler.TabPageContextMenu = value; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_TabPageContextMenuStrip_Description")]
[DefaultValue(null)]
public ContextMenuStrip TabPageContextMenuStrip
{
get { return DockHandler.TabPageContextMenuStrip; }
set { DockHandler.TabPageContextMenuStrip = value; }
}
[Localizable(true)]
[Category("Appearance")]
[LocalizedDescription("DockContent_ToolTipText_Description")]
[DefaultValue(null)]
public string ToolTipText
{
get { return DockHandler.ToolTipText; }
set { DockHandler.ToolTipText = value; }
}
public new void Activate()
{
DockHandler.Activate();
}
public new void Hide()
{
DockHandler.Hide();
}
public new void Show()
{
DockHandler.Show();
}
public void Show(DockPanel dockPanel)
{
DockHandler.Show(dockPanel);
}
public void Show(DockPanel dockPanel, DockState dockState)
{
DockHandler.Show(dockPanel, dockState);
}
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")]
public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
{
DockHandler.Show(dockPanel, floatWindowBounds);
}
public void Show(DockPane pane, IDockContent beforeContent)
{
DockHandler.Show(pane, beforeContent);
}
public void Show(DockPane previousPane, DockAlignment alignment, double proportion)
{
DockHandler.Show(previousPane, alignment, proportion);
}
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")]
public void FloatAt(Rectangle floatWindowBounds)
{
DockHandler.FloatAt(floatWindowBounds);
}
public void DockTo(DockPane paneTo, DockStyle dockStyle, int contentIndex)
{
DockHandler.DockTo(paneTo, dockStyle, contentIndex);
}
public void DockTo(DockPanel panel, DockStyle dockStyle)
{
DockHandler.DockTo(panel, dockStyle);
}
#region IDockContent Members
void IDockContent.OnActivated(EventArgs e)
{
this.OnActivated(e);
}
void IDockContent.OnDeactivate(EventArgs e)
{
this.OnDeactivate(e);
}
#endregion
#region Events
private void DockHandler_DockStateChanged(object sender, EventArgs e)
{
OnDockStateChanged(e);
}
private static readonly object DockStateChangedEvent = new object();
[LocalizedCategory("Category_PropertyChanged")]
[LocalizedDescription("Pane_DockStateChanged_Description")]
public event EventHandler DockStateChanged
{
add { Events.AddHandler(DockStateChangedEvent, value); }
remove { Events.RemoveHandler(DockStateChangedEvent, value); }
}
protected virtual void OnDockStateChanged(EventArgs e)
{
EventHandler handler = (EventHandler)Events[DockStateChangedEvent];
if (handler != null)
handler(this, e);
}
#endregion
}
}
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics.CodeAnalysis;
namespace LSLEditor.Docking
{
public class DockContent : Form, IDockContent
{
public DockContent()
{
m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
//Suggested as a fix by bensty regarding form resize
this.ParentChanged += new EventHandler(DockContent_ParentChanged);
}
//Suggested as a fix by bensty regarding form resize
private void DockContent_ParentChanged(object Sender, EventArgs e)
{
if (this.Parent != null)
this.Font = this.Parent.Font;
}
private DockContentHandler m_dockHandler = null;
[Browsable(false)]
public DockContentHandler DockHandler
{
get { return m_dockHandler; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_AllowEndUserDocking_Description")]
[DefaultValue(true)]
public bool AllowEndUserDocking
{
get { return DockHandler.AllowEndUserDocking; }
set { DockHandler.AllowEndUserDocking = value; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_DockAreas_Description")]
[DefaultValue(DockAreas.DockLeft|DockAreas.DockRight|DockAreas.DockTop|DockAreas.DockBottom|DockAreas.Document|DockAreas.Float)]
public DockAreas DockAreas
{
get { return DockHandler.DockAreas; }
set { DockHandler.DockAreas = value; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_AutoHidePortion_Description")]
[DefaultValue(0.25)]
public double AutoHidePortion
{
get { return DockHandler.AutoHidePortion; }
set { DockHandler.AutoHidePortion = value; }
}
[Localizable(true)]
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_TabText_Description")]
[DefaultValue(null)]
private string m_tabText = null;
public string TabText
{
get { return m_tabText; }
set { DockHandler.TabText = m_tabText = value; }
}
private bool ShouldSerializeTabText()
{
return (m_tabText != null);
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_CloseButton_Description")]
[DefaultValue(true)]
public bool CloseButton
{
get { return DockHandler.CloseButton; }
set { DockHandler.CloseButton = value; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_CloseButtonVisible_Description")]
[DefaultValue(true)]
public bool CloseButtonVisible
{
get { return DockHandler.CloseButtonVisible; }
set { DockHandler.CloseButtonVisible = value; }
}
[Browsable(false)]
public DockPanel DockPanel
{
get { return DockHandler.DockPanel; }
set { DockHandler.DockPanel = value; }
}
[Browsable(false)]
public DockState DockState
{
get { return DockHandler.DockState; }
set { DockHandler.DockState = value; }
}
[Browsable(false)]
public DockPane Pane
{
get { return DockHandler.Pane; }
set { DockHandler.Pane = value; }
}
[Browsable(false)]
public bool IsHidden
{
get { return DockHandler.IsHidden; }
set { DockHandler.IsHidden = value; }
}
[Browsable(false)]
public DockState VisibleState
{
get { return DockHandler.VisibleState; }
set { DockHandler.VisibleState = value; }
}
[Browsable(false)]
public bool IsFloat
{
get { return DockHandler.IsFloat; }
set { DockHandler.IsFloat = value; }
}
[Browsable(false)]
public DockPane PanelPane
{
get { return DockHandler.PanelPane; }
set { DockHandler.PanelPane = value; }
}
[Browsable(false)]
public DockPane FloatPane
{
get { return DockHandler.FloatPane; }
set { DockHandler.FloatPane = value; }
}
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
protected virtual string GetPersistString()
{
return GetType().ToString();
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_HideOnClose_Description")]
[DefaultValue(false)]
public bool HideOnClose
{
get { return DockHandler.HideOnClose; }
set { DockHandler.HideOnClose = value; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_ShowHint_Description")]
[DefaultValue(DockState.Unknown)]
public DockState ShowHint
{
get { return DockHandler.ShowHint; }
set { DockHandler.ShowHint = value; }
}
[Browsable(false)]
public bool IsActivated
{
get { return DockHandler.IsActivated; }
}
public bool IsDockStateValid(DockState dockState)
{
return DockHandler.IsDockStateValid(dockState);
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_TabPageContextMenu_Description")]
[DefaultValue(null)]
public ContextMenu TabPageContextMenu
{
get { return DockHandler.TabPageContextMenu; }
set { DockHandler.TabPageContextMenu = value; }
}
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockContent_TabPageContextMenuStrip_Description")]
[DefaultValue(null)]
public ContextMenuStrip TabPageContextMenuStrip
{
get { return DockHandler.TabPageContextMenuStrip; }
set { DockHandler.TabPageContextMenuStrip = value; }
}
[Localizable(true)]
[Category("Appearance")]
[LocalizedDescription("DockContent_ToolTipText_Description")]
[DefaultValue(null)]
public string ToolTipText
{
get { return DockHandler.ToolTipText; }
set { DockHandler.ToolTipText = value; }
}
public new void Activate()
{
DockHandler.Activate();
}
public new void Hide()
{
DockHandler.Hide();
}
public new void Show()
{
DockHandler.Show();
}
public void Show(DockPanel dockPanel)
{
DockHandler.Show(dockPanel);
}
public void Show(DockPanel dockPanel, DockState dockState)
{
DockHandler.Show(dockPanel, dockState);
}
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")]
public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
{
DockHandler.Show(dockPanel, floatWindowBounds);
}
public void Show(DockPane pane, IDockContent beforeContent)
{
DockHandler.Show(pane, beforeContent);
}
public void Show(DockPane previousPane, DockAlignment alignment, double proportion)
{
DockHandler.Show(previousPane, alignment, proportion);
}
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")]
public void FloatAt(Rectangle floatWindowBounds)
{
DockHandler.FloatAt(floatWindowBounds);
}
public void DockTo(DockPane paneTo, DockStyle dockStyle, int contentIndex)
{
DockHandler.DockTo(paneTo, dockStyle, contentIndex);
}
public void DockTo(DockPanel panel, DockStyle dockStyle)
{
DockHandler.DockTo(panel, dockStyle);
}
#region IDockContent Members
void IDockContent.OnActivated(EventArgs e)
{
this.OnActivated(e);
}
void IDockContent.OnDeactivate(EventArgs e)
{
this.OnDeactivate(e);
}
#endregion
#region Events
private void DockHandler_DockStateChanged(object sender, EventArgs e)
{
OnDockStateChanged(e);
}
private static readonly object DockStateChangedEvent = new object();
[LocalizedCategory("Category_PropertyChanged")]
[LocalizedDescription("Pane_DockStateChanged_Description")]
public event EventHandler DockStateChanged
{
add { Events.AddHandler(DockStateChangedEvent, value); }
remove { Events.RemoveHandler(DockStateChangedEvent, value); }
}
protected virtual void OnDockStateChanged(EventArgs e)
{
EventHandler handler = (EventHandler)Events[DockStateChangedEvent];
if (handler != null)
handler(this, e);
}
#endregion
}
}

View file

@ -1,175 +1,175 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace LSLEditor.Docking
{
public class DockContentCollection : ReadOnlyCollection<IDockContent>
{
private static List<IDockContent> _emptyList = new List<IDockContent>(0);
internal DockContentCollection()
: base(new List<IDockContent>())
{
}
internal DockContentCollection(DockPane pane)
: base(_emptyList)
{
m_dockPane = pane;
}
private DockPane m_dockPane = null;
private DockPane DockPane
{
get { return m_dockPane; }
}
public new IDockContent this[int index]
{
get
{
if (DockPane == null)
return Items[index] as IDockContent;
else
return GetVisibleContent(index);
}
}
internal int Add(IDockContent content)
{
#if DEBUG
if (DockPane != null)
throw new InvalidOperationException();
#endif
if (Contains(content))
return IndexOf(content);
Items.Add(content);
return Count - 1;
}
internal void AddAt(IDockContent content, int index)
{
#if DEBUG
if (DockPane != null)
throw new InvalidOperationException();
#endif
if (index < 0 || index > Items.Count - 1)
return;
if (Contains(content))
return;
Items.Insert(index, content);
}
public new bool Contains(IDockContent content)
{
if (DockPane == null)
return Items.Contains(content);
else
return (GetIndexOfVisibleContents(content) != -1);
}
public new int Count
{
get
{
if (DockPane == null)
return base.Count;
else
return CountOfVisibleContents;
}
}
public new int IndexOf(IDockContent content)
{
if (DockPane == null)
{
if (!Contains(content))
return -1;
else
return Items.IndexOf(content);
}
else
return GetIndexOfVisibleContents(content);
}
internal void Remove(IDockContent content)
{
if (DockPane != null)
throw new InvalidOperationException();
if (!Contains(content))
return;
Items.Remove(content);
}
private int CountOfVisibleContents
{
get
{
#if DEBUG
if (DockPane == null)
throw new InvalidOperationException();
#endif
int count = 0;
foreach (IDockContent content in DockPane.Contents)
{
if (content.DockHandler.DockState == DockPane.DockState)
count++;
}
return count;
}
}
private IDockContent GetVisibleContent(int index)
{
#if DEBUG
if (DockPane == null)
throw new InvalidOperationException();
#endif
int currentIndex = -1;
foreach (IDockContent content in DockPane.Contents)
{
if (content.DockHandler.DockState == DockPane.DockState)
currentIndex++;
if (currentIndex == index)
return content;
}
throw (new ArgumentOutOfRangeException());
}
private int GetIndexOfVisibleContents(IDockContent content)
{
#if DEBUG
if (DockPane == null)
throw new InvalidOperationException();
#endif
if (content == null)
return -1;
int index = -1;
foreach (IDockContent c in DockPane.Contents)
{
if (c.DockHandler.DockState == DockPane.DockState)
{
index++;
if (c == content)
return index;
}
}
return -1;
}
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace LSLEditor.Docking
{
public class DockContentCollection : ReadOnlyCollection<IDockContent>
{
private static List<IDockContent> _emptyList = new List<IDockContent>(0);
internal DockContentCollection()
: base(new List<IDockContent>())
{
}
internal DockContentCollection(DockPane pane)
: base(_emptyList)
{
m_dockPane = pane;
}
private DockPane m_dockPane = null;
private DockPane DockPane
{
get { return m_dockPane; }
}
public new IDockContent this[int index]
{
get
{
if (DockPane == null)
return Items[index] as IDockContent;
else
return GetVisibleContent(index);
}
}
internal int Add(IDockContent content)
{
#if DEBUG
if (DockPane != null)
throw new InvalidOperationException();
#endif
if (Contains(content))
return IndexOf(content);
Items.Add(content);
return Count - 1;
}
internal void AddAt(IDockContent content, int index)
{
#if DEBUG
if (DockPane != null)
throw new InvalidOperationException();
#endif
if (index < 0 || index > Items.Count - 1)
return;
if (Contains(content))
return;
Items.Insert(index, content);
}
public new bool Contains(IDockContent content)
{
if (DockPane == null)
return Items.Contains(content);
else
return (GetIndexOfVisibleContents(content) != -1);
}
public new int Count
{
get
{
if (DockPane == null)
return base.Count;
else
return CountOfVisibleContents;
}
}
public new int IndexOf(IDockContent content)
{
if (DockPane == null)
{
if (!Contains(content))
return -1;
else
return Items.IndexOf(content);
}
else
return GetIndexOfVisibleContents(content);
}
internal void Remove(IDockContent content)
{
if (DockPane != null)
throw new InvalidOperationException();
if (!Contains(content))
return;
Items.Remove(content);
}
private int CountOfVisibleContents
{
get
{
#if DEBUG
if (DockPane == null)
throw new InvalidOperationException();
#endif
int count = 0;
foreach (IDockContent content in DockPane.Contents)
{
if (content.DockHandler.DockState == DockPane.DockState)
count++;
}
return count;
}
}
private IDockContent GetVisibleContent(int index)
{
#if DEBUG
if (DockPane == null)
throw new InvalidOperationException();
#endif
int currentIndex = -1;
foreach (IDockContent content in DockPane.Contents)
{
if (content.DockHandler.DockState == DockPane.DockState)
currentIndex++;
if (currentIndex == index)
return content;
}
throw (new ArgumentOutOfRangeException());
}
private int GetIndexOfVisibleContents(IDockContent content)
{
#if DEBUG
if (DockPane == null)
throw new InvalidOperationException();
#endif
if (content == null)
return -1;
int index = -1;
foreach (IDockContent c in DockPane.Contents)
{
if (c.DockHandler.DockState == DockPane.DockState)
{
index++;
if (c == content)
return index;
}
}
return -1;
}
}
}

View file

@ -1,19 +1,19 @@
using System;
namespace LSLEditor.Docking
{
public class DockContentEventArgs : EventArgs
{
private IDockContent m_content;
public DockContentEventArgs(IDockContent content)
{
m_content = content;
}
public IDockContent Content
{
get { return m_content; }
}
}
}
using System;
namespace LSLEditor.Docking
{
public class DockContentEventArgs : EventArgs
{
private IDockContent m_content;
public DockContentEventArgs(IDockContent content)
{
m_content = content;
}
public IDockContent Content
{
get { return m_content; }
}
}
}

View file

@ -1,161 +1,161 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
internal abstract class DockOutlineBase
{
public DockOutlineBase()
{
Init();
}
private void Init()
{
SetValues(Rectangle.Empty, null, DockStyle.None, -1);
SaveOldValues();
}
private Rectangle m_oldFloatWindowBounds;
protected Rectangle OldFloatWindowBounds
{
get { return m_oldFloatWindowBounds; }
}
private Control m_oldDockTo;
protected Control OldDockTo
{
get { return m_oldDockTo; }
}
private DockStyle m_oldDock;
protected DockStyle OldDock
{
get { return m_oldDock; }
}
private int m_oldContentIndex;
protected int OldContentIndex
{
get { return m_oldContentIndex; }
}
protected bool SameAsOldValue
{
get
{
return FloatWindowBounds == OldFloatWindowBounds &&
DockTo == OldDockTo &&
Dock == OldDock &&
ContentIndex == OldContentIndex;
}
}
private Rectangle m_floatWindowBounds;
public Rectangle FloatWindowBounds
{
get { return m_floatWindowBounds; }
}
private Control m_dockTo;
public Control DockTo
{
get { return m_dockTo; }
}
private DockStyle m_dock;
public DockStyle Dock
{
get { return m_dock; }
}
private int m_contentIndex;
public int ContentIndex
{
get { return m_contentIndex; }
}
public bool FlagFullEdge
{
get { return m_contentIndex != 0; }
}
private bool m_flagTestDrop = false;
public bool FlagTestDrop
{
get { return m_flagTestDrop; }
set { m_flagTestDrop = value; }
}
private void SaveOldValues()
{
m_oldDockTo = m_dockTo;
m_oldDock = m_dock;
m_oldContentIndex = m_contentIndex;
m_oldFloatWindowBounds = m_floatWindowBounds;
}
protected abstract void OnShow();
protected abstract void OnClose();
private void SetValues(Rectangle floatWindowBounds, Control dockTo, DockStyle dock, int contentIndex)
{
m_floatWindowBounds = floatWindowBounds;
m_dockTo = dockTo;
m_dock = dock;
m_contentIndex = contentIndex;
FlagTestDrop = true;
}
private void TestChange()
{
if (m_floatWindowBounds != m_oldFloatWindowBounds ||
m_dockTo != m_oldDockTo ||
m_dock != m_oldDock ||
m_contentIndex != m_oldContentIndex)
OnShow();
}
public void Show()
{
SaveOldValues();
SetValues(Rectangle.Empty, null, DockStyle.None, -1);
TestChange();
}
public void Show(DockPane pane, DockStyle dock)
{
SaveOldValues();
SetValues(Rectangle.Empty, pane, dock, -1);
TestChange();
}
public void Show(DockPane pane, int contentIndex)
{
SaveOldValues();
SetValues(Rectangle.Empty, pane, DockStyle.Fill, contentIndex);
TestChange();
}
public void Show(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge)
{
SaveOldValues();
SetValues(Rectangle.Empty, dockPanel, dock, fullPanelEdge ? -1 : 0);
TestChange();
}
public void Show(Rectangle floatWindowBounds)
{
SaveOldValues();
SetValues(floatWindowBounds, null, DockStyle.None, -1);
TestChange();
}
public void Close()
{
OnClose();
}
}
}
using System;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
internal abstract class DockOutlineBase
{
public DockOutlineBase()
{
Init();
}
private void Init()
{
SetValues(Rectangle.Empty, null, DockStyle.None, -1);
SaveOldValues();
}
private Rectangle m_oldFloatWindowBounds;
protected Rectangle OldFloatWindowBounds
{
get { return m_oldFloatWindowBounds; }
}
private Control m_oldDockTo;
protected Control OldDockTo
{
get { return m_oldDockTo; }
}
private DockStyle m_oldDock;
protected DockStyle OldDock
{
get { return m_oldDock; }
}
private int m_oldContentIndex;
protected int OldContentIndex
{
get { return m_oldContentIndex; }
}
protected bool SameAsOldValue
{
get
{
return FloatWindowBounds == OldFloatWindowBounds &&
DockTo == OldDockTo &&
Dock == OldDock &&
ContentIndex == OldContentIndex;
}
}
private Rectangle m_floatWindowBounds;
public Rectangle FloatWindowBounds
{
get { return m_floatWindowBounds; }
}
private Control m_dockTo;
public Control DockTo
{
get { return m_dockTo; }
}
private DockStyle m_dock;
public DockStyle Dock
{
get { return m_dock; }
}
private int m_contentIndex;
public int ContentIndex
{
get { return m_contentIndex; }
}
public bool FlagFullEdge
{
get { return m_contentIndex != 0; }
}
private bool m_flagTestDrop = false;
public bool FlagTestDrop
{
get { return m_flagTestDrop; }
set { m_flagTestDrop = value; }
}
private void SaveOldValues()
{
m_oldDockTo = m_dockTo;
m_oldDock = m_dock;
m_oldContentIndex = m_contentIndex;
m_oldFloatWindowBounds = m_floatWindowBounds;
}
protected abstract void OnShow();
protected abstract void OnClose();
private void SetValues(Rectangle floatWindowBounds, Control dockTo, DockStyle dock, int contentIndex)
{
m_floatWindowBounds = floatWindowBounds;
m_dockTo = dockTo;
m_dock = dock;
m_contentIndex = contentIndex;
FlagTestDrop = true;
}
private void TestChange()
{
if (m_floatWindowBounds != m_oldFloatWindowBounds ||
m_dockTo != m_oldDockTo ||
m_dock != m_oldDock ||
m_contentIndex != m_oldContentIndex)
OnShow();
}
public void Show()
{
SaveOldValues();
SetValues(Rectangle.Empty, null, DockStyle.None, -1);
TestChange();
}
public void Show(DockPane pane, DockStyle dock)
{
SaveOldValues();
SetValues(Rectangle.Empty, pane, dock, -1);
TestChange();
}
public void Show(DockPane pane, int contentIndex)
{
SaveOldValues();
SetValues(Rectangle.Empty, pane, DockStyle.Fill, contentIndex);
TestChange();
}
public void Show(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge)
{
SaveOldValues();
SetValues(Rectangle.Empty, dockPanel, dock, fullPanelEdge ? -1 : 0);
TestChange();
}
public void Show(Rectangle floatWindowBounds)
{
SaveOldValues();
SetValues(floatWindowBounds, null, DockStyle.None, -1);
TestChange();
}
public void Close()
{
OnClose();
}
}
}

View file

@ -1,157 +1,157 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
partial class DockPane
{
private class SplitterControl : Control, ISplitterDragSource
{
DockPane m_pane;
public SplitterControl(DockPane pane)
{
SetStyle(ControlStyles.Selectable, false);
m_pane = pane;
}
public DockPane DockPane
{
get { return m_pane; }
}
private DockAlignment m_alignment;
public DockAlignment Alignment
{
get { return m_alignment; }
set
{
m_alignment = value;
if (m_alignment == DockAlignment.Left || m_alignment == DockAlignment.Right)
Cursor = Cursors.VSplit;
else if (m_alignment == DockAlignment.Top || m_alignment == DockAlignment.Bottom)
Cursor = Cursors.HSplit;
else
Cursor = Cursors.Default;
if (DockPane.DockState == DockState.Document)
Invalidate();
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (DockPane.DockState != DockState.Document)
return;
Graphics g = e.Graphics;
Rectangle rect = ClientRectangle;
if (Alignment == DockAlignment.Top || Alignment == DockAlignment.Bottom)
g.DrawLine(SystemPens.ControlDark, rect.Left, rect.Bottom - 1, rect.Right, rect.Bottom - 1);
else if (Alignment == DockAlignment.Left || Alignment == DockAlignment.Right)
g.DrawLine(SystemPens.ControlDarkDark, rect.Right - 1, rect.Top, rect.Right - 1, rect.Bottom);
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
if (e.Button != MouseButtons.Left)
return;
DockPane.DockPanel.BeginDrag(this, Parent.RectangleToScreen(Bounds));
}
#region ISplitterDragSource Members
void ISplitterDragSource.BeginDrag(Rectangle rectSplitter)
{
}
void ISplitterDragSource.EndDrag()
{
}
bool ISplitterDragSource.IsVertical
{
get
{
NestedDockingStatus status = DockPane.NestedDockingStatus;
return (status.DisplayingAlignment == DockAlignment.Left ||
status.DisplayingAlignment == DockAlignment.Right);
}
}
Rectangle ISplitterDragSource.DragLimitBounds
{
get
{
NestedDockingStatus status = DockPane.NestedDockingStatus;
Rectangle rectLimit = Parent.RectangleToScreen(status.LogicalBounds);
if (((ISplitterDragSource)this).IsVertical)
{
rectLimit.X += MeasurePane.MinSize;
rectLimit.Width -= 2 * MeasurePane.MinSize;
}
else
{
rectLimit.Y += MeasurePane.MinSize;
rectLimit.Height -= 2 * MeasurePane.MinSize;
}
return rectLimit;
}
}
void ISplitterDragSource.MoveSplitter(int offset)
{
NestedDockingStatus status = DockPane.NestedDockingStatus;
double proportion = status.Proportion;
if (status.LogicalBounds.Width <= 0 || status.LogicalBounds.Height <= 0)
return;
else if (status.DisplayingAlignment == DockAlignment.Left)
proportion += ((double)offset) / (double)status.LogicalBounds.Width;
else if (status.DisplayingAlignment == DockAlignment.Right)
proportion -= ((double)offset) / (double)status.LogicalBounds.Width;
else if (status.DisplayingAlignment == DockAlignment.Top)
proportion += ((double)offset) / (double)status.LogicalBounds.Height;
else
proportion -= ((double)offset) / (double)status.LogicalBounds.Height;
DockPane.SetNestedDockingProportion(proportion);
}
#region IDragSource Members
Control IDragSource.DragControl
{
get { return this; }
}
#endregion
#endregion
}
private SplitterControl m_splitter;
private SplitterControl Splitter
{
get { return m_splitter; }
}
internal Rectangle SplitterBounds
{
set { Splitter.Bounds = value; }
}
internal DockAlignment SplitterAlignment
{
set { Splitter.Alignment = value; }
}
}
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
partial class DockPane
{
private class SplitterControl : Control, ISplitterDragSource
{
DockPane m_pane;
public SplitterControl(DockPane pane)
{
SetStyle(ControlStyles.Selectable, false);
m_pane = pane;
}
public DockPane DockPane
{
get { return m_pane; }
}
private DockAlignment m_alignment;
public DockAlignment Alignment
{
get { return m_alignment; }
set
{
m_alignment = value;
if (m_alignment == DockAlignment.Left || m_alignment == DockAlignment.Right)
Cursor = Cursors.VSplit;
else if (m_alignment == DockAlignment.Top || m_alignment == DockAlignment.Bottom)
Cursor = Cursors.HSplit;
else
Cursor = Cursors.Default;
if (DockPane.DockState == DockState.Document)
Invalidate();
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (DockPane.DockState != DockState.Document)
return;
Graphics g = e.Graphics;
Rectangle rect = ClientRectangle;
if (Alignment == DockAlignment.Top || Alignment == DockAlignment.Bottom)
g.DrawLine(SystemPens.ControlDark, rect.Left, rect.Bottom - 1, rect.Right, rect.Bottom - 1);
else if (Alignment == DockAlignment.Left || Alignment == DockAlignment.Right)
g.DrawLine(SystemPens.ControlDarkDark, rect.Right - 1, rect.Top, rect.Right - 1, rect.Bottom);
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
if (e.Button != MouseButtons.Left)
return;
DockPane.DockPanel.BeginDrag(this, Parent.RectangleToScreen(Bounds));
}
#region ISplitterDragSource Members
void ISplitterDragSource.BeginDrag(Rectangle rectSplitter)
{
}
void ISplitterDragSource.EndDrag()
{
}
bool ISplitterDragSource.IsVertical
{
get
{
NestedDockingStatus status = DockPane.NestedDockingStatus;
return (status.DisplayingAlignment == DockAlignment.Left ||
status.DisplayingAlignment == DockAlignment.Right);
}
}
Rectangle ISplitterDragSource.DragLimitBounds
{
get
{
NestedDockingStatus status = DockPane.NestedDockingStatus;
Rectangle rectLimit = Parent.RectangleToScreen(status.LogicalBounds);
if (((ISplitterDragSource)this).IsVertical)
{
rectLimit.X += MeasurePane.MinSize;
rectLimit.Width -= 2 * MeasurePane.MinSize;
}
else
{
rectLimit.Y += MeasurePane.MinSize;
rectLimit.Height -= 2 * MeasurePane.MinSize;
}
return rectLimit;
}
}
void ISplitterDragSource.MoveSplitter(int offset)
{
NestedDockingStatus status = DockPane.NestedDockingStatus;
double proportion = status.Proportion;
if (status.LogicalBounds.Width <= 0 || status.LogicalBounds.Height <= 0)
return;
else if (status.DisplayingAlignment == DockAlignment.Left)
proportion += ((double)offset) / (double)status.LogicalBounds.Width;
else if (status.DisplayingAlignment == DockAlignment.Right)
proportion -= ((double)offset) / (double)status.LogicalBounds.Width;
else if (status.DisplayingAlignment == DockAlignment.Top)
proportion += ((double)offset) / (double)status.LogicalBounds.Height;
else
proportion -= ((double)offset) / (double)status.LogicalBounds.Height;
DockPane.SetNestedDockingProportion(proportion);
}
#region IDragSource Members
Control IDragSource.DragControl
{
get { return this; }
}
#endregion
#endregion
}
private SplitterControl m_splitter;
private SplitterControl Splitter
{
get { return m_splitter; }
}
internal Rectangle SplitterBounds
{
set { Splitter.Bounds = value; }
}
internal DockAlignment SplitterAlignment
{
set { Splitter.Alignment = value; }
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,100 +1,100 @@
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Security.Permissions;
namespace LSLEditor.Docking
{
public abstract class DockPaneCaptionBase : Control
{
protected internal DockPaneCaptionBase(DockPane pane)
{
m_dockPane = pane;
SetStyle(ControlStyles.OptimizedDoubleBuffer |
ControlStyles.ResizeRedraw |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.Selectable, false);
}
private DockPane m_dockPane;
protected DockPane DockPane
{
get { return m_dockPane; }
}
protected DockPane.AppearanceStyle Appearance
{
get { return DockPane.Appearance; }
}
protected bool HasTabPageContextMenu
{
get { return DockPane.HasTabPageContextMenu; }
}
protected void ShowTabPageContextMenu(Point position)
{
DockPane.ShowTabPageContextMenu(this, position);
}
protected override void OnMouseUp(MouseEventArgs e)
{
base.OnMouseUp(e);
if (e.Button == MouseButtons.Right)
ShowTabPageContextMenu(new Point(e.X, e.Y));
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
if (e.Button == MouseButtons.Left &&
DockPane.DockPanel.AllowEndUserDocking &&
DockPane.AllowDockDragAndDrop &&
!DockHelper.IsDockStateAutoHide(DockPane.DockState) &&
DockPane.ActiveContent != null)
DockPane.DockPanel.BeginDrag(DockPane);
}
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK)
{
if (DockHelper.IsDockStateAutoHide(DockPane.DockState))
{
DockPane.DockPanel.ActiveAutoHideContent = null;
return;
}
if (DockPane.IsFloat)
DockPane.RestoreToPanel();
else
DockPane.Float();
}
base.WndProc(ref m);
}
internal void RefreshChanges()
{
if (IsDisposed)
return;
OnRefreshChanges();
}
protected virtual void OnRightToLeftLayoutChanged()
{
}
protected virtual void OnRefreshChanges()
{
}
protected internal abstract int MeasureHeight();
}
}
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Security.Permissions;
namespace LSLEditor.Docking
{
public abstract class DockPaneCaptionBase : Control
{
protected internal DockPaneCaptionBase(DockPane pane)
{
m_dockPane = pane;
SetStyle(ControlStyles.OptimizedDoubleBuffer |
ControlStyles.ResizeRedraw |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.Selectable, false);
}
private DockPane m_dockPane;
protected DockPane DockPane
{
get { return m_dockPane; }
}
protected DockPane.AppearanceStyle Appearance
{
get { return DockPane.Appearance; }
}
protected bool HasTabPageContextMenu
{
get { return DockPane.HasTabPageContextMenu; }
}
protected void ShowTabPageContextMenu(Point position)
{
DockPane.ShowTabPageContextMenu(this, position);
}
protected override void OnMouseUp(MouseEventArgs e)
{
base.OnMouseUp(e);
if (e.Button == MouseButtons.Right)
ShowTabPageContextMenu(new Point(e.X, e.Y));
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
if (e.Button == MouseButtons.Left &&
DockPane.DockPanel.AllowEndUserDocking &&
DockPane.AllowDockDragAndDrop &&
!DockHelper.IsDockStateAutoHide(DockPane.DockState) &&
DockPane.ActiveContent != null)
DockPane.DockPanel.BeginDrag(DockPane);
}
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK)
{
if (DockHelper.IsDockStateAutoHide(DockPane.DockState))
{
DockPane.DockPanel.ActiveAutoHideContent = null;
return;
}
if (DockPane.IsFloat)
DockPane.RestoreToPanel();
else
DockPane.Float();
}
base.WndProc(ref m);
}
internal void RefreshChanges()
{
if (IsDisposed)
return;
OnRefreshChanges();
}
protected virtual void OnRightToLeftLayoutChanged()
{
}
protected virtual void OnRefreshChanges()
{
}
protected internal abstract int MeasureHeight();
}
}

View file

@ -1,47 +1,47 @@
using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
public class DockPaneCollection : ReadOnlyCollection<DockPane>
{
internal DockPaneCollection()
: base(new List<DockPane>())
{
}
internal int Add(DockPane pane)
{
if (Items.Contains(pane))
return Items.IndexOf(pane);
Items.Add(pane);
return Count - 1;
}
internal void AddAt(DockPane pane, int index)
{
if (index < 0 || index > Items.Count - 1)
return;
if (Contains(pane))
return;
Items.Insert(index, pane);
}
internal void Dispose()
{
for (int i=Count - 1; i>=0; i--)
this[i].Close();
}
internal void Remove(DockPane pane)
{
Items.Remove(pane);
}
}
}
using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
public class DockPaneCollection : ReadOnlyCollection<DockPane>
{
internal DockPaneCollection()
: base(new List<DockPane>())
{
}
internal int Add(DockPane pane)
{
if (Items.Contains(pane))
return Items.IndexOf(pane);
Items.Add(pane);
return Count - 1;
}
internal void AddAt(DockPane pane, int index)
{
if (index < 0 || index > Items.Count - 1)
return;
if (Contains(pane))
return;
Items.Insert(index, pane);
}
internal void Dispose()
{
for (int i=Count - 1; i>=0; i--)
this[i].Close();
}
internal void Remove(DockPane pane)
{
Items.Remove(pane);
}
}
}

View file

@ -1,252 +1,252 @@
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.Collections.Generic;
using System.Security.Permissions;
using System.Diagnostics.CodeAnalysis;
namespace LSLEditor.Docking
{
public abstract class DockPaneStripBase : Control
{
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
protected internal class Tab : IDisposable
{
private IDockContent m_content;
public Tab(IDockContent content)
{
m_content = content;
}
~Tab()
{
Dispose(false);
}
public IDockContent Content
{
get { return m_content; }
}
public Form ContentForm
{
get { return m_content as Form; }
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
}
}
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
protected sealed class TabCollection : IEnumerable<Tab>
{
#region IEnumerable Members
IEnumerator<Tab> IEnumerable<Tab>.GetEnumerator()
{
for (int i = 0; i < Count; i++)
yield return this[i];
}
IEnumerator IEnumerable.GetEnumerator()
{
for (int i = 0; i < Count; i++)
yield return this[i];
}
#endregion
internal TabCollection(DockPane pane)
{
m_dockPane = pane;
}
private DockPane m_dockPane;
public DockPane DockPane
{
get { return m_dockPane; }
}
public int Count
{
get { return DockPane.DisplayingContents.Count; }
}
public Tab this[int index]
{
get
{
IDockContent content = DockPane.DisplayingContents[index];
if (content == null)
throw (new ArgumentOutOfRangeException("index"));
return content.DockHandler.GetTab(DockPane.TabStripControl);
}
}
public bool Contains(Tab tab)
{
return (IndexOf(tab) != -1);
}
public bool Contains(IDockContent content)
{
return (IndexOf(content) != -1);
}
public int IndexOf(Tab tab)
{
if (tab == null)
return -1;
return DockPane.DisplayingContents.IndexOf(tab.Content);
}
public int IndexOf(IDockContent content)
{
return DockPane.DisplayingContents.IndexOf(content);
}
}
protected DockPaneStripBase(DockPane pane)
{
m_dockPane = pane;
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.Selectable, false);
AllowDrop = true;
}
private DockPane m_dockPane;
protected DockPane DockPane
{
get { return m_dockPane; }
}
protected DockPane.AppearanceStyle Appearance
{
get { return DockPane.Appearance; }
}
private TabCollection m_tabs = null;
protected TabCollection Tabs
{
get
{
if (m_tabs == null)
m_tabs = new TabCollection(DockPane);
return m_tabs;
}
}
internal void RefreshChanges()
{
if (IsDisposed)
return;
OnRefreshChanges();
}
protected virtual void OnRefreshChanges()
{
}
protected internal abstract int MeasureHeight();
protected internal abstract void EnsureTabVisible(IDockContent content);
protected int HitTest()
{
return HitTest(PointToClient(Control.MousePosition));
}
protected internal abstract int HitTest(Point point);
protected internal abstract GraphicsPath GetOutline(int index);
protected internal virtual Tab CreateTab(IDockContent content)
{
return new Tab(content);
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
int index = HitTest();
if (index != -1)
{
IDockContent content = Tabs[index].Content;
if (DockPane.ActiveContent != content)
DockPane.ActiveContent = content;
}
if (e.Button == MouseButtons.Left)
{
if (DockPane.DockPanel.AllowEndUserDocking && DockPane.AllowDockDragAndDrop && DockPane.ActiveContent.DockHandler.AllowEndUserDocking)
DockPane.DockPanel.BeginDrag(DockPane.ActiveContent.DockHandler);
}
}
protected bool HasTabPageContextMenu
{
get { return DockPane.HasTabPageContextMenu; }
}
protected void ShowTabPageContextMenu(Point position)
{
DockPane.ShowTabPageContextMenu(this, position);
}
protected override void OnMouseUp(MouseEventArgs e)
{
base.OnMouseUp(e);
if (e.Button == MouseButtons.Right)
ShowTabPageContextMenu(new Point(e.X, e.Y));
}
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK)
{
base.WndProc(ref m);
int index = HitTest();
if (DockPane.DockPanel.AllowEndUserDocking && index != -1)
{
IDockContent content = Tabs[index].Content;
if (content.DockHandler.CheckDockState(!content.DockHandler.IsFloat) != DockState.Unknown)
content.DockHandler.IsFloat = !content.DockHandler.IsFloat;
}
return;
}
base.WndProc(ref m);
return;
}
protected override void OnDragOver(DragEventArgs drgevent)
{
base.OnDragOver(drgevent);
int index = HitTest();
if (index != -1)
{
IDockContent content = Tabs[index].Content;
if (DockPane.ActiveContent != content)
DockPane.ActiveContent = content;
}
}
}
}
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.Collections.Generic;
using System.Security.Permissions;
using System.Diagnostics.CodeAnalysis;
namespace LSLEditor.Docking
{
public abstract class DockPaneStripBase : Control
{
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
protected internal class Tab : IDisposable
{
private IDockContent m_content;
public Tab(IDockContent content)
{
m_content = content;
}
~Tab()
{
Dispose(false);
}
public IDockContent Content
{
get { return m_content; }
}
public Form ContentForm
{
get { return m_content as Form; }
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
}
}
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
protected sealed class TabCollection : IEnumerable<Tab>
{
#region IEnumerable Members
IEnumerator<Tab> IEnumerable<Tab>.GetEnumerator()
{
for (int i = 0; i < Count; i++)
yield return this[i];
}
IEnumerator IEnumerable.GetEnumerator()
{
for (int i = 0; i < Count; i++)
yield return this[i];
}
#endregion
internal TabCollection(DockPane pane)
{
m_dockPane = pane;
}
private DockPane m_dockPane;
public DockPane DockPane
{
get { return m_dockPane; }
}
public int Count
{
get { return DockPane.DisplayingContents.Count; }
}
public Tab this[int index]
{
get
{
IDockContent content = DockPane.DisplayingContents[index];
if (content == null)
throw (new ArgumentOutOfRangeException("index"));
return content.DockHandler.GetTab(DockPane.TabStripControl);
}
}
public bool Contains(Tab tab)
{
return (IndexOf(tab) != -1);
}
public bool Contains(IDockContent content)
{
return (IndexOf(content) != -1);
}
public int IndexOf(Tab tab)
{
if (tab == null)
return -1;
return DockPane.DisplayingContents.IndexOf(tab.Content);
}
public int IndexOf(IDockContent content)
{
return DockPane.DisplayingContents.IndexOf(content);
}
}
protected DockPaneStripBase(DockPane pane)
{
m_dockPane = pane;
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.Selectable, false);
AllowDrop = true;
}
private DockPane m_dockPane;
protected DockPane DockPane
{
get { return m_dockPane; }
}
protected DockPane.AppearanceStyle Appearance
{
get { return DockPane.Appearance; }
}
private TabCollection m_tabs = null;
protected TabCollection Tabs
{
get
{
if (m_tabs == null)
m_tabs = new TabCollection(DockPane);
return m_tabs;
}
}
internal void RefreshChanges()
{
if (IsDisposed)
return;
OnRefreshChanges();
}
protected virtual void OnRefreshChanges()
{
}
protected internal abstract int MeasureHeight();
protected internal abstract void EnsureTabVisible(IDockContent content);
protected int HitTest()
{
return HitTest(PointToClient(Control.MousePosition));
}
protected internal abstract int HitTest(Point point);
protected internal abstract GraphicsPath GetOutline(int index);
protected internal virtual Tab CreateTab(IDockContent content)
{
return new Tab(content);
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
int index = HitTest();
if (index != -1)
{
IDockContent content = Tabs[index].Content;
if (DockPane.ActiveContent != content)
DockPane.ActiveContent = content;
}
if (e.Button == MouseButtons.Left)
{
if (DockPane.DockPanel.AllowEndUserDocking && DockPane.AllowDockDragAndDrop && DockPane.ActiveContent.DockHandler.AllowEndUserDocking)
DockPane.DockPanel.BeginDrag(DockPane.ActiveContent.DockHandler);
}
}
protected bool HasTabPageContextMenu
{
get { return DockPane.HasTabPageContextMenu; }
}
protected void ShowTabPageContextMenu(Point position)
{
DockPane.ShowTabPageContextMenu(this, position);
}
protected override void OnMouseUp(MouseEventArgs e)
{
base.OnMouseUp(e);
if (e.Button == MouseButtons.Right)
ShowTabPageContextMenu(new Point(e.X, e.Y));
}
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK)
{
base.WndProc(ref m);
int index = HitTest();
if (DockPane.DockPanel.AllowEndUserDocking && index != -1)
{
IDockContent content = Tabs[index].Content;
if (content.DockHandler.CheckDockState(!content.DockHandler.IsFloat) != DockState.Unknown)
content.DockHandler.IsFloat = !content.DockHandler.IsFloat;
}
return;
}
base.WndProc(ref m);
return;
}
protected override void OnDragOver(DragEventArgs drgevent)
{
base.OnDragOver(drgevent);
int index = HitTest();
if (index != -1)
{
IDockContent content = Tabs[index].Content;
if (DockPane.ActiveContent != content)
DockPane.ActiveContent = content;
}
}
}
}

View file

@ -1,135 +1,135 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
namespace LSLEditor.Docking
{
partial class DockPanel
{
/// <summary>
/// DragHandlerBase is the base class for drag handlers. The derived class should:
/// 1. Define its public method BeginDrag. From within this public BeginDrag method,
/// DragHandlerBase.BeginDrag should be called to initialize the mouse capture
/// and message filtering.
/// 2. Override the OnDragging and OnEndDrag methods.
/// </summary>
private abstract class DragHandlerBase : NativeWindow, IMessageFilter
{
protected DragHandlerBase()
{
}
protected abstract Control DragControl
{
get;
}
private Point m_startMousePosition = Point.Empty;
protected Point StartMousePosition
{
get { return m_startMousePosition; }
private set { m_startMousePosition = value; }
}
protected bool BeginDrag()
{
// Avoid re-entrance;
lock (this)
{
if (DragControl == null)
return false;
StartMousePosition = Control.MousePosition;
if (!NativeMethods.DragDetect(DragControl.Handle, StartMousePosition))
return false;
DragControl.FindForm().Capture = true;
AssignHandle(DragControl.FindForm().Handle);
Application.AddMessageFilter(this);
return true;
}
}
protected abstract void OnDragging();
protected abstract void OnEndDrag(bool abort);
private void EndDrag(bool abort)
{
ReleaseHandle();
Application.RemoveMessageFilter(this);
DragControl.FindForm().Capture = false;
OnEndDrag(abort);
}
bool IMessageFilter.PreFilterMessage(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_MOUSEMOVE)
OnDragging();
else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONUP)
EndDrag(false);
else if (m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED)
EndDrag(true);
else if (m.Msg == (int)Win32.Msgs.WM_KEYDOWN && (int)m.WParam == (int)Keys.Escape)
EndDrag(true);
return OnPreFilterMessage(ref m);
}
protected virtual bool OnPreFilterMessage(ref Message m)
{
return false;
}
protected sealed override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_CANCELMODE || m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED)
EndDrag(true);
base.WndProc(ref m);
}
}
private abstract class DragHandler : DragHandlerBase
{
private DockPanel m_dockPanel;
protected DragHandler(DockPanel dockPanel)
{
m_dockPanel = dockPanel;
}
public DockPanel DockPanel
{
get { return m_dockPanel; }
}
private IDragSource m_dragSource;
protected IDragSource DragSource
{
get { return m_dragSource; }
set { m_dragSource = value; }
}
protected sealed override Control DragControl
{
get { return DragSource == null ? null : DragSource.DragControl; }
}
protected sealed override bool OnPreFilterMessage(ref Message m)
{
if ((m.Msg == (int)Win32.Msgs.WM_KEYDOWN || m.Msg == (int)Win32.Msgs.WM_KEYUP) &&
((int)m.WParam == (int)Keys.ControlKey || (int)m.WParam == (int)Keys.ShiftKey))
OnDragging();
return base.OnPreFilterMessage(ref m);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
namespace LSLEditor.Docking
{
partial class DockPanel
{
/// <summary>
/// DragHandlerBase is the base class for drag handlers. The derived class should:
/// 1. Define its public method BeginDrag. From within this public BeginDrag method,
/// DragHandlerBase.BeginDrag should be called to initialize the mouse capture
/// and message filtering.
/// 2. Override the OnDragging and OnEndDrag methods.
/// </summary>
private abstract class DragHandlerBase : NativeWindow, IMessageFilter
{
protected DragHandlerBase()
{
}
protected abstract Control DragControl
{
get;
}
private Point m_startMousePosition = Point.Empty;
protected Point StartMousePosition
{
get { return m_startMousePosition; }
private set { m_startMousePosition = value; }
}
protected bool BeginDrag()
{
// Avoid re-entrance;
lock (this)
{
if (DragControl == null)
return false;
StartMousePosition = Control.MousePosition;
if (!NativeMethods.DragDetect(DragControl.Handle, StartMousePosition))
return false;
DragControl.FindForm().Capture = true;
AssignHandle(DragControl.FindForm().Handle);
Application.AddMessageFilter(this);
return true;
}
}
protected abstract void OnDragging();
protected abstract void OnEndDrag(bool abort);
private void EndDrag(bool abort)
{
ReleaseHandle();
Application.RemoveMessageFilter(this);
DragControl.FindForm().Capture = false;
OnEndDrag(abort);
}
bool IMessageFilter.PreFilterMessage(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_MOUSEMOVE)
OnDragging();
else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONUP)
EndDrag(false);
else if (m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED)
EndDrag(true);
else if (m.Msg == (int)Win32.Msgs.WM_KEYDOWN && (int)m.WParam == (int)Keys.Escape)
EndDrag(true);
return OnPreFilterMessage(ref m);
}
protected virtual bool OnPreFilterMessage(ref Message m)
{
return false;
}
protected sealed override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_CANCELMODE || m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED)
EndDrag(true);
base.WndProc(ref m);
}
}
private abstract class DragHandler : DragHandlerBase
{
private DockPanel m_dockPanel;
protected DragHandler(DockPanel dockPanel)
{
m_dockPanel = dockPanel;
}
public DockPanel DockPanel
{
get { return m_dockPanel; }
}
private IDragSource m_dragSource;
protected IDragSource DragSource
{
get { return m_dragSource; }
set { m_dragSource = value; }
}
protected sealed override Control DragControl
{
get { return DragSource == null ? null : DragSource.DragControl; }
}
protected sealed override bool OnPreFilterMessage(ref Message m)
{
if ((m.Msg == (int)Win32.Msgs.WM_KEYDOWN || m.Msg == (int)Win32.Msgs.WM_KEYUP) &&
((int)m.WParam == (int)Keys.ControlKey || (int)m.WParam == (int)Keys.ShiftKey))
OnDragging();
return base.OnPreFilterMessage(ref m);
}
}
}
}

View file

@ -1,430 +1,430 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Runtime.InteropServices;
namespace LSLEditor.Docking
{
partial class DockPanel
{
// This class comes from Jacob Slusser's MdiClientController class:
// http://www.codeproject.com/cs/miscctrl/mdiclientcontroller.asp
private class MdiClientController : NativeWindow, IComponent, IDisposable
{
private bool m_autoScroll = true;
private BorderStyle m_borderStyle = BorderStyle.Fixed3D;
private MdiClient m_mdiClient = null;
private Form m_parentForm = null;
private ISite m_site = null;
public MdiClientController()
{
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
lock (this)
{
if (Site != null && Site.Container != null)
Site.Container.Remove(this);
if (Disposed != null)
Disposed(this, EventArgs.Empty);
}
}
}
public bool AutoScroll
{
get { return m_autoScroll; }
set
{
// By default the MdiClient control scrolls. It can appear though that
// there are no scrollbars by turning them off when the non-client
// area is calculated. I decided to expose this method following
// the .NET vernacular of an AutoScroll property.
m_autoScroll = value;
if (MdiClient != null)
UpdateStyles();
}
}
public BorderStyle BorderStyle
{
set
{
// Error-check the enum.
if (!Enum.IsDefined(typeof(BorderStyle), value))
throw new InvalidEnumArgumentException();
m_borderStyle = value;
if (MdiClient == null)
return;
// This property can actually be visible in design-mode,
// but to keep it consistent with the others,
// prevent this from being show at design-time.
if (Site != null && Site.DesignMode)
return;
// There is no BorderStyle property exposed by the MdiClient class,
// but this can be controlled by Win32 functions. A Win32 ExStyle
// of WS_EX_CLIENTEDGE is equivalent to a Fixed3D border and a
// Style of WS_BORDER is equivalent to a FixedSingle border.
// This code is inspired Jason Dori's article:
// "Adding designable borders to user controls".
// http://www.codeproject.com/cs/miscctrl/CsAddingBorders.asp
// Get styles using Win32 calls
int style = NativeMethods.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE);
int exStyle = NativeMethods.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE);
// Add or remove style flags as necessary.
switch (m_borderStyle)
{
case BorderStyle.Fixed3D:
exStyle |= (int)Win32.WindowExStyles.WS_EX_CLIENTEDGE;
style &= ~((int)Win32.WindowStyles.WS_BORDER);
break;
case BorderStyle.FixedSingle:
exStyle &= ~((int)Win32.WindowExStyles.WS_EX_CLIENTEDGE);
style |= (int)Win32.WindowStyles.WS_BORDER;
break;
case BorderStyle.None:
style &= ~((int)Win32.WindowStyles.WS_BORDER);
exStyle &= ~((int)Win32.WindowExStyles.WS_EX_CLIENTEDGE);
break;
}
// Set the styles using Win32 calls
NativeMethods.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE, style);
NativeMethods.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE, exStyle);
// Cause an update of the non-client area.
UpdateStyles();
}
}
public MdiClient MdiClient
{
get { return m_mdiClient; }
}
[Browsable(false)]
public Form ParentForm
{
get { return m_parentForm; }
set
{
// If the ParentForm has previously been set,
// unwire events connected to the old parent.
if (m_parentForm != null)
{
m_parentForm.HandleCreated -= new EventHandler(ParentFormHandleCreated);
m_parentForm.MdiChildActivate -= new EventHandler(ParentFormMdiChildActivate);
}
m_parentForm = value;
if (m_parentForm == null)
return;
// If the parent form has not been created yet,
// wait to initialize the MDI client until it is.
if (m_parentForm.IsHandleCreated)
{
InitializeMdiClient();
RefreshProperties();
}
else
m_parentForm.HandleCreated += new EventHandler(ParentFormHandleCreated);
m_parentForm.MdiChildActivate += new EventHandler(ParentFormMdiChildActivate);
}
}
public ISite Site
{
get { return m_site; }
set
{
m_site = value;
if (m_site == null)
return;
// If the component is dropped onto a form during design-time,
// set the ParentForm property.
IDesignerHost host = (value.GetService(typeof(IDesignerHost)) as IDesignerHost);
if (host != null)
{
Form parent = host.RootComponent as Form;
if (parent != null)
ParentForm = parent;
}
}
}
public void RenewMdiClient()
{
// Reinitialize the MdiClient and its properties.
InitializeMdiClient();
RefreshProperties();
}
public event EventHandler Disposed;
public event EventHandler HandleAssigned;
public event EventHandler MdiChildActivate;
public event LayoutEventHandler Layout;
protected virtual void OnHandleAssigned(EventArgs e)
{
// Raise the HandleAssigned event.
if (HandleAssigned != null)
HandleAssigned(this, e);
}
protected virtual void OnMdiChildActivate(EventArgs e)
{
// Raise the MdiChildActivate event
if (MdiChildActivate != null)
MdiChildActivate(this, e);
}
protected virtual void OnLayout(LayoutEventArgs e)
{
// Raise the Layout event
if (Layout != null)
Layout(this, e);
}
public event PaintEventHandler Paint;
protected virtual void OnPaint(PaintEventArgs e)
{
// Raise the Paint event.
if (Paint != null)
Paint(this, e);
}
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case (int)Win32.Msgs.WM_NCCALCSIZE:
// If AutoScroll is set to false, hide the scrollbars when the control
// calculates its non-client area.
if (!AutoScroll)
NativeMethods.ShowScrollBar(m.HWnd, (int)Win32.ScrollBars.SB_BOTH, 0 /*false*/);
break;
}
base.WndProc(ref m);
}
private void ParentFormHandleCreated(object sender, EventArgs e)
{
// The form has been created, unwire the event, and initialize the MdiClient.
this.m_parentForm.HandleCreated -= new EventHandler(ParentFormHandleCreated);
InitializeMdiClient();
RefreshProperties();
}
private void ParentFormMdiChildActivate(object sender, EventArgs e)
{
OnMdiChildActivate(e);
}
private void MdiClientLayout(object sender, LayoutEventArgs e)
{
OnLayout(e);
}
private void MdiClientHandleDestroyed(object sender, EventArgs e)
{
// If the MdiClient handle has been released, drop the reference and
// release the handle.
if (m_mdiClient != null)
{
m_mdiClient.HandleDestroyed -= new EventHandler(MdiClientHandleDestroyed);
m_mdiClient = null;
}
ReleaseHandle();
}
private void InitializeMdiClient()
{
// If the mdiClient has previously been set, unwire events connected
// to the old MDI.
if (MdiClient != null)
{
MdiClient.HandleDestroyed -= new EventHandler(MdiClientHandleDestroyed);
MdiClient.Layout -= new LayoutEventHandler(MdiClientLayout);
}
if (ParentForm == null)
return;
// Get the MdiClient from the parent form.
foreach (Control control in ParentForm.Controls)
{
// If the form is an MDI container, it will contain an MdiClient control
// just as it would any other control.
m_mdiClient = control as MdiClient;
if (m_mdiClient == null)
continue;
// Assign the MdiClient Handle to the NativeWindow.
ReleaseHandle();
AssignHandle(MdiClient.Handle);
// Raise the HandleAssigned event.
OnHandleAssigned(EventArgs.Empty);
// Monitor the MdiClient for when its handle is destroyed.
MdiClient.HandleDestroyed += new EventHandler(MdiClientHandleDestroyed);
MdiClient.Layout += new LayoutEventHandler(MdiClientLayout);
break;
}
}
private void RefreshProperties()
{
// Refresh all the properties
BorderStyle = m_borderStyle;
AutoScroll = m_autoScroll;
}
private void UpdateStyles()
{
// To show style changes, the non-client area must be repainted. Using the
// control's Invalidate method does not affect the non-client area.
// Instead use a Win32 call to signal the style has changed.
NativeMethods.SetWindowPos(MdiClient.Handle, IntPtr.Zero, 0, 0, 0, 0,
Win32.FlagsSetWindowPos.SWP_NOACTIVATE |
Win32.FlagsSetWindowPos.SWP_NOMOVE |
Win32.FlagsSetWindowPos.SWP_NOSIZE |
Win32.FlagsSetWindowPos.SWP_NOZORDER |
Win32.FlagsSetWindowPos.SWP_NOOWNERZORDER |
Win32.FlagsSetWindowPos.SWP_FRAMECHANGED);
}
}
private MdiClientController m_mdiClientController = null;
private MdiClientController GetMdiClientController()
{
if (m_mdiClientController == null)
{
m_mdiClientController = new MdiClientController();
m_mdiClientController.HandleAssigned += new EventHandler(MdiClientHandleAssigned);
m_mdiClientController.MdiChildActivate += new EventHandler(ParentFormMdiChildActivate);
m_mdiClientController.Layout += new LayoutEventHandler(MdiClient_Layout);
}
return m_mdiClientController;
}
private void ParentFormMdiChildActivate(object sender, EventArgs e)
{
if (GetMdiClientController().ParentForm == null)
return;
IDockContent content = GetMdiClientController().ParentForm.ActiveMdiChild as IDockContent;
if (content == null)
return;
if (content.DockHandler.DockPanel == this && content.DockHandler.Pane != null)
content.DockHandler.Pane.ActiveContent = content;
}
private bool MdiClientExists
{
get { return GetMdiClientController().MdiClient != null; }
}
private void SetMdiClientBounds(Rectangle bounds)
{
GetMdiClientController().MdiClient.Bounds = bounds;
}
private void SuspendMdiClientLayout()
{
if (GetMdiClientController().MdiClient != null)
GetMdiClientController().MdiClient.SuspendLayout();
}
private void ResumeMdiClientLayout(bool perform)
{
if (GetMdiClientController().MdiClient != null)
GetMdiClientController().MdiClient.ResumeLayout(perform);
}
private void PerformMdiClientLayout()
{
if (GetMdiClientController().MdiClient != null)
GetMdiClientController().MdiClient.PerformLayout();
}
// Called when:
// 1. DockPanel.DocumentStyle changed
// 2. DockPanel.Visible changed
// 3. MdiClientController.Handle assigned
private void SetMdiClient()
{
MdiClientController controller = GetMdiClientController();
if (this.DocumentStyle == DocumentStyle.DockingMdi)
{
controller.AutoScroll = false;
controller.BorderStyle = BorderStyle.None;
if (MdiClientExists)
controller.MdiClient.Dock = DockStyle.Fill;
}
else if (DocumentStyle == DocumentStyle.DockingSdi || DocumentStyle == DocumentStyle.DockingWindow)
{
controller.AutoScroll = true;
controller.BorderStyle = BorderStyle.Fixed3D;
if (MdiClientExists)
controller.MdiClient.Dock = DockStyle.Fill;
}
else if (this.DocumentStyle == DocumentStyle.SystemMdi)
{
controller.AutoScroll = true;
controller.BorderStyle = BorderStyle.Fixed3D;
if (controller.MdiClient != null)
{
controller.MdiClient.Dock = DockStyle.None;
controller.MdiClient.Bounds = SystemMdiClientBounds;
}
}
}
internal Rectangle RectangleToMdiClient(Rectangle rect)
{
if (MdiClientExists)
return GetMdiClientController().MdiClient.RectangleToClient(rect);
else
return Rectangle.Empty;
}
}
}
using System;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Runtime.InteropServices;
namespace LSLEditor.Docking
{
partial class DockPanel
{
// This class comes from Jacob Slusser's MdiClientController class:
// http://www.codeproject.com/cs/miscctrl/mdiclientcontroller.asp
private class MdiClientController : NativeWindow, IComponent, IDisposable
{
private bool m_autoScroll = true;
private BorderStyle m_borderStyle = BorderStyle.Fixed3D;
private MdiClient m_mdiClient = null;
private Form m_parentForm = null;
private ISite m_site = null;
public MdiClientController()
{
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
lock (this)
{
if (Site != null && Site.Container != null)
Site.Container.Remove(this);
if (Disposed != null)
Disposed(this, EventArgs.Empty);
}
}
}
public bool AutoScroll
{
get { return m_autoScroll; }
set
{
// By default the MdiClient control scrolls. It can appear though that
// there are no scrollbars by turning them off when the non-client
// area is calculated. I decided to expose this method following
// the .NET vernacular of an AutoScroll property.
m_autoScroll = value;
if (MdiClient != null)
UpdateStyles();
}
}
public BorderStyle BorderStyle
{
set
{
// Error-check the enum.
if (!Enum.IsDefined(typeof(BorderStyle), value))
throw new InvalidEnumArgumentException();
m_borderStyle = value;
if (MdiClient == null)
return;
// This property can actually be visible in design-mode,
// but to keep it consistent with the others,
// prevent this from being show at design-time.
if (Site != null && Site.DesignMode)
return;
// There is no BorderStyle property exposed by the MdiClient class,
// but this can be controlled by Win32 functions. A Win32 ExStyle
// of WS_EX_CLIENTEDGE is equivalent to a Fixed3D border and a
// Style of WS_BORDER is equivalent to a FixedSingle border.
// This code is inspired Jason Dori's article:
// "Adding designable borders to user controls".
// http://www.codeproject.com/cs/miscctrl/CsAddingBorders.asp
// Get styles using Win32 calls
int style = NativeMethods.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE);
int exStyle = NativeMethods.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE);
// Add or remove style flags as necessary.
switch (m_borderStyle)
{
case BorderStyle.Fixed3D:
exStyle |= (int)Win32.WindowExStyles.WS_EX_CLIENTEDGE;
style &= ~((int)Win32.WindowStyles.WS_BORDER);
break;
case BorderStyle.FixedSingle:
exStyle &= ~((int)Win32.WindowExStyles.WS_EX_CLIENTEDGE);
style |= (int)Win32.WindowStyles.WS_BORDER;
break;
case BorderStyle.None:
style &= ~((int)Win32.WindowStyles.WS_BORDER);
exStyle &= ~((int)Win32.WindowExStyles.WS_EX_CLIENTEDGE);
break;
}
// Set the styles using Win32 calls
NativeMethods.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE, style);
NativeMethods.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE, exStyle);
// Cause an update of the non-client area.
UpdateStyles();
}
}
public MdiClient MdiClient
{
get { return m_mdiClient; }
}
[Browsable(false)]
public Form ParentForm
{
get { return m_parentForm; }
set
{
// If the ParentForm has previously been set,
// unwire events connected to the old parent.
if (m_parentForm != null)
{
m_parentForm.HandleCreated -= new EventHandler(ParentFormHandleCreated);
m_parentForm.MdiChildActivate -= new EventHandler(ParentFormMdiChildActivate);
}
m_parentForm = value;
if (m_parentForm == null)
return;
// If the parent form has not been created yet,
// wait to initialize the MDI client until it is.
if (m_parentForm.IsHandleCreated)
{
InitializeMdiClient();
RefreshProperties();
}
else
m_parentForm.HandleCreated += new EventHandler(ParentFormHandleCreated);
m_parentForm.MdiChildActivate += new EventHandler(ParentFormMdiChildActivate);
}
}
public ISite Site
{
get { return m_site; }
set
{
m_site = value;
if (m_site == null)
return;
// If the component is dropped onto a form during design-time,
// set the ParentForm property.
IDesignerHost host = (value.GetService(typeof(IDesignerHost)) as IDesignerHost);
if (host != null)
{
Form parent = host.RootComponent as Form;
if (parent != null)
ParentForm = parent;
}
}
}
public void RenewMdiClient()
{
// Reinitialize the MdiClient and its properties.
InitializeMdiClient();
RefreshProperties();
}
public event EventHandler Disposed;
public event EventHandler HandleAssigned;
public event EventHandler MdiChildActivate;
public event LayoutEventHandler Layout;
protected virtual void OnHandleAssigned(EventArgs e)
{
// Raise the HandleAssigned event.
if (HandleAssigned != null)
HandleAssigned(this, e);
}
protected virtual void OnMdiChildActivate(EventArgs e)
{
// Raise the MdiChildActivate event
if (MdiChildActivate != null)
MdiChildActivate(this, e);
}
protected virtual void OnLayout(LayoutEventArgs e)
{
// Raise the Layout event
if (Layout != null)
Layout(this, e);
}
public event PaintEventHandler Paint;
protected virtual void OnPaint(PaintEventArgs e)
{
// Raise the Paint event.
if (Paint != null)
Paint(this, e);
}
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case (int)Win32.Msgs.WM_NCCALCSIZE:
// If AutoScroll is set to false, hide the scrollbars when the control
// calculates its non-client area.
if (!AutoScroll)
NativeMethods.ShowScrollBar(m.HWnd, (int)Win32.ScrollBars.SB_BOTH, 0 /*false*/);
break;
}
base.WndProc(ref m);
}
private void ParentFormHandleCreated(object sender, EventArgs e)
{
// The form has been created, unwire the event, and initialize the MdiClient.
this.m_parentForm.HandleCreated -= new EventHandler(ParentFormHandleCreated);
InitializeMdiClient();
RefreshProperties();
}
private void ParentFormMdiChildActivate(object sender, EventArgs e)
{
OnMdiChildActivate(e);
}
private void MdiClientLayout(object sender, LayoutEventArgs e)
{
OnLayout(e);
}
private void MdiClientHandleDestroyed(object sender, EventArgs e)
{
// If the MdiClient handle has been released, drop the reference and
// release the handle.
if (m_mdiClient != null)
{
m_mdiClient.HandleDestroyed -= new EventHandler(MdiClientHandleDestroyed);
m_mdiClient = null;
}
ReleaseHandle();
}
private void InitializeMdiClient()
{
// If the mdiClient has previously been set, unwire events connected
// to the old MDI.
if (MdiClient != null)
{
MdiClient.HandleDestroyed -= new EventHandler(MdiClientHandleDestroyed);
MdiClient.Layout -= new LayoutEventHandler(MdiClientLayout);
}
if (ParentForm == null)
return;
// Get the MdiClient from the parent form.
foreach (Control control in ParentForm.Controls)
{
// If the form is an MDI container, it will contain an MdiClient control
// just as it would any other control.
m_mdiClient = control as MdiClient;
if (m_mdiClient == null)
continue;
// Assign the MdiClient Handle to the NativeWindow.
ReleaseHandle();
AssignHandle(MdiClient.Handle);
// Raise the HandleAssigned event.
OnHandleAssigned(EventArgs.Empty);
// Monitor the MdiClient for when its handle is destroyed.
MdiClient.HandleDestroyed += new EventHandler(MdiClientHandleDestroyed);
MdiClient.Layout += new LayoutEventHandler(MdiClientLayout);
break;
}
}
private void RefreshProperties()
{
// Refresh all the properties
BorderStyle = m_borderStyle;
AutoScroll = m_autoScroll;
}
private void UpdateStyles()
{
// To show style changes, the non-client area must be repainted. Using the
// control's Invalidate method does not affect the non-client area.
// Instead use a Win32 call to signal the style has changed.
NativeMethods.SetWindowPos(MdiClient.Handle, IntPtr.Zero, 0, 0, 0, 0,
Win32.FlagsSetWindowPos.SWP_NOACTIVATE |
Win32.FlagsSetWindowPos.SWP_NOMOVE |
Win32.FlagsSetWindowPos.SWP_NOSIZE |
Win32.FlagsSetWindowPos.SWP_NOZORDER |
Win32.FlagsSetWindowPos.SWP_NOOWNERZORDER |
Win32.FlagsSetWindowPos.SWP_FRAMECHANGED);
}
}
private MdiClientController m_mdiClientController = null;
private MdiClientController GetMdiClientController()
{
if (m_mdiClientController == null)
{
m_mdiClientController = new MdiClientController();
m_mdiClientController.HandleAssigned += new EventHandler(MdiClientHandleAssigned);
m_mdiClientController.MdiChildActivate += new EventHandler(ParentFormMdiChildActivate);
m_mdiClientController.Layout += new LayoutEventHandler(MdiClient_Layout);
}
return m_mdiClientController;
}
private void ParentFormMdiChildActivate(object sender, EventArgs e)
{
if (GetMdiClientController().ParentForm == null)
return;
IDockContent content = GetMdiClientController().ParentForm.ActiveMdiChild as IDockContent;
if (content == null)
return;
if (content.DockHandler.DockPanel == this && content.DockHandler.Pane != null)
content.DockHandler.Pane.ActiveContent = content;
}
private bool MdiClientExists
{
get { return GetMdiClientController().MdiClient != null; }
}
private void SetMdiClientBounds(Rectangle bounds)
{
GetMdiClientController().MdiClient.Bounds = bounds;
}
private void SuspendMdiClientLayout()
{
if (GetMdiClientController().MdiClient != null)
GetMdiClientController().MdiClient.SuspendLayout();
}
private void ResumeMdiClientLayout(bool perform)
{
if (GetMdiClientController().MdiClient != null)
GetMdiClientController().MdiClient.ResumeLayout(perform);
}
private void PerformMdiClientLayout()
{
if (GetMdiClientController().MdiClient != null)
GetMdiClientController().MdiClient.PerformLayout();
}
// Called when:
// 1. DockPanel.DocumentStyle changed
// 2. DockPanel.Visible changed
// 3. MdiClientController.Handle assigned
private void SetMdiClient()
{
MdiClientController controller = GetMdiClientController();
if (this.DocumentStyle == DocumentStyle.DockingMdi)
{
controller.AutoScroll = false;
controller.BorderStyle = BorderStyle.None;
if (MdiClientExists)
controller.MdiClient.Dock = DockStyle.Fill;
}
else if (DocumentStyle == DocumentStyle.DockingSdi || DocumentStyle == DocumentStyle.DockingWindow)
{
controller.AutoScroll = true;
controller.BorderStyle = BorderStyle.Fixed3D;
if (MdiClientExists)
controller.MdiClient.Dock = DockStyle.Fill;
}
else if (this.DocumentStyle == DocumentStyle.SystemMdi)
{
controller.AutoScroll = true;
controller.BorderStyle = BorderStyle.Fixed3D;
if (controller.MdiClient != null)
{
controller.MdiClient.Dock = DockStyle.None;
controller.MdiClient.Bounds = SystemMdiClientBounds;
}
}
}
internal Rectangle RectangleToMdiClient(Rectangle rect)
{
if (MdiClientExists)
return GetMdiClientController().MdiClient.RectangleToClient(rect);
else
return Rectangle.Empty;
}
}
}

View file

@ -1,165 +1,165 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
namespace LSLEditor.Docking
{
partial class DockPanel
{
private sealed class SplitterDragHandler : DragHandler
{
private class SplitterOutline
{
public SplitterOutline()
{
m_dragForm = new DragForm();
SetDragForm(Rectangle.Empty);
DragForm.BackColor = Color.Black;
DragForm.Opacity = 0.7;
DragForm.Show(false);
}
DragForm m_dragForm;
private DragForm DragForm
{
get { return m_dragForm; }
}
public void Show(Rectangle rect)
{
SetDragForm(rect);
}
public void Close()
{
DragForm.Close();
}
private void SetDragForm(Rectangle rect)
{
DragForm.Bounds = rect;
if (rect == Rectangle.Empty)
DragForm.Region = new Region(Rectangle.Empty);
else if (DragForm.Region != null)
DragForm.Region = null;
}
}
public SplitterDragHandler(DockPanel dockPanel)
: base(dockPanel)
{
}
public new ISplitterDragSource DragSource
{
get { return base.DragSource as ISplitterDragSource; }
private set { base.DragSource = value; }
}
private SplitterOutline m_outline;
private SplitterOutline Outline
{
get { return m_outline; }
set { m_outline = value; }
}
private Rectangle m_rectSplitter;
private Rectangle RectSplitter
{
get { return m_rectSplitter; }
set { m_rectSplitter = value; }
}
public void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter)
{
DragSource = dragSource;
RectSplitter = rectSplitter;
if (!BeginDrag())
{
DragSource = null;
return;
}
Outline = new SplitterOutline();
Outline.Show(rectSplitter);
DragSource.BeginDrag(rectSplitter);
}
protected override void OnDragging()
{
Outline.Show(GetSplitterOutlineBounds(Control.MousePosition));
}
protected override void OnEndDrag(bool abort)
{
DockPanel.SuspendLayout(true);
Outline.Close();
if (!abort)
DragSource.MoveSplitter(GetMovingOffset(Control.MousePosition));
DragSource.EndDrag();
DockPanel.ResumeLayout(true, true);
}
private int GetMovingOffset(Point ptMouse)
{
Rectangle rect = GetSplitterOutlineBounds(ptMouse);
if (DragSource.IsVertical)
return rect.X - RectSplitter.X;
else
return rect.Y - RectSplitter.Y;
}
private Rectangle GetSplitterOutlineBounds(Point ptMouse)
{
Rectangle rectLimit = DragSource.DragLimitBounds;
Rectangle rect = RectSplitter;
if (rectLimit.Width <= 0 || rectLimit.Height <= 0)
return rect;
if (DragSource.IsVertical)
{
rect.X += ptMouse.X - StartMousePosition.X;
rect.Height = rectLimit.Height;
}
else
{
rect.Y += ptMouse.Y - StartMousePosition.Y;
rect.Width = rectLimit.Width;
}
if (rect.Left < rectLimit.Left)
rect.X = rectLimit.X;
if (rect.Top < rectLimit.Top)
rect.Y = rectLimit.Y;
if (rect.Right > rectLimit.Right)
rect.X -= rect.Right - rectLimit.Right;
if (rect.Bottom > rectLimit.Bottom)
rect.Y -= rect.Bottom - rectLimit.Bottom;
return rect;
}
}
private SplitterDragHandler m_splitterDragHandler = null;
private SplitterDragHandler GetSplitterDragHandler()
{
if (m_splitterDragHandler == null)
m_splitterDragHandler = new SplitterDragHandler(this);
return m_splitterDragHandler;
}
internal void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter)
{
GetSplitterDragHandler().BeginDrag(dragSource, rectSplitter);
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
namespace LSLEditor.Docking
{
partial class DockPanel
{
private sealed class SplitterDragHandler : DragHandler
{
private class SplitterOutline
{
public SplitterOutline()
{
m_dragForm = new DragForm();
SetDragForm(Rectangle.Empty);
DragForm.BackColor = Color.Black;
DragForm.Opacity = 0.7;
DragForm.Show(false);
}
DragForm m_dragForm;
private DragForm DragForm
{
get { return m_dragForm; }
}
public void Show(Rectangle rect)
{
SetDragForm(rect);
}
public void Close()
{
DragForm.Close();
}
private void SetDragForm(Rectangle rect)
{
DragForm.Bounds = rect;
if (rect == Rectangle.Empty)
DragForm.Region = new Region(Rectangle.Empty);
else if (DragForm.Region != null)
DragForm.Region = null;
}
}
public SplitterDragHandler(DockPanel dockPanel)
: base(dockPanel)
{
}
public new ISplitterDragSource DragSource
{
get { return base.DragSource as ISplitterDragSource; }
private set { base.DragSource = value; }
}
private SplitterOutline m_outline;
private SplitterOutline Outline
{
get { return m_outline; }
set { m_outline = value; }
}
private Rectangle m_rectSplitter;
private Rectangle RectSplitter
{
get { return m_rectSplitter; }
set { m_rectSplitter = value; }
}
public void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter)
{
DragSource = dragSource;
RectSplitter = rectSplitter;
if (!BeginDrag())
{
DragSource = null;
return;
}
Outline = new SplitterOutline();
Outline.Show(rectSplitter);
DragSource.BeginDrag(rectSplitter);
}
protected override void OnDragging()
{
Outline.Show(GetSplitterOutlineBounds(Control.MousePosition));
}
protected override void OnEndDrag(bool abort)
{
DockPanel.SuspendLayout(true);
Outline.Close();
if (!abort)
DragSource.MoveSplitter(GetMovingOffset(Control.MousePosition));
DragSource.EndDrag();
DockPanel.ResumeLayout(true, true);
}
private int GetMovingOffset(Point ptMouse)
{
Rectangle rect = GetSplitterOutlineBounds(ptMouse);
if (DragSource.IsVertical)
return rect.X - RectSplitter.X;
else
return rect.Y - RectSplitter.Y;
}
private Rectangle GetSplitterOutlineBounds(Point ptMouse)
{
Rectangle rectLimit = DragSource.DragLimitBounds;
Rectangle rect = RectSplitter;
if (rectLimit.Width <= 0 || rectLimit.Height <= 0)
return rect;
if (DragSource.IsVertical)
{
rect.X += ptMouse.X - StartMousePosition.X;
rect.Height = rectLimit.Height;
}
else
{
rect.Y += ptMouse.Y - StartMousePosition.Y;
rect.Width = rectLimit.Width;
}
if (rect.Left < rectLimit.Left)
rect.X = rectLimit.X;
if (rect.Top < rectLimit.Top)
rect.Y = rectLimit.Y;
if (rect.Right > rectLimit.Right)
rect.X -= rect.Right - rectLimit.Right;
if (rect.Bottom > rectLimit.Bottom)
rect.Y -= rect.Bottom - rectLimit.Bottom;
return rect;
}
}
private SplitterDragHandler m_splitterDragHandler = null;
private SplitterDragHandler GetSplitterDragHandler()
{
if (m_splitterDragHandler == null)
m_splitterDragHandler = new SplitterDragHandler(this);
return m_splitterDragHandler;
}
internal void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter)
{
GetSplitterDragHandler().BeginDrag(dragSource, rectSplitter);
}
}
}

View file

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 822 B

Before After
Before After

File diff suppressed because it is too large Load diff

View file

@ -1,225 +1,225 @@
using System;
using System.Drawing;
using System.Diagnostics.CodeAnalysis;
namespace LSLEditor.Docking
{
public sealed class DockPanelExtender
{
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IDockPaneFactory
{
DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show);
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")]
DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show);
DockPane CreateDockPane(IDockContent content, DockPane previousPane, DockAlignment alignment, double proportion, bool show);
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")]
DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show);
}
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IFloatWindowFactory
{
FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane);
FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds);
}
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IDockPaneCaptionFactory
{
DockPaneCaptionBase CreateDockPaneCaption(DockPane pane);
}
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IDockPaneStripFactory
{
DockPaneStripBase CreateDockPaneStrip(DockPane pane);
}
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IAutoHideStripFactory
{
AutoHideStripBase CreateAutoHideStrip(DockPanel panel);
}
#region DefaultDockPaneFactory
private class DefaultDockPaneFactory : IDockPaneFactory
{
public DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show)
{
return new DockPane(content, visibleState, show);
}
public DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show)
{
return new DockPane(content, floatWindow, show);
}
public DockPane CreateDockPane(IDockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
{
return new DockPane(content, prevPane, alignment, proportion, show);
}
public DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show)
{
return new DockPane(content, floatWindowBounds, show);
}
}
#endregion
#region DefaultFloatWindowFactory
private class DefaultFloatWindowFactory : IFloatWindowFactory
{
public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane)
{
return new FloatWindow(dockPanel, pane);
}
public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
{
return new FloatWindow(dockPanel, pane, bounds);
}
}
#endregion
#region DefaultDockPaneCaptionFactory
private class DefaultDockPaneCaptionFactory : IDockPaneCaptionFactory
{
public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane)
{
return new VS2005DockPaneCaption(pane);
}
}
#endregion
#region DefaultDockPaneTabStripFactory
private class DefaultDockPaneStripFactory : IDockPaneStripFactory
{
public DockPaneStripBase CreateDockPaneStrip(DockPane pane)
{
return new VS2005DockPaneStrip(pane);
}
}
#endregion
#region DefaultAutoHideStripFactory
private class DefaultAutoHideStripFactory : IAutoHideStripFactory
{
public AutoHideStripBase CreateAutoHideStrip(DockPanel panel)
{
return new VS2005AutoHideStrip(panel);
}
}
#endregion
internal DockPanelExtender(DockPanel dockPanel)
{
m_dockPanel = dockPanel;
}
private DockPanel m_dockPanel;
private DockPanel DockPanel
{
get { return m_dockPanel; }
}
private IDockPaneFactory m_dockPaneFactory = null;
public IDockPaneFactory DockPaneFactory
{
get
{
if (m_dockPaneFactory == null)
m_dockPaneFactory = new DefaultDockPaneFactory();
return m_dockPaneFactory;
}
set
{
if (DockPanel.Panes.Count > 0)
throw new InvalidOperationException();
m_dockPaneFactory = value;
}
}
private IFloatWindowFactory m_floatWindowFactory = null;
public IFloatWindowFactory FloatWindowFactory
{
get
{
if (m_floatWindowFactory == null)
m_floatWindowFactory = new DefaultFloatWindowFactory();
return m_floatWindowFactory;
}
set
{
if (DockPanel.FloatWindows.Count > 0)
throw new InvalidOperationException();
m_floatWindowFactory = value;
}
}
private IDockPaneCaptionFactory m_dockPaneCaptionFactory = null;
public IDockPaneCaptionFactory DockPaneCaptionFactory
{
get
{
if (m_dockPaneCaptionFactory == null)
m_dockPaneCaptionFactory = new DefaultDockPaneCaptionFactory();
return m_dockPaneCaptionFactory;
}
set
{
if (DockPanel.Panes.Count > 0)
throw new InvalidOperationException();
m_dockPaneCaptionFactory = value;
}
}
private IDockPaneStripFactory m_dockPaneStripFactory = null;
public IDockPaneStripFactory DockPaneStripFactory
{
get
{
if (m_dockPaneStripFactory == null)
m_dockPaneStripFactory = new DefaultDockPaneStripFactory();
return m_dockPaneStripFactory;
}
set
{
if (DockPanel.Contents.Count > 0)
throw new InvalidOperationException();
m_dockPaneStripFactory = value;
}
}
private IAutoHideStripFactory m_autoHideStripFactory = null;
public IAutoHideStripFactory AutoHideStripFactory
{
get
{
if (m_autoHideStripFactory == null)
m_autoHideStripFactory = new DefaultAutoHideStripFactory();
return m_autoHideStripFactory;
}
set
{
if (DockPanel.Contents.Count > 0)
throw new InvalidOperationException();
if (m_autoHideStripFactory == value)
return;
m_autoHideStripFactory = value;
DockPanel.ResetAutoHideStripControl();
}
}
}
}
using System;
using System.Drawing;
using System.Diagnostics.CodeAnalysis;
namespace LSLEditor.Docking
{
public sealed class DockPanelExtender
{
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IDockPaneFactory
{
DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show);
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")]
DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show);
DockPane CreateDockPane(IDockContent content, DockPane previousPane, DockAlignment alignment, double proportion, bool show);
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")]
DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show);
}
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IFloatWindowFactory
{
FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane);
FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds);
}
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IDockPaneCaptionFactory
{
DockPaneCaptionBase CreateDockPaneCaption(DockPane pane);
}
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IDockPaneStripFactory
{
DockPaneStripBase CreateDockPaneStrip(DockPane pane);
}
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IAutoHideStripFactory
{
AutoHideStripBase CreateAutoHideStrip(DockPanel panel);
}
#region DefaultDockPaneFactory
private class DefaultDockPaneFactory : IDockPaneFactory
{
public DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show)
{
return new DockPane(content, visibleState, show);
}
public DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show)
{
return new DockPane(content, floatWindow, show);
}
public DockPane CreateDockPane(IDockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
{
return new DockPane(content, prevPane, alignment, proportion, show);
}
public DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show)
{
return new DockPane(content, floatWindowBounds, show);
}
}
#endregion
#region DefaultFloatWindowFactory
private class DefaultFloatWindowFactory : IFloatWindowFactory
{
public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane)
{
return new FloatWindow(dockPanel, pane);
}
public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
{
return new FloatWindow(dockPanel, pane, bounds);
}
}
#endregion
#region DefaultDockPaneCaptionFactory
private class DefaultDockPaneCaptionFactory : IDockPaneCaptionFactory
{
public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane)
{
return new VS2005DockPaneCaption(pane);
}
}
#endregion
#region DefaultDockPaneTabStripFactory
private class DefaultDockPaneStripFactory : IDockPaneStripFactory
{
public DockPaneStripBase CreateDockPaneStrip(DockPane pane)
{
return new VS2005DockPaneStrip(pane);
}
}
#endregion
#region DefaultAutoHideStripFactory
private class DefaultAutoHideStripFactory : IAutoHideStripFactory
{
public AutoHideStripBase CreateAutoHideStrip(DockPanel panel)
{
return new VS2005AutoHideStrip(panel);
}
}
#endregion
internal DockPanelExtender(DockPanel dockPanel)
{
m_dockPanel = dockPanel;
}
private DockPanel m_dockPanel;
private DockPanel DockPanel
{
get { return m_dockPanel; }
}
private IDockPaneFactory m_dockPaneFactory = null;
public IDockPaneFactory DockPaneFactory
{
get
{
if (m_dockPaneFactory == null)
m_dockPaneFactory = new DefaultDockPaneFactory();
return m_dockPaneFactory;
}
set
{
if (DockPanel.Panes.Count > 0)
throw new InvalidOperationException();
m_dockPaneFactory = value;
}
}
private IFloatWindowFactory m_floatWindowFactory = null;
public IFloatWindowFactory FloatWindowFactory
{
get
{
if (m_floatWindowFactory == null)
m_floatWindowFactory = new DefaultFloatWindowFactory();
return m_floatWindowFactory;
}
set
{
if (DockPanel.FloatWindows.Count > 0)
throw new InvalidOperationException();
m_floatWindowFactory = value;
}
}
private IDockPaneCaptionFactory m_dockPaneCaptionFactory = null;
public IDockPaneCaptionFactory DockPaneCaptionFactory
{
get
{
if (m_dockPaneCaptionFactory == null)
m_dockPaneCaptionFactory = new DefaultDockPaneCaptionFactory();
return m_dockPaneCaptionFactory;
}
set
{
if (DockPanel.Panes.Count > 0)
throw new InvalidOperationException();
m_dockPaneCaptionFactory = value;
}
}
private IDockPaneStripFactory m_dockPaneStripFactory = null;
public IDockPaneStripFactory DockPaneStripFactory
{
get
{
if (m_dockPaneStripFactory == null)
m_dockPaneStripFactory = new DefaultDockPaneStripFactory();
return m_dockPaneStripFactory;
}
set
{
if (DockPanel.Contents.Count > 0)
throw new InvalidOperationException();
m_dockPaneStripFactory = value;
}
}
private IAutoHideStripFactory m_autoHideStripFactory = null;
public IAutoHideStripFactory AutoHideStripFactory
{
get
{
if (m_autoHideStripFactory == null)
m_autoHideStripFactory = new DefaultAutoHideStripFactory();
return m_autoHideStripFactory;
}
set
{
if (DockPanel.Contents.Count > 0)
throw new InvalidOperationException();
if (m_autoHideStripFactory == value)
return;
m_autoHideStripFactory = value;
DockPanel.ResetAutoHideStripControl();
}
}
}
}

View file

@ -1,421 +1,421 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Design;
using System.Windows.Forms.Design;
using System.ComponentModel;
namespace LSLEditor.Docking
{
#region DockPanelSkin classes
/// <summary>
/// The skin to use when displaying the DockPanel.
/// The skin allows custom gradient color schemes to be used when drawing the
/// DockStrips and Tabs.
/// </summary>
[TypeConverter(typeof(DockPanelSkinConverter))]
public class DockPanelSkin
{
private AutoHideStripSkin m_autoHideStripSkin;
private DockPaneStripSkin m_dockPaneStripSkin;
public DockPanelSkin()
{
m_autoHideStripSkin = new AutoHideStripSkin();
m_dockPaneStripSkin = new DockPaneStripSkin();
}
/// <summary>
/// The skin used to display the auto hide strips and tabs.
/// </summary>
public AutoHideStripSkin AutoHideStripSkin
{
get { return m_autoHideStripSkin; }
set { m_autoHideStripSkin = value; }
}
/// <summary>
/// The skin used to display the Document and ToolWindow style DockStrips and Tabs.
/// </summary>
public DockPaneStripSkin DockPaneStripSkin
{
get { return m_dockPaneStripSkin; }
set { m_dockPaneStripSkin = value; }
}
}
/// <summary>
/// The skin used to display the auto hide strip and tabs.
/// </summary>
[TypeConverter(typeof(AutoHideStripConverter))]
public class AutoHideStripSkin
{
private DockPanelGradient m_dockStripGradient;
private TabGradient m_TabGradient;
public AutoHideStripSkin()
{
m_dockStripGradient = new DockPanelGradient();
m_dockStripGradient.StartColor = SystemColors.ControlLight;
m_dockStripGradient.EndColor = SystemColors.ControlLight;
m_TabGradient = new TabGradient();
m_TabGradient.TextColor = SystemColors.ControlDarkDark;
}
/// <summary>
/// The gradient color skin for the DockStrips.
/// </summary>
public DockPanelGradient DockStripGradient
{
get { return m_dockStripGradient; }
set { m_dockStripGradient = value; }
}
/// <summary>
/// The gradient color skin for the Tabs.
/// </summary>
public TabGradient TabGradient
{
get { return m_TabGradient; }
set { m_TabGradient = value; }
}
}
/// <summary>
/// The skin used to display the document and tool strips and tabs.
/// </summary>
[TypeConverter(typeof(DockPaneStripConverter))]
public class DockPaneStripSkin
{
private DockPaneStripGradient m_DocumentGradient;
private DockPaneStripToolWindowGradient m_ToolWindowGradient;
public DockPaneStripSkin()
{
m_DocumentGradient = new DockPaneStripGradient();
m_DocumentGradient.DockStripGradient.StartColor = SystemColors.Control;
m_DocumentGradient.DockStripGradient.EndColor = SystemColors.Control;
m_DocumentGradient.ActiveTabGradient.StartColor = SystemColors.ControlLightLight;
m_DocumentGradient.ActiveTabGradient.EndColor = SystemColors.ControlLightLight;
m_DocumentGradient.InactiveTabGradient.StartColor = SystemColors.ControlLight;
m_DocumentGradient.InactiveTabGradient.EndColor = SystemColors.ControlLight;
m_ToolWindowGradient = new DockPaneStripToolWindowGradient();
m_ToolWindowGradient.DockStripGradient.StartColor = SystemColors.ControlLight;
m_ToolWindowGradient.DockStripGradient.EndColor = SystemColors.ControlLight;
m_ToolWindowGradient.ActiveTabGradient.StartColor = SystemColors.Control;
m_ToolWindowGradient.ActiveTabGradient.EndColor = SystemColors.Control;
m_ToolWindowGradient.InactiveTabGradient.StartColor = Color.Transparent;
m_ToolWindowGradient.InactiveTabGradient.EndColor = Color.Transparent;
m_ToolWindowGradient.InactiveTabGradient.TextColor = SystemColors.ControlDarkDark;
m_ToolWindowGradient.ActiveCaptionGradient.StartColor = SystemColors.GradientActiveCaption;
m_ToolWindowGradient.ActiveCaptionGradient.EndColor = SystemColors.ActiveCaption;
m_ToolWindowGradient.ActiveCaptionGradient.LinearGradientMode = LinearGradientMode.Vertical;
m_ToolWindowGradient.ActiveCaptionGradient.TextColor = SystemColors.ActiveCaptionText;
m_ToolWindowGradient.InactiveCaptionGradient.StartColor = SystemColors.GradientInactiveCaption;
m_ToolWindowGradient.InactiveCaptionGradient.EndColor = SystemColors.GradientInactiveCaption;
m_ToolWindowGradient.InactiveCaptionGradient.LinearGradientMode = LinearGradientMode.Vertical;
m_ToolWindowGradient.InactiveCaptionGradient.TextColor = SystemColors.ControlText;
}
/// <summary>
/// The skin used to display the Document style DockPane strip and tab.
/// </summary>
public DockPaneStripGradient DocumentGradient
{
get { return m_DocumentGradient; }
set { m_DocumentGradient = value; }
}
/// <summary>
/// The skin used to display the ToolWindow style DockPane strip and tab.
/// </summary>
public DockPaneStripToolWindowGradient ToolWindowGradient
{
get { return m_ToolWindowGradient; }
set { m_ToolWindowGradient = value; }
}
}
/// <summary>
/// The skin used to display the DockPane ToolWindow strip and tab.
/// </summary>
[TypeConverter(typeof(DockPaneStripGradientConverter))]
public class DockPaneStripToolWindowGradient : DockPaneStripGradient
{
private TabGradient m_activeCaptionGradient;
private TabGradient m_inactiveCaptionGradient;
public DockPaneStripToolWindowGradient()
{
m_activeCaptionGradient = new TabGradient();
m_inactiveCaptionGradient = new TabGradient();
}
/// <summary>
/// The skin used to display the active ToolWindow caption.
/// </summary>
public TabGradient ActiveCaptionGradient
{
get { return m_activeCaptionGradient; }
set { m_activeCaptionGradient = value; }
}
/// <summary>
/// The skin used to display the inactive ToolWindow caption.
/// </summary>
public TabGradient InactiveCaptionGradient
{
get { return m_inactiveCaptionGradient; }
set { m_inactiveCaptionGradient = value; }
}
}
/// <summary>
/// The skin used to display the DockPane strip and tab.
/// </summary>
[TypeConverter(typeof(DockPaneStripGradientConverter))]
public class DockPaneStripGradient
{
private DockPanelGradient m_dockStripGradient;
private TabGradient m_activeTabGradient;
private TabGradient m_inactiveTabGradient;
public DockPaneStripGradient()
{
m_dockStripGradient = new DockPanelGradient();
m_activeTabGradient = new TabGradient();
m_inactiveTabGradient = new TabGradient();
}
/// <summary>
/// The gradient color skin for the DockStrip.
/// </summary>
public DockPanelGradient DockStripGradient
{
get { return m_dockStripGradient; }
set { m_dockStripGradient = value; }
}
/// <summary>
/// The skin used to display the active DockPane tabs.
/// </summary>
public TabGradient ActiveTabGradient
{
get { return m_activeTabGradient; }
set { m_activeTabGradient = value; }
}
/// <summary>
/// The skin used to display the inactive DockPane tabs.
/// </summary>
public TabGradient InactiveTabGradient
{
get { return m_inactiveTabGradient; }
set { m_inactiveTabGradient = value; }
}
}
/// <summary>
/// The skin used to display the dock pane tab
/// </summary>
[TypeConverter(typeof(DockPaneTabGradientConverter))]
public class TabGradient : DockPanelGradient
{
private Color m_textColor;
public TabGradient()
{
m_textColor = SystemColors.ControlText;
}
/// <summary>
/// The text color.
/// </summary>
[DefaultValue(typeof(SystemColors), "ControlText")]
public Color TextColor
{
get { return m_textColor; }
set { m_textColor = value; }
}
}
/// <summary>
/// The gradient color skin.
/// </summary>
[TypeConverter(typeof(DockPanelGradientConverter))]
public class DockPanelGradient
{
private Color m_startColor;
private Color m_endColor;
private LinearGradientMode m_linearGradientMode;
public DockPanelGradient()
{
m_startColor = SystemColors.Control;
m_endColor = SystemColors.Control;
m_linearGradientMode = LinearGradientMode.Horizontal;
}
/// <summary>
/// The beginning gradient color.
/// </summary>
[DefaultValue(typeof(SystemColors), "Control")]
public Color StartColor
{
get { return m_startColor; }
set { m_startColor = value; }
}
/// <summary>
/// The ending gradient color.
/// </summary>
[DefaultValue(typeof(SystemColors), "Control")]
public Color EndColor
{
get { return m_endColor; }
set { m_endColor = value; }
}
/// <summary>
/// The gradient mode to display the colors.
/// </summary>
[DefaultValue(LinearGradientMode.Horizontal)]
public LinearGradientMode LinearGradientMode
{
get { return m_linearGradientMode; }
set { m_linearGradientMode = value; }
}
}
#endregion
#region Converters
public class DockPanelSkinConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(DockPanelSkin))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is DockPanelSkin)
{
return "DockPanelSkin";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public class DockPanelGradientConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(DockPanelGradient))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is DockPanelGradient)
{
return "DockPanelGradient";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public class AutoHideStripConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(AutoHideStripSkin))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is AutoHideStripSkin)
{
return "AutoHideStripSkin";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public class DockPaneStripConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(DockPaneStripSkin))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is DockPaneStripSkin)
{
return "DockPaneStripSkin";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public class DockPaneStripGradientConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(DockPaneStripGradient))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is DockPaneStripGradient)
{
return "DockPaneStripGradient";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public class DockPaneTabGradientConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(TabGradient))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is TabGradient)
{
return "DockPaneTabGradient";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
#endregion
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Design;
using System.Windows.Forms.Design;
using System.ComponentModel;
namespace LSLEditor.Docking
{
#region DockPanelSkin classes
/// <summary>
/// The skin to use when displaying the DockPanel.
/// The skin allows custom gradient color schemes to be used when drawing the
/// DockStrips and Tabs.
/// </summary>
[TypeConverter(typeof(DockPanelSkinConverter))]
public class DockPanelSkin
{
private AutoHideStripSkin m_autoHideStripSkin;
private DockPaneStripSkin m_dockPaneStripSkin;
public DockPanelSkin()
{
m_autoHideStripSkin = new AutoHideStripSkin();
m_dockPaneStripSkin = new DockPaneStripSkin();
}
/// <summary>
/// The skin used to display the auto hide strips and tabs.
/// </summary>
public AutoHideStripSkin AutoHideStripSkin
{
get { return m_autoHideStripSkin; }
set { m_autoHideStripSkin = value; }
}
/// <summary>
/// The skin used to display the Document and ToolWindow style DockStrips and Tabs.
/// </summary>
public DockPaneStripSkin DockPaneStripSkin
{
get { return m_dockPaneStripSkin; }
set { m_dockPaneStripSkin = value; }
}
}
/// <summary>
/// The skin used to display the auto hide strip and tabs.
/// </summary>
[TypeConverter(typeof(AutoHideStripConverter))]
public class AutoHideStripSkin
{
private DockPanelGradient m_dockStripGradient;
private TabGradient m_TabGradient;
public AutoHideStripSkin()
{
m_dockStripGradient = new DockPanelGradient();
m_dockStripGradient.StartColor = SystemColors.ControlLight;
m_dockStripGradient.EndColor = SystemColors.ControlLight;
m_TabGradient = new TabGradient();
m_TabGradient.TextColor = SystemColors.ControlDarkDark;
}
/// <summary>
/// The gradient color skin for the DockStrips.
/// </summary>
public DockPanelGradient DockStripGradient
{
get { return m_dockStripGradient; }
set { m_dockStripGradient = value; }
}
/// <summary>
/// The gradient color skin for the Tabs.
/// </summary>
public TabGradient TabGradient
{
get { return m_TabGradient; }
set { m_TabGradient = value; }
}
}
/// <summary>
/// The skin used to display the document and tool strips and tabs.
/// </summary>
[TypeConverter(typeof(DockPaneStripConverter))]
public class DockPaneStripSkin
{
private DockPaneStripGradient m_DocumentGradient;
private DockPaneStripToolWindowGradient m_ToolWindowGradient;
public DockPaneStripSkin()
{
m_DocumentGradient = new DockPaneStripGradient();
m_DocumentGradient.DockStripGradient.StartColor = SystemColors.Control;
m_DocumentGradient.DockStripGradient.EndColor = SystemColors.Control;
m_DocumentGradient.ActiveTabGradient.StartColor = SystemColors.ControlLightLight;
m_DocumentGradient.ActiveTabGradient.EndColor = SystemColors.ControlLightLight;
m_DocumentGradient.InactiveTabGradient.StartColor = SystemColors.ControlLight;
m_DocumentGradient.InactiveTabGradient.EndColor = SystemColors.ControlLight;
m_ToolWindowGradient = new DockPaneStripToolWindowGradient();
m_ToolWindowGradient.DockStripGradient.StartColor = SystemColors.ControlLight;
m_ToolWindowGradient.DockStripGradient.EndColor = SystemColors.ControlLight;
m_ToolWindowGradient.ActiveTabGradient.StartColor = SystemColors.Control;
m_ToolWindowGradient.ActiveTabGradient.EndColor = SystemColors.Control;
m_ToolWindowGradient.InactiveTabGradient.StartColor = Color.Transparent;
m_ToolWindowGradient.InactiveTabGradient.EndColor = Color.Transparent;
m_ToolWindowGradient.InactiveTabGradient.TextColor = SystemColors.ControlDarkDark;
m_ToolWindowGradient.ActiveCaptionGradient.StartColor = SystemColors.GradientActiveCaption;
m_ToolWindowGradient.ActiveCaptionGradient.EndColor = SystemColors.ActiveCaption;
m_ToolWindowGradient.ActiveCaptionGradient.LinearGradientMode = LinearGradientMode.Vertical;
m_ToolWindowGradient.ActiveCaptionGradient.TextColor = SystemColors.ActiveCaptionText;
m_ToolWindowGradient.InactiveCaptionGradient.StartColor = SystemColors.GradientInactiveCaption;
m_ToolWindowGradient.InactiveCaptionGradient.EndColor = SystemColors.GradientInactiveCaption;
m_ToolWindowGradient.InactiveCaptionGradient.LinearGradientMode = LinearGradientMode.Vertical;
m_ToolWindowGradient.InactiveCaptionGradient.TextColor = SystemColors.ControlText;
}
/// <summary>
/// The skin used to display the Document style DockPane strip and tab.
/// </summary>
public DockPaneStripGradient DocumentGradient
{
get { return m_DocumentGradient; }
set { m_DocumentGradient = value; }
}
/// <summary>
/// The skin used to display the ToolWindow style DockPane strip and tab.
/// </summary>
public DockPaneStripToolWindowGradient ToolWindowGradient
{
get { return m_ToolWindowGradient; }
set { m_ToolWindowGradient = value; }
}
}
/// <summary>
/// The skin used to display the DockPane ToolWindow strip and tab.
/// </summary>
[TypeConverter(typeof(DockPaneStripGradientConverter))]
public class DockPaneStripToolWindowGradient : DockPaneStripGradient
{
private TabGradient m_activeCaptionGradient;
private TabGradient m_inactiveCaptionGradient;
public DockPaneStripToolWindowGradient()
{
m_activeCaptionGradient = new TabGradient();
m_inactiveCaptionGradient = new TabGradient();
}
/// <summary>
/// The skin used to display the active ToolWindow caption.
/// </summary>
public TabGradient ActiveCaptionGradient
{
get { return m_activeCaptionGradient; }
set { m_activeCaptionGradient = value; }
}
/// <summary>
/// The skin used to display the inactive ToolWindow caption.
/// </summary>
public TabGradient InactiveCaptionGradient
{
get { return m_inactiveCaptionGradient; }
set { m_inactiveCaptionGradient = value; }
}
}
/// <summary>
/// The skin used to display the DockPane strip and tab.
/// </summary>
[TypeConverter(typeof(DockPaneStripGradientConverter))]
public class DockPaneStripGradient
{
private DockPanelGradient m_dockStripGradient;
private TabGradient m_activeTabGradient;
private TabGradient m_inactiveTabGradient;
public DockPaneStripGradient()
{
m_dockStripGradient = new DockPanelGradient();
m_activeTabGradient = new TabGradient();
m_inactiveTabGradient = new TabGradient();
}
/// <summary>
/// The gradient color skin for the DockStrip.
/// </summary>
public DockPanelGradient DockStripGradient
{
get { return m_dockStripGradient; }
set { m_dockStripGradient = value; }
}
/// <summary>
/// The skin used to display the active DockPane tabs.
/// </summary>
public TabGradient ActiveTabGradient
{
get { return m_activeTabGradient; }
set { m_activeTabGradient = value; }
}
/// <summary>
/// The skin used to display the inactive DockPane tabs.
/// </summary>
public TabGradient InactiveTabGradient
{
get { return m_inactiveTabGradient; }
set { m_inactiveTabGradient = value; }
}
}
/// <summary>
/// The skin used to display the dock pane tab
/// </summary>
[TypeConverter(typeof(DockPaneTabGradientConverter))]
public class TabGradient : DockPanelGradient
{
private Color m_textColor;
public TabGradient()
{
m_textColor = SystemColors.ControlText;
}
/// <summary>
/// The text color.
/// </summary>
[DefaultValue(typeof(SystemColors), "ControlText")]
public Color TextColor
{
get { return m_textColor; }
set { m_textColor = value; }
}
}
/// <summary>
/// The gradient color skin.
/// </summary>
[TypeConverter(typeof(DockPanelGradientConverter))]
public class DockPanelGradient
{
private Color m_startColor;
private Color m_endColor;
private LinearGradientMode m_linearGradientMode;
public DockPanelGradient()
{
m_startColor = SystemColors.Control;
m_endColor = SystemColors.Control;
m_linearGradientMode = LinearGradientMode.Horizontal;
}
/// <summary>
/// The beginning gradient color.
/// </summary>
[DefaultValue(typeof(SystemColors), "Control")]
public Color StartColor
{
get { return m_startColor; }
set { m_startColor = value; }
}
/// <summary>
/// The ending gradient color.
/// </summary>
[DefaultValue(typeof(SystemColors), "Control")]
public Color EndColor
{
get { return m_endColor; }
set { m_endColor = value; }
}
/// <summary>
/// The gradient mode to display the colors.
/// </summary>
[DefaultValue(LinearGradientMode.Horizontal)]
public LinearGradientMode LinearGradientMode
{
get { return m_linearGradientMode; }
set { m_linearGradientMode = value; }
}
}
#endregion
#region Converters
public class DockPanelSkinConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(DockPanelSkin))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is DockPanelSkin)
{
return "DockPanelSkin";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public class DockPanelGradientConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(DockPanelGradient))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is DockPanelGradient)
{
return "DockPanelGradient";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public class AutoHideStripConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(AutoHideStripSkin))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is AutoHideStripSkin)
{
return "AutoHideStripSkin";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public class DockPaneStripConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(DockPaneStripSkin))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is DockPaneStripSkin)
{
return "DockPaneStripSkin";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public class DockPaneStripGradientConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(DockPaneStripGradient))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is DockPaneStripGradient)
{
return "DockPaneStripGradient";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public class DockPaneTabGradientConverter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(TabGradient))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(String) && value is TabGradient)
{
return "DockPaneTabGradient";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
#endregion
}

View file

@ -1,28 +1,28 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
public partial class DockWindow
{
private class SplitterControl : SplitterBase
{
protected override int SplitterSize
{
get { return Measures.SplitterSize; }
}
protected override void StartDrag()
{
DockWindow window = Parent as DockWindow;
if (window == null)
return;
window.DockPanel.BeginDrag(window, window.RectangleToScreen(Bounds));
}
}
}
}
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
public partial class DockWindow
{
private class SplitterControl : SplitterBase
{
protected override int SplitterSize
{
get { return Measures.SplitterSize; }
}
protected override void StartDrag()
{
DockWindow window = Parent as DockWindow;
if (window == null)
return;
window.DockPanel.BeginDrag(window, window.RectangleToScreen(Bounds));
}
}
}
}

View file

@ -1,243 +1,243 @@
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace LSLEditor.Docking
{
[ToolboxItem(false)]
public partial class DockWindow : Panel, INestedPanesContainer, ISplitterDragSource
{
private DockPanel m_dockPanel;
private DockState m_dockState;
private SplitterControl m_splitter;
private NestedPaneCollection m_nestedPanes;
internal DockWindow(DockPanel dockPanel, DockState dockState)
{
m_nestedPanes = new NestedPaneCollection(this);
m_dockPanel = dockPanel;
m_dockState = dockState;
Visible = false;
SuspendLayout();
if (DockState == DockState.DockLeft || DockState == DockState.DockRight ||
DockState == DockState.DockTop || DockState == DockState.DockBottom)
{
m_splitter = new SplitterControl();
Controls.Add(m_splitter);
}
if (DockState == DockState.DockLeft)
{
Dock = DockStyle.Left;
m_splitter.Dock = DockStyle.Right;
}
else if (DockState == DockState.DockRight)
{
Dock = DockStyle.Right;
m_splitter.Dock = DockStyle.Left;
}
else if (DockState == DockState.DockTop)
{
Dock = DockStyle.Top;
m_splitter.Dock = DockStyle.Bottom;
}
else if (DockState == DockState.DockBottom)
{
Dock = DockStyle.Bottom;
m_splitter.Dock = DockStyle.Top;
}
else if (DockState == DockState.Document)
{
Dock = DockStyle.Fill;
}
ResumeLayout();
}
public VisibleNestedPaneCollection VisibleNestedPanes
{
get { return NestedPanes.VisibleNestedPanes; }
}
public NestedPaneCollection NestedPanes
{
get { return m_nestedPanes; }
}
public DockPanel DockPanel
{
get { return m_dockPanel; }
}
public DockState DockState
{
get { return m_dockState; }
}
public bool IsFloat
{
get { return DockState == DockState.Float; }
}
internal DockPane DefaultPane
{
get { return VisibleNestedPanes.Count == 0 ? null : VisibleNestedPanes[0]; }
}
public virtual Rectangle DisplayingRectangle
{
get
{
Rectangle rect = ClientRectangle;
// if DockWindow is document, exclude the border
if (DockState == DockState.Document)
{
rect.X += 1;
rect.Y += 1;
rect.Width -= 2;
rect.Height -= 2;
}
// exclude the splitter
else if (DockState == DockState.DockLeft)
rect.Width -= Measures.SplitterSize;
else if (DockState == DockState.DockRight)
{
rect.X += Measures.SplitterSize;
rect.Width -= Measures.SplitterSize;
}
else if (DockState == DockState.DockTop)
rect.Height -= Measures.SplitterSize;
else if (DockState == DockState.DockBottom)
{
rect.Y += Measures.SplitterSize;
rect.Height -= Measures.SplitterSize;
}
return rect;
}
}
protected override void OnPaint(PaintEventArgs e)
{
// if DockWindow is document, draw the border
if (DockState == DockState.Document)
e.Graphics.DrawRectangle(SystemPens.ControlDark, ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1);
base.OnPaint(e);
}
protected override void OnLayout(LayoutEventArgs levent)
{
VisibleNestedPanes.Refresh();
if (VisibleNestedPanes.Count == 0)
{
if (Visible)
Visible = false;
}
else if (!Visible)
{
Visible = true;
VisibleNestedPanes.Refresh();
}
base.OnLayout (levent);
}
#region ISplitterDragSource Members
void ISplitterDragSource.BeginDrag(Rectangle rectSplitter)
{
}
void ISplitterDragSource.EndDrag()
{
}
bool ISplitterDragSource.IsVertical
{
get { return (DockState == DockState.DockLeft || DockState == DockState.DockRight); }
}
Rectangle ISplitterDragSource.DragLimitBounds
{
get
{
Rectangle rectLimit = DockPanel.DockArea;
Point location;
if ((Control.ModifierKeys & Keys.Shift) == 0)
location = Location;
else
location = DockPanel.DockArea.Location;
if (((ISplitterDragSource)this).IsVertical)
{
rectLimit.X += MeasurePane.MinSize;
rectLimit.Width -= 2 * MeasurePane.MinSize;
rectLimit.Y = location.Y;
if ((Control.ModifierKeys & Keys.Shift) == 0)
rectLimit.Height = Height;
}
else
{
rectLimit.Y += MeasurePane.MinSize;
rectLimit.Height -= 2 * MeasurePane.MinSize;
rectLimit.X = location.X;
if ((Control.ModifierKeys & Keys.Shift) == 0)
rectLimit.Width = Width;
}
return DockPanel.RectangleToScreen(rectLimit);
}
}
void ISplitterDragSource.MoveSplitter(int offset)
{
if ((Control.ModifierKeys & Keys.Shift) != 0)
SendToBack();
Rectangle rectDockArea = DockPanel.DockArea;
if (DockState == DockState.DockLeft && rectDockArea.Width > 0)
{
if (DockPanel.DockLeftPortion > 1)
DockPanel.DockLeftPortion = Width + offset;
else
DockPanel.DockLeftPortion += ((double)offset) / (double)rectDockArea.Width;
}
else if (DockState == DockState.DockRight && rectDockArea.Width > 0)
{
if (DockPanel.DockRightPortion > 1)
DockPanel.DockRightPortion = Width - offset;
else
DockPanel.DockRightPortion -= ((double)offset) / (double)rectDockArea.Width;
}
else if (DockState == DockState.DockBottom && rectDockArea.Height > 0)
{
if (DockPanel.DockBottomPortion > 1)
DockPanel.DockBottomPortion = Height - offset;
else
DockPanel.DockBottomPortion -= ((double)offset) / (double)rectDockArea.Height;
}
else if (DockState == DockState.DockTop && rectDockArea.Height > 0)
{
if (DockPanel.DockTopPortion > 1)
DockPanel.DockTopPortion = Height + offset;
else
DockPanel.DockTopPortion += ((double)offset) / (double)rectDockArea.Height;
}
}
#region IDragSource Members
Control IDragSource.DragControl
{
get { return this; }
}
#endregion
#endregion
}
}
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace LSLEditor.Docking
{
[ToolboxItem(false)]
public partial class DockWindow : Panel, INestedPanesContainer, ISplitterDragSource
{
private DockPanel m_dockPanel;
private DockState m_dockState;
private SplitterControl m_splitter;
private NestedPaneCollection m_nestedPanes;
internal DockWindow(DockPanel dockPanel, DockState dockState)
{
m_nestedPanes = new NestedPaneCollection(this);
m_dockPanel = dockPanel;
m_dockState = dockState;
Visible = false;
SuspendLayout();
if (DockState == DockState.DockLeft || DockState == DockState.DockRight ||
DockState == DockState.DockTop || DockState == DockState.DockBottom)
{
m_splitter = new SplitterControl();
Controls.Add(m_splitter);
}
if (DockState == DockState.DockLeft)
{
Dock = DockStyle.Left;
m_splitter.Dock = DockStyle.Right;
}
else if (DockState == DockState.DockRight)
{
Dock = DockStyle.Right;
m_splitter.Dock = DockStyle.Left;
}
else if (DockState == DockState.DockTop)
{
Dock = DockStyle.Top;
m_splitter.Dock = DockStyle.Bottom;
}
else if (DockState == DockState.DockBottom)
{
Dock = DockStyle.Bottom;
m_splitter.Dock = DockStyle.Top;
}
else if (DockState == DockState.Document)
{
Dock = DockStyle.Fill;
}
ResumeLayout();
}
public VisibleNestedPaneCollection VisibleNestedPanes
{
get { return NestedPanes.VisibleNestedPanes; }
}
public NestedPaneCollection NestedPanes
{
get { return m_nestedPanes; }
}
public DockPanel DockPanel
{
get { return m_dockPanel; }
}
public DockState DockState
{
get { return m_dockState; }
}
public bool IsFloat
{
get { return DockState == DockState.Float; }
}
internal DockPane DefaultPane
{
get { return VisibleNestedPanes.Count == 0 ? null : VisibleNestedPanes[0]; }
}
public virtual Rectangle DisplayingRectangle
{
get
{
Rectangle rect = ClientRectangle;
// if DockWindow is document, exclude the border
if (DockState == DockState.Document)
{
rect.X += 1;
rect.Y += 1;
rect.Width -= 2;
rect.Height -= 2;
}
// exclude the splitter
else if (DockState == DockState.DockLeft)
rect.Width -= Measures.SplitterSize;
else if (DockState == DockState.DockRight)
{
rect.X += Measures.SplitterSize;
rect.Width -= Measures.SplitterSize;
}
else if (DockState == DockState.DockTop)
rect.Height -= Measures.SplitterSize;
else if (DockState == DockState.DockBottom)
{
rect.Y += Measures.SplitterSize;
rect.Height -= Measures.SplitterSize;
}
return rect;
}
}
protected override void OnPaint(PaintEventArgs e)
{
// if DockWindow is document, draw the border
if (DockState == DockState.Document)
e.Graphics.DrawRectangle(SystemPens.ControlDark, ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1);
base.OnPaint(e);
}
protected override void OnLayout(LayoutEventArgs levent)
{
VisibleNestedPanes.Refresh();
if (VisibleNestedPanes.Count == 0)
{
if (Visible)
Visible = false;
}
else if (!Visible)
{
Visible = true;
VisibleNestedPanes.Refresh();
}
base.OnLayout (levent);
}
#region ISplitterDragSource Members
void ISplitterDragSource.BeginDrag(Rectangle rectSplitter)
{
}
void ISplitterDragSource.EndDrag()
{
}
bool ISplitterDragSource.IsVertical
{
get { return (DockState == DockState.DockLeft || DockState == DockState.DockRight); }
}
Rectangle ISplitterDragSource.DragLimitBounds
{
get
{
Rectangle rectLimit = DockPanel.DockArea;
Point location;
if ((Control.ModifierKeys & Keys.Shift) == 0)
location = Location;
else
location = DockPanel.DockArea.Location;
if (((ISplitterDragSource)this).IsVertical)
{
rectLimit.X += MeasurePane.MinSize;
rectLimit.Width -= 2 * MeasurePane.MinSize;
rectLimit.Y = location.Y;
if ((Control.ModifierKeys & Keys.Shift) == 0)
rectLimit.Height = Height;
}
else
{
rectLimit.Y += MeasurePane.MinSize;
rectLimit.Height -= 2 * MeasurePane.MinSize;
rectLimit.X = location.X;
if ((Control.ModifierKeys & Keys.Shift) == 0)
rectLimit.Width = Width;
}
return DockPanel.RectangleToScreen(rectLimit);
}
}
void ISplitterDragSource.MoveSplitter(int offset)
{
if ((Control.ModifierKeys & Keys.Shift) != 0)
SendToBack();
Rectangle rectDockArea = DockPanel.DockArea;
if (DockState == DockState.DockLeft && rectDockArea.Width > 0)
{
if (DockPanel.DockLeftPortion > 1)
DockPanel.DockLeftPortion = Width + offset;
else
DockPanel.DockLeftPortion += ((double)offset) / (double)rectDockArea.Width;
}
else if (DockState == DockState.DockRight && rectDockArea.Width > 0)
{
if (DockPanel.DockRightPortion > 1)
DockPanel.DockRightPortion = Width - offset;
else
DockPanel.DockRightPortion -= ((double)offset) / (double)rectDockArea.Width;
}
else if (DockState == DockState.DockBottom && rectDockArea.Height > 0)
{
if (DockPanel.DockBottomPortion > 1)
DockPanel.DockBottomPortion = Height - offset;
else
DockPanel.DockBottomPortion -= ((double)offset) / (double)rectDockArea.Height;
}
else if (DockState == DockState.DockTop && rectDockArea.Height > 0)
{
if (DockPanel.DockTopPortion > 1)
DockPanel.DockTopPortion = Height + offset;
else
DockPanel.DockTopPortion += ((double)offset) / (double)rectDockArea.Height;
}
}
#region IDragSource Members
Control IDragSource.DragControl
{
get { return this; }
}
#endregion
#endregion
}
}

View file

@ -1,38 +1,38 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace LSLEditor.Docking
{
public class DockWindowCollection : ReadOnlyCollection<DockWindow>
{
internal DockWindowCollection(DockPanel dockPanel)
: base(new List<DockWindow>())
{
Items.Add(new DockWindow(dockPanel, DockState.Document));
Items.Add(new DockWindow(dockPanel, DockState.DockLeft));
Items.Add(new DockWindow(dockPanel, DockState.DockRight));
Items.Add(new DockWindow(dockPanel, DockState.DockTop));
Items.Add(new DockWindow(dockPanel, DockState.DockBottom));
}
public DockWindow this [DockState dockState]
{
get
{
if (dockState == DockState.Document)
return Items[0];
else if (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide)
return Items[1];
else if (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide)
return Items[2];
else if (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide)
return Items[3];
else if (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide)
return Items[4];
throw (new ArgumentOutOfRangeException());
}
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace LSLEditor.Docking
{
public class DockWindowCollection : ReadOnlyCollection<DockWindow>
{
internal DockWindowCollection(DockPanel dockPanel)
: base(new List<DockWindow>())
{
Items.Add(new DockWindow(dockPanel, DockState.Document));
Items.Add(new DockWindow(dockPanel, DockState.DockLeft));
Items.Add(new DockWindow(dockPanel, DockState.DockRight));
Items.Add(new DockWindow(dockPanel, DockState.DockTop));
Items.Add(new DockWindow(dockPanel, DockState.DockBottom));
}
public DockWindow this [DockState dockState]
{
get
{
if (dockState == DockState.Document)
return Items[0];
else if (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide)
return Items[1];
else if (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide)
return Items[2];
else if (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide)
return Items[3];
else if (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide)
return Items[4];
throw (new ArgumentOutOfRangeException());
}
}
}
}

View file

@ -1,64 +1,64 @@
using System;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
// Inspired by Chris Sano's article:
// http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnwinforms/html/colorpicker.asp
// In Sano's article, the DragForm needs to meet the following criteria:
// (1) it was not to show up in the task bar;
// ShowInTaskBar = false
// (2) it needed to be the top-most window;
// TopMost = true (not necessary here)
// (3) its icon could not show up in the ALT+TAB window if the user pressed ALT+TAB during a drag-and-drop;
// FormBorderStyle = FormBorderStyle.None;
// Create with WS_EX_TOOLWINDOW window style.
// Compares with the solution in the artile by setting FormBorderStyle as FixedToolWindow,
// and then clip the window caption and border, this way is much simplier.
// (4) it was not to steal focus from the application when displayed.
// User Win32 ShowWindow API with SW_SHOWNOACTIVATE
// In addition, this form should only for display and therefore should act as transparent, otherwise
// WindowFromPoint will return this form, instead of the control beneath. Need BOTH of the following to
// achieve this (don't know why, spent hours to try it out :( ):
// 1. Enabled = false;
// 2. WM_NCHITTEST returns HTTRANSPARENT
internal class DragForm : Form
{
public DragForm()
{
FormBorderStyle = FormBorderStyle.None;
ShowInTaskbar = false;
SetStyle(ControlStyles.Selectable, false);
Enabled = false;
}
protected override CreateParams CreateParams
{
get
{
CreateParams createParams = base.CreateParams;
createParams.ExStyle |= (int)Win32.WindowExStyles.WS_EX_TOOLWINDOW;
return createParams;
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_NCHITTEST)
{
m.Result = (IntPtr)Win32.HitTest.HTTRANSPARENT;
return;
}
base.WndProc (ref m);
}
public virtual void Show(bool bActivate)
{
if (bActivate)
Show();
else
NativeMethods.ShowWindow(Handle, (int)Win32.ShowWindowStyles.SW_SHOWNOACTIVATE);
}
}
}
using System;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
// Inspired by Chris Sano's article:
// http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnwinforms/html/colorpicker.asp
// In Sano's article, the DragForm needs to meet the following criteria:
// (1) it was not to show up in the task bar;
// ShowInTaskBar = false
// (2) it needed to be the top-most window;
// TopMost = true (not necessary here)
// (3) its icon could not show up in the ALT+TAB window if the user pressed ALT+TAB during a drag-and-drop;
// FormBorderStyle = FormBorderStyle.None;
// Create with WS_EX_TOOLWINDOW window style.
// Compares with the solution in the artile by setting FormBorderStyle as FixedToolWindow,
// and then clip the window caption and border, this way is much simplier.
// (4) it was not to steal focus from the application when displayed.
// User Win32 ShowWindow API with SW_SHOWNOACTIVATE
// In addition, this form should only for display and therefore should act as transparent, otherwise
// WindowFromPoint will return this form, instead of the control beneath. Need BOTH of the following to
// achieve this (don't know why, spent hours to try it out :( ):
// 1. Enabled = false;
// 2. WM_NCHITTEST returns HTTRANSPARENT
internal class DragForm : Form
{
public DragForm()
{
FormBorderStyle = FormBorderStyle.None;
ShowInTaskbar = false;
SetStyle(ControlStyles.Selectable, false);
Enabled = false;
}
protected override CreateParams CreateParams
{
get
{
CreateParams createParams = base.CreateParams;
createParams.ExStyle |= (int)Win32.WindowExStyles.WS_EX_TOOLWINDOW;
return createParams;
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_NCHITTEST)
{
m.Result = (IntPtr)Win32.HitTest.HTTRANSPARENT;
return;
}
base.WndProc (ref m);
}
public virtual void Show(bool bActivate)
{
if (bActivate)
Show();
else
NativeMethods.ShowWindow(Handle, (int)Win32.ShowWindowStyles.SW_SHOWNOACTIVATE);
}
}
}

View file

@ -1,13 +1,13 @@
using System;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
internal class DummyControl : Control
{
public DummyControl()
{
SetStyle(ControlStyles.Selectable, false);
}
}
}
using System;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
internal class DummyControl : Control
{
public DummyControl()
{
SetStyle(ControlStyles.Selectable, false);
}
}
}

View file

@ -1,60 +1,60 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
[Flags]
[Serializable]
[Editor(typeof(DockAreasEditor), typeof(System.Drawing.Design.UITypeEditor))]
public enum DockAreas
{
Float = 1,
DockLeft = 2,
DockRight = 4,
DockTop = 8,
DockBottom = 16,
Document = 32
}
public enum DockState
{
Unknown = 0,
Float = 1,
DockTopAutoHide = 2,
DockLeftAutoHide = 3,
DockBottomAutoHide = 4,
DockRightAutoHide = 5,
Document = 6,
DockTop = 7,
DockLeft = 8,
DockBottom = 9,
DockRight = 10,
Hidden = 11
}
public enum DockAlignment
{
Left,
Right,
Top,
Bottom
}
public enum DocumentStyle
{
DockingMdi,
DockingWindow,
DockingSdi,
SystemMdi,
}
/// <summary>
/// The location to draw the DockPaneStrip for Document style windows.
/// </summary>
public enum DocumentTabStripLocation
{
Top,
Bottom
}
}
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
[Flags]
[Serializable]
[Editor(typeof(DockAreasEditor), typeof(System.Drawing.Design.UITypeEditor))]
public enum DockAreas
{
Float = 1,
DockLeft = 2,
DockRight = 4,
DockTop = 8,
DockBottom = 16,
Document = 32
}
public enum DockState
{
Unknown = 0,
Float = 1,
DockTopAutoHide = 2,
DockLeftAutoHide = 3,
DockBottomAutoHide = 4,
DockRightAutoHide = 5,
Document = 6,
DockTop = 7,
DockLeft = 8,
DockBottom = 9,
DockRight = 10,
Hidden = 11
}
public enum DockAlignment
{
Left,
Right,
Top,
Bottom
}
public enum DocumentStyle
{
DockingMdi,
DockingWindow,
DockingSdi,
SystemMdi,
}
/// <summary>
/// The location to draw the DockPaneStrip for Document style windows.
/// </summary>
public enum DocumentTabStripLocation
{
Top,
Bottom
}
}

View file

@ -1,453 +1,453 @@
using System;
using System.Collections;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Diagnostics.CodeAnalysis;
namespace LSLEditor.Docking
{
public class FloatWindow : Form, INestedPanesContainer, IDockDragSource
{
private NestedPaneCollection m_nestedPanes;
internal const int WM_CHECKDISPOSE = (int)(Win32.Msgs.WM_USER + 1);
internal protected FloatWindow(DockPanel dockPanel, DockPane pane)
{
InternalConstruct(dockPanel, pane, false, Rectangle.Empty);
}
internal protected FloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
{
InternalConstruct(dockPanel, pane, true, bounds);
}
private void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds)
{
if (dockPanel == null)
throw(new ArgumentNullException(Strings.FloatWindow_Constructor_NullDockPanel));
m_nestedPanes = new NestedPaneCollection(this);
FormBorderStyle = FormBorderStyle.SizableToolWindow;
ShowInTaskbar = false;
if (dockPanel.RightToLeft != RightToLeft)
RightToLeft = dockPanel.RightToLeft;
if (RightToLeftLayout != dockPanel.RightToLeftLayout)
RightToLeftLayout = dockPanel.RightToLeftLayout;
SuspendLayout();
if (boundsSpecified)
{
Bounds = bounds;
StartPosition = FormStartPosition.Manual;
}
else
{
StartPosition = FormStartPosition.WindowsDefaultLocation;
Size = dockPanel.DefaultFloatWindowSize;
}
m_dockPanel = dockPanel;
Owner = DockPanel.FindForm();
DockPanel.AddFloatWindow(this);
if (pane != null)
pane.FloatWindow = this;
ResumeLayout();
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (DockPanel != null)
DockPanel.RemoveFloatWindow(this);
m_dockPanel = null;
}
base.Dispose(disposing);
}
private bool m_allowEndUserDocking = true;
public bool AllowEndUserDocking
{
get { return m_allowEndUserDocking; }
set { m_allowEndUserDocking = value; }
}
public NestedPaneCollection NestedPanes
{
get { return m_nestedPanes; }
}
public VisibleNestedPaneCollection VisibleNestedPanes
{
get { return NestedPanes.VisibleNestedPanes; }
}
private DockPanel m_dockPanel;
public DockPanel DockPanel
{
get { return m_dockPanel; }
}
public DockState DockState
{
get { return DockState.Float; }
}
public bool IsFloat
{
get { return DockState == DockState.Float; }
}
internal bool IsDockStateValid(DockState dockState)
{
foreach (DockPane pane in NestedPanes)
foreach (IDockContent content in pane.Contents)
if (!DockHelper.IsDockStateValid(dockState, content.DockHandler.DockAreas))
return false;
return true;
}
protected override void OnActivated(EventArgs e)
{
DockPanel.FloatWindows.BringWindowToFront(this);
base.OnActivated (e);
// Propagate the Activated event to the visible panes content objects
foreach (DockPane pane in VisibleNestedPanes)
foreach (IDockContent content in pane.Contents)
content.OnActivated(e);
}
protected override void OnDeactivate(EventArgs e)
{
base.OnDeactivate(e);
// Propagate the Deactivate event to the visible panes content objects
foreach (DockPane pane in VisibleNestedPanes)
foreach (IDockContent content in pane.Contents)
content.OnDeactivate(e);
}
protected override void OnLayout(LayoutEventArgs levent)
{
VisibleNestedPanes.Refresh();
RefreshChanges();
Visible = (VisibleNestedPanes.Count > 0);
SetText();
base.OnLayout(levent);
}
[SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.Windows.Forms.Control.set_Text(System.String)")]
internal void SetText()
{
DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null;
if (theOnlyPane == null)
Text = " "; // use " " instead of string.Empty because the whole title bar will disappear when ControlBox is set to false.
else if (theOnlyPane.ActiveContent == null)
Text = " ";
else
Text = theOnlyPane.ActiveContent.DockHandler.TabText;
}
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
{
Rectangle rectWorkArea = SystemInformation.VirtualScreen;
if (y + height > rectWorkArea.Bottom)
y -= (y + height) - rectWorkArea.Bottom;
if (y < rectWorkArea.Top)
y += rectWorkArea.Top - y;
base.SetBoundsCore (x, y, width, height, specified);
}
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_NCLBUTTONDOWN)
{
if (IsDisposed)
return;
uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
if (result == 2 && DockPanel.AllowEndUserDocking && this.AllowEndUserDocking) // HITTEST_CAPTION
{
Activate();
m_dockPanel.BeginDrag(this);
}
else
base.WndProc(ref m);
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_NCRBUTTONDOWN)
{
uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
if (result == 2) // HITTEST_CAPTION
{
DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null;
if (theOnlyPane != null && theOnlyPane.ActiveContent != null)
{
theOnlyPane.ShowTabPageContextMenu(this, PointToClient(Control.MousePosition));
return;
}
}
base.WndProc(ref m);
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_CLOSE)
{
if (NestedPanes.Count == 0)
{
base.WndProc(ref m);
return;
}
for (int i = NestedPanes.Count - 1; i >= 0; i--)
{
DockContentCollection contents = NestedPanes[i].Contents;
for (int j = contents.Count - 1; j >= 0; j--)
{
IDockContent content = contents[j];
if (content.DockHandler.DockState != DockState.Float)
continue;
if (!content.DockHandler.CloseButton)
continue;
if (content.DockHandler.HideOnClose)
content.DockHandler.Hide();
else
content.DockHandler.Close();
}
}
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_NCLBUTTONDBLCLK)
{
uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
if (result != 2) // HITTEST_CAPTION
{
base.WndProc(ref m);
return;
}
DockPanel.SuspendLayout(true);
// Restore to panel
foreach (DockPane pane in NestedPanes)
{
if (pane.DockState != DockState.Float)
continue;
pane.RestoreToPanel();
}
DockPanel.ResumeLayout(true, true);
return;
}
else if (m.Msg == WM_CHECKDISPOSE)
{
if (NestedPanes.Count == 0)
Dispose();
return;
}
base.WndProc(ref m);
}
internal void RefreshChanges()
{
if (IsDisposed)
return;
if (VisibleNestedPanes.Count == 0)
{
ControlBox = true;
return;
}
for (int i=VisibleNestedPanes.Count - 1; i>=0; i--)
{
DockContentCollection contents = VisibleNestedPanes[i].Contents;
for (int j=contents.Count - 1; j>=0; j--)
{
IDockContent content = contents[j];
if (content.DockHandler.DockState != DockState.Float)
continue;
if (content.DockHandler.CloseButton && content.DockHandler.CloseButtonVisible)
{
ControlBox = true;
return;
}
}
}
//Only if there is a ControlBox do we turn it off
//old code caused a flash of the window.
if (ControlBox)
ControlBox = false;
}
public virtual Rectangle DisplayingRectangle
{
get { return ClientRectangle; }
}
internal void TestDrop(IDockDragSource dragSource, DockOutlineBase dockOutline)
{
if (VisibleNestedPanes.Count == 1)
{
DockPane pane = VisibleNestedPanes[0];
if (!dragSource.CanDockTo(pane))
return;
Point ptMouse = Control.MousePosition;
uint lParam = Win32Helper.MakeLong(ptMouse.X, ptMouse.Y);
if (NativeMethods.SendMessage(Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, lParam) == (uint)Win32.HitTest.HTCAPTION)
dockOutline.Show(VisibleNestedPanes[0], -1);
}
}
#region IDockDragSource Members
#region IDragSource Members
Control IDragSource.DragControl
{
get { return this; }
}
#endregion
bool IDockDragSource.IsDockStateValid(DockState dockState)
{
return IsDockStateValid(dockState);
}
bool IDockDragSource.CanDockTo(DockPane pane)
{
if (!IsDockStateValid(pane.DockState))
return false;
if (pane.FloatWindow == this)
return false;
return true;
}
Rectangle IDockDragSource.BeginDrag(Point ptMouse)
{
return Bounds;
}
public void FloatAt(Rectangle floatWindowBounds)
{
Bounds = floatWindowBounds;
}
public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
{
if (dockStyle == DockStyle.Fill)
{
for (int i = NestedPanes.Count - 1; i >= 0; i--)
{
DockPane paneFrom = NestedPanes[i];
for (int j = paneFrom.Contents.Count - 1; j >= 0; j--)
{
IDockContent c = paneFrom.Contents[j];
c.DockHandler.Pane = pane;
if (contentIndex != -1)
pane.SetContentIndex(c, contentIndex);
c.DockHandler.Activate();
}
}
}
else
{
DockAlignment alignment = DockAlignment.Left;
if (dockStyle == DockStyle.Left)
alignment = DockAlignment.Left;
else if (dockStyle == DockStyle.Right)
alignment = DockAlignment.Right;
else if (dockStyle == DockStyle.Top)
alignment = DockAlignment.Top;
else if (dockStyle == DockStyle.Bottom)
alignment = DockAlignment.Bottom;
MergeNestedPanes(VisibleNestedPanes, pane.NestedPanesContainer.NestedPanes, pane, alignment, 0.5);
}
}
public void DockTo(DockPanel panel, DockStyle dockStyle)
{
if (panel != DockPanel)
throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, "panel");
NestedPaneCollection nestedPanesTo = null;
if (dockStyle == DockStyle.Top)
nestedPanesTo = DockPanel.DockWindows[DockState.DockTop].NestedPanes;
else if (dockStyle == DockStyle.Bottom)
nestedPanesTo = DockPanel.DockWindows[DockState.DockBottom].NestedPanes;
else if (dockStyle == DockStyle.Left)
nestedPanesTo = DockPanel.DockWindows[DockState.DockLeft].NestedPanes;
else if (dockStyle == DockStyle.Right)
nestedPanesTo = DockPanel.DockWindows[DockState.DockRight].NestedPanes;
else if (dockStyle == DockStyle.Fill)
nestedPanesTo = DockPanel.DockWindows[DockState.Document].NestedPanes;
DockPane prevPane = null;
for (int i = nestedPanesTo.Count - 1; i >= 0; i--)
if (nestedPanesTo[i] != VisibleNestedPanes[0])
prevPane = nestedPanesTo[i];
MergeNestedPanes(VisibleNestedPanes, nestedPanesTo, prevPane, DockAlignment.Left, 0.5);
}
private static void MergeNestedPanes(VisibleNestedPaneCollection nestedPanesFrom, NestedPaneCollection nestedPanesTo, DockPane prevPane, DockAlignment alignment, double proportion)
{
if (nestedPanesFrom.Count == 0)
return;
int count = nestedPanesFrom.Count;
DockPane[] panes = new DockPane[count];
DockPane[] prevPanes = new DockPane[count];
DockAlignment[] alignments = new DockAlignment[count];
double[] proportions = new double[count];
for (int i = 0; i < count; i++)
{
panes[i] = nestedPanesFrom[i];
prevPanes[i] = nestedPanesFrom[i].NestedDockingStatus.PreviousPane;
alignments[i] = nestedPanesFrom[i].NestedDockingStatus.Alignment;
proportions[i] = nestedPanesFrom[i].NestedDockingStatus.Proportion;
}
DockPane pane = panes[0].DockTo(nestedPanesTo.Container, prevPane, alignment, proportion);
panes[0].DockState = nestedPanesTo.DockState;
for (int i = 1; i < count; i++)
{
for (int j = i; j < count; j++)
{
if (prevPanes[j] == panes[i - 1])
prevPanes[j] = pane;
}
pane = panes[i].DockTo(nestedPanesTo.Container, prevPanes[i], alignments[i], proportions[i]);
panes[i].DockState = nestedPanesTo.DockState;
}
}
#endregion
}
}
using System;
using System.Collections;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Diagnostics.CodeAnalysis;
namespace LSLEditor.Docking
{
public class FloatWindow : Form, INestedPanesContainer, IDockDragSource
{
private NestedPaneCollection m_nestedPanes;
internal const int WM_CHECKDISPOSE = (int)(Win32.Msgs.WM_USER + 1);
internal protected FloatWindow(DockPanel dockPanel, DockPane pane)
{
InternalConstruct(dockPanel, pane, false, Rectangle.Empty);
}
internal protected FloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
{
InternalConstruct(dockPanel, pane, true, bounds);
}
private void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds)
{
if (dockPanel == null)
throw(new ArgumentNullException(Strings.FloatWindow_Constructor_NullDockPanel));
m_nestedPanes = new NestedPaneCollection(this);
FormBorderStyle = FormBorderStyle.SizableToolWindow;
ShowInTaskbar = false;
if (dockPanel.RightToLeft != RightToLeft)
RightToLeft = dockPanel.RightToLeft;
if (RightToLeftLayout != dockPanel.RightToLeftLayout)
RightToLeftLayout = dockPanel.RightToLeftLayout;
SuspendLayout();
if (boundsSpecified)
{
Bounds = bounds;
StartPosition = FormStartPosition.Manual;
}
else
{
StartPosition = FormStartPosition.WindowsDefaultLocation;
Size = dockPanel.DefaultFloatWindowSize;
}
m_dockPanel = dockPanel;
Owner = DockPanel.FindForm();
DockPanel.AddFloatWindow(this);
if (pane != null)
pane.FloatWindow = this;
ResumeLayout();
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (DockPanel != null)
DockPanel.RemoveFloatWindow(this);
m_dockPanel = null;
}
base.Dispose(disposing);
}
private bool m_allowEndUserDocking = true;
public bool AllowEndUserDocking
{
get { return m_allowEndUserDocking; }
set { m_allowEndUserDocking = value; }
}
public NestedPaneCollection NestedPanes
{
get { return m_nestedPanes; }
}
public VisibleNestedPaneCollection VisibleNestedPanes
{
get { return NestedPanes.VisibleNestedPanes; }
}
private DockPanel m_dockPanel;
public DockPanel DockPanel
{
get { return m_dockPanel; }
}
public DockState DockState
{
get { return DockState.Float; }
}
public bool IsFloat
{
get { return DockState == DockState.Float; }
}
internal bool IsDockStateValid(DockState dockState)
{
foreach (DockPane pane in NestedPanes)
foreach (IDockContent content in pane.Contents)
if (!DockHelper.IsDockStateValid(dockState, content.DockHandler.DockAreas))
return false;
return true;
}
protected override void OnActivated(EventArgs e)
{
DockPanel.FloatWindows.BringWindowToFront(this);
base.OnActivated (e);
// Propagate the Activated event to the visible panes content objects
foreach (DockPane pane in VisibleNestedPanes)
foreach (IDockContent content in pane.Contents)
content.OnActivated(e);
}
protected override void OnDeactivate(EventArgs e)
{
base.OnDeactivate(e);
// Propagate the Deactivate event to the visible panes content objects
foreach (DockPane pane in VisibleNestedPanes)
foreach (IDockContent content in pane.Contents)
content.OnDeactivate(e);
}
protected override void OnLayout(LayoutEventArgs levent)
{
VisibleNestedPanes.Refresh();
RefreshChanges();
Visible = (VisibleNestedPanes.Count > 0);
SetText();
base.OnLayout(levent);
}
[SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.Windows.Forms.Control.set_Text(System.String)")]
internal void SetText()
{
DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null;
if (theOnlyPane == null)
Text = " "; // use " " instead of string.Empty because the whole title bar will disappear when ControlBox is set to false.
else if (theOnlyPane.ActiveContent == null)
Text = " ";
else
Text = theOnlyPane.ActiveContent.DockHandler.TabText;
}
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
{
Rectangle rectWorkArea = SystemInformation.VirtualScreen;
if (y + height > rectWorkArea.Bottom)
y -= (y + height) - rectWorkArea.Bottom;
if (y < rectWorkArea.Top)
y += rectWorkArea.Top - y;
base.SetBoundsCore (x, y, width, height, specified);
}
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)Win32.Msgs.WM_NCLBUTTONDOWN)
{
if (IsDisposed)
return;
uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
if (result == 2 && DockPanel.AllowEndUserDocking && this.AllowEndUserDocking) // HITTEST_CAPTION
{
Activate();
m_dockPanel.BeginDrag(this);
}
else
base.WndProc(ref m);
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_NCRBUTTONDOWN)
{
uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
if (result == 2) // HITTEST_CAPTION
{
DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null;
if (theOnlyPane != null && theOnlyPane.ActiveContent != null)
{
theOnlyPane.ShowTabPageContextMenu(this, PointToClient(Control.MousePosition));
return;
}
}
base.WndProc(ref m);
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_CLOSE)
{
if (NestedPanes.Count == 0)
{
base.WndProc(ref m);
return;
}
for (int i = NestedPanes.Count - 1; i >= 0; i--)
{
DockContentCollection contents = NestedPanes[i].Contents;
for (int j = contents.Count - 1; j >= 0; j--)
{
IDockContent content = contents[j];
if (content.DockHandler.DockState != DockState.Float)
continue;
if (!content.DockHandler.CloseButton)
continue;
if (content.DockHandler.HideOnClose)
content.DockHandler.Hide();
else
content.DockHandler.Close();
}
}
return;
}
else if (m.Msg == (int)Win32.Msgs.WM_NCLBUTTONDBLCLK)
{
uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
if (result != 2) // HITTEST_CAPTION
{
base.WndProc(ref m);
return;
}
DockPanel.SuspendLayout(true);
// Restore to panel
foreach (DockPane pane in NestedPanes)
{
if (pane.DockState != DockState.Float)
continue;
pane.RestoreToPanel();
}
DockPanel.ResumeLayout(true, true);
return;
}
else if (m.Msg == WM_CHECKDISPOSE)
{
if (NestedPanes.Count == 0)
Dispose();
return;
}
base.WndProc(ref m);
}
internal void RefreshChanges()
{
if (IsDisposed)
return;
if (VisibleNestedPanes.Count == 0)
{
ControlBox = true;
return;
}
for (int i=VisibleNestedPanes.Count - 1; i>=0; i--)
{
DockContentCollection contents = VisibleNestedPanes[i].Contents;
for (int j=contents.Count - 1; j>=0; j--)
{
IDockContent content = contents[j];
if (content.DockHandler.DockState != DockState.Float)
continue;
if (content.DockHandler.CloseButton && content.DockHandler.CloseButtonVisible)
{
ControlBox = true;
return;
}
}
}
//Only if there is a ControlBox do we turn it off
//old code caused a flash of the window.
if (ControlBox)
ControlBox = false;
}
public virtual Rectangle DisplayingRectangle
{
get { return ClientRectangle; }
}
internal void TestDrop(IDockDragSource dragSource, DockOutlineBase dockOutline)
{
if (VisibleNestedPanes.Count == 1)
{
DockPane pane = VisibleNestedPanes[0];
if (!dragSource.CanDockTo(pane))
return;
Point ptMouse = Control.MousePosition;
uint lParam = Win32Helper.MakeLong(ptMouse.X, ptMouse.Y);
if (NativeMethods.SendMessage(Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, lParam) == (uint)Win32.HitTest.HTCAPTION)
dockOutline.Show(VisibleNestedPanes[0], -1);
}
}
#region IDockDragSource Members
#region IDragSource Members
Control IDragSource.DragControl
{
get { return this; }
}
#endregion
bool IDockDragSource.IsDockStateValid(DockState dockState)
{
return IsDockStateValid(dockState);
}
bool IDockDragSource.CanDockTo(DockPane pane)
{
if (!IsDockStateValid(pane.DockState))
return false;
if (pane.FloatWindow == this)
return false;
return true;
}
Rectangle IDockDragSource.BeginDrag(Point ptMouse)
{
return Bounds;
}
public void FloatAt(Rectangle floatWindowBounds)
{
Bounds = floatWindowBounds;
}
public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
{
if (dockStyle == DockStyle.Fill)
{
for (int i = NestedPanes.Count - 1; i >= 0; i--)
{
DockPane paneFrom = NestedPanes[i];
for (int j = paneFrom.Contents.Count - 1; j >= 0; j--)
{
IDockContent c = paneFrom.Contents[j];
c.DockHandler.Pane = pane;
if (contentIndex != -1)
pane.SetContentIndex(c, contentIndex);
c.DockHandler.Activate();
}
}
}
else
{
DockAlignment alignment = DockAlignment.Left;
if (dockStyle == DockStyle.Left)
alignment = DockAlignment.Left;
else if (dockStyle == DockStyle.Right)
alignment = DockAlignment.Right;
else if (dockStyle == DockStyle.Top)
alignment = DockAlignment.Top;
else if (dockStyle == DockStyle.Bottom)
alignment = DockAlignment.Bottom;
MergeNestedPanes(VisibleNestedPanes, pane.NestedPanesContainer.NestedPanes, pane, alignment, 0.5);
}
}
public void DockTo(DockPanel panel, DockStyle dockStyle)
{
if (panel != DockPanel)
throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, "panel");
NestedPaneCollection nestedPanesTo = null;
if (dockStyle == DockStyle.Top)
nestedPanesTo = DockPanel.DockWindows[DockState.DockTop].NestedPanes;
else if (dockStyle == DockStyle.Bottom)
nestedPanesTo = DockPanel.DockWindows[DockState.DockBottom].NestedPanes;
else if (dockStyle == DockStyle.Left)
nestedPanesTo = DockPanel.DockWindows[DockState.DockLeft].NestedPanes;
else if (dockStyle == DockStyle.Right)
nestedPanesTo = DockPanel.DockWindows[DockState.DockRight].NestedPanes;
else if (dockStyle == DockStyle.Fill)
nestedPanesTo = DockPanel.DockWindows[DockState.Document].NestedPanes;
DockPane prevPane = null;
for (int i = nestedPanesTo.Count - 1; i >= 0; i--)
if (nestedPanesTo[i] != VisibleNestedPanes[0])
prevPane = nestedPanesTo[i];
MergeNestedPanes(VisibleNestedPanes, nestedPanesTo, prevPane, DockAlignment.Left, 0.5);
}
private static void MergeNestedPanes(VisibleNestedPaneCollection nestedPanesFrom, NestedPaneCollection nestedPanesTo, DockPane prevPane, DockAlignment alignment, double proportion)
{
if (nestedPanesFrom.Count == 0)
return;
int count = nestedPanesFrom.Count;
DockPane[] panes = new DockPane[count];
DockPane[] prevPanes = new DockPane[count];
DockAlignment[] alignments = new DockAlignment[count];
double[] proportions = new double[count];
for (int i = 0; i < count; i++)
{
panes[i] = nestedPanesFrom[i];
prevPanes[i] = nestedPanesFrom[i].NestedDockingStatus.PreviousPane;
alignments[i] = nestedPanesFrom[i].NestedDockingStatus.Alignment;
proportions[i] = nestedPanesFrom[i].NestedDockingStatus.Proportion;
}
DockPane pane = panes[0].DockTo(nestedPanesTo.Container, prevPane, alignment, proportion);
panes[0].DockState = nestedPanesTo.DockState;
for (int i = 1; i < count; i++)
{
for (int j = i; j < count; j++)
{
if (prevPanes[j] == panes[i - 1])
prevPanes[j] = pane;
}
pane = panes[i].DockTo(nestedPanesTo.Container, prevPanes[i], alignments[i], proportions[i]);
panes[i].DockState = nestedPanesTo.DockState;
}
}
#endregion
}
}

View file

@ -1,42 +1,42 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
public class FloatWindowCollection : ReadOnlyCollection<FloatWindow>
{
internal FloatWindowCollection()
: base(new List<FloatWindow>())
{
}
internal int Add(FloatWindow fw)
{
if (Items.Contains(fw))
return Items.IndexOf(fw);
Items.Add(fw);
return Count - 1;
}
internal void Dispose()
{
for (int i=Count - 1; i>=0; i--)
this[i].Close();
}
internal void Remove(FloatWindow fw)
{
Items.Remove(fw);
}
internal void BringWindowToFront(FloatWindow fw)
{
Items.Remove(fw);
Items.Add(fw);
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
public class FloatWindowCollection : ReadOnlyCollection<FloatWindow>
{
internal FloatWindowCollection()
: base(new List<FloatWindow>())
{
}
internal int Add(FloatWindow fw)
{
if (Items.Contains(fw))
return Items.IndexOf(fw);
Items.Add(fw);
return Count - 1;
}
internal void Dispose()
{
for (int i=Count - 1; i>=0; i--)
this[i].Close();
}
internal void Remove(FloatWindow fw)
{
Items.Remove(fw);
}
internal void BringWindowToFront(FloatWindow fw)
{
Items.Remove(fw);
Items.Add(fw);
}
}
}

View file

@ -1,103 +1,103 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
internal static class DockHelper
{
public static bool IsDockStateAutoHide(DockState dockState)
{
if (dockState == DockState.DockLeftAutoHide ||
dockState == DockState.DockRightAutoHide ||
dockState == DockState.DockTopAutoHide ||
dockState == DockState.DockBottomAutoHide)
return true;
else
return false;
}
public static bool IsDockStateValid(DockState dockState, DockAreas dockableAreas)
{
if (((dockableAreas & DockAreas.Float) == 0) &&
(dockState == DockState.Float))
return false;
else if (((dockableAreas & DockAreas.Document) == 0) &&
(dockState == DockState.Document))
return false;
else if (((dockableAreas & DockAreas.DockLeft) == 0) &&
(dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide))
return false;
else if (((dockableAreas & DockAreas.DockRight) == 0) &&
(dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide))
return false;
else if (((dockableAreas & DockAreas.DockTop) == 0) &&
(dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide))
return false;
else if (((dockableAreas & DockAreas.DockBottom) == 0) &&
(dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide))
return false;
else
return true;
}
public static bool IsDockWindowState(DockState state)
{
if (state == DockState.DockTop || state == DockState.DockBottom || state == DockState.DockLeft ||
state == DockState.DockRight || state == DockState.Document)
return true;
else
return false;
}
public static DockState ToggleAutoHideState(DockState state)
{
if (state == DockState.DockLeft)
return DockState.DockLeftAutoHide;
else if (state == DockState.DockRight)
return DockState.DockRightAutoHide;
else if (state == DockState.DockTop)
return DockState.DockTopAutoHide;
else if (state == DockState.DockBottom)
return DockState.DockBottomAutoHide;
else if (state == DockState.DockLeftAutoHide)
return DockState.DockLeft;
else if (state == DockState.DockRightAutoHide)
return DockState.DockRight;
else if (state == DockState.DockTopAutoHide)
return DockState.DockTop;
else if (state == DockState.DockBottomAutoHide)
return DockState.DockBottom;
else
return state;
}
public static DockPane PaneAtPoint(Point pt, DockPanel dockPanel)
{
for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
{
IDockContent content = control as IDockContent;
if (content != null && content.DockHandler.DockPanel == dockPanel)
return content.DockHandler.Pane;
DockPane pane = control as DockPane;
if (pane != null && pane.DockPanel == dockPanel)
return pane;
}
return null;
}
public static FloatWindow FloatWindowAtPoint(Point pt, DockPanel dockPanel)
{
for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
{
FloatWindow floatWindow = control as FloatWindow;
if (floatWindow != null && floatWindow.DockPanel == dockPanel)
return floatWindow;
}
return null;
}
}
}
using System;
using System.Drawing;
using System.Windows.Forms;
namespace LSLEditor.Docking
{
internal static class DockHelper
{
public static bool IsDockStateAutoHide(DockState dockState)
{
if (dockState == DockState.DockLeftAutoHide ||
dockState == DockState.DockRightAutoHide ||
dockState == DockState.DockTopAutoHide ||
dockState == DockState.DockBottomAutoHide)
return true;
else
return false;
}
public static bool IsDockStateValid(DockState dockState, DockAreas dockableAreas)
{
if (((dockableAreas & DockAreas.Float) == 0) &&
(dockState == DockState.Float))
return false;
else if (((dockableAreas & DockAreas.Document) == 0) &&
(dockState == DockState.Document))
return false;
else if (((dockableAreas & DockAreas.DockLeft) == 0) &&
(dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide))
return false;
else if (((dockableAreas & DockAreas.DockRight) == 0) &&
(dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide))
return false;
else if (((dockableAreas & DockAreas.DockTop) == 0) &&
(dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide))
return false;
else if (((dockableAreas & DockAreas.DockBottom) == 0) &&
(dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide))
return false;
else
return true;
}
public static bool IsDockWindowState(DockState state)
{
if (state == DockState.DockTop || state == DockState.DockBottom || state == DockState.DockLeft ||
state == DockState.DockRight || state == DockState.Document)
return true;
else
return false;
}
public static DockState ToggleAutoHideState(DockState state)
{
if (state == DockState.DockLeft)
return DockState.DockLeftAutoHide;
else if (state == DockState.DockRight)
return DockState.DockRightAutoHide;
else if (state == DockState.DockTop)
return DockState.DockTopAutoHide;
else if (state == DockState.DockBottom)
return DockState.DockBottomAutoHide;
else if (state == DockState.DockLeftAutoHide)
return DockState.DockLeft;
else if (state == DockState.DockRightAutoHide)
return DockState.DockRight;
else if (state == DockState.DockTopAutoHide)
return DockState.DockTop;
else if (state == DockState.DockBottomAutoHide)
return DockState.DockBottom;
else
return state;
}
public static DockPane PaneAtPoint(Point pt, DockPanel dockPanel)
{
for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
{
IDockContent content = control as IDockContent;
if (content != null && content.DockHandler.DockPanel == dockPanel)
return content.DockHandler.Pane;
DockPane pane = control as DockPane;
if (pane != null && pane.DockPanel == dockPanel)
return pane;
}
return null;
}
public static FloatWindow FloatWindowAtPoint(Point pt, DockPanel dockPanel)
{
for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
{
FloatWindow floatWindow = control as FloatWindow;
if (floatWindow != null && floatWindow.DockPanel == dockPanel)
return floatWindow;
}
return null;
}
}
}

Some files were not shown because too many files have changed in this diff Show more