Compare commits

...
Sign in to create a new pull request.

209 commits
next ... master

Author SHA1 Message Date
391fe9e106 Fix more references to images to prevent a crash 2022-12-15 09:50:06 -07:00
71cf04e433 Milestone: Got LSL Editor to open once more 2022-12-15 09:42:07 -07:00
96c2e0f49c Comment out until it compiles! 2022-11-20 17:50:41 -07:00
a3d8b659a5 Resolve most compile issues related to the Form1
Also adds notes about Form1's old usage of a deprecated class.
2022-11-20 10:51:02 -07:00
eb638f9d0f Batch update: Fix most issues 2022-11-20 09:08:34 -07:00
514015e45b Fix up a bunch of compile errors 2022-11-20 08:08:51 -07:00
70dfdbc77e Upgrade solution and project 2022-11-20 07:23:22 -07:00
247102af84 Move solution file! 2022-11-20 07:08:40 -07:00
7f7f8970bc Make structural changes to repository
Modernizes the repository
2022-11-20 07:05:44 -07:00
a67593b58f
Create LICENSE 2022-11-20 06:59:16 -07:00
Jasper Wiggerink
85df205a44 Assembly info 2018-01-29 12:32:15 +01:00
User
0d8bda717d Release notes 2018-01-18 14:45:53 +01:00
User
ac2de4fcfa Release notes 2018-01-15 13:49:41 +01:00
User
7484b886af Version 2018-01-11 15:17:53 +01:00
User
5d5684ecb5 Merge include functionality in master 2018-01-11 10:43:10 +01:00
User
17fef905a7 merge osprimitives into master 2018-01-11 10:37:24 +01:00
User
433da987f2 csproj 2018-01-11 10:34:29 +01:00
User
123808c7d5 Fix bug show include errors 2017-12-21 10:47:55 +01:00
User
b7911a5b87 Settings, bug fixes and extra functionalities 2017-11-07 15:20:29 +01:00
User
334359ac96 Export functionality, bug fixes 2017-10-27 15:45:11 +02:00
User
086f7d2887 LSLIPathHelper and updates 2017-10-26 14:50:23 +02:00
User
8d6b35dade Lot's of bug fixes and features 2017-10-16 14:55:51 +02:00
User
c9baf200f7 Basic functionality 2017-10-09 10:54:25 +02:00
User
a07ccf6726 git ignore 2017-10-03 11:29:21 +02:00
User
a98fd67fb8 gitignore 2017-10-03 11:26:34 +02:00
User
3b9c2f6d27 Format string 2017-10-02 09:26:39 +02:00
User
67abbddc8f All functions 2017-09-28 15:28:09 +02:00
User
d7d080961e First few ossl functions 2017-09-21 14:23:49 +02:00
Ima Mechanique
24f25ee6bd Bumping version number for release. 2013-10-18 18:31:20 +01:00
Ima Mechanique
427ad53d23 Adding the JSON_DELETE constant. 2013-10-18 18:27:59 +01:00
Ima Mechanique
65f9678930 Changing build to create the documentation xml file. 2013-07-20 18:14:13 +01:00
Ima Mechanique
6bf275439a Replacing empty parenthesis for functions with the word 'void' to allow autocomplete to work. 2013-07-18 22:31:39 +01:00
Ima Mechanique
bf211138f8 Merge branch 'dev-v3-audit-style' into dev-autocomplete 2013-07-18 19:30:20 +01:00
Ima Mechanique
efaa845095 Fixing StyleCop violations. 2013-07-18 19:25:47 +01:00
Ima Mechanique
40862a4ad7 Fixing white space and naming style. 2013-07-18 19:25:38 +01:00
Ima Mechanique
69749abe53 Disabling the "Fields Must be private" rule (SA1401). 2013-07-17 18:31:52 +01:00
Ima Mechanique
531bfe8728 Adding SecondLifeHost.cs to StyleCop policing. 2013-07-17 17:58:38 +01:00
Ima Mechanique
2df884b7e8 Fixing some trailing white space. 2013-07-17 16:25:50 +01:00
Ima Mechanique
5ecbdecaf3 Changing formatting of file-header/copyright statement. 2013-07-17 16:23:54 +01:00
Ima Mechanique
89de5582f5 Moving StyleCop SuppressMessage to start of code. 2013-07-16 18:38:44 +01:00
Ima Mechanique
2d79d6f56f Fixing StyleCop violations. 2013-07-16 18:29:01 +01:00
Ima Mechanique
4207586fe5 Adding SecondLife/Float.cs to StyleCop policing. 2013-07-16 17:37:10 +01:00
Ima Mechanique
3f0e973a81 Fixing a typo. 2013-07-16 17:33:31 +01:00
Ima Mechanique
5601de60d3 Added LSL_Events to StyleCop policing. 2013-07-16 17:33:13 +01:00
Ima Mechanique
73e7084458 Fixing StyleCop violations. 2013-07-16 17:21:34 +01:00
Ima Mechanique
1265264cc7 Moving StyleCop's setings file out of source tree. 2013-07-16 16:50:22 +01:00
Ima Mechanique
6baa0a1beb Adding LSL_Functions to StyleCop Policing. 2013-07-16 16:49:43 +01:00
Ima Mechanique
87598963e7 Adding constants to StyleCop policing. 2013-07-16 16:47:51 +01:00
Ima Mechanique
bc8082b003 Fixing some StyleCop violations. 2013-07-16 16:47:13 +01:00
Ima Mechanique
b54ae2b89d Renaming constant, event, function, and host files. 2013-07-16 14:14:34 +01:00
Ima Mechanique
e08b64474d Merge branch 'dev-v3-audit-style' into dev-v3 2013-07-16 14:04:50 +01:00
Ima Mechanique
907d306c05 Merge branch 'dev-v3' into dev-next 2013-07-16 13:49:00 +01:00
Ima Mechanique
e05ab6ae1e Splitting Constants, Events, and Functions into seperate files. This should make it easier to automate checking/updating them later. 2013-07-15 21:30:36 +01:00
Ima Mechanique
d185e8967e Updating copyright date 2013-07-15 21:27:07 +01:00
Ima Mechanique
0af6c22404 Ficing version number which accidentally got the v3-dev bump merged. 2013-07-15 21:18:22 +01:00
Ima Mechanique
cb03ca2168 Adding constant JSON_APPEND 2013-07-15 21:05:51 +01:00
Ima Mechanique
961ddfa78f Adding missing JSON APPEND constant. 2013-07-15 21:02:04 +01:00
Ima Mechanique
8f1ef1581c Adding missing JSON APPEND constant. 2013-07-15 21:01:22 +01:00
Ima Mechanique
571f034395 Updating first batch of files. 2013-07-15 21:00:09 +01:00
Ima Mechanique
afddb63ecc Adding StyleCop changes to allow style enforcement. 2013-07-15 20:58:55 +01:00
Ima Mechanique
af230cbed7 Fixing indentation and braces in trunk/ 2013-07-14 16:49:03 +01:00
Ima Mechanique
6437594240 Fixing a few missed braces. 2013-07-14 12:37:16 +01:00
Ima Mechanique
52b52a2fa7 Renaming variables and fixing methods to have a single return. 2013-07-14 11:46:16 +01:00
Ima Mechanique
8d7cab032f Fixing indents and braces. 2013-07-14 07:50:24 +01:00
Ima Mechanique
f738a42e11 Merge branch 'dev-v3' into dev-v3-audit-style 2013-07-14 07:03:12 +01:00
Ima Mechanique
0e35b7e927 Splitting Constants, Events, and Functions into seperate files. This should make it easier to automate checking/updating them later. 2013-07-14 07:00:47 +01:00
Ima Mechanique
56d4d5a883 Merge branch 'dev-v3' into dev-v3-audit-style 2013-07-14 04:20:53 +01:00
Ima Mechanique
0c774368f9 Moving AssemblyRevisionIncrementer into repo tree. 2013-07-14 04:19:43 +01:00
Ima Mechanique
546be43b01 Merge branch 'dev-v3' into dev-v3-audit-style 2013-07-14 03:59:42 +01:00
Ima Mechanique
1c685b74c4 Moving AssemblyRevisionIncrementer into repo tree. 2013-07-14 03:53:26 +01:00
Ima Mechanique
7f06c5050c Adding new post-build event that updates AssemblyInfo.cs 'revision' on successful build. 2013-07-13 14:14:35 +01:00
Ima Mechanique
468aecd0b9 Merge branch 'dev-v3' into dev-v3-audit-style 2013-07-13 13:53:20 +01:00
Ima Mechanique
4b1ca5cae7 Adding new post-build event that updates AssemblyInfo.cs 'revision' on successful build. 2013-07-13 13:53:06 +01:00
Ima Mechanique
95889e1a35 Fixing return value that I missed during style fix. 2013-07-13 13:51:25 +01:00
Ima Mechanique
52be06be96 Updating copyright date 2013-07-13 12:36:00 +01:00
Ima Mechanique
3542169d5d Merge branch 'dev-v3' into dev-v3-audit-style 2013-07-13 12:03:40 +01:00
Ima Mechanique
49c12fbe6d Removing _ReSharper directory and contents. 2013-07-13 12:03:25 +01:00
Ima Mechanique
8661094ddd Fixing whitespace/formatting style. 2013-07-13 11:42:48 +01:00
Ima Mechanique
3bc95288c5 Bumping version number to 2.999.999.x 2013-07-13 03:11:22 +01:00
Ima Mechanique
f042d61218 Style clenup of functions final batch 2013-07-13 03:01:08 +01:00
Ima Mechanique
cfada14ef7 Style clenup of functions llMessageLinked. - llRequestSecureURL 2013-07-11 02:25:18 +01:00
Ima Mechanique
ef91041a0c Merge branch 'dev-v3' into dev-v3-stub-audit 2013-07-11 01:21:29 +01:00
Ima Mechanique
d14fb73355 Merge branch 'dev-next' into dev-v3 2013-07-11 01:20:16 +01:00
Ima Mechanique
987c2ad77f Adding neew function stubs, constant entries. Moving llXorBase64StringsCorrect to deprecated functions. 2013-07-11 01:18:32 +01:00
Ima Mechanique
01cf42fe07 Cleaning up code fixing bug 2013-07-10 23:49:49 +01:00
Ima Mechanique
5a871a9792 Fixing parameter in function 2013-07-10 23:49:22 +01:00
Ima Mechanique
cd9d030aee Backporting style changes from dev-v3 2013-07-10 23:48:19 +01:00
Ima Mechanique
254790613c Adding properties for ParcelID and ParcelSeeAvatars. 2013-07-10 23:42:57 +01:00
Ima Mechanique
ebf2d3512c Adding highlighting for constants AVOID_NONE, OBJECT_CHARACTER_TIME, PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED, PU_FAILURE_PARCEL_UNREACHABLE and functions llGetStaticPath, llXorBase64. 2013-07-10 22:54:34 +01:00
Ima Mechanique
759581c095 Style clenup of functions llGetWallclock - llMessageLinked. 2013-07-10 22:51:08 +01:00
Ima Mechanique
afd8520899 Style clenup of functions llGetClosestNavPoint - llGetWallclock. 2013-07-07 22:18:42 +01:00
Ima Mechanique
740e4aec52 Fixed misnamed function 2013-07-07 22:18:28 +01:00
Ima Mechanique
b3957ffa99 Adding properties for ParcelID and ParcelSeeAvatars. 2013-07-07 22:14:43 +01:00
Ima Mechanique
d4e2203d43 Merge branch 'dev-stub-audit' into dev-v3 2013-07-07 18:24:04 +01:00
Ima Mechanique
c90ec56a84 Merge branch 'master' into dev-v3 2013-07-07 18:22:40 +01:00
Ima Mechanique
54b3d31d57 Removing json.cs which was accidentally merged into next. 2013-07-07 18:20:27 +01:00
Ima Mechanique
8512eead10 Merge branch 'master' into dev-v3 2013-07-07 05:00:28 +01:00
Ima Mechanique
7260dbd9de Merge branch 'master' into dev-stub-audit 2013-07-07 04:47:57 +01:00
Ima Mechanique
7a2e6b5ad7 Tagging version at v2.53.1 2013-07-07 04:45:28 +01:00
Ima Mechanique
b69bfee3fe Fixing indentation whitespace. 2013-07-07 04:38:17 +01:00
Ima Mechanique
e354bfcdd4 Style clenup of functions llAbs - llGetClosestNavPoint. 2013-07-07 01:28:41 +01:00
Ima Mechanique
33df6d8148 Adding required property setting for printing on AMD64 CPUs, plus code cleanup. 2013-07-05 20:58:01 +01:00
Ima Mechanique
2b0deb49e1 Starting investigation of print (preview) failures. 2013-07-03 22:22:09 +01:00
Ima Mechanique
13667e5a3c Starting work on JSON functionality. 2013-07-03 04:35:14 +01:00
Ima Mechanique
c54b50b4a0 Adding new parcel return constants and functions. 2013-07-03 04:29:46 +01:00
Ima Mechanique
0273bbb9d6 Merge branch 'dev-next' 2013-06-22 09:35:56 +01:00
Ima Mechanique
dc4af94aa9 Updating version numbers 2013-06-22 09:35:49 +01:00
Ima Mechanique
1f868c91ad Adding JSON constants and functions. 2013-06-22 09:34:16 +01:00
Ima Mechanique
cfdec7300b Fixing some formatting. 2013-06-22 07:01:43 +01:00
Ima Mechanique
c8a37b66bc Releasing 2.51.0 2013-05-16 15:12:12 +01:00
Ima Mechanique
a4ccd96bb9 Stopping signing assembly as the certificate ran out and it is too much hassle getting a free/open source one. 2013-05-16 15:11:40 +01:00
Ima Mechanique
e84ab1fe5a Tagged and built for v2.50.0 2013-03-04 14:47:36 +00:00
Ima Mechanique
76be31637e Updated release date. 2013-03-04 13:52:03 +00:00
Ima Mechanique
484b33d422 Merge branch 'dev-next' 2013-03-04 13:51:35 +00:00
Ima Mechanique
b83574ac0c Adding missing llGenerate function. 2013-02-25 23:50:26 +00:00
Ima Mechanique
a544d1b4ac Merge branch 'dev-next' into dev-syntax-code-highlighting 2013-02-25 23:32:58 +00:00
Ima Mechanique
582963ba18 Bumped release version 2013-02-14 18:11:35 +00:00
Ima Mechanique
0bb0e8a104 Adding constants ATTACH_AVATAR_CENTER and ATTACH_NECK 2013-02-14 18:08:42 +00:00
Ima Mechanique
22b4795ea5 Branching to start work on v3 overhaul. 2012-12-28 03:01:42 +00:00
Ima Mechanique
e9b5a4f825 Merge branch 'dev-next' into dev-syntax-code 2012-12-28 02:51:15 +00:00
Ima Mechanique
6152c2a509 Updating version numbers 2012-12-28 02:43:00 +00:00
Ima Mechanique
7d8a3ae47f Adding constants: OBJECT_PHANTOM, OBJECT_PHYSICS, and OBJECT_TEMP_ON_REZ. 2012-12-28 02:32:19 +00:00
Ima Mechanique
c50cd9efbd updating version 2012-12-25 04:02:15 +00:00
Ima Mechanique
b3cd0ed59f Updating Release Notes. 2012-12-25 03:52:38 +00:00
Ima Mechanique
0bd4ec18df Fixing llWanderWithin - second argument should be vector instead of float. 2012-12-17 15:18:19 +00:00
Ima Mechanique
5374fec377 Fixing regression to llClearPrimMedia keyword data (added Link parameter by mistake). 2012-12-01 21:23:59 +00:00
Ima Mechanique
bf8147e110 Updating Release Notes. 2012-11-29 00:48:46 +00:00
Ima Mechanique
7a23109140 Improving emulation code for llAngleBetween. It is still NOT 100% accurate. 2012-11-29 00:40:30 +00:00
Ima Mechanique
1a87874d79 Updating Release Notes. 2012-11-28 23:45:49 +00:00
Ima Mechanique
d0fdf8b9a9 Fixing Bug 28 - Alt+F4/File => Exit does not close unsaved files properly. 2012-11-28 23:22:49 +00:00
Ima Mechanique
ac4d11de87 Merge branch 'dev-next' into dev-syntax-code 2012-11-28 22:21:26 +00:00
Ima Mechanique
409aba35b3 Removed conditional update addresses because VS kept removing them when the file was touched by other changes. 2012-11-28 22:21:08 +00:00
Ima Mechanique
39978d3543 Build number update 2012-11-28 22:19:54 +00:00
Ima Mechanique
3ad442128b Merge branch 'dev-next' into dev-syntax-code 2012-11-26 20:55:58 +00:00
Ima Mechanique
20211983a0 Fixing conditional update addresses, which VS broke (again! TODO replace this with prebuild script). 2012-11-26 20:54:15 +00:00
Ima Mechanique
5d30a4f09c Merge branch 'dev-next' into dev-syntax-code 2012-11-26 20:04:50 +00:00
Ima Mechanique
b8c6277050 Tagging and final Release Notes update 2012-11-26 20:02:31 +00:00
Ima Mechanique
8d290d04e4 Removing LSLEditor.RES from versioning. It is generated per build. 2012-11-24 16:38:38 +00:00
Ima Mechanique
b125d075e3 Removing duplicate entries from Help => About dialogue. Updating Release Notes 2012-11-24 15:27:38 +00:00
Ima Mechanique
2ae11a21f8 Resource changes/updates reverting use of manifest over resource file. 2012-11-24 15:26:42 +00:00
Ima Mechanique
7f3e782da3 Merge branch 'dev-next' into dev-syntax-code 2012-11-22 19:04:17 +00:00
Ima Mechanique
b2b2de3962 Updating build settings. 2012-11-22 19:02:38 +00:00
Ima Mechanique
51e402c28a Updated Release Notes. 2012-11-22 18:36:03 +00:00
Ima Mechanique
3038427909 Setting icon for application file. 2012-11-22 18:31:00 +00:00
Ima Mechanique
4bcf3041c0 Changing build method: manually specifying build/verion number, removing some info from the resource file. 2012-11-22 18:29:11 +00:00
Ima Mechanique
7c56943183 Removing duplicated constants (merge error?) 2012-11-22 18:25:39 +00:00
Ima Mechanique
2d836703db Merge branch 'dev-next' into bug-SF-3489102 2012-11-22 16:52:02 +00:00
Ima Mechanique
3a0905ad7e Adding constants to code emulation: CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES, HTTP_PRAGMA_NO_CACHE, OBJECT_ATTACHED_POINT, OBJECT_PATHFINDING_TYPE, OBJECT_ROOT, OPT_AVATAR, OPT_CHARACTER, OPT_EXCLUSION_VOLUME, OPT_LEGACY_LINKSET, OPT_MATERIAL_VOLUME, OPT_OTHER, OPT_STATIC_OBSTACLE, OPT_WALKABLE, SIM_STAT_PCT_CHARS_STEPPED; and function stubs: llAttachToAvatarTemp, llGetSimStats, llTeleportAgent, llTeleportAgentGlobalCoords. 2012-11-22 16:51:08 +00:00
Ima Mechanique
32c81be487 Merge branch 'dev-syntax-highlighting' into dev-next 2012-11-21 06:27:53 +00:00
Ima Mechanique
88eb607dee Adding functions: llAttachToAvatarTemp, llGetSimStats, llTeleportAgent, llTeleportAgentGlobalCoords. 2012-11-21 06:27:32 +00:00
Ima Mechanique
0ecbb86c74 Fixing tooltip text for llClearLinkMedia. Adding constants CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES, HTTP_PRAGMA_NO_CACHE, OBJECT_ATTACHED_POINT, OBJECT_PATHFINDING_TYPE, OBJECT_ROOT, OPT_AVATAR, OPT_CHARACTER, OPT_EXCLUSION_VOLUME, OPT_LEGACY_LINKSET, OPT_MATERIAL_VOLUME, OPT_OTHER, OPT_STATIC_OBSTACLE, OPT_WALKABLE, SIM_STAT_PCT_CHARS_STEPPED 2012-11-21 02:04:27 +00:00
Ima Mechanique
f2332d9399 Fixing tooltip text for llClearLinkMedia. Adding constants CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES, HTTP_PRAGMA_NO_CACHE, OBJECT_ATTACHED_POINT, OBJECT_PATHFINDING_TYPE, OBJECT_ROOT, OPT_AVATAR, OPT_CHARACTER, OPT_EXCLUSION_VOLUME, OPT_LEGACY_LINKSET, OPT_MATERIAL_VOLUME, OPT_OTHER, OPT_STATIC_OBSTACLE, OPT_WALKABLE 2012-11-21 02:03:09 +00:00
Ima Mechanique
1ce8fece34 Merge branch 'dev-next' into dev-syntax-highlighting 2012-11-21 01:23:25 +00:00
Ima Mechanique
ab531593d8 Constants: Adding HTTP_CUSTOM_HEADER, PERMISSION_TELEPORT; Updating PURSUIT_GOAL_TOLERANCE, WANDER_PAUSE_AT_WAYPOINTS, REQUIRE_LINE_OF_SIGHT 2012-11-21 01:23:03 +00:00
Ima Mechanique
d9a08c4ec8 Updating Release Notes 2012-11-18 19:56:15 +00:00
Ima Mechanique
c7415e910b Removing from syntax-highlighting CHARACTER_MAX_ANGULAR_ACCEL,CHARACTER_MAX_ANGULAR_SPEED. 2012-11-18 19:52:07 +00:00
Ima Mechanique
5dd1ea069f Adding syntax-check for ATTACH_LEFT_PEC, ATTACH_RIGHT_PEC, CHARACTER_MAX_SPEED, CHARACTER_MAX_TURN_RADIUS, CHARACTER_ORIENTATION, CHARACTER_RADIUS, HORIZONTAL, VERTICAL.
Removed CHARACTER_MAX_ANGULAR_ACCEL, CHARACTER_MAX_ANGULAR_SPEED, CHARACTER_RADIUS.
2012-11-18 19:46:26 +00:00
Ima Mechanique
244bed413e Removed CHARACTER_TURN_SPEED_MULTIPLIER which was removed before release. 2012-11-18 19:11:38 +00:00
Ima Mechanique
e0fd0904d2 Added PathFinding constants HORIZONTAL/VERTICAL. 2012-11-18 19:08:36 +00:00
Ima Mechanique
c3fdaaedb5 Merge branch 'dev-next' into dev-syntax-highlighting 2012-11-18 16:05:22 +00:00
Ima Mechanique
15234df030 resourve change after building Release version. Bad me, should release from master only 2012-11-18 16:04:27 +00:00
Ima Mechanique
5ee142ee4d Adding Link paramter to llClearMedia() highlighting. Updated Release Notes. 2012-11-18 13:56:09 +00:00
Ima Mechanique
a9db752cfa Merge branch 'dev-syntax-code' into dev-next 2012-11-18 13:23:52 +00:00
Ima Mechanique
3f71914fe7 Cleared out unversioned files 2012-11-18 13:23:25 +00:00
Ima Mechanique
e010001a52 Fixed missing Link argument, in stub, for llClearLinkMedia() 2012-11-18 13:20:55 +00:00
Ima Mechanique
f4b0f045e0 Merge branch 'dev-load+save-notecards' into dev-next 2012-10-23 16:43:29 +00:00
Ima Mechanique
a94055b6ab Changes to store the file encoding of loaded files, so that they can be saved the same way. This means we'll need an 'export' feature to overide the setting. 2012-10-23 16:31:58 +00:00
Ima Mechanique
02fda552c0 Forces note-cards to save as UTF-8. Also renamed open/save dialog properties. 2012-10-23 16:19:43 +00:00
Ima Mechanique
bc7907ffc3 Updating release notes. 2012-10-23 14:21:48 +00:00
Ima Mechanique
0472df43d7 Merge branch 'dev-load+save-notecards' into dev-next 2012-10-23 14:06:06 +00:00
Ima Mechanique
4de3cebeaa Bumped version number to 2.47.0 2012-10-23 14:05:32 +00:00
Ima Mechanique
3cec169755 Seperates code for opening script/notecard files and flags files appropriately. 2012-10-23 13:51:45 +00:00
Ima Mechanique
db5aa32eb6 Merge branch 'dev-next' into dev-syntax-code 2012-05-13 10:01:42 +01:00
Ima Mechanique
4a6348e460 Merge branch 'dev-next' into dev-syntax-highlighting 2012-05-13 10:01:28 +01:00
Ima Mechanique
fc1c3e349b Added TODO note 2012-05-13 10:01:12 +01:00
Ima Mechanique
d6582d8ff1 Updated Release notes for path-finding updates 2012-05-13 09:58:57 +01:00
Ima Mechanique
f89b3ecc88 Added/Removed/Renamed path-finding constants. 2012-05-13 09:58:07 +01:00
Ima Mechanique
6c6309a938 Environment updates 2012-04-22 10:24:35 +01:00
Ima Mechanique
be5499a6c5 Merge branch 'master' into dev-next 2012-04-22 10:15:11 +01:00
Ima Mechanique
7d4b51e5ff Merge branch 'master' into bug-SF-3489102 2012-04-22 10:14:59 +01:00
Ima Mechanique
a2e80080ca Merge branch 'master' into dev-syntax-highlighting 2012-04-22 10:14:30 +01:00
Ima Mechanique
8354188e36 Merge branch 'master' into dev-syntax-code 2012-04-22 10:14:16 +01:00
Ima Mechanique
ef1d710170 Merge branch 'dev-next' 2012-04-22 10:12:49 +01:00
Ima Mechanique
8bf516eb20 Updating Relase Notes and version number 2012-04-22 10:12:28 +01:00
Ima Mechanique
cd65779486 Merge branch 'dev-syntax-code' into dev-next 2012-04-22 10:06:44 +01:00
Ima Mechanique
f3aa4a752c Adding lLGetAgentList/constants and PRIM_SLICE to code emulation. 2012-04-22 10:06:28 +01:00
Ima Mechanique
4405a661f8 Merge branch 'dev-next' into dev-syntax-code 2012-04-22 10:04:58 +01:00
Ima Mechanique
01b64cae0e Merge branch 'dev-syntax-highlighting' into dev-next 2012-04-21 08:00:54 +01:00
Ima Mechanique
fc7a8f22d5 Updating Release Notes 2012-04-21 08:00:43 +01:00
Ima Mechanique
9dcbc4b09f Adding llGetAgentList and related constants plus PRIM_SLICE. 2012-04-21 08:00:01 +01:00
Ima Mechanique
39bad6b5ff Merge branch 'bug-SF-3072580-HTTPRequest-gzip-encoding' into bug-SF-3489102 2012-04-05 18:05:09 +01:00
Ima Mechanique
f1543567ff Merge branch 'bug-SF-3072580-HTTPRequest-gzip-encoding' into dev-syntax-highlighting 2012-04-05 18:04:53 +01:00
Ima Mechanique
72d70f4d27 Merge branch 'bug-SF-3072580-HTTPRequest-gzip-encoding' into dev-syntax-code 2012-04-05 18:04:39 +01:00
Ima Mechanique
f007061f47 Merge branch 'bug-SF-3072580-HTTPRequest-gzip-encoding' into dev-next 2012-04-05 18:03:51 +01:00
Ima Mechanique
a442da2ba8 Fix for SF-3072580 and ensure UTF-8 encoding is used instead of ASCII.
Thanks to Akkarin Dryke for the 3072580 fix.
2012-04-05 18:03:19 +01:00
Ima Mechanique
42b4d9fdac Merge branch 'dev-next' into dev-syntax-highlighting 2012-04-05 17:45:20 +01:00
Ima Mechanique
6c638b67b6 Merge branch 'dev-next' into dev-syntax-code 2012-04-05 17:45:07 +01:00
Ima Mechanique
82287f9eed Changes to configuration files. 2012-04-05 17:44:47 +01:00
Ima Mechanique
8b2baa8bbc Updating version numbers/ReleaseNotes 2012-03-18 05:52:21 +00:00
Ima Mechanique
3b80d5668c Settings cleanup 2012-03-18 05:50:54 +00:00
Ima Mechanique
962fbed2c7 Fixed BZip2 Decompressor, which wasn't properly included in the project. 2012-03-18 05:49:44 +00:00
Ima Mechanique
948d0527aa Updating version numbers 2012-03-16 04:22:40 +00:00
Ima Mechanique
285938ea84 White space fix. 2012-03-14 21:45:26 +00:00
Ima Mechanique
dd4f051b9d Updating ReleaseNotes.htm 2012-03-14 21:44:21 +00:00
Ima Mechanique
5cf77a1308 Merge branch 'next-syntax-code' 2012-03-14 21:37:05 +00:00
Ima Mechanique
734930c9a9 Fixed some bad constants and function entries. 2012-03-14 21:35:52 +00:00
Ima Mechanique
a16cc8b7a2 Merge branch 'next' into next-syntax-highlighting 2012-03-05 23:56:31 +00:00
Ima Mechanique
1fecbad9fe Merge branch 'next' into next-syntax-code 2012-03-05 23:56:15 +00:00
Ima Mechanique
b7a837060c Updated release notes. 2012-03-05 23:35:52 +00:00
469 changed files with 73477 additions and 66886 deletions

398
.gitignore vendored Normal file
View file

@ -0,0 +1,398 @@
## 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

View file

@ -1,339 +1,339 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
Preamble Preamble
The licenses for most software are designed to take away your The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to the GNU Lesser General Public License instead.) You can apply it to
your programs, too. your programs, too.
When we speak of free software, we are referring to freedom, not When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things. in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights. anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it. distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their source code. And you must show them these terms so they know their
rights. rights.
We protect your rights with two steps: (1) copyright the software, and We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy, (2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software. distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original that any problems introduced by others will not reflect on the original
authors' reputations. authors' reputations.
Finally, any free program is threatened constantly by software Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all. patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and The precise terms and conditions for copying, distribution and
modification follow. modification follow.
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains 0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below, under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program" refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law: means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it, that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you". the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program). Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does. Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's 1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty; notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License and give any other recipients of the Program a copy of this License
along with the Program. along with the Program.
You may charge a fee for the physical act of transferring a copy, and You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee. you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion 2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1 distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions: above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change. stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License. parties under the terms of this License.
c) If the modified program normally reads commands interactively c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on does not normally print such an announcement, your work based on
the Program is not required to print an announcement.) the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program, identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it. entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or exercise the right to control the distribution of derivative or
collective works based on the Program. collective works based on the Program.
In addition, mere aggregation of another work not based on the Program In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under a storage or distribution medium does not bring the other work under
the scope of this License. the scope of this License.
3. You may copy and distribute the Program (or a work based on it, 3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following: Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or, 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or, customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such received the program in object code or executable form with such
an offer, in accord with Subsection b above.) an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component operating system on which the executable runs, unless that component
itself accompanies the executable. itself accompanies the executable.
If distribution of executable or object code is made by offering If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not distribution of the source code, even though third parties are not
compelled to copy the source along with the object code. compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program 4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License. void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such this License will not have their licenses terminated so long as such
parties remain in full compliance. parties remain in full compliance.
5. You are not required to accept this License, since you have not 5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying all its terms and conditions for copying, distributing or modifying
the Program or works based on it. the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the 6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein. restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to You are not responsible for enforcing compliance by third parties to
this License. this License.
7. If, as a consequence of a court judgment or allegation of patent 7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues), infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program. refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other apply and the section as a whole is intended to apply in other
circumstances. circumstances.
It is not the purpose of this section to induce you to infringe any It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is integrity of the free software distribution system, which is
implemented by public license practices. Many people have made implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot to distribute software through any other system and a licensee cannot
impose that choice. impose that choice.
This section is intended to make thoroughly clear what is believed to This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License. be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in 8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License. the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions 9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to be similar in spirit to the present version, but may differ in detail to
address new problems or concerns. address new problems or concerns.
Each version is given a distinguishing version number. If the Program Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software this License, you may choose any version ever published by the Free Software
Foundation. Foundation.
10. If you wish to incorporate parts of the Program into other free 10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally. of promoting the sharing and reuse of software generally.
NO WARRANTY NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION. REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms. free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found. the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.> <one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author> Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License along 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., with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this If the program is interactive, make it output a short notice like this
when it starts in an interactive mode: when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details. under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program. mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names: necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker. `Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989 <signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice Ty Coon, President of Vice
This General Public License does not permit incorporating your program into This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. Public License instead of this License.

5
TODO.txt Normal file
View file

@ -0,0 +1,5 @@
LSL-Editor v3 porting TODO list
The aim of this overhaul of the code-base is to make it multi-platform friendly and gain a better insight into the workings of all areas of the code. Hopefully this will lead to removal of any cruft and a leaner code-base.
===============================
1) Port window UI/control to GTK+.
2) Clean up all the 'syntax' stuff. Alphabetise all constants, events, functions, etc.)

View file

@ -1,30 +1,35 @@
 
Microsoft Visual Studio Solution File, Format Version 11.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2010 # Visual Studio Version 17
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lsleditor", "lsleditor.csproj", "{59468D25-6E68-4113-B740-C6EF4695045B}" VisualStudioVersion = 17.3.32929.385
EndProject MinimumVisualStudioVersion = 10.0.40219.1
Global Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LSLEditor", "source\LSLEditor.csproj", "{59468D25-6E68-4113-B740-C6EF4695045B}"
GlobalSection(SubversionScc) = preSolution EndProject
Svn-Managed = True Global
Manager = AnkhSVN - Subversion Support for Visual Studio GlobalSection(SolutionConfigurationPlatforms) = preSolution
EndGlobalSection Debug|Any CPU = Debug|Any CPU
GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms Release|Mixed Platforms = Release|Mixed Platforms
Release|Any CPU = Release|Any CPU EndGlobalSection
Release|Mixed Platforms = Release|Mixed Platforms GlobalSection(ProjectConfigurationPlatforms) = postSolution
EndGlobalSection {59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
GlobalSection(ProjectConfigurationPlatforms) = postSolution {59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Any CPU.Build.0 = Debug|Any CPU {59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {59468D25-6E68-4113-B740-C6EF4695045B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {59468D25-6E68-4113-B740-C6EF4695045B}.Release|Any CPU.Build.0 = Release|Any CPU
{59468D25-6E68-4113-B740-C6EF4695045B}.Release|Any CPU.ActiveCfg = Release|Any CPU {59468D25-6E68-4113-B740-C6EF4695045B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{59468D25-6E68-4113-B740-C6EF4695045B}.Release|Any CPU.Build.0 = Release|Any CPU {59468D25-6E68-4113-B740-C6EF4695045B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{59468D25-6E68-4113-B740-C6EF4695045B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU EndGlobalSection
{59468D25-6E68-4113-B740-C6EF4695045B}.Release|Mixed Platforms.Build.0 = Release|Any CPU GlobalSection(SolutionProperties) = preSolution
EndGlobalSection HideSolutionNode = FALSE
GlobalSection(SolutionProperties) = preSolution EndGlobalSection
HideSolutionNode = FALSE GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection SolutionGuid = {69EB7C6C-E955-4FF7-AE34-B439210197AC}
EndGlobal EndGlobalSection
GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection
EndGlobal

View file

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

100
source/About.cs Normal file
View file

@ -0,0 +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);
}
}
}

View file

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

667
source/App.config Normal file
View file

@ -0,0 +1,667 @@
<?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

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

View file

@ -0,0 +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();
}
}
}
}
}
}

View file

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

View file

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

View file

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

160
source/Browser.cs Normal file
View file

@ -0,0 +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));
}
}
}
}
}
}
}

View file

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

View file

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

View file

@ -1,298 +1,293 @@
// /** // <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 &
// * ORIGINAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden // Malcolm J. Kudra, who in turn License under the GPLv2 in agreement with Alphons van der Heijden's wishes.
// * The code was donated on 4/28/2010 by Alphons van der Heijden //
// * To Brandon 'Dimentox Travanti' Husbands & Malcolm J. Kudra, who in turn License under the GPLv2. // The community would like to thank Alphons for all of his hard work, blood sweat and tears. Without his work
// * In agreement with Alphons van der Heijden's wishes. // the community would be stuck with crappy editors.
// * //
// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. // The source code in this file ("Source Code") is provided by The LSLEditor Group to you under the terms of the GNU
// * Without his work the community would be stuck with crappy editors. // 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.
// * The source code in this file ("Source Code") is provided by The LSLEditor Group // Terms of the GPL can be found in the gplv2.txt document.
// * to you under the terms of the GNU General Public License, version 2.0 //
// * ("GPL"), unless you have obtained a separate licensing agreement // GPLv2 Header
// * ("Other License"), formally executed by you and The LSLEditor Group. Terms of // ************
// * the GPL can be found in the gplv2.txt document. // LSLEditor, a External editor for the LSL Language.
// * // Copyright (C) 2010 The LSLEditor Group.
// ******** //
// * GPLv2 Header // 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
// * LSLEditor, a External editor for the LSL Language. // later version.
// * Copyright (C) 2010 The LSLEditor Group. //
// // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// * This program is free software; you can redistribute it and/or // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// * modify it under the terms of the GNU General Public License // details.
// * as published by the Free Software Foundation; either version 2 //
// * of the License, or (at your option) any later version. // 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.
// * This program is distributed in the hope that it will be useful, // ********************************************************************************************************************
// * but WITHOUT ANY WARRANTY; without even the implied warranty of // The above copyright notice and this permission notice shall be included in copies or substantial portions of the
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // Software.
// * GNU General Public License for more details. // ********************************************************************************************************************
// * // </copyright>
// * You should have received a copy of the GNU General Public License //
// * along with this program; if not, write to the Free Software // <summary>
// * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // BugReportForm.cs
// ******** //
// * // </summary>
// * The above copyright notice and this permission notice shall be included in all
// * copies or substantial portions of the Software. using System;
// * using System.Collections.Generic;
// ******** using System.ComponentModel;
// */ using System.Drawing;
using System; using System.Text;
using System.Collections.Generic; using System.Windows.Forms;
using System.ComponentModel; using System.Reflection;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection; namespace LSLEditor.BugReport
{
using LSLEditor.org.lsleditor.www; public partial class BugReportForm : Form
{
private bool blnComplete;
namespace LSLEditor.BugReport private UploadBugReport ubr;
{
public partial class BugReportForm : Form private LSLEditorForm parent;
{
private bool blnComplete; public BugReportForm(LSLEditorForm parent)
private UploadBugReport ubr; {
InitializeComponent();
private LSLEditorForm parent; this.parent = parent;
this.Icon = parent.Icon;
public BugReportForm(LSLEditorForm parent) this.textBox1.Text = Properties.Settings.Default.AvatarName;
{ this.textBox2.Text = Properties.Settings.Default.EmailAddress;
InitializeComponent(); this.listView1.Columns.Add("ScriptName",this.listView1.Width-30);
this.parent = parent; foreach (Form form in parent.Children)
this.Icon = parent.Icon; {
this.textBox1.Text = Properties.Settings.Default.AvatarName; EditForm editForm = form as EditForm;
this.textBox2.Text = Properties.Settings.Default.EmailAddress; if (editForm == null || editForm.IsDisposed)
this.listView1.Columns.Add("ScriptName",this.listView1.Width-30); continue;
foreach (Form form in parent.Children) ListViewItem lvi = new ListViewItem(editForm.ScriptName);
{ lvi.Checked = false;
EditForm editForm = form as EditForm; this.listView1.Items.Add(lvi);
if (editForm == null || editForm.IsDisposed) }
continue; ShowBugReportsList();
ListViewItem lvi = new ListViewItem(editForm.ScriptName); }
lvi.Checked = false;
this.listView1.Items.Add(lvi); private void ShowBugReportsList()
} {
ShowBugReportsList(); if (Properties.Settings.Default.Bugreports == null)
} return;
this.listView2.Items.Clear();
private void ShowBugReportsList() foreach (string Handle in Properties.Settings.Default.Bugreports)
{ {
if (Properties.Settings.Default.Bugreports == null) long result;
return; if (!long.TryParse(Handle, out result))
this.listView2.Items.Clear(); continue;
foreach (string Handle in Properties.Settings.Default.Bugreports) result *= (long)1e7;
{ DateTime dateTime = new DateTime(result);
long result; ListViewItem lvi = new ListViewItem(Handle);
if (!long.TryParse(Handle, out result)) lvi.SubItems.Add(dateTime.ToString());
continue; lvi.Tag = Handle;
result *= (long)1e7; this.listView2.Items.Add(lvi);
DateTime dateTime = new DateTime(result); }
ListViewItem lvi = new ListViewItem(Handle); }
lvi.SubItems.Add(dateTime.ToString());
lvi.Tag = Handle; //close
this.listView2.Items.Add(lvi); private void button3_Click(object sender, EventArgs e)
} {
} this.timer1.Stop();
if (ubr != null)
//close ubr.Stop();
private void button3_Click(object sender, EventArgs e) this.Close();
{ }
this.timer1.Stop();
if (ubr != null) // cancel
ubr.Stop(); private void button2_Click(object sender, EventArgs e)
this.Close(); {
} this.button2.Enabled = false;
this.timer1.Stop();
// cancel this.progressBar1.Value = 0;
private void button2_Click(object sender, EventArgs e) if (ubr != null)
{ ubr.Stop();
this.button2.Enabled = false; this.button1.Enabled = true;
this.timer1.Stop(); }
this.progressBar1.Value = 0;
if (ubr != null) private void button1_Click(object sender, EventArgs e)
ubr.Stop(); {
this.button1.Enabled = true; string strMessage = this.textBox3.Text.Trim();
} if (strMessage == "")
{
private void button1_Click(object sender, EventArgs e) MessageBox.Show("The bug report is empty(?!), it is not send!", "Bug report", MessageBoxButtons.OK, MessageBoxIcon.Information);
{ return;
string strMessage = this.textBox3.Text.Trim(); }
if (strMessage == "") ubr = new UploadBugReport();
{ this.button1.Enabled = false;
MessageBox.Show("The bug report is empty(?!), it is not send!", "Bug report", MessageBoxButtons.OK, MessageBoxIcon.Information); this.button2.Enabled = true;
return; this.blnComplete = false;
} this.timer1.Start();
ubr = new UploadBugReport(); ubr.OnComplete += new UploadBugReport.UploadCompleteHandler(ubr_OnComplete);
this.button1.Enabled = false; List<UploadBugReport.FileToUpload> list = new List<UploadBugReport.FileToUpload>();
this.button2.Enabled = true; StringBuilder sb = new StringBuilder();
this.blnComplete = false;
this.timer1.Start(); Properties.Settings.Default.AvatarName = this.textBox1.Text;
ubr.OnComplete += new UploadBugReport.UploadCompleteHandler(ubr_OnComplete); Properties.Settings.Default.EmailAddress = this.textBox2.Text;
List<UploadBugReport.FileToUpload> list = new List<UploadBugReport.FileToUpload>();
StringBuilder sb = new StringBuilder(); sb.AppendFormat("Version: {0} {1}\r\n",
this.parent.Text,
Properties.Settings.Default.AvatarName = this.textBox1.Text; Assembly.GetExecutingAssembly().GetName().Version.ToString());
Properties.Settings.Default.EmailAddress = this.textBox2.Text; sb.AppendFormat("Name: {0}\r\n", this.textBox1.Text);
sb.AppendFormat("Email: {0}\r\n\r\n", this.textBox2.Text);
sb.AppendFormat("Version: {0} {1}\r\n", sb.Append(this.textBox3.Text);
this.parent.Text, list.Add(new UploadBugReport.FileToUpload("bugreport.txt", sb.ToString()));
Assembly.GetExecutingAssembly().GetName().Version.ToString()); foreach (ListViewItem lvi in this.listView1.Items)
sb.AppendFormat("Name: {0}\r\n", this.textBox1.Text); {
sb.AppendFormat("Email: {0}\r\n\r\n", this.textBox2.Text); if (!lvi.Checked)
sb.Append(this.textBox3.Text); continue;
list.Add(new UploadBugReport.FileToUpload("bugreport.txt", sb.ToString())); string strScriptName = lvi.Text;
foreach (ListViewItem lvi in this.listView1.Items) string strBody = null;
{ foreach (Form form in parent.Children)
if (!lvi.Checked) {
continue; EditForm editForm = form as EditForm;
string strScriptName = lvi.Text; if (editForm == null || editForm.IsDisposed)
string strBody = null; continue;
foreach (Form form in parent.Children) if (editForm.ScriptName == strScriptName)
{ strBody = editForm.SourceCode;
EditForm editForm = form as EditForm; }
if (editForm == null || editForm.IsDisposed) if(strBody != null)
continue; list.Add(new UploadBugReport.FileToUpload(strScriptName, strBody));
if (editForm.ScriptName == strScriptName) }
strBody = editForm.SourceCode; ubr.UploadAsync(list, this.progressBar1);
} }
if(strBody != null)
list.Add(new UploadBugReport.FileToUpload(strScriptName, strBody)); void ubr_OnComplete(object sender, UploadBugReport.UploadCompleteEventArgs e)
} {
ubr.UploadAsync(list, this.progressBar1); if(e.TotalBytes == -1)
} MessageBox.Show("There is something wrong. Your bug report has not been sent!!", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
else
void ubr_OnComplete(object sender, UploadBugReport.UploadCompleteEventArgs e) MessageBox.Show("Your bug report has been sent (" + e.TotalBytes + " bytes)", "Ready", MessageBoxButtons.OK, MessageBoxIcon.Information);
{ this.blnComplete = true;
if(e.TotalBytes == -1) }
MessageBox.Show("There is something wrong. Your bug report has not been sent!!", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error);
else private void timer1_Tick(object sender, EventArgs e)
MessageBox.Show("Your bug report has been sent (" + e.TotalBytes + " bytes)", "Ready", MessageBoxButtons.OK, MessageBoxIcon.Information); {
this.blnComplete = true; if (this.blnComplete)
} {
this.timer1.Stop();
private void timer1_Tick(object sender, EventArgs e)
{ this.button1.Enabled = true;
if (this.blnComplete) this.button2.Enabled = false;
{
this.timer1.Stop(); this.progressBar1.Value = 0;
this.textBox3.Clear();
this.button1.Enabled = true; ShowBugReportsList();
this.button2.Enabled = false; this.tabControl1.SelectedIndex = 1;
}
this.progressBar1.Value = 0;
this.textBox3.Clear(); if (ubr != null)
ShowBugReportsList(); {
this.tabControl1.SelectedIndex = 1; if (!ubr.blnRunning)
} {
this.button1.Enabled = true;
if (ubr != null) this.timer1.Stop();
{ }
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];
private void listView2_SelectedIndexChanged(object sender, EventArgs e) string Handle = lvi.Tag.ToString();
{
if (this.listView2.SelectedItems.Count == 0) Service1 service1 = new Service1();
return; service1.GetStatusCompleted += new GetStatusCompletedEventHandler(service1_GetStatusCompleted);
ListViewItem lvi = this.listView2.SelectedItems[0]; service1.GetStatusAsync(Handle, Handle);*/
string Handle = lvi.Tag.ToString(); }
/*
Service1 service1 = new Service1(); void service1_GetStatusCompleted(object sender, GetStatusCompletedEventArgs e)
service1.GetStatusCompleted += new GetStatusCompletedEventHandler(service1_GetStatusCompleted); {
service1.GetStatusAsync(Handle, Handle); /*this.textBox5.Clear();
} string Handle = e.UserState.ToString();
if (e.Error != null)
void service1_GetStatusCompleted(object sender, GetStatusCompletedEventArgs e) {
{ this.textBox4.Text = "Bug report [" + Handle + "] not available (at this time)";
this.textBox5.Clear(); return;
string Handle = e.UserState.ToString(); }
if (e.Error != null)
{ string strResult = e.Result;
this.textBox4.Text = "Bug report [" + Handle + "] not available (at this time)"; if (strResult == null)
return; {
} this.textBox5.Text = "Bug report [" + Handle + "] does not exist (anymore)";
return;
string strResult = e.Result; }
if (strResult == null)
{ this.textBox5.Text = strResult.Replace("\n", "\r\n");
this.textBox5.Text = "Bug report [" + Handle + "] does not exist (anymore)";
return; Service1 service1 = new Service1();
} service1.GetBugReportCompleted += new GetBugReportCompletedEventHandler(service1_GetBugReportCompleted);
service1.GetBugReportAsync(Handle, Handle);
this.textBox5.Text = strResult.Replace("\n", "\r\n"); }
Service1 service1 = new Service1(); void service1_GetBugReportCompleted(object sender, GetBugReportCompletedEventArgs e)
service1.GetBugReportCompleted += new GetBugReportCompletedEventHandler(service1_GetBugReportCompleted); {
service1.GetBugReportAsync(Handle, Handle); this.textBox4.Clear();
} string Handle = e.UserState.ToString();
void service1_GetBugReportCompleted(object sender, GetBugReportCompletedEventArgs e) if (e.Error != null)
{ {
this.textBox4.Clear(); this.textBox4.Text = "Bug report [" + Handle + "] not available (at this time)";
string Handle = e.UserState.ToString(); return;
}
if (e.Error != null)
{ string strResult = e.Result;
this.textBox4.Text = "Bug report [" + Handle + "] not available (at this time)"; if (strResult == null)
return; {
} this.textBox4.Text = "Bug report [" + Handle + "] does not extist (anymore)";
return;
string strResult = e.Result; }
if (strResult == null)
{ this.textBox4.Text = strResult.Replace("\n", "\r\n");
this.textBox4.Text = "Bug report [" + Handle + "] does not extist (anymore)"; }*/
return;
} private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
this.textBox4.Text = strResult.Replace("\n", "\r\n"); if (this.listView2.SelectedItems.Count == 0)
} return;
private void deleteToolStripMenuItem_Click(object sender, EventArgs e) if (MessageBox.Show("Delete " + this.listView2.SelectedItems.Count + " bugreports?", "Delete Bugreports", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
{ {
if (this.listView2.SelectedItems.Count == 0) for(int intI=0; intI<this.listView2.SelectedItems.Count;intI++)
return; {
ListViewItem lvi = this.listView2.SelectedItems[intI];
if (MessageBox.Show("Delete " + this.listView2.SelectedItems.Count + " bugreports?", "Delete Bugreports", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) string Handle = lvi.Tag.ToString();
{ Properties.Settings.Default.Bugreports.Remove(Handle);
for(int intI=0; intI<this.listView2.SelectedItems.Count;intI++) }
{ this.textBox4.Clear();
ListViewItem lvi = this.listView2.SelectedItems[intI]; this.textBox5.Clear();
string Handle = lvi.Tag.ToString(); }
Properties.Settings.Default.Bugreports.Remove(Handle); ShowBugReportsList();
} }
this.textBox4.Clear();
this.textBox5.Clear(); private void button4_Click(object sender, EventArgs e)
} {
ShowBugReportsList(); if (this.button4.Text.Contains("uncheck"))
} {
foreach (ListViewItem lvi in this.listView1.Items)
private void button4_Click(object sender, EventArgs e) lvi.Checked = false;
{ this.button4.Text = "check all";
if (this.button4.Text.Contains("uncheck")) }
{ else
foreach (ListViewItem lvi in this.listView1.Items) {
lvi.Checked = false; foreach (ListViewItem lvi in this.listView1.Items)
this.button4.Text = "check all"; lvi.Checked = true;
} this.button4.Text = "uncheck 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"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <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> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : 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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata"> <xsd:element name="metadata">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" /> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
<xsd:complexType> <xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <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:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <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="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" /> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" /> <xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:choice> </xsd:choice>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:schema> </xsd:schema>
<resheader name="resmimetype"> <resheader name="resmimetype">
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>100, 17</value> <value>100, 17</value>
</metadata> </metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>42</value> <value>42</value>
</metadata> </metadata>
</root> </root>

View file

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

View file

@ -0,0 +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);
}
}
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,165 +1,165 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.ComponentModel; using System.ComponentModel;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
partial class DockPanel partial class DockPanel
{ {
private sealed class SplitterDragHandler : DragHandler private sealed class SplitterDragHandler : DragHandler
{ {
private class SplitterOutline private class SplitterOutline
{ {
public SplitterOutline() public SplitterOutline()
{ {
m_dragForm = new DragForm(); m_dragForm = new DragForm();
SetDragForm(Rectangle.Empty); SetDragForm(Rectangle.Empty);
DragForm.BackColor = Color.Black; DragForm.BackColor = Color.Black;
DragForm.Opacity = 0.7; DragForm.Opacity = 0.7;
DragForm.Show(false); DragForm.Show(false);
} }
DragForm m_dragForm; DragForm m_dragForm;
private DragForm DragForm private DragForm DragForm
{ {
get { return m_dragForm; } get { return m_dragForm; }
} }
public void Show(Rectangle rect) public void Show(Rectangle rect)
{ {
SetDragForm(rect); SetDragForm(rect);
} }
public void Close() public void Close()
{ {
DragForm.Close(); DragForm.Close();
} }
private void SetDragForm(Rectangle rect) private void SetDragForm(Rectangle rect)
{ {
DragForm.Bounds = rect; DragForm.Bounds = rect;
if (rect == Rectangle.Empty) if (rect == Rectangle.Empty)
DragForm.Region = new Region(Rectangle.Empty); DragForm.Region = new Region(Rectangle.Empty);
else if (DragForm.Region != null) else if (DragForm.Region != null)
DragForm.Region = null; DragForm.Region = null;
} }
} }
public SplitterDragHandler(DockPanel dockPanel) public SplitterDragHandler(DockPanel dockPanel)
: base(dockPanel) : base(dockPanel)
{ {
} }
public new ISplitterDragSource DragSource public new ISplitterDragSource DragSource
{ {
get { return base.DragSource as ISplitterDragSource; } get { return base.DragSource as ISplitterDragSource; }
private set { base.DragSource = value; } private set { base.DragSource = value; }
} }
private SplitterOutline m_outline; private SplitterOutline m_outline;
private SplitterOutline Outline private SplitterOutline Outline
{ {
get { return m_outline; } get { return m_outline; }
set { m_outline = value; } set { m_outline = value; }
} }
private Rectangle m_rectSplitter; private Rectangle m_rectSplitter;
private Rectangle RectSplitter private Rectangle RectSplitter
{ {
get { return m_rectSplitter; } get { return m_rectSplitter; }
set { m_rectSplitter = value; } set { m_rectSplitter = value; }
} }
public void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter) public void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter)
{ {
DragSource = dragSource; DragSource = dragSource;
RectSplitter = rectSplitter; RectSplitter = rectSplitter;
if (!BeginDrag()) if (!BeginDrag())
{ {
DragSource = null; DragSource = null;
return; return;
} }
Outline = new SplitterOutline(); Outline = new SplitterOutline();
Outline.Show(rectSplitter); Outline.Show(rectSplitter);
DragSource.BeginDrag(rectSplitter); DragSource.BeginDrag(rectSplitter);
} }
protected override void OnDragging() protected override void OnDragging()
{ {
Outline.Show(GetSplitterOutlineBounds(Control.MousePosition)); Outline.Show(GetSplitterOutlineBounds(Control.MousePosition));
} }
protected override void OnEndDrag(bool abort) protected override void OnEndDrag(bool abort)
{ {
DockPanel.SuspendLayout(true); DockPanel.SuspendLayout(true);
Outline.Close(); Outline.Close();
if (!abort) if (!abort)
DragSource.MoveSplitter(GetMovingOffset(Control.MousePosition)); DragSource.MoveSplitter(GetMovingOffset(Control.MousePosition));
DragSource.EndDrag(); DragSource.EndDrag();
DockPanel.ResumeLayout(true, true); DockPanel.ResumeLayout(true, true);
} }
private int GetMovingOffset(Point ptMouse) private int GetMovingOffset(Point ptMouse)
{ {
Rectangle rect = GetSplitterOutlineBounds(ptMouse); Rectangle rect = GetSplitterOutlineBounds(ptMouse);
if (DragSource.IsVertical) if (DragSource.IsVertical)
return rect.X - RectSplitter.X; return rect.X - RectSplitter.X;
else else
return rect.Y - RectSplitter.Y; return rect.Y - RectSplitter.Y;
} }
private Rectangle GetSplitterOutlineBounds(Point ptMouse) private Rectangle GetSplitterOutlineBounds(Point ptMouse)
{ {
Rectangle rectLimit = DragSource.DragLimitBounds; Rectangle rectLimit = DragSource.DragLimitBounds;
Rectangle rect = RectSplitter; Rectangle rect = RectSplitter;
if (rectLimit.Width <= 0 || rectLimit.Height <= 0) if (rectLimit.Width <= 0 || rectLimit.Height <= 0)
return rect; return rect;
if (DragSource.IsVertical) if (DragSource.IsVertical)
{ {
rect.X += ptMouse.X - StartMousePosition.X; rect.X += ptMouse.X - StartMousePosition.X;
rect.Height = rectLimit.Height; rect.Height = rectLimit.Height;
} }
else else
{ {
rect.Y += ptMouse.Y - StartMousePosition.Y; rect.Y += ptMouse.Y - StartMousePosition.Y;
rect.Width = rectLimit.Width; rect.Width = rectLimit.Width;
} }
if (rect.Left < rectLimit.Left) if (rect.Left < rectLimit.Left)
rect.X = rectLimit.X; rect.X = rectLimit.X;
if (rect.Top < rectLimit.Top) if (rect.Top < rectLimit.Top)
rect.Y = rectLimit.Y; rect.Y = rectLimit.Y;
if (rect.Right > rectLimit.Right) if (rect.Right > rectLimit.Right)
rect.X -= rect.Right - rectLimit.Right; rect.X -= rect.Right - rectLimit.Right;
if (rect.Bottom > rectLimit.Bottom) if (rect.Bottom > rectLimit.Bottom)
rect.Y -= rect.Bottom - rectLimit.Bottom; rect.Y -= rect.Bottom - rectLimit.Bottom;
return rect; return rect;
} }
} }
private SplitterDragHandler m_splitterDragHandler = null; private SplitterDragHandler m_splitterDragHandler = null;
private SplitterDragHandler GetSplitterDragHandler() private SplitterDragHandler GetSplitterDragHandler()
{ {
if (m_splitterDragHandler == null) if (m_splitterDragHandler == null)
m_splitterDragHandler = new SplitterDragHandler(this); m_splitterDragHandler = new SplitterDragHandler(this);
return m_splitterDragHandler; return m_splitterDragHandler;
} }
internal void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter) internal void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter)
{ {
GetSplitterDragHandler().BeginDrag(dragSource, 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;
using System.Drawing; using System.Drawing;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
public sealed class DockPanelExtender public sealed class DockPanelExtender
{ {
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IDockPaneFactory public interface IDockPaneFactory
{ {
DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show); DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show);
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")] [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")]
DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show); DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show);
DockPane CreateDockPane(IDockContent content, DockPane previousPane, DockAlignment alignment, double proportion, bool show); DockPane CreateDockPane(IDockContent content, DockPane previousPane, DockAlignment alignment, double proportion, bool show);
[SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")] [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")]
DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show); DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show);
} }
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IFloatWindowFactory public interface IFloatWindowFactory
{ {
FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane); FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane);
FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds); FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds);
} }
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IDockPaneCaptionFactory public interface IDockPaneCaptionFactory
{ {
DockPaneCaptionBase CreateDockPaneCaption(DockPane pane); DockPaneCaptionBase CreateDockPaneCaption(DockPane pane);
} }
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IDockPaneStripFactory public interface IDockPaneStripFactory
{ {
DockPaneStripBase CreateDockPaneStrip(DockPane pane); DockPaneStripBase CreateDockPaneStrip(DockPane pane);
} }
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public interface IAutoHideStripFactory public interface IAutoHideStripFactory
{ {
AutoHideStripBase CreateAutoHideStrip(DockPanel panel); AutoHideStripBase CreateAutoHideStrip(DockPanel panel);
} }
#region DefaultDockPaneFactory #region DefaultDockPaneFactory
private class DefaultDockPaneFactory : IDockPaneFactory private class DefaultDockPaneFactory : IDockPaneFactory
{ {
public DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show) public DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show)
{ {
return new DockPane(content, visibleState, show); return new DockPane(content, visibleState, show);
} }
public DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show) public DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show)
{ {
return new DockPane(content, floatWindow, show); return new DockPane(content, floatWindow, show);
} }
public DockPane CreateDockPane(IDockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show) public DockPane CreateDockPane(IDockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
{ {
return new DockPane(content, prevPane, alignment, proportion, show); return new DockPane(content, prevPane, alignment, proportion, show);
} }
public DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show) public DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show)
{ {
return new DockPane(content, floatWindowBounds, show); return new DockPane(content, floatWindowBounds, show);
} }
} }
#endregion #endregion
#region DefaultFloatWindowFactory #region DefaultFloatWindowFactory
private class DefaultFloatWindowFactory : IFloatWindowFactory private class DefaultFloatWindowFactory : IFloatWindowFactory
{ {
public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane) public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane)
{ {
return new FloatWindow(dockPanel, pane); return new FloatWindow(dockPanel, pane);
} }
public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds) public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
{ {
return new FloatWindow(dockPanel, pane, bounds); return new FloatWindow(dockPanel, pane, bounds);
} }
} }
#endregion #endregion
#region DefaultDockPaneCaptionFactory #region DefaultDockPaneCaptionFactory
private class DefaultDockPaneCaptionFactory : IDockPaneCaptionFactory private class DefaultDockPaneCaptionFactory : IDockPaneCaptionFactory
{ {
public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane) public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane)
{ {
return new VS2005DockPaneCaption(pane); return new VS2005DockPaneCaption(pane);
} }
} }
#endregion #endregion
#region DefaultDockPaneTabStripFactory #region DefaultDockPaneTabStripFactory
private class DefaultDockPaneStripFactory : IDockPaneStripFactory private class DefaultDockPaneStripFactory : IDockPaneStripFactory
{ {
public DockPaneStripBase CreateDockPaneStrip(DockPane pane) public DockPaneStripBase CreateDockPaneStrip(DockPane pane)
{ {
return new VS2005DockPaneStrip(pane); return new VS2005DockPaneStrip(pane);
} }
} }
#endregion #endregion
#region DefaultAutoHideStripFactory #region DefaultAutoHideStripFactory
private class DefaultAutoHideStripFactory : IAutoHideStripFactory private class DefaultAutoHideStripFactory : IAutoHideStripFactory
{ {
public AutoHideStripBase CreateAutoHideStrip(DockPanel panel) public AutoHideStripBase CreateAutoHideStrip(DockPanel panel)
{ {
return new VS2005AutoHideStrip(panel); return new VS2005AutoHideStrip(panel);
} }
} }
#endregion #endregion
internal DockPanelExtender(DockPanel dockPanel) internal DockPanelExtender(DockPanel dockPanel)
{ {
m_dockPanel = dockPanel; m_dockPanel = dockPanel;
} }
private DockPanel m_dockPanel; private DockPanel m_dockPanel;
private DockPanel DockPanel private DockPanel DockPanel
{ {
get { return m_dockPanel; } get { return m_dockPanel; }
} }
private IDockPaneFactory m_dockPaneFactory = null; private IDockPaneFactory m_dockPaneFactory = null;
public IDockPaneFactory DockPaneFactory public IDockPaneFactory DockPaneFactory
{ {
get get
{ {
if (m_dockPaneFactory == null) if (m_dockPaneFactory == null)
m_dockPaneFactory = new DefaultDockPaneFactory(); m_dockPaneFactory = new DefaultDockPaneFactory();
return m_dockPaneFactory; return m_dockPaneFactory;
} }
set set
{ {
if (DockPanel.Panes.Count > 0) if (DockPanel.Panes.Count > 0)
throw new InvalidOperationException(); throw new InvalidOperationException();
m_dockPaneFactory = value; m_dockPaneFactory = value;
} }
} }
private IFloatWindowFactory m_floatWindowFactory = null; private IFloatWindowFactory m_floatWindowFactory = null;
public IFloatWindowFactory FloatWindowFactory public IFloatWindowFactory FloatWindowFactory
{ {
get get
{ {
if (m_floatWindowFactory == null) if (m_floatWindowFactory == null)
m_floatWindowFactory = new DefaultFloatWindowFactory(); m_floatWindowFactory = new DefaultFloatWindowFactory();
return m_floatWindowFactory; return m_floatWindowFactory;
} }
set set
{ {
if (DockPanel.FloatWindows.Count > 0) if (DockPanel.FloatWindows.Count > 0)
throw new InvalidOperationException(); throw new InvalidOperationException();
m_floatWindowFactory = value; m_floatWindowFactory = value;
} }
} }
private IDockPaneCaptionFactory m_dockPaneCaptionFactory = null; private IDockPaneCaptionFactory m_dockPaneCaptionFactory = null;
public IDockPaneCaptionFactory DockPaneCaptionFactory public IDockPaneCaptionFactory DockPaneCaptionFactory
{ {
get get
{ {
if (m_dockPaneCaptionFactory == null) if (m_dockPaneCaptionFactory == null)
m_dockPaneCaptionFactory = new DefaultDockPaneCaptionFactory(); m_dockPaneCaptionFactory = new DefaultDockPaneCaptionFactory();
return m_dockPaneCaptionFactory; return m_dockPaneCaptionFactory;
} }
set set
{ {
if (DockPanel.Panes.Count > 0) if (DockPanel.Panes.Count > 0)
throw new InvalidOperationException(); throw new InvalidOperationException();
m_dockPaneCaptionFactory = value; m_dockPaneCaptionFactory = value;
} }
} }
private IDockPaneStripFactory m_dockPaneStripFactory = null; private IDockPaneStripFactory m_dockPaneStripFactory = null;
public IDockPaneStripFactory DockPaneStripFactory public IDockPaneStripFactory DockPaneStripFactory
{ {
get get
{ {
if (m_dockPaneStripFactory == null) if (m_dockPaneStripFactory == null)
m_dockPaneStripFactory = new DefaultDockPaneStripFactory(); m_dockPaneStripFactory = new DefaultDockPaneStripFactory();
return m_dockPaneStripFactory; return m_dockPaneStripFactory;
} }
set set
{ {
if (DockPanel.Contents.Count > 0) if (DockPanel.Contents.Count > 0)
throw new InvalidOperationException(); throw new InvalidOperationException();
m_dockPaneStripFactory = value; m_dockPaneStripFactory = value;
} }
} }
private IAutoHideStripFactory m_autoHideStripFactory = null; private IAutoHideStripFactory m_autoHideStripFactory = null;
public IAutoHideStripFactory AutoHideStripFactory public IAutoHideStripFactory AutoHideStripFactory
{ {
get get
{ {
if (m_autoHideStripFactory == null) if (m_autoHideStripFactory == null)
m_autoHideStripFactory = new DefaultAutoHideStripFactory(); m_autoHideStripFactory = new DefaultAutoHideStripFactory();
return m_autoHideStripFactory; return m_autoHideStripFactory;
} }
set set
{ {
if (DockPanel.Contents.Count > 0) if (DockPanel.Contents.Count > 0)
throw new InvalidOperationException(); throw new InvalidOperationException();
if (m_autoHideStripFactory == value) if (m_autoHideStripFactory == value)
return; return;
m_autoHideStripFactory = value; m_autoHideStripFactory = value;
DockPanel.ResetAutoHideStripControl(); DockPanel.ResetAutoHideStripControl();
} }
} }
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,88 +1,88 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Windows.Forms; using System.Windows.Forms;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
internal static class DrawHelper internal static class DrawHelper
{ {
public static Point RtlTransform(Control control, Point point) public static Point RtlTransform(Control control, Point point)
{ {
if (control.RightToLeft != RightToLeft.Yes) if (control.RightToLeft != RightToLeft.Yes)
return point; return point;
else else
return new Point(control.Right - point.X, point.Y); return new Point(control.Right - point.X, point.Y);
} }
public static Rectangle RtlTransform(Control control, Rectangle rectangle) public static Rectangle RtlTransform(Control control, Rectangle rectangle)
{ {
if (control.RightToLeft != RightToLeft.Yes) if (control.RightToLeft != RightToLeft.Yes)
return rectangle; return rectangle;
else else
return new Rectangle(control.ClientRectangle.Right - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height); return new Rectangle(control.ClientRectangle.Right - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height);
} }
public static GraphicsPath GetRoundedCornerTab(GraphicsPath graphicsPath, Rectangle rect, bool upCorner) public static GraphicsPath GetRoundedCornerTab(GraphicsPath graphicsPath, Rectangle rect, bool upCorner)
{ {
if (graphicsPath == null) if (graphicsPath == null)
graphicsPath = new GraphicsPath(); graphicsPath = new GraphicsPath();
else else
graphicsPath.Reset(); graphicsPath.Reset();
int curveSize = 6; int curveSize = 6;
if (upCorner) if (upCorner)
{ {
graphicsPath.AddLine(rect.Left, rect.Bottom, rect.Left, rect.Top + curveSize / 2); graphicsPath.AddLine(rect.Left, rect.Bottom, rect.Left, rect.Top + curveSize / 2);
graphicsPath.AddArc(new Rectangle(rect.Left, rect.Top, curveSize, curveSize), 180, 90); graphicsPath.AddArc(new Rectangle(rect.Left, rect.Top, curveSize, curveSize), 180, 90);
graphicsPath.AddLine(rect.Left + curveSize / 2, rect.Top, rect.Right - curveSize / 2, rect.Top); graphicsPath.AddLine(rect.Left + curveSize / 2, rect.Top, rect.Right - curveSize / 2, rect.Top);
graphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Top, curveSize, curveSize), -90, 90); graphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Top, curveSize, curveSize), -90, 90);
graphicsPath.AddLine(rect.Right, rect.Top + curveSize / 2, rect.Right, rect.Bottom); graphicsPath.AddLine(rect.Right, rect.Top + curveSize / 2, rect.Right, rect.Bottom);
} }
else else
{ {
graphicsPath.AddLine(rect.Right, rect.Top, rect.Right, rect.Bottom - curveSize / 2); graphicsPath.AddLine(rect.Right, rect.Top, rect.Right, rect.Bottom - curveSize / 2);
graphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize), 0, 90); graphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize), 0, 90);
graphicsPath.AddLine(rect.Right - curveSize / 2, rect.Bottom, rect.Left + curveSize / 2, rect.Bottom); graphicsPath.AddLine(rect.Right - curveSize / 2, rect.Bottom, rect.Left + curveSize / 2, rect.Bottom);
graphicsPath.AddArc(new Rectangle(rect.Left, rect.Bottom - curveSize, curveSize, curveSize), 90, 90); graphicsPath.AddArc(new Rectangle(rect.Left, rect.Bottom - curveSize, curveSize, curveSize), 90, 90);
graphicsPath.AddLine(rect.Left, rect.Bottom - curveSize / 2, rect.Left, rect.Top); graphicsPath.AddLine(rect.Left, rect.Bottom - curveSize / 2, rect.Left, rect.Top);
} }
return graphicsPath; return graphicsPath;
} }
public static GraphicsPath CalculateGraphicsPathFromBitmap(Bitmap bitmap) public static GraphicsPath CalculateGraphicsPathFromBitmap(Bitmap bitmap)
{ {
return CalculateGraphicsPathFromBitmap(bitmap, Color.Empty); return CalculateGraphicsPathFromBitmap(bitmap, Color.Empty);
} }
// From http://edu.cnzz.cn/show_3281.html // From http://edu.cnzz.cn/show_3281.html
public static GraphicsPath CalculateGraphicsPathFromBitmap(Bitmap bitmap, Color colorTransparent) public static GraphicsPath CalculateGraphicsPathFromBitmap(Bitmap bitmap, Color colorTransparent)
{ {
GraphicsPath graphicsPath = new GraphicsPath(); GraphicsPath graphicsPath = new GraphicsPath();
if (colorTransparent == Color.Empty) if (colorTransparent == Color.Empty)
colorTransparent = bitmap.GetPixel(0, 0); colorTransparent = bitmap.GetPixel(0, 0);
for(int row = 0; row < bitmap.Height; row ++) for(int row = 0; row < bitmap.Height; row ++)
{ {
int colOpaquePixel = 0; int colOpaquePixel = 0;
for(int col = 0; col < bitmap.Width; col ++) for(int col = 0; col < bitmap.Width; col ++)
{ {
if(bitmap.GetPixel(col, row) != colorTransparent) if(bitmap.GetPixel(col, row) != colorTransparent)
{ {
colOpaquePixel = col; colOpaquePixel = col;
int colNext = col; int colNext = col;
for(colNext = colOpaquePixel; colNext < bitmap.Width; colNext ++) for(colNext = colOpaquePixel; colNext < bitmap.Width; colNext ++)
if(bitmap.GetPixel(colNext, row) == colorTransparent) if(bitmap.GetPixel(colNext, row) == colorTransparent)
break; break;
graphicsPath.AddRectangle(new Rectangle(colOpaquePixel, row, colNext - colOpaquePixel, 1)); graphicsPath.AddRectangle(new Rectangle(colOpaquePixel, row, colNext - colOpaquePixel, 1));
col = colNext; col = colNext;
} }
} }
} }
return graphicsPath; return graphicsPath;
} }
} }
} }

View file

@ -1,29 +1,29 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Reflection; using System.Reflection;
using System.Resources; using System.Resources;
using System.Windows.Forms; using System.Windows.Forms;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
internal static class ResourceHelper internal static class ResourceHelper
{ {
private static ResourceManager _resourceManager = null; private static ResourceManager _resourceManager = null;
private static ResourceManager ResourceManager private static ResourceManager ResourceManager
{ {
get get
{ {
if (_resourceManager == null) if (_resourceManager == null)
_resourceManager = new ResourceManager("LSLEditor.Docking.Strings", typeof(ResourceHelper).Assembly); _resourceManager = new ResourceManager("LSLEditor.Docking.Strings", typeof(ResourceHelper).Assembly);
return _resourceManager; return _resourceManager;
} }
} }
public static string GetString(string name) public static string GetString(string name)
{ {
return ResourceManager.GetString(name); return ResourceManager.GetString(name);
} }
} }
} }

View file

@ -1,19 +1,19 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
internal static class Win32Helper internal static class Win32Helper
{ {
public static Control ControlAtPoint(Point pt) public static Control ControlAtPoint(Point pt)
{ {
return Control.FromChildHandle(NativeMethods.WindowFromPoint(pt)); return Control.FromChildHandle(NativeMethods.WindowFromPoint(pt));
} }
public static uint MakeLong(int low, int high) public static uint MakeLong(int low, int high)
{ {
return (uint)((high << 16) + low); return (uint)((high << 16) + low);
} }
} }
} }

View file

@ -1,115 +1,115 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
internal abstract class InertButtonBase : Control internal abstract class InertButtonBase : Control
{ {
protected InertButtonBase() protected InertButtonBase()
{ {
SetStyle(ControlStyles.SupportsTransparentBackColor, true); SetStyle(ControlStyles.SupportsTransparentBackColor, true);
BackColor = Color.Transparent; BackColor = Color.Transparent;
} }
public abstract Bitmap Image public abstract Bitmap Image
{ {
get; get;
} }
private bool m_isMouseOver = false; private bool m_isMouseOver = false;
protected bool IsMouseOver protected bool IsMouseOver
{ {
get { return m_isMouseOver; } get { return m_isMouseOver; }
private set private set
{ {
if (m_isMouseOver == value) if (m_isMouseOver == value)
return; return;
m_isMouseOver = value; m_isMouseOver = value;
Invalidate(); Invalidate();
} }
} }
protected override Size DefaultSize protected override Size DefaultSize
{ {
get { return Resources.DockPane_Close.Size; } get { return Resources.DockPane_Close.Size; }
} }
protected override void OnMouseMove(MouseEventArgs e) protected override void OnMouseMove(MouseEventArgs e)
{ {
base.OnMouseMove(e); base.OnMouseMove(e);
bool over = ClientRectangle.Contains(e.X, e.Y); bool over = ClientRectangle.Contains(e.X, e.Y);
if (IsMouseOver != over) if (IsMouseOver != over)
IsMouseOver = over; IsMouseOver = over;
} }
protected override void OnMouseEnter(EventArgs e) protected override void OnMouseEnter(EventArgs e)
{ {
base.OnMouseEnter(e); base.OnMouseEnter(e);
if (!IsMouseOver) if (!IsMouseOver)
IsMouseOver = true; IsMouseOver = true;
} }
protected override void OnMouseLeave(EventArgs e) protected override void OnMouseLeave(EventArgs e)
{ {
base.OnMouseLeave(e); base.OnMouseLeave(e);
if (IsMouseOver) if (IsMouseOver)
IsMouseOver = false; IsMouseOver = false;
} }
protected override void OnPaint(PaintEventArgs e) protected override void OnPaint(PaintEventArgs e)
{ {
if (IsMouseOver && Enabled) if (IsMouseOver && Enabled)
{ {
using (Pen pen = new Pen(ForeColor)) using (Pen pen = new Pen(ForeColor))
{ {
e.Graphics.DrawRectangle(pen, Rectangle.Inflate(ClientRectangle, -1, -1)); e.Graphics.DrawRectangle(pen, Rectangle.Inflate(ClientRectangle, -1, -1));
} }
} }
using (ImageAttributes imageAttributes = new ImageAttributes()) using (ImageAttributes imageAttributes = new ImageAttributes())
{ {
ColorMap[] colorMap = new ColorMap[2]; ColorMap[] colorMap = new ColorMap[2];
colorMap[0] = new ColorMap(); colorMap[0] = new ColorMap();
colorMap[0].OldColor = Color.FromArgb(0, 0, 0); colorMap[0].OldColor = Color.FromArgb(0, 0, 0);
colorMap[0].NewColor = ForeColor; colorMap[0].NewColor = ForeColor;
colorMap[1] = new ColorMap(); colorMap[1] = new ColorMap();
colorMap[1].OldColor = Image.GetPixel(0, 0); colorMap[1].OldColor = Image.GetPixel(0, 0);
colorMap[1].NewColor = Color.Transparent; colorMap[1].NewColor = Color.Transparent;
imageAttributes.SetRemapTable(colorMap); imageAttributes.SetRemapTable(colorMap);
e.Graphics.DrawImage( e.Graphics.DrawImage(
Image, Image,
new Rectangle(0, 0, Image.Width, Image.Height), new Rectangle(0, 0, Image.Width, Image.Height),
0, 0, 0, 0,
Image.Width, Image.Width,
Image.Height, Image.Height,
GraphicsUnit.Pixel, GraphicsUnit.Pixel,
imageAttributes); imageAttributes);
} }
base.OnPaint(e); base.OnPaint(e);
} }
public void RefreshChanges() public void RefreshChanges()
{ {
if (IsDisposed) if (IsDisposed)
return; return;
bool mouseOver = ClientRectangle.Contains(PointToClient(Control.MousePosition)); bool mouseOver = ClientRectangle.Contains(PointToClient(Control.MousePosition));
if (mouseOver != IsMouseOver) if (mouseOver != IsMouseOver)
IsMouseOver = mouseOver; IsMouseOver = mouseOver;
OnRefreshChanges(); OnRefreshChanges();
} }
protected virtual void OnRefreshChanges() protected virtual void OnRefreshChanges()
{ {
} }
} }
} }

View file

@ -1,46 +1,46 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
public interface IDockContent public interface IDockContent
{ {
DockContentHandler DockHandler { get; } DockContentHandler DockHandler { get; }
void OnActivated(EventArgs e); void OnActivated(EventArgs e);
void OnDeactivate(EventArgs e); void OnDeactivate(EventArgs e);
} }
public interface INestedPanesContainer public interface INestedPanesContainer
{ {
DockState DockState { get; } DockState DockState { get; }
Rectangle DisplayingRectangle { get; } Rectangle DisplayingRectangle { get; }
NestedPaneCollection NestedPanes { get; } NestedPaneCollection NestedPanes { get; }
VisibleNestedPaneCollection VisibleNestedPanes { get; } VisibleNestedPaneCollection VisibleNestedPanes { get; }
bool IsFloat { get; } bool IsFloat { get; }
} }
internal interface IDragSource internal interface IDragSource
{ {
Control DragControl { get; } Control DragControl { get; }
} }
internal interface IDockDragSource : IDragSource internal interface IDockDragSource : IDragSource
{ {
Rectangle BeginDrag(Point ptMouse); Rectangle BeginDrag(Point ptMouse);
bool IsDockStateValid(DockState dockState); bool IsDockStateValid(DockState dockState);
bool CanDockTo(DockPane pane); bool CanDockTo(DockPane pane);
void FloatAt(Rectangle floatWindowBounds); void FloatAt(Rectangle floatWindowBounds);
void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex); void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex);
void DockTo(DockPanel panel, DockStyle dockStyle); void DockTo(DockPanel panel, DockStyle dockStyle);
} }
internal interface ISplitterDragSource : IDragSource internal interface ISplitterDragSource : IDragSource
{ {
void BeginDrag(Rectangle rectSplitter); void BeginDrag(Rectangle rectSplitter);
void EndDrag(); void EndDrag();
bool IsVertical { get; } bool IsVertical { get; }
Rectangle DragLimitBounds { get; } Rectangle DragLimitBounds { get; }
void MoveSplitter(int offset); void MoveSplitter(int offset);
} }
} }

View file

@ -1,46 +1,46 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
[AttributeUsage(AttributeTargets.All)] [AttributeUsage(AttributeTargets.All)]
internal sealed class LocalizedDescriptionAttribute : DescriptionAttribute internal sealed class LocalizedDescriptionAttribute : DescriptionAttribute
{ {
private bool m_initialized = false; private bool m_initialized = false;
public LocalizedDescriptionAttribute(string key) : base(key) public LocalizedDescriptionAttribute(string key) : base(key)
{ {
} }
public override string Description public override string Description
{ {
get get
{ {
if (!m_initialized) if (!m_initialized)
{ {
string key = base.Description; string key = base.Description;
DescriptionValue = ResourceHelper.GetString(key); DescriptionValue = ResourceHelper.GetString(key);
if (DescriptionValue == null) if (DescriptionValue == null)
DescriptionValue = String.Empty; DescriptionValue = String.Empty;
m_initialized = true; m_initialized = true;
} }
return DescriptionValue; return DescriptionValue;
} }
} }
} }
[AttributeUsage(AttributeTargets.All)] [AttributeUsage(AttributeTargets.All)]
internal sealed class LocalizedCategoryAttribute : CategoryAttribute internal sealed class LocalizedCategoryAttribute : CategoryAttribute
{ {
public LocalizedCategoryAttribute(string key) : base(key) public LocalizedCategoryAttribute(string key) : base(key)
{ {
} }
protected override string GetLocalizedString(string key) protected override string GetLocalizedString(string key)
{ {
return ResourceHelper.GetString(key); return ResourceHelper.GetString(key);
} }
} }
} }

View file

@ -1,14 +1,14 @@
using System; using System;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
internal static class Measures internal static class Measures
{ {
public const int SplitterSize = 4; public const int SplitterSize = 4;
} }
internal static class MeasurePane internal static class MeasurePane
{ {
public const int MinSize = 24; public const int MinSize = 24;
} }
} }

View file

@ -1,108 +1,108 @@
using System; using System;
using System.Drawing; using System.Drawing;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
public sealed class NestedDockingStatus public sealed class NestedDockingStatus
{ {
internal NestedDockingStatus(DockPane pane) internal NestedDockingStatus(DockPane pane)
{ {
m_dockPane = pane; m_dockPane = pane;
} }
private DockPane m_dockPane = null; private DockPane m_dockPane = null;
public DockPane DockPane public DockPane DockPane
{ {
get { return m_dockPane; } get { return m_dockPane; }
} }
private NestedPaneCollection m_nestedPanes = null; private NestedPaneCollection m_nestedPanes = null;
public NestedPaneCollection NestedPanes public NestedPaneCollection NestedPanes
{ {
get { return m_nestedPanes; } get { return m_nestedPanes; }
} }
private DockPane m_previousPane = null; private DockPane m_previousPane = null;
public DockPane PreviousPane public DockPane PreviousPane
{ {
get { return m_previousPane; } get { return m_previousPane; }
} }
private DockAlignment m_alignment = DockAlignment.Left; private DockAlignment m_alignment = DockAlignment.Left;
public DockAlignment Alignment public DockAlignment Alignment
{ {
get { return m_alignment; } get { return m_alignment; }
} }
private double m_proportion = 0.5; private double m_proportion = 0.5;
public double Proportion public double Proportion
{ {
get { return m_proportion; } get { return m_proportion; }
} }
private bool m_isDisplaying = false; private bool m_isDisplaying = false;
public bool IsDisplaying public bool IsDisplaying
{ {
get { return m_isDisplaying; } get { return m_isDisplaying; }
} }
private DockPane m_displayingPreviousPane = null; private DockPane m_displayingPreviousPane = null;
public DockPane DisplayingPreviousPane public DockPane DisplayingPreviousPane
{ {
get { return m_displayingPreviousPane; } get { return m_displayingPreviousPane; }
} }
private DockAlignment m_displayingAlignment = DockAlignment.Left; private DockAlignment m_displayingAlignment = DockAlignment.Left;
public DockAlignment DisplayingAlignment public DockAlignment DisplayingAlignment
{ {
get { return m_displayingAlignment; } get { return m_displayingAlignment; }
} }
private double m_displayingProportion = 0.5; private double m_displayingProportion = 0.5;
public double DisplayingProportion public double DisplayingProportion
{ {
get { return m_displayingProportion; } get { return m_displayingProportion; }
} }
private Rectangle m_logicalBounds = Rectangle.Empty; private Rectangle m_logicalBounds = Rectangle.Empty;
public Rectangle LogicalBounds public Rectangle LogicalBounds
{ {
get { return m_logicalBounds; } get { return m_logicalBounds; }
} }
private Rectangle m_paneBounds = Rectangle.Empty; private Rectangle m_paneBounds = Rectangle.Empty;
public Rectangle PaneBounds public Rectangle PaneBounds
{ {
get { return m_paneBounds; } get { return m_paneBounds; }
} }
private Rectangle m_splitterBounds = Rectangle.Empty; private Rectangle m_splitterBounds = Rectangle.Empty;
public Rectangle SplitterBounds public Rectangle SplitterBounds
{ {
get { return m_splitterBounds; } get { return m_splitterBounds; }
} }
internal void SetStatus(NestedPaneCollection nestedPanes, DockPane previousPane, DockAlignment alignment, double proportion) internal void SetStatus(NestedPaneCollection nestedPanes, DockPane previousPane, DockAlignment alignment, double proportion)
{ {
m_nestedPanes = nestedPanes; m_nestedPanes = nestedPanes;
m_previousPane = previousPane; m_previousPane = previousPane;
m_alignment = alignment; m_alignment = alignment;
m_proportion = proportion; m_proportion = proportion;
} }
internal void SetDisplayingStatus(bool isDisplaying, DockPane displayingPreviousPane, DockAlignment displayingAlignment, double displayingProportion) internal void SetDisplayingStatus(bool isDisplaying, DockPane displayingPreviousPane, DockAlignment displayingAlignment, double displayingProportion)
{ {
m_isDisplaying = isDisplaying; m_isDisplaying = isDisplaying;
m_displayingPreviousPane = displayingPreviousPane; m_displayingPreviousPane = displayingPreviousPane;
m_displayingAlignment = displayingAlignment; m_displayingAlignment = displayingAlignment;
m_displayingProportion = displayingProportion; m_displayingProportion = displayingProportion;
} }
internal void SetDisplayingBounds(Rectangle logicalBounds, Rectangle paneBounds, Rectangle splitterBounds) internal void SetDisplayingBounds(Rectangle logicalBounds, Rectangle paneBounds, Rectangle splitterBounds)
{ {
m_logicalBounds = logicalBounds; m_logicalBounds = logicalBounds;
m_paneBounds = paneBounds; m_paneBounds = paneBounds;
m_splitterBounds = splitterBounds; m_splitterBounds = splitterBounds;
} }
} }
} }

View file

@ -1,116 +1,116 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Drawing; using System.Drawing;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
public sealed class NestedPaneCollection : ReadOnlyCollection<DockPane> public sealed class NestedPaneCollection : ReadOnlyCollection<DockPane>
{ {
private INestedPanesContainer m_container; private INestedPanesContainer m_container;
private VisibleNestedPaneCollection m_visibleNestedPanes; private VisibleNestedPaneCollection m_visibleNestedPanes;
internal NestedPaneCollection(INestedPanesContainer container) internal NestedPaneCollection(INestedPanesContainer container)
: base(new List<DockPane>()) : base(new List<DockPane>())
{ {
m_container = container; m_container = container;
m_visibleNestedPanes = new VisibleNestedPaneCollection(this); m_visibleNestedPanes = new VisibleNestedPaneCollection(this);
} }
public INestedPanesContainer Container public INestedPanesContainer Container
{ {
get { return m_container; } get { return m_container; }
} }
public VisibleNestedPaneCollection VisibleNestedPanes public VisibleNestedPaneCollection VisibleNestedPanes
{ {
get { return m_visibleNestedPanes; } get { return m_visibleNestedPanes; }
} }
public DockState DockState public DockState DockState
{ {
get { return Container.DockState; } get { return Container.DockState; }
} }
public bool IsFloat public bool IsFloat
{ {
get { return DockState == DockState.Float; } get { return DockState == DockState.Float; }
} }
internal void Add(DockPane pane) internal void Add(DockPane pane)
{ {
if (pane == null) if (pane == null)
return; return;
NestedPaneCollection oldNestedPanes = (pane.NestedPanesContainer == null) ? null : pane.NestedPanesContainer.NestedPanes; NestedPaneCollection oldNestedPanes = (pane.NestedPanesContainer == null) ? null : pane.NestedPanesContainer.NestedPanes;
if (oldNestedPanes != null) if (oldNestedPanes != null)
oldNestedPanes.InternalRemove(pane); oldNestedPanes.InternalRemove(pane);
Items.Add(pane); Items.Add(pane);
if (oldNestedPanes != null) if (oldNestedPanes != null)
oldNestedPanes.CheckFloatWindowDispose(); oldNestedPanes.CheckFloatWindowDispose();
} }
private void CheckFloatWindowDispose() private void CheckFloatWindowDispose()
{ {
if (Count == 0 && Container.DockState == DockState.Float) if (Count == 0 && Container.DockState == DockState.Float)
{ {
FloatWindow floatWindow = (FloatWindow)Container; FloatWindow floatWindow = (FloatWindow)Container;
if (!floatWindow.Disposing && !floatWindow.IsDisposed) if (!floatWindow.Disposing && !floatWindow.IsDisposed)
NativeMethods.PostMessage(((FloatWindow)Container).Handle, FloatWindow.WM_CHECKDISPOSE, 0, 0); NativeMethods.PostMessage(((FloatWindow)Container).Handle, FloatWindow.WM_CHECKDISPOSE, 0, 0);
} }
} }
internal void Remove(DockPane pane) internal void Remove(DockPane pane)
{ {
InternalRemove(pane); InternalRemove(pane);
CheckFloatWindowDispose(); CheckFloatWindowDispose();
} }
private void InternalRemove(DockPane pane) private void InternalRemove(DockPane pane)
{ {
if (!Contains(pane)) if (!Contains(pane))
return; return;
NestedDockingStatus statusPane = pane.NestedDockingStatus; NestedDockingStatus statusPane = pane.NestedDockingStatus;
DockPane lastNestedPane = null; DockPane lastNestedPane = null;
for (int i=Count - 1; i> IndexOf(pane); i--) for (int i=Count - 1; i> IndexOf(pane); i--)
{ {
if (this[i].NestedDockingStatus.PreviousPane == pane) if (this[i].NestedDockingStatus.PreviousPane == pane)
{ {
lastNestedPane = this[i]; lastNestedPane = this[i];
break; break;
} }
} }
if (lastNestedPane != null) if (lastNestedPane != null)
{ {
int indexLastNestedPane = IndexOf(lastNestedPane); int indexLastNestedPane = IndexOf(lastNestedPane);
Items.Remove(lastNestedPane); Items.Remove(lastNestedPane);
Items[IndexOf(pane)] = lastNestedPane; Items[IndexOf(pane)] = lastNestedPane;
NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus; NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus;
lastNestedDock.SetStatus(this, statusPane.PreviousPane, statusPane.Alignment, statusPane.Proportion); lastNestedDock.SetStatus(this, statusPane.PreviousPane, statusPane.Alignment, statusPane.Proportion);
for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--) for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--)
{ {
NestedDockingStatus status = this[i].NestedDockingStatus; NestedDockingStatus status = this[i].NestedDockingStatus;
if (status.PreviousPane == pane) if (status.PreviousPane == pane)
status.SetStatus(this, lastNestedPane, status.Alignment, status.Proportion); status.SetStatus(this, lastNestedPane, status.Alignment, status.Proportion);
} }
} }
else else
Items.Remove(pane); Items.Remove(pane);
statusPane.SetStatus(null, null, DockAlignment.Left, 0.5); statusPane.SetStatus(null, null, DockAlignment.Left, 0.5);
statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5); statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5);
statusPane.SetDisplayingBounds(Rectangle.Empty, Rectangle.Empty, Rectangle.Empty); statusPane.SetDisplayingBounds(Rectangle.Empty, Rectangle.Empty, Rectangle.Empty);
} }
public DockPane GetDefaultPreviousPane(DockPane pane) public DockPane GetDefaultPreviousPane(DockPane pane)
{ {
for (int i=Count-1; i>=0; i--) for (int i=Count-1; i>=0; i--)
if (this[i] != pane) if (this[i] != pane)
return this[i]; return this[i];
return null; return null;
} }
} }
} }

View file

@ -1,225 +1,225 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:2.0.50727.3603 // Runtime Version:2.0.50727.3603
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
using System; using System;
/// <summary> /// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc. /// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary> /// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder // This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
private static global::System.Resources.ResourceManager resourceMan; private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture; private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() { internal Resources() {
} }
/// <summary> /// <summary>
/// Returns the cached ResourceManager instance used by this class. /// Returns the cached ResourceManager instance used by this class.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LSLEditor.Docking.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LSLEditor.Docking.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;
} }
} }
/// <summary> /// <summary>
/// Overrides the current thread's CurrentUICulture property for all /// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class. /// resource lookups using this strongly typed resource class.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { internal static global::System.Globalization.CultureInfo Culture {
get { get {
return resourceCulture; return resourceCulture;
} }
set { set {
resourceCulture = value; resourceCulture = value;
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PaneDiamond { internal static System.Drawing.Bitmap DockIndicator_PaneDiamond {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Bottom { internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Bottom {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Bottom", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Bottom", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Fill { internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Fill {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Fill", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Fill", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_HotSpot { internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_HotSpot {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_HotSpot", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_HotSpot", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_HotSpotIndex { internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_HotSpotIndex {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_HotSpotIndex", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_HotSpotIndex", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Left { internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Left {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Left", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Left", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Right { internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Right {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Right", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Right", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Top { internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Top {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Top", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Top", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PanelBottom { internal static System.Drawing.Bitmap DockIndicator_PanelBottom {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PanelBottom", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PanelBottom", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PanelBottom_Active { internal static System.Drawing.Bitmap DockIndicator_PanelBottom_Active {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PanelBottom_Active", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PanelBottom_Active", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PanelFill { internal static System.Drawing.Bitmap DockIndicator_PanelFill {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PanelFill", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PanelFill", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PanelFill_Active { internal static System.Drawing.Bitmap DockIndicator_PanelFill_Active {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PanelFill_Active", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PanelFill_Active", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PanelLeft { internal static System.Drawing.Bitmap DockIndicator_PanelLeft {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PanelLeft", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PanelLeft", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PanelLeft_Active { internal static System.Drawing.Bitmap DockIndicator_PanelLeft_Active {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PanelLeft_Active", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PanelLeft_Active", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PanelRight { internal static System.Drawing.Bitmap DockIndicator_PanelRight {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PanelRight", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PanelRight", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PanelRight_Active { internal static System.Drawing.Bitmap DockIndicator_PanelRight_Active {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PanelRight_Active", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PanelRight_Active", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PanelTop { internal static System.Drawing.Bitmap DockIndicator_PanelTop {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PanelTop", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PanelTop", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockIndicator_PanelTop_Active { internal static System.Drawing.Bitmap DockIndicator_PanelTop_Active {
get { get {
object obj = ResourceManager.GetObject("DockIndicator_PanelTop_Active", resourceCulture); object obj = ResourceManager.GetObject("DockIndicator_PanelTop_Active", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockPane_AutoHide { internal static System.Drawing.Bitmap DockPane_AutoHide {
get { get {
object obj = ResourceManager.GetObject("DockPane_AutoHide", resourceCulture); object obj = ResourceManager.GetObject("DockPane_AutoHide", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockPane_Close { internal static System.Drawing.Bitmap DockPane_Close {
get { get {
object obj = ResourceManager.GetObject("DockPane_Close", resourceCulture); object obj = ResourceManager.GetObject("DockPane_Close", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockPane_Dock { internal static System.Drawing.Bitmap DockPane_Dock {
get { get {
object obj = ResourceManager.GetObject("DockPane_Dock", resourceCulture); object obj = ResourceManager.GetObject("DockPane_Dock", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockPane_Option { internal static System.Drawing.Bitmap DockPane_Option {
get { get {
object obj = ResourceManager.GetObject("DockPane_Option", resourceCulture); object obj = ResourceManager.GetObject("DockPane_Option", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
internal static System.Drawing.Bitmap DockPane_OptionOverflow { internal static System.Drawing.Bitmap DockPane_OptionOverflow {
get { get {
object obj = ResourceManager.GetObject("DockPane_OptionOverflow", resourceCulture); object obj = ResourceManager.GetObject("DockPane_OptionOverflow", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
} }
} }

View file

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

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 774 B

After

Width:  |  Height:  |  Size: 774 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 774 B

After

Width:  |  Height:  |  Size: 774 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 774 B

After

Width:  |  Height:  |  Size: 774 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 774 B

After

Width:  |  Height:  |  Size: 774 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 774 B

After

Width:  |  Height:  |  Size: 774 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

View file

@ -1,70 +1,70 @@
using System; using System;
using System.Collections; using System.Collections;
using System.ComponentModel; using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
internal class SplitterBase : Control internal class SplitterBase : Control
{ {
public SplitterBase() public SplitterBase()
{ {
SetStyle(ControlStyles.Selectable, false); SetStyle(ControlStyles.Selectable, false);
} }
public override DockStyle Dock public override DockStyle Dock
{ {
get { return base.Dock; } get { return base.Dock; }
set set
{ {
SuspendLayout(); SuspendLayout();
base.Dock = value; base.Dock = value;
if (Dock == DockStyle.Left || Dock == DockStyle.Right) if (Dock == DockStyle.Left || Dock == DockStyle.Right)
Width = SplitterSize; Width = SplitterSize;
else if (Dock == DockStyle.Top || Dock == DockStyle.Bottom) else if (Dock == DockStyle.Top || Dock == DockStyle.Bottom)
Height = SplitterSize; Height = SplitterSize;
else else
Bounds = Rectangle.Empty; Bounds = Rectangle.Empty;
if (Dock == DockStyle.Left || Dock == DockStyle.Right) if (Dock == DockStyle.Left || Dock == DockStyle.Right)
Cursor = Cursors.VSplit; Cursor = Cursors.VSplit;
else if (Dock == DockStyle.Top || Dock == DockStyle.Bottom) else if (Dock == DockStyle.Top || Dock == DockStyle.Bottom)
Cursor = Cursors.HSplit; Cursor = Cursors.HSplit;
else else
Cursor = Cursors.Default; Cursor = Cursors.Default;
ResumeLayout(); ResumeLayout();
} }
} }
protected virtual int SplitterSize protected virtual int SplitterSize
{ {
get { return 0; } get { return 0; }
} }
protected override void OnMouseDown(MouseEventArgs e) protected override void OnMouseDown(MouseEventArgs e)
{ {
base.OnMouseDown(e); base.OnMouseDown(e);
if (e.Button != MouseButtons.Left) if (e.Button != MouseButtons.Left)
return; return;
StartDrag(); StartDrag();
} }
protected virtual void StartDrag() protected virtual void StartDrag()
{ {
} }
protected override void WndProc(ref Message m) protected override void WndProc(ref Message m)
{ {
// eat the WM_MOUSEACTIVATE message // eat the WM_MOUSEACTIVATE message
if (m.Msg == (int)Win32.Msgs.WM_MOUSEACTIVATE) if (m.Msg == (int)Win32.Msgs.WM_MOUSEACTIVATE)
return; return;
base.WndProc(ref m); base.WndProc(ref m);
} }
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -1,357 +1,357 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <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> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : 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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata"> <xsd:element name="metadata">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" /> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
<xsd:complexType> <xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <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:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <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="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" /> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" /> <xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:choice> </xsd:choice>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:schema> </xsd:schema>
<resheader name="resmimetype"> <resheader name="resmimetype">
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="Category_Docking" xml:space="preserve"> <data name="Category_Docking" xml:space="preserve">
<value>Docking</value> <value>Docking</value>
</data> </data>
<data name="Category_DockingNotification" xml:space="preserve"> <data name="Category_DockingNotification" xml:space="preserve">
<value>Docking Notification</value> <value>Docking Notification</value>
</data> </data>
<data name="Category_PropertyChanged" xml:space="preserve"> <data name="Category_PropertyChanged" xml:space="preserve">
<value>Property Changed</value> <value>Property Changed</value>
</data> </data>
<data name="DockAreaEditor_FloatCheckBoxText" xml:space="preserve"> <data name="DockAreaEditor_FloatCheckBoxText" xml:space="preserve">
<value>(Float)</value> <value>(Float)</value>
</data> </data>
<data name="DockContent_AllowEndUserDocking_Description" xml:space="preserve"> <data name="DockContent_AllowEndUserDocking_Description" xml:space="preserve">
<value>Determines if end user drag and drop docking is allowed.</value> <value>Determines if end user drag and drop docking is allowed.</value>
</data> </data>
<data name="DockContent_AutoHidePortion_Description" xml:space="preserve"> <data name="DockContent_AutoHidePortion_Description" xml:space="preserve">
<value>The size to display the content in auto hide mode. Value &lt; 1 to specify the size in portion; value &gt;= 1 to specify the size in pixel.</value> <value>The size to display the content in auto hide mode. Value &lt; 1 to specify the size in portion; value &gt;= 1 to specify the size in pixel.</value>
</data> </data>
<data name="DockContent_CloseButton_Description" xml:space="preserve"> <data name="DockContent_CloseButton_Description" xml:space="preserve">
<value>Enable/Disable the close button of the content.</value> <value>Enable/Disable the close button of the content.</value>
</data> </data>
<data name="DockContent_Constructor_InvalidForm" xml:space="preserve"> <data name="DockContent_Constructor_InvalidForm" xml:space="preserve">
<value>The form must be of type IDockContent.</value> <value>The form must be of type IDockContent.</value>
</data> </data>
<data name="DockContent_DockAreas_Description" xml:space="preserve"> <data name="DockContent_DockAreas_Description" xml:space="preserve">
<value>Gets or sets a value indicating in which area of the DockPanel the content allowed to show.</value> <value>Gets or sets a value indicating in which area of the DockPanel the content allowed to show.</value>
</data> </data>
<data name="DockContent_DockStateChanged_Description" xml:space="preserve"> <data name="DockContent_DockStateChanged_Description" xml:space="preserve">
<value>Occurs when the value of DockState property changed.</value> <value>Occurs when the value of DockState property changed.</value>
</data> </data>
<data name="DockContent_HideOnClose_Description" xml:space="preserve"> <data name="DockContent_HideOnClose_Description" xml:space="preserve">
<value>Indicates the content will be hidden instead of being closed.</value> <value>Indicates the content will be hidden instead of being closed.</value>
</data> </data>
<data name="DockContent_ShowHint_Description" xml:space="preserve"> <data name="DockContent_ShowHint_Description" xml:space="preserve">
<value>The desired docking state when first showing.</value> <value>The desired docking state when first showing.</value>
</data> </data>
<data name="DockContent_TabPageContextMenu_Description" xml:space="preserve"> <data name="DockContent_TabPageContextMenu_Description" xml:space="preserve">
<value>Context menu displayed for the dock pane tab strip.</value> <value>Context menu displayed for the dock pane tab strip.</value>
</data> </data>
<data name="DockContent_TabText_Description" xml:space="preserve"> <data name="DockContent_TabText_Description" xml:space="preserve">
<value>The tab text displayed in the dock pane. If not set, the Text property will be used.</value> <value>The tab text displayed in the dock pane. If not set, the Text property will be used.</value>
</data> </data>
<data name="DockContent_ToolTipText_Description" xml:space="preserve"> <data name="DockContent_ToolTipText_Description" xml:space="preserve">
<value>The text displayed when mouse hovers over the tab.</value> <value>The text displayed when mouse hovers over the tab.</value>
</data> </data>
<data name="DockContentHandler_AutoHidePortion_OutOfRange" xml:space="preserve"> <data name="DockContentHandler_AutoHidePortion_OutOfRange" xml:space="preserve">
<value>The provided value is out of range.</value> <value>The provided value is out of range.</value>
</data> </data>
<data name="DockContentHandler_DockAreas_InvalidValue" xml:space="preserve"> <data name="DockContentHandler_DockAreas_InvalidValue" xml:space="preserve">
<value>Invalid Value: The value of DockAreas conflicts with current DockState.</value> <value>Invalid Value: The value of DockAreas conflicts with current DockState.</value>
</data> </data>
<data name="DockContentHandler_DockPane_InvalidValue" xml:space="preserve"> <data name="DockContentHandler_DockPane_InvalidValue" xml:space="preserve">
<value>The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane.</value> <value>The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane.</value>
</data> </data>
<data name="DockContentHandler_FloatPane_InvalidValue" xml:space="preserve"> <data name="DockContentHandler_FloatPane_InvalidValue" xml:space="preserve">
<value>The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane.</value> <value>The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane.</value>
</data> </data>
<data name="DockContentHandler_IsFloat_InvalidValue" xml:space="preserve"> <data name="DockContentHandler_IsFloat_InvalidValue" xml:space="preserve">
<value>Invalid value, conflicts with DockableAreas property.</value> <value>Invalid value, conflicts with DockableAreas property.</value>
</data> </data>
<data name="DockContentHandler_SetDockState_InvalidState" xml:space="preserve"> <data name="DockContentHandler_SetDockState_InvalidState" xml:space="preserve">
<value>The dock state is invalid.</value> <value>The dock state is invalid.</value>
</data> </data>
<data name="DockContentHandler_SetDockState_NullPanel" xml:space="preserve"> <data name="DockContentHandler_SetDockState_NullPanel" xml:space="preserve">
<value>The dock panel is null.</value> <value>The dock panel is null.</value>
</data> </data>
<data name="DockContentHandler_Show_InvalidBeforeContent" xml:space="preserve"> <data name="DockContentHandler_Show_InvalidBeforeContent" xml:space="preserve">
<value>Invalid beforeContent, it must be contained by the pane.</value> <value>Invalid beforeContent, it must be contained by the pane.</value>
</data> </data>
<data name="DockContentHandler_Show_InvalidDockState" xml:space="preserve"> <data name="DockContentHandler_Show_InvalidDockState" xml:space="preserve">
<value>Invalid DockState: Content can not be showed as "Unknown" or "Hidden".</value> <value>Invalid DockState: Content can not be showed as "Unknown" or "Hidden".</value>
</data> </data>
<data name="DockContentHandler_Show_InvalidPrevPane" xml:space="preserve"> <data name="DockContentHandler_Show_InvalidPrevPane" xml:space="preserve">
<value>The previous pane is invalid. It can not be null, and its docking state must not be auto-hide.</value> <value>The previous pane is invalid. It can not be null, and its docking state must not be auto-hide.</value>
</data> </data>
<data name="DockContentHandler_Show_NullDockPanel" xml:space="preserve"> <data name="DockContentHandler_Show_NullDockPanel" xml:space="preserve">
<value>DockPanel can not be null.</value> <value>DockPanel can not be null.</value>
</data> </data>
<data name="DockContentHandler_Show_NullPane" xml:space="preserve"> <data name="DockContentHandler_Show_NullPane" xml:space="preserve">
<value>The Pane can not be null.</value> <value>The Pane can not be null.</value>
</data> </data>
<data name="DockContentHandler_ShowHint_InvalidValue" xml:space="preserve"> <data name="DockContentHandler_ShowHint_InvalidValue" xml:space="preserve">
<value>Invalid value, check DockableAreas property.</value> <value>Invalid value, check DockableAreas property.</value>
</data> </data>
<data name="DockHandler_TabPageContextMenuStrip_Description" xml:space="preserve"> <data name="DockHandler_TabPageContextMenuStrip_Description" xml:space="preserve">
<value>Context menu displayed for the dock pane tab strip.</value> <value>Context menu displayed for the dock pane tab strip.</value>
</data> </data>
<data name="DockIndicator_ToolTipText" xml:space="preserve"> <data name="DockIndicator_ToolTipText" xml:space="preserve">
<value>Press SHIFT for docking to full side.</value> <value>Press SHIFT for docking to full side.</value>
</data> </data>
<data name="DockPane_ActiveContent_InvalidValue" xml:space="preserve"> <data name="DockPane_ActiveContent_InvalidValue" xml:space="preserve">
<value>Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content.</value> <value>Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content.</value>
</data> </data>
<data name="DockPane_Constructor_NullContent" xml:space="preserve"> <data name="DockPane_Constructor_NullContent" xml:space="preserve">
<value>Invalid argument: Content can not be "null".</value> <value>Invalid argument: Content can not be "null".</value>
</data> </data>
<data name="DockPane_Constructor_NullDockPanel" xml:space="preserve"> <data name="DockPane_Constructor_NullDockPanel" xml:space="preserve">
<value>Invalid argument: The content's DockPanel can not be "null".</value> <value>Invalid argument: The content's DockPanel can not be "null".</value>
</data> </data>
<data name="DockPane_DockTo_InvalidContainer" xml:space="preserve"> <data name="DockPane_DockTo_InvalidContainer" xml:space="preserve">
<value>The specified container conflicts with the IsFloat property.</value> <value>The specified container conflicts with the IsFloat property.</value>
</data> </data>
<data name="DockPane_DockTo_NoPrevPane" xml:space="preserve"> <data name="DockPane_DockTo_NoPrevPane" xml:space="preserve">
<value>The previous pane does not exist in the nested docking pane collection.</value> <value>The previous pane does not exist in the nested docking pane collection.</value>
</data> </data>
<data name="DockPane_DockTo_NullContainer" xml:space="preserve"> <data name="DockPane_DockTo_NullContainer" xml:space="preserve">
<value>The container can not be null.</value> <value>The container can not be null.</value>
</data> </data>
<data name="DockPane_DockTo_NullPrevPane" xml:space="preserve"> <data name="DockPane_DockTo_NullPrevPane" xml:space="preserve">
<value>The previous pane can not be null when the nested docking pane collection is not empty.</value> <value>The previous pane can not be null when the nested docking pane collection is not empty.</value>
</data> </data>
<data name="DockPane_DockTo_SelfPrevPane" xml:space="preserve"> <data name="DockPane_DockTo_SelfPrevPane" xml:space="preserve">
<value>The previous pane can not be itself.</value> <value>The previous pane can not be itself.</value>
</data> </data>
<data name="DockPane_FloatWindow_InvalidValue" xml:space="preserve"> <data name="DockPane_FloatWindow_InvalidValue" xml:space="preserve">
<value>FloatWindow property can not be set to "null" when DockState is DockState.Float.</value> <value>FloatWindow property can not be set to "null" when DockState is DockState.Float.</value>
</data> </data>
<data name="DockPane_SetContentIndex_InvalidContent" xml:space="preserve"> <data name="DockPane_SetContentIndex_InvalidContent" xml:space="preserve">
<value>Invalid Content: Content not within the collection.</value> <value>Invalid Content: Content not within the collection.</value>
</data> </data>
<data name="DockPane_SetContentIndex_InvalidIndex" xml:space="preserve"> <data name="DockPane_SetContentIndex_InvalidIndex" xml:space="preserve">
<value>Invalid Index: The index is out of range.</value> <value>Invalid Index: The index is out of range.</value>
</data> </data>
<data name="DockPane_SetDockState_InvalidState" xml:space="preserve"> <data name="DockPane_SetDockState_InvalidState" xml:space="preserve">
<value>The state for the dock pane is invalid.</value> <value>The state for the dock pane is invalid.</value>
</data> </data>
<data name="DockPaneCaption_ToolTipAutoHide" xml:space="preserve"> <data name="DockPaneCaption_ToolTipAutoHide" xml:space="preserve">
<value>Auto Hide</value> <value>Auto Hide</value>
</data> </data>
<data name="DockPaneCaption_ToolTipClose" xml:space="preserve"> <data name="DockPaneCaption_ToolTipClose" xml:space="preserve">
<value>Close</value> <value>Close</value>
</data> </data>
<data name="DockPaneCaption_ToolTipOptions" xml:space="preserve"> <data name="DockPaneCaption_ToolTipOptions" xml:space="preserve">
<value>Options</value> <value>Options</value>
</data> </data>
<data name="DockPanel_ActiveAutoHideContent_InvalidValue" xml:space="preserve"> <data name="DockPanel_ActiveAutoHideContent_InvalidValue" xml:space="preserve">
<value>Invalid Content: The content must be auto-hide state and associates with this DockPanel.</value> <value>Invalid Content: The content must be auto-hide state and associates with this DockPanel.</value>
</data> </data>
<data name="DockPanel_ActiveContentChanged_Description" xml:space="preserve"> <data name="DockPanel_ActiveContentChanged_Description" xml:space="preserve">
<value>Occurs when the value of ActiveContentProperty changed.</value> <value>Occurs when the value of ActiveContentProperty changed.</value>
</data> </data>
<data name="DockPanel_ActiveDocumentChanged_Description" xml:space="preserve"> <data name="DockPanel_ActiveDocumentChanged_Description" xml:space="preserve">
<value>Occurs when the value of ActiveDocument property changed.</value> <value>Occurs when the value of ActiveDocument property changed.</value>
</data> </data>
<data name="DockPanel_ActivePaneChanged_Description" xml:space="preserve"> <data name="DockPanel_ActivePaneChanged_Description" xml:space="preserve">
<value>Occurs when the value of ActivePane property changed.</value> <value>Occurs when the value of ActivePane property changed.</value>
</data> </data>
<data name="DockPanel_AllowEndUserDocking_Description" xml:space="preserve"> <data name="DockPanel_AllowEndUserDocking_Description" xml:space="preserve">
<value>Determines if the drag and drop docking is allowed.</value> <value>Determines if the drag and drop docking is allowed.</value>
</data> </data>
<data name="DockPanel_AllowEndUserNestedDocking_Description" xml:space="preserve"> <data name="DockPanel_AllowEndUserNestedDocking_Description" xml:space="preserve">
<value>Determines if the drag and drop nested docking is allowed.</value> <value>Determines if the drag and drop nested docking is allowed.</value>
</data> </data>
<data name="DockPanel_ContentAdded_Description" xml:space="preserve"> <data name="DockPanel_ContentAdded_Description" xml:space="preserve">
<value>Occurs when a content added to the DockPanel.</value> <value>Occurs when a content added to the DockPanel.</value>
</data> </data>
<data name="DockPanel_ContentRemoved_Description" xml:space="preserve"> <data name="DockPanel_ContentRemoved_Description" xml:space="preserve">
<value>Occurs when a content removed from the DockPanel.</value> <value>Occurs when a content removed from the DockPanel.</value>
</data> </data>
<data name="DockPanel_DefaultFloatWindowSize_Description" xml:space="preserve"> <data name="DockPanel_DefaultFloatWindowSize_Description" xml:space="preserve">
<value>The default size of float window.</value> <value>The default size of float window.</value>
</data> </data>
<data name="DockPanel_Description" xml:space="preserve"> <data name="DockPanel_Description" xml:space="preserve">
<value>Provides Visual Studio .Net style docking.</value> <value>Provides Visual Studio .Net style docking.</value>
</data> </data>
<data name="DockPanel_DockBottomPortion_Description" xml:space="preserve"> <data name="DockPanel_DockBottomPortion_Description" xml:space="preserve">
<value>Size of the bottom docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.</value> <value>Size of the bottom docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.</value>
</data> </data>
<data name="DockPanel_DockLeftPortion_Description" xml:space="preserve"> <data name="DockPanel_DockLeftPortion_Description" xml:space="preserve">
<value>Size of the left docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.</value> <value>Size of the left docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.</value>
</data> </data>
<data name="DockPanel_DockRightPortion_Description" xml:space="preserve"> <data name="DockPanel_DockRightPortion_Description" xml:space="preserve">
<value>Size of the right docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.</value> <value>Size of the right docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.</value>
</data> </data>
<data name="DockPanel_DockTopPortion_Description" xml:space="preserve"> <data name="DockPanel_DockTopPortion_Description" xml:space="preserve">
<value>Size of the top docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.</value> <value>Size of the top docking window. Value &lt; 1 to specify the size in portion; value &gt; 1 to specify the size in pixels.</value>
</data> </data>
<data name="DockPanel_DocumentStyle_Description" xml:space="preserve"> <data name="DockPanel_DocumentStyle_Description" xml:space="preserve">
<value>The style of the document window.</value> <value>The style of the document window.</value>
</data> </data>
<data name="DockPanel_LoadFromXml_AlreadyInitialized" xml:space="preserve"> <data name="DockPanel_LoadFromXml_AlreadyInitialized" xml:space="preserve">
<value>The DockPanel has already been initialized.</value> <value>The DockPanel has already been initialized.</value>
</data> </data>
<data name="DockPanel_LoadFromXml_InvalidFormatVersion" xml:space="preserve"> <data name="DockPanel_LoadFromXml_InvalidFormatVersion" xml:space="preserve">
<value>The configuration file's version is invalid.</value> <value>The configuration file's version is invalid.</value>
</data> </data>
<data name="DockPanel_LoadFromXml_InvalidXmlFormat" xml:space="preserve"> <data name="DockPanel_LoadFromXml_InvalidXmlFormat" xml:space="preserve">
<value>The XML file format is invalid.</value> <value>The XML file format is invalid.</value>
</data> </data>
<data name="DockPanel_ParentForm_Invalid" xml:space="preserve"> <data name="DockPanel_ParentForm_Invalid" xml:space="preserve">
<value>Invalid parent form. When using DockingMdi or SystemMdi document style, the DockPanel control must be the child control of the main MDI container form.</value> <value>Invalid parent form. When using DockingMdi or SystemMdi document style, the DockPanel control must be the child control of the main MDI container form.</value>
</data> </data>
<data name="DockPanel_Persistor_XmlFileComment1" xml:space="preserve"> <data name="DockPanel_Persistor_XmlFileComment1" xml:space="preserve">
<value>DockPanel configuration file. Author: Weifen Luo, all rights reserved.</value> <value>DockPanel configuration file. Author: Weifen Luo, all rights reserved.</value>
</data> </data>
<data name="DockPanel_Persistor_XmlFileComment2" xml:space="preserve"> <data name="DockPanel_Persistor_XmlFileComment2" xml:space="preserve">
<value>!!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!</value> <value>!!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!</value>
</data> </data>
<data name="DockPanel_RightToLeftLayout_Description" xml:space="preserve"> <data name="DockPanel_RightToLeftLayout_Description" xml:space="preserve">
<value>Indicates whether the control layout is right-to-left when the RightToLeft property is set to Yes.</value> <value>Indicates whether the control layout is right-to-left when the RightToLeft property is set to Yes.</value>
</data> </data>
<data name="DockPanel_SetPaneIndex_InvalidIndex" xml:space="preserve"> <data name="DockPanel_SetPaneIndex_InvalidIndex" xml:space="preserve">
<value>Invalid Index: The index is out of range.</value> <value>Invalid Index: The index is out of range.</value>
</data> </data>
<data name="DockPanel_SetPaneIndex_InvalidPane" xml:space="preserve"> <data name="DockPanel_SetPaneIndex_InvalidPane" xml:space="preserve">
<value>Invalid Pane: DockPane not within the collection.</value> <value>Invalid Pane: DockPane not within the collection.</value>
</data> </data>
<data name="DockPanel_ShowDocumentIcon_Description" xml:space="preserve"> <data name="DockPanel_ShowDocumentIcon_Description" xml:space="preserve">
<value>Determines if the document icon will be displayed in the tab strip.</value> <value>Determines if the document icon will be displayed in the tab strip.</value>
</data> </data>
<data name="DockPaneStrip_ToolTipClose" xml:space="preserve"> <data name="DockPaneStrip_ToolTipClose" xml:space="preserve">
<value>Close</value> <value>Close</value>
</data> </data>
<data name="DockPaneStrip_ToolTipWindowList" xml:space="preserve"> <data name="DockPaneStrip_ToolTipWindowList" xml:space="preserve">
<value>Window List</value> <value>Window List</value>
</data> </data>
<data name="FloatWindow_Constructor_NullDockPanel" xml:space="preserve"> <data name="FloatWindow_Constructor_NullDockPanel" xml:space="preserve">
<value>Invalid argument: DockPanel can not be "null".</value> <value>Invalid argument: DockPanel can not be "null".</value>
</data> </data>
<data name="FloatWindow_SetPaneIndex_InvalidIndex" xml:space="preserve"> <data name="FloatWindow_SetPaneIndex_InvalidIndex" xml:space="preserve">
<value>Invalid Index: The index is out of range.</value> <value>Invalid Index: The index is out of range.</value>
</data> </data>
<data name="FloatWindow_SetPaneIndex_InvalidPane" xml:space="preserve"> <data name="FloatWindow_SetPaneIndex_InvalidPane" xml:space="preserve">
<value>Invalid Pane: DockPane not within the collection.</value> <value>Invalid Pane: DockPane not within the collection.</value>
</data> </data>
<data name="IDockDragSource_DockTo_InvalidPanel" xml:space="preserve"> <data name="IDockDragSource_DockTo_InvalidPanel" xml:space="preserve">
<value>Invalid DockPanel.</value> <value>Invalid DockPanel.</value>
</data> </data>
<data name="DockContent_CloseButtonVisible_Description" xml:space="preserve"> <data name="DockContent_CloseButtonVisible_Description" xml:space="preserve">
<value>Shows or hides the close button of the content. This property does not function with System MDI Document Style.</value> <value>Shows or hides the close button of the content. This property does not function with System MDI Document Style.</value>
</data> </data>
<data name="DockPanel_DockPanelSkin" xml:space="preserve"> <data name="DockPanel_DockPanelSkin" xml:space="preserve">
<value>The visual skin to use when displaying the docked windows.</value> <value>The visual skin to use when displaying the docked windows.</value>
</data> </data>
<data name="DockPanel_DocumentTabStripLocation" xml:space="preserve"> <data name="DockPanel_DocumentTabStripLocation" xml:space="preserve">
<value>Determines where the tab strip for Document style content is drawn.</value> <value>Determines where the tab strip for Document style content is drawn.</value>
</data> </data>
</root> </root>

View file

@ -1,478 +1,478 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Windows.Forms; using System.Windows.Forms;
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms.VisualStyles; using System.Windows.Forms.VisualStyles;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
internal class VS2005DockPaneCaption : DockPaneCaptionBase internal class VS2005DockPaneCaption : DockPaneCaptionBase
{ {
private sealed class InertButton : InertButtonBase private sealed class InertButton : InertButtonBase
{ {
private Bitmap m_image, m_imageAutoHide; private Bitmap m_image, m_imageAutoHide;
public InertButton(VS2005DockPaneCaption dockPaneCaption, Bitmap image, Bitmap imageAutoHide) public InertButton(VS2005DockPaneCaption dockPaneCaption, Bitmap image, Bitmap imageAutoHide)
: base() : base()
{ {
m_dockPaneCaption = dockPaneCaption; m_dockPaneCaption = dockPaneCaption;
m_image = image; m_image = image;
m_imageAutoHide = imageAutoHide; m_imageAutoHide = imageAutoHide;
RefreshChanges(); RefreshChanges();
} }
private VS2005DockPaneCaption m_dockPaneCaption; private VS2005DockPaneCaption m_dockPaneCaption;
private VS2005DockPaneCaption DockPaneCaption private VS2005DockPaneCaption DockPaneCaption
{ {
get { return m_dockPaneCaption; } get { return m_dockPaneCaption; }
} }
public bool IsAutoHide public bool IsAutoHide
{ {
get { return DockPaneCaption.DockPane.IsAutoHide; } get { return DockPaneCaption.DockPane.IsAutoHide; }
} }
public override Bitmap Image public override Bitmap Image
{ {
get { return IsAutoHide ? m_imageAutoHide : m_image; } get { return IsAutoHide ? m_imageAutoHide : m_image; }
} }
protected override void OnRefreshChanges() protected override void OnRefreshChanges()
{ {
if (DockPaneCaption.DockPane.DockPanel != null) if (DockPaneCaption.DockPane.DockPanel != null)
{ {
if (DockPaneCaption.TextColor != ForeColor) if (DockPaneCaption.TextColor != ForeColor)
{ {
ForeColor = DockPaneCaption.TextColor; ForeColor = DockPaneCaption.TextColor;
Invalidate(); Invalidate();
} }
} }
} }
} }
#region consts #region consts
private const int _TextGapTop = 2; private const int _TextGapTop = 2;
private const int _TextGapBottom = 0; private const int _TextGapBottom = 0;
private const int _TextGapLeft = 3; private const int _TextGapLeft = 3;
private const int _TextGapRight = 3; private const int _TextGapRight = 3;
private const int _ButtonGapTop = 2; private const int _ButtonGapTop = 2;
private const int _ButtonGapBottom = 1; private const int _ButtonGapBottom = 1;
private const int _ButtonGapBetween = 1; private const int _ButtonGapBetween = 1;
private const int _ButtonGapLeft = 1; private const int _ButtonGapLeft = 1;
private const int _ButtonGapRight = 2; private const int _ButtonGapRight = 2;
#endregion #endregion
private static Bitmap _imageButtonClose; private static Bitmap _imageButtonClose;
private static Bitmap ImageButtonClose private static Bitmap ImageButtonClose
{ {
get get
{ {
if (_imageButtonClose == null) if (_imageButtonClose == null)
_imageButtonClose = Resources.DockPane_Close; _imageButtonClose = Resources.DockPane_Close;
return _imageButtonClose; return _imageButtonClose;
} }
} }
private InertButton m_buttonClose; private InertButton m_buttonClose;
private InertButton ButtonClose private InertButton ButtonClose
{ {
get get
{ {
if (m_buttonClose == null) if (m_buttonClose == null)
{ {
m_buttonClose = new InertButton(this, ImageButtonClose, ImageButtonClose); m_buttonClose = new InertButton(this, ImageButtonClose, ImageButtonClose);
m_toolTip.SetToolTip(m_buttonClose, ToolTipClose); m_toolTip.SetToolTip(m_buttonClose, ToolTipClose);
m_buttonClose.Click += new EventHandler(Close_Click); m_buttonClose.Click += new EventHandler(Close_Click);
Controls.Add(m_buttonClose); Controls.Add(m_buttonClose);
} }
return m_buttonClose; return m_buttonClose;
} }
} }
private static Bitmap _imageButtonAutoHide; private static Bitmap _imageButtonAutoHide;
private static Bitmap ImageButtonAutoHide private static Bitmap ImageButtonAutoHide
{ {
get get
{ {
if (_imageButtonAutoHide == null) if (_imageButtonAutoHide == null)
_imageButtonAutoHide = Resources.DockPane_AutoHide; _imageButtonAutoHide = Resources.DockPane_AutoHide;
return _imageButtonAutoHide; return _imageButtonAutoHide;
} }
} }
private static Bitmap _imageButtonDock; private static Bitmap _imageButtonDock;
private static Bitmap ImageButtonDock private static Bitmap ImageButtonDock
{ {
get get
{ {
if (_imageButtonDock == null) if (_imageButtonDock == null)
_imageButtonDock = Resources.DockPane_Dock; _imageButtonDock = Resources.DockPane_Dock;
return _imageButtonDock; return _imageButtonDock;
} }
} }
private InertButton m_buttonAutoHide; private InertButton m_buttonAutoHide;
private InertButton ButtonAutoHide private InertButton ButtonAutoHide
{ {
get get
{ {
if (m_buttonAutoHide == null) if (m_buttonAutoHide == null)
{ {
m_buttonAutoHide = new InertButton(this, ImageButtonDock, ImageButtonAutoHide); m_buttonAutoHide = new InertButton(this, ImageButtonDock, ImageButtonAutoHide);
m_toolTip.SetToolTip(m_buttonAutoHide, ToolTipAutoHide); m_toolTip.SetToolTip(m_buttonAutoHide, ToolTipAutoHide);
m_buttonAutoHide.Click += new EventHandler(AutoHide_Click); m_buttonAutoHide.Click += new EventHandler(AutoHide_Click);
Controls.Add(m_buttonAutoHide); Controls.Add(m_buttonAutoHide);
} }
return m_buttonAutoHide; return m_buttonAutoHide;
} }
} }
private static Bitmap _imageButtonOptions; private static Bitmap _imageButtonOptions;
private static Bitmap ImageButtonOptions private static Bitmap ImageButtonOptions
{ {
get get
{ {
if (_imageButtonOptions == null) if (_imageButtonOptions == null)
_imageButtonOptions = Resources.DockPane_Option; _imageButtonOptions = Resources.DockPane_Option;
return _imageButtonOptions; return _imageButtonOptions;
} }
} }
private InertButton m_buttonOptions; private InertButton m_buttonOptions;
private InertButton ButtonOptions private InertButton ButtonOptions
{ {
get get
{ {
if (m_buttonOptions == null) if (m_buttonOptions == null)
{ {
m_buttonOptions = new InertButton(this, ImageButtonOptions, ImageButtonOptions); m_buttonOptions = new InertButton(this, ImageButtonOptions, ImageButtonOptions);
m_toolTip.SetToolTip(m_buttonOptions, ToolTipOptions); m_toolTip.SetToolTip(m_buttonOptions, ToolTipOptions);
m_buttonOptions.Click += new EventHandler(Options_Click); m_buttonOptions.Click += new EventHandler(Options_Click);
Controls.Add(m_buttonOptions); Controls.Add(m_buttonOptions);
} }
return m_buttonOptions; return m_buttonOptions;
} }
} }
private IContainer m_components; private IContainer m_components;
private IContainer Components private IContainer Components
{ {
get { return m_components; } get { return m_components; }
} }
private ToolTip m_toolTip; private ToolTip m_toolTip;
public VS2005DockPaneCaption(DockPane pane) : base(pane) public VS2005DockPaneCaption(DockPane pane) : base(pane)
{ {
SuspendLayout(); SuspendLayout();
m_components = new Container(); m_components = new Container();
m_toolTip = new ToolTip(Components); m_toolTip = new ToolTip(Components);
ResumeLayout(); ResumeLayout();
} }
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing) if (disposing)
Components.Dispose(); Components.Dispose();
base.Dispose(disposing); base.Dispose(disposing);
} }
private static int TextGapTop private static int TextGapTop
{ {
get { return _TextGapTop; } get { return _TextGapTop; }
} }
private static Font TextFont private static Font TextFont
{ {
get { return SystemInformation.MenuFont; } get { return SystemInformation.MenuFont; }
} }
private static int TextGapBottom private static int TextGapBottom
{ {
get { return _TextGapBottom; } get { return _TextGapBottom; }
} }
private static int TextGapLeft private static int TextGapLeft
{ {
get { return _TextGapLeft; } get { return _TextGapLeft; }
} }
private static int TextGapRight private static int TextGapRight
{ {
get { return _TextGapRight; } get { return _TextGapRight; }
} }
private static int ButtonGapTop private static int ButtonGapTop
{ {
get { return _ButtonGapTop; } get { return _ButtonGapTop; }
} }
private static int ButtonGapBottom private static int ButtonGapBottom
{ {
get { return _ButtonGapBottom; } get { return _ButtonGapBottom; }
} }
private static int ButtonGapLeft private static int ButtonGapLeft
{ {
get { return _ButtonGapLeft; } get { return _ButtonGapLeft; }
} }
private static int ButtonGapRight private static int ButtonGapRight
{ {
get { return _ButtonGapRight; } get { return _ButtonGapRight; }
} }
private static int ButtonGapBetween private static int ButtonGapBetween
{ {
get { return _ButtonGapBetween; } get { return _ButtonGapBetween; }
} }
private static string _toolTipClose; private static string _toolTipClose;
private static string ToolTipClose private static string ToolTipClose
{ {
get get
{ {
if (_toolTipClose == null) if (_toolTipClose == null)
_toolTipClose = Strings.DockPaneCaption_ToolTipClose; _toolTipClose = Strings.DockPaneCaption_ToolTipClose;
return _toolTipClose; return _toolTipClose;
} }
} }
private static string _toolTipOptions; private static string _toolTipOptions;
private static string ToolTipOptions private static string ToolTipOptions
{ {
get get
{ {
if (_toolTipOptions == null) if (_toolTipOptions == null)
_toolTipOptions = Strings.DockPaneCaption_ToolTipOptions; _toolTipOptions = Strings.DockPaneCaption_ToolTipOptions;
return _toolTipOptions; return _toolTipOptions;
} }
} }
private static string _toolTipAutoHide; private static string _toolTipAutoHide;
private static string ToolTipAutoHide private static string ToolTipAutoHide
{ {
get get
{ {
if (_toolTipAutoHide == null) if (_toolTipAutoHide == null)
_toolTipAutoHide = Strings.DockPaneCaption_ToolTipAutoHide; _toolTipAutoHide = Strings.DockPaneCaption_ToolTipAutoHide;
return _toolTipAutoHide; return _toolTipAutoHide;
} }
} }
private static Blend _activeBackColorGradientBlend; private static Blend _activeBackColorGradientBlend;
private static Blend ActiveBackColorGradientBlend private static Blend ActiveBackColorGradientBlend
{ {
get get
{ {
if (_activeBackColorGradientBlend == null) if (_activeBackColorGradientBlend == null)
{ {
Blend blend = new Blend(2); Blend blend = new Blend(2);
blend.Factors = new float[]{0.5F, 1.0F}; blend.Factors = new float[]{0.5F, 1.0F};
blend.Positions = new float[]{0.0F, 1.0F}; blend.Positions = new float[]{0.0F, 1.0F};
_activeBackColorGradientBlend = blend; _activeBackColorGradientBlend = blend;
} }
return _activeBackColorGradientBlend; return _activeBackColorGradientBlend;
} }
} }
private Color TextColor private Color TextColor
{ {
get get
{ {
if (DockPane.IsActivated) if (DockPane.IsActivated)
return DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.TextColor; return DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.TextColor;
else else
return DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.TextColor; return DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.TextColor;
} }
} }
private static TextFormatFlags _textFormat = private static TextFormatFlags _textFormat =
TextFormatFlags.SingleLine | TextFormatFlags.SingleLine |
TextFormatFlags.EndEllipsis | TextFormatFlags.EndEllipsis |
TextFormatFlags.VerticalCenter; TextFormatFlags.VerticalCenter;
private TextFormatFlags TextFormat private TextFormatFlags TextFormat
{ {
get get
{ {
if (RightToLeft == RightToLeft.No) if (RightToLeft == RightToLeft.No)
return _textFormat; return _textFormat;
else else
return _textFormat | TextFormatFlags.RightToLeft | TextFormatFlags.Right; return _textFormat | TextFormatFlags.RightToLeft | TextFormatFlags.Right;
} }
} }
protected internal override int MeasureHeight() protected internal override int MeasureHeight()
{ {
int height = TextFont.Height + TextGapTop + TextGapBottom; int height = TextFont.Height + TextGapTop + TextGapBottom;
if (height < ButtonClose.Image.Height + ButtonGapTop + ButtonGapBottom) if (height < ButtonClose.Image.Height + ButtonGapTop + ButtonGapBottom)
height = ButtonClose.Image.Height + ButtonGapTop + ButtonGapBottom; height = ButtonClose.Image.Height + ButtonGapTop + ButtonGapBottom;
return height; return height;
} }
protected override void OnPaint(PaintEventArgs e) protected override void OnPaint(PaintEventArgs e)
{ {
base.OnPaint (e); base.OnPaint (e);
DrawCaption(e.Graphics); DrawCaption(e.Graphics);
} }
private void DrawCaption(Graphics g) private void DrawCaption(Graphics g)
{ {
if (ClientRectangle.Width == 0 || ClientRectangle.Height == 0) if (ClientRectangle.Width == 0 || ClientRectangle.Height == 0)
return; return;
if (DockPane.IsActivated) if (DockPane.IsActivated)
{ {
Color startColor = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.StartColor; Color startColor = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.StartColor;
Color endColor = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.EndColor; Color endColor = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.EndColor;
LinearGradientMode gradientMode = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.LinearGradientMode; LinearGradientMode gradientMode = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.LinearGradientMode;
using (LinearGradientBrush brush = new LinearGradientBrush(ClientRectangle, startColor, endColor, gradientMode)) using (LinearGradientBrush brush = new LinearGradientBrush(ClientRectangle, startColor, endColor, gradientMode))
{ {
brush.Blend = ActiveBackColorGradientBlend; brush.Blend = ActiveBackColorGradientBlend;
g.FillRectangle(brush, ClientRectangle); g.FillRectangle(brush, ClientRectangle);
} }
} }
else else
{ {
Color startColor = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.StartColor; Color startColor = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.StartColor;
Color endColor = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.EndColor; Color endColor = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.EndColor;
LinearGradientMode gradientMode = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.LinearGradientMode; LinearGradientMode gradientMode = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.LinearGradientMode;
using (LinearGradientBrush brush = new LinearGradientBrush(ClientRectangle, startColor, endColor, gradientMode)) using (LinearGradientBrush brush = new LinearGradientBrush(ClientRectangle, startColor, endColor, gradientMode))
{ {
g.FillRectangle(brush, ClientRectangle); g.FillRectangle(brush, ClientRectangle);
} }
} }
Rectangle rectCaption = ClientRectangle; Rectangle rectCaption = ClientRectangle;
Rectangle rectCaptionText = rectCaption; Rectangle rectCaptionText = rectCaption;
rectCaptionText.X += TextGapLeft; rectCaptionText.X += TextGapLeft;
rectCaptionText.Width -= TextGapLeft + TextGapRight; rectCaptionText.Width -= TextGapLeft + TextGapRight;
rectCaptionText.Width -= ButtonGapLeft + ButtonClose.Width + ButtonGapRight; rectCaptionText.Width -= ButtonGapLeft + ButtonClose.Width + ButtonGapRight;
if (ShouldShowAutoHideButton) if (ShouldShowAutoHideButton)
rectCaptionText.Width -= ButtonAutoHide.Width + ButtonGapBetween; rectCaptionText.Width -= ButtonAutoHide.Width + ButtonGapBetween;
if (HasTabPageContextMenu) if (HasTabPageContextMenu)
rectCaptionText.Width -= ButtonOptions.Width + ButtonGapBetween; rectCaptionText.Width -= ButtonOptions.Width + ButtonGapBetween;
rectCaptionText.Y += TextGapTop; rectCaptionText.Y += TextGapTop;
rectCaptionText.Height -= TextGapTop + TextGapBottom; rectCaptionText.Height -= TextGapTop + TextGapBottom;
Color colorText; Color colorText;
if (DockPane.IsActivated) if (DockPane.IsActivated)
colorText = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.TextColor; colorText = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.TextColor;
else else
colorText = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.TextColor; colorText = DockPane.DockPanel.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.TextColor;
TextRenderer.DrawText(g, DockPane.CaptionText, TextFont, DrawHelper.RtlTransform(this, rectCaptionText), colorText, TextFormat); TextRenderer.DrawText(g, DockPane.CaptionText, TextFont, DrawHelper.RtlTransform(this, rectCaptionText), colorText, TextFormat);
} }
protected override void OnLayout(LayoutEventArgs levent) protected override void OnLayout(LayoutEventArgs levent)
{ {
SetButtonsPosition(); SetButtonsPosition();
base.OnLayout (levent); base.OnLayout (levent);
} }
protected override void OnRefreshChanges() protected override void OnRefreshChanges()
{ {
SetButtons(); SetButtons();
Invalidate(); Invalidate();
} }
private bool CloseButtonEnabled private bool CloseButtonEnabled
{ {
get { return (DockPane.ActiveContent != null)? DockPane.ActiveContent.DockHandler.CloseButton : false; } get { return (DockPane.ActiveContent != null)? DockPane.ActiveContent.DockHandler.CloseButton : false; }
} }
/// <summary> /// <summary>
/// Determines whether the close button is visible on the content /// Determines whether the close button is visible on the content
/// </summary> /// </summary>
private bool CloseButtonVisible private bool CloseButtonVisible
{ {
get { return (DockPane.ActiveContent != null) ? DockPane.ActiveContent.DockHandler.CloseButtonVisible : false; } get { return (DockPane.ActiveContent != null) ? DockPane.ActiveContent.DockHandler.CloseButtonVisible : false; }
} }
private bool ShouldShowAutoHideButton private bool ShouldShowAutoHideButton
{ {
get { return !DockPane.IsFloat; } get { return !DockPane.IsFloat; }
} }
private void SetButtons() private void SetButtons()
{ {
ButtonClose.Enabled = CloseButtonEnabled; ButtonClose.Enabled = CloseButtonEnabled;
ButtonClose.Visible = CloseButtonVisible; ButtonClose.Visible = CloseButtonVisible;
ButtonAutoHide.Visible = ShouldShowAutoHideButton; ButtonAutoHide.Visible = ShouldShowAutoHideButton;
ButtonOptions.Visible = HasTabPageContextMenu; ButtonOptions.Visible = HasTabPageContextMenu;
ButtonClose.RefreshChanges(); ButtonClose.RefreshChanges();
ButtonAutoHide.RefreshChanges(); ButtonAutoHide.RefreshChanges();
ButtonOptions.RefreshChanges(); ButtonOptions.RefreshChanges();
SetButtonsPosition(); SetButtonsPosition();
} }
private void SetButtonsPosition() private void SetButtonsPosition()
{ {
// set the size and location for close and auto-hide buttons // set the size and location for close and auto-hide buttons
Rectangle rectCaption = ClientRectangle; Rectangle rectCaption = ClientRectangle;
int buttonWidth = ButtonClose.Image.Width; int buttonWidth = ButtonClose.Image.Width;
int buttonHeight = ButtonClose.Image.Height; int buttonHeight = ButtonClose.Image.Height;
int height = rectCaption.Height - ButtonGapTop - ButtonGapBottom; int height = rectCaption.Height - ButtonGapTop - ButtonGapBottom;
if (buttonHeight < height) if (buttonHeight < height)
{ {
buttonWidth = buttonWidth * (height / buttonHeight); buttonWidth = buttonWidth * (height / buttonHeight);
buttonHeight = height; buttonHeight = height;
} }
Size buttonSize = new Size(buttonWidth, buttonHeight); Size buttonSize = new Size(buttonWidth, buttonHeight);
int x = rectCaption.X + rectCaption.Width - 1 - ButtonGapRight - m_buttonClose.Width; int x = rectCaption.X + rectCaption.Width - 1 - ButtonGapRight - m_buttonClose.Width;
int y = rectCaption.Y + ButtonGapTop; int y = rectCaption.Y + ButtonGapTop;
Point point = new Point(x, y); Point point = new Point(x, y);
ButtonClose.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize)); ButtonClose.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize));
// If the close button is not visible draw the auto hide button overtop. // If the close button is not visible draw the auto hide button overtop.
// Otherwise it is drawn to the left of the close button. // Otherwise it is drawn to the left of the close button.
if (CloseButtonVisible) if (CloseButtonVisible)
point.Offset(-(buttonWidth + ButtonGapBetween), 0); point.Offset(-(buttonWidth + ButtonGapBetween), 0);
ButtonAutoHide.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize)); ButtonAutoHide.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize));
if (ShouldShowAutoHideButton) if (ShouldShowAutoHideButton)
point.Offset(-(buttonWidth + ButtonGapBetween), 0); point.Offset(-(buttonWidth + ButtonGapBetween), 0);
ButtonOptions.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize)); ButtonOptions.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize));
} }
private void Close_Click(object sender, EventArgs e) private void Close_Click(object sender, EventArgs e)
{ {
DockPane.CloseActiveContent(); DockPane.CloseActiveContent();
} }
private void AutoHide_Click(object sender, EventArgs e) private void AutoHide_Click(object sender, EventArgs e)
{ {
DockPane.DockState = DockHelper.ToggleAutoHideState(DockPane.DockState); DockPane.DockState = DockHelper.ToggleAutoHideState(DockPane.DockState);
if (DockHelper.IsDockStateAutoHide(DockPane.DockState)) if (DockHelper.IsDockStateAutoHide(DockPane.DockState))
DockPane.DockPanel.ActiveAutoHideContent = null; DockPane.DockPanel.ActiveAutoHideContent = null;
} }
private void Options_Click(object sender, EventArgs e) private void Options_Click(object sender, EventArgs e)
{ {
ShowTabPageContextMenu(PointToClient(Control.MousePosition)); ShowTabPageContextMenu(PointToClient(Control.MousePosition));
} }
protected override void OnRightToLeftChanged(EventArgs e) protected override void OnRightToLeftChanged(EventArgs e)
{ {
base.OnRightToLeftChanged(e); base.OnRightToLeftChanged(e);
PerformLayout(); PerformLayout();
} }
} }
} }

View file

@ -1,168 +1,168 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
namespace LSLEditor.Docking namespace LSLEditor.Docking
{ {
public sealed class VisibleNestedPaneCollection : ReadOnlyCollection<DockPane> public sealed class VisibleNestedPaneCollection : ReadOnlyCollection<DockPane>
{ {
private NestedPaneCollection m_nestedPanes; private NestedPaneCollection m_nestedPanes;
internal VisibleNestedPaneCollection(NestedPaneCollection nestedPanes) internal VisibleNestedPaneCollection(NestedPaneCollection nestedPanes)
: base(new List<DockPane>()) : base(new List<DockPane>())
{ {
m_nestedPanes = nestedPanes; m_nestedPanes = nestedPanes;
} }
public NestedPaneCollection NestedPanes public NestedPaneCollection NestedPanes
{ {
get { return m_nestedPanes; } get { return m_nestedPanes; }
} }
public INestedPanesContainer Container public INestedPanesContainer Container
{ {
get { return NestedPanes.Container; } get { return NestedPanes.Container; }
} }
public DockState DockState public DockState DockState
{ {
get { return NestedPanes.DockState; } get { return NestedPanes.DockState; }
} }
public bool IsFloat public bool IsFloat
{ {
get { return NestedPanes.IsFloat; } get { return NestedPanes.IsFloat; }
} }
internal void Refresh() internal void Refresh()
{ {
Items.Clear(); Items.Clear();
for (int i=0; i<NestedPanes.Count; i++) for (int i=0; i<NestedPanes.Count; i++)
{ {
DockPane pane = NestedPanes[i]; DockPane pane = NestedPanes[i];
NestedDockingStatus status = pane.NestedDockingStatus; NestedDockingStatus status = pane.NestedDockingStatus;
status.SetDisplayingStatus(true, status.PreviousPane, status.Alignment, status.Proportion); status.SetDisplayingStatus(true, status.PreviousPane, status.Alignment, status.Proportion);
Items.Add(pane); Items.Add(pane);
} }
foreach (DockPane pane in NestedPanes) foreach (DockPane pane in NestedPanes)
if (pane.DockState != DockState || pane.IsHidden) if (pane.DockState != DockState || pane.IsHidden)
{ {
pane.Bounds = Rectangle.Empty; pane.Bounds = Rectangle.Empty;
pane.SplitterBounds = Rectangle.Empty; pane.SplitterBounds = Rectangle.Empty;
Remove(pane); Remove(pane);
} }
CalculateBounds(); CalculateBounds();
foreach (DockPane pane in this) foreach (DockPane pane in this)
{ {
NestedDockingStatus status = pane.NestedDockingStatus; NestedDockingStatus status = pane.NestedDockingStatus;
pane.Bounds = status.PaneBounds; pane.Bounds = status.PaneBounds;
pane.SplitterBounds = status.SplitterBounds; pane.SplitterBounds = status.SplitterBounds;
pane.SplitterAlignment = status.Alignment; pane.SplitterAlignment = status.Alignment;
} }
} }
private void Remove(DockPane pane) private void Remove(DockPane pane)
{ {
if (!Contains(pane)) if (!Contains(pane))
return; return;
NestedDockingStatus statusPane = pane.NestedDockingStatus; NestedDockingStatus statusPane = pane.NestedDockingStatus;
DockPane lastNestedPane = null; DockPane lastNestedPane = null;
for (int i=Count - 1; i> IndexOf(pane); i--) for (int i=Count - 1; i> IndexOf(pane); i--)
{ {
if (this[i].NestedDockingStatus.PreviousPane == pane) if (this[i].NestedDockingStatus.PreviousPane == pane)
{ {
lastNestedPane = this[i]; lastNestedPane = this[i];
break; break;
} }
} }
if (lastNestedPane != null) if (lastNestedPane != null)
{ {
int indexLastNestedPane = IndexOf(lastNestedPane); int indexLastNestedPane = IndexOf(lastNestedPane);
Items.Remove(lastNestedPane); Items.Remove(lastNestedPane);
Items[IndexOf(pane)] = lastNestedPane; Items[IndexOf(pane)] = lastNestedPane;
NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus; NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus;
lastNestedDock.SetDisplayingStatus(true, statusPane.DisplayingPreviousPane, statusPane.DisplayingAlignment, statusPane.DisplayingProportion); lastNestedDock.SetDisplayingStatus(true, statusPane.DisplayingPreviousPane, statusPane.DisplayingAlignment, statusPane.DisplayingProportion);
for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--) for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--)
{ {
NestedDockingStatus status = this[i].NestedDockingStatus; NestedDockingStatus status = this[i].NestedDockingStatus;
if (status.PreviousPane == pane) if (status.PreviousPane == pane)
status.SetDisplayingStatus(true, lastNestedPane, status.DisplayingAlignment, status.DisplayingProportion); status.SetDisplayingStatus(true, lastNestedPane, status.DisplayingAlignment, status.DisplayingProportion);
} }
} }
else else
Items.Remove(pane); Items.Remove(pane);
statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5); statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5);
} }
private void CalculateBounds() private void CalculateBounds()
{ {
if (Count == 0) if (Count == 0)
return; return;
this[0].NestedDockingStatus.SetDisplayingBounds(Container.DisplayingRectangle, Container.DisplayingRectangle, Rectangle.Empty); this[0].NestedDockingStatus.SetDisplayingBounds(Container.DisplayingRectangle, Container.DisplayingRectangle, Rectangle.Empty);
for (int i=1; i<Count; i++) for (int i=1; i<Count; i++)
{ {
DockPane pane = this[i]; DockPane pane = this[i];
NestedDockingStatus status = pane.NestedDockingStatus; NestedDockingStatus status = pane.NestedDockingStatus;
DockPane prevPane = status.DisplayingPreviousPane; DockPane prevPane = status.DisplayingPreviousPane;
NestedDockingStatus statusPrev = prevPane.NestedDockingStatus; NestedDockingStatus statusPrev = prevPane.NestedDockingStatus;
Rectangle rect = statusPrev.PaneBounds; Rectangle rect = statusPrev.PaneBounds;
bool bVerticalSplitter = (status.DisplayingAlignment == DockAlignment.Left || status.DisplayingAlignment == DockAlignment.Right); bool bVerticalSplitter = (status.DisplayingAlignment == DockAlignment.Left || status.DisplayingAlignment == DockAlignment.Right);
Rectangle rectThis = rect; Rectangle rectThis = rect;
Rectangle rectPrev = rect; Rectangle rectPrev = rect;
Rectangle rectSplitter = rect; Rectangle rectSplitter = rect;
if (status.DisplayingAlignment == DockAlignment.Left) if (status.DisplayingAlignment == DockAlignment.Left)
{ {
rectThis.Width = (int)((double)rect.Width * status.DisplayingProportion) - (Measures.SplitterSize / 2); rectThis.Width = (int)((double)rect.Width * status.DisplayingProportion) - (Measures.SplitterSize / 2);
rectSplitter.X = rectThis.X + rectThis.Width; rectSplitter.X = rectThis.X + rectThis.Width;
rectSplitter.Width = Measures.SplitterSize; rectSplitter.Width = Measures.SplitterSize;
rectPrev.X = rectSplitter.X + rectSplitter.Width; rectPrev.X = rectSplitter.X + rectSplitter.Width;
rectPrev.Width = rect.Width - rectThis.Width - rectSplitter.Width; rectPrev.Width = rect.Width - rectThis.Width - rectSplitter.Width;
} }
else if (status.DisplayingAlignment == DockAlignment.Right) else if (status.DisplayingAlignment == DockAlignment.Right)
{ {
rectPrev.Width = (rect.Width - (int)((double)rect.Width * status.DisplayingProportion)) - (Measures.SplitterSize / 2); rectPrev.Width = (rect.Width - (int)((double)rect.Width * status.DisplayingProportion)) - (Measures.SplitterSize / 2);
rectSplitter.X = rectPrev.X + rectPrev.Width; rectSplitter.X = rectPrev.X + rectPrev.Width;
rectSplitter.Width = Measures.SplitterSize; rectSplitter.Width = Measures.SplitterSize;
rectThis.X = rectSplitter.X + rectSplitter.Width; rectThis.X = rectSplitter.X + rectSplitter.Width;
rectThis.Width = rect.Width - rectPrev.Width - rectSplitter.Width; rectThis.Width = rect.Width - rectPrev.Width - rectSplitter.Width;
} }
else if (status.DisplayingAlignment == DockAlignment.Top) else if (status.DisplayingAlignment == DockAlignment.Top)
{ {
rectThis.Height = (int)((double)rect.Height * status.DisplayingProportion) - (Measures.SplitterSize / 2); rectThis.Height = (int)((double)rect.Height * status.DisplayingProportion) - (Measures.SplitterSize / 2);
rectSplitter.Y = rectThis.Y + rectThis.Height; rectSplitter.Y = rectThis.Y + rectThis.Height;
rectSplitter.Height = Measures.SplitterSize; rectSplitter.Height = Measures.SplitterSize;
rectPrev.Y = rectSplitter.Y + rectSplitter.Height; rectPrev.Y = rectSplitter.Y + rectSplitter.Height;
rectPrev.Height = rect.Height - rectThis.Height - rectSplitter.Height; rectPrev.Height = rect.Height - rectThis.Height - rectSplitter.Height;
} }
else if (status.DisplayingAlignment == DockAlignment.Bottom) else if (status.DisplayingAlignment == DockAlignment.Bottom)
{ {
rectPrev.Height = (rect.Height - (int)((double)rect.Height * status.DisplayingProportion)) - (Measures.SplitterSize / 2); rectPrev.Height = (rect.Height - (int)((double)rect.Height * status.DisplayingProportion)) - (Measures.SplitterSize / 2);
rectSplitter.Y = rectPrev.Y + rectPrev.Height; rectSplitter.Y = rectPrev.Y + rectPrev.Height;
rectSplitter.Height = Measures.SplitterSize; rectSplitter.Height = Measures.SplitterSize;
rectThis.Y = rectSplitter.Y + rectSplitter.Height; rectThis.Y = rectSplitter.Y + rectSplitter.Height;
rectThis.Height = rect.Height - rectPrev.Height - rectSplitter.Height; rectThis.Height = rect.Height - rectPrev.Height - rectSplitter.Height;
} }
else else
rectThis = Rectangle.Empty; rectThis = Rectangle.Empty;
rectSplitter.Intersect(rect); rectSplitter.Intersect(rect);
rectThis.Intersect(rect); rectThis.Intersect(rect);
rectPrev.Intersect(rect); rectPrev.Intersect(rect);
status.SetDisplayingBounds(rect, rectThis, rectSplitter); status.SetDisplayingBounds(rect, rectThis, rectSplitter);
statusPrev.SetDisplayingBounds(statusPrev.LogicalBounds, rectPrev, statusPrev.SplitterBounds); statusPrev.SetDisplayingBounds(statusPrev.LogicalBounds, rectPrev, statusPrev.SplitterBounds);
} }
} }
} }
} }

View file

@ -1,134 +1,135 @@
namespace LSLEditor namespace LSLEditor
{ {
partial class EditForm partial class EditForm
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary> /// <summary>
/// Clean up any resources being used. /// Clean up any resources being used.
/// </summary> /// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing && (components != null)) if (disposing && (components != null))
{ {
components.Dispose(); components.Dispose();
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
#region Windows Form Designer generated code #region Windows Form Designer generated code
/// <summary> /// <summary>
/// Required method for Designer support - do not modify /// Required method for Designer support - do not modify
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tvOutline = new System.Windows.Forms.TreeView(); this.numberedTextBoxUC1 = new NumberedTextBox.NumberedTextBoxUC();
this.numberedTextBoxUC1 = new NumberedTextBox.NumberedTextBoxUC(); this.tvOutline = new System.Windows.Forms.TreeView();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// tabControl1 // tabControl1
// //
this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0; this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(560, 264); this.tabControl1.Size = new System.Drawing.Size(560, 264);
this.tabControl1.TabIndex = 1; this.tabControl1.TabIndex = 1;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
// //
// tabPage1 // tabPage1
// //
this.tabPage1.Controls.Add(this.splitContainer1); this.tabPage1.Controls.Add(this.splitContainer1);
this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1"; this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3); this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(552, 238); this.tabPage1.Size = new System.Drawing.Size(552, 238);
this.tabPage1.TabIndex = 0; this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Script"; this.tabPage1.Text = "Script";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// splitContainer1 // splitContainer1
// //
this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(3, 3); this.splitContainer1.Location = new System.Drawing.Point(3, 3);
this.splitContainer1.Name = "splitContainer1"; this.splitContainer1.Name = "splitContainer1";
// //
// splitContainer1.Panel1 // splitContainer1.Panel1
// //
this.splitContainer1.Panel1.Controls.Add(this.numberedTextBoxUC1); this.splitContainer1.Panel1.Controls.Add(this.numberedTextBoxUC1);
this.splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.No; this.splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.No;
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
this.splitContainer1.Panel2.Controls.Add(this.tvOutline); this.splitContainer1.Panel2.Controls.Add(this.tvOutline);
this.splitContainer1.Panel2.RightToLeft = System.Windows.Forms.RightToLeft.No; this.splitContainer1.Panel2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.splitContainer1.RightToLeft = System.Windows.Forms.RightToLeft.No; this.splitContainer1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.splitContainer1.Size = new System.Drawing.Size(546, 232); this.splitContainer1.Size = new System.Drawing.Size(546, 232);
this.splitContainer1.SplitterDistance = 397; this.splitContainer1.SplitterDistance = 397;
this.splitContainer1.TabIndex = 7; this.splitContainer1.TabIndex = 7;
// //
// tvOutline // numberedTextBoxUC1
// //
this.tvOutline.Dock = System.Windows.Forms.DockStyle.Fill; this.numberedTextBoxUC1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tvOutline.HotTracking = true; this.numberedTextBoxUC1.Location = new System.Drawing.Point(0, 0);
this.tvOutline.Location = new System.Drawing.Point(0, 0); this.numberedTextBoxUC1.Name = "numberedTextBoxUC1";
this.tvOutline.Name = "tvOutline"; this.numberedTextBoxUC1.Size = new System.Drawing.Size(393, 228);
this.tvOutline.Size = new System.Drawing.Size(141, 228); this.numberedTextBoxUC1.TabIndex = 4;
this.tvOutline.TabIndex = 6; //
this.tvOutline.VisibleChanged += new System.EventHandler(this.tvOutline_VisibleChanged); // tvOutline
this.tvOutline.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvOutline_AfterSelect); //
this.tvOutline.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvOutline_NodeMouseClick); this.tvOutline.Dock = System.Windows.Forms.DockStyle.Fill;
// this.tvOutline.HotTracking = true;
// numberedTextBoxUC1 this.tvOutline.Location = new System.Drawing.Point(0, 0);
// this.tvOutline.Name = "tvOutline";
this.numberedTextBoxUC1.Dock = System.Windows.Forms.DockStyle.Fill; this.tvOutline.Size = new System.Drawing.Size(141, 228);
this.numberedTextBoxUC1.Location = new System.Drawing.Point(0, 0); this.tvOutline.TabIndex = 6;
this.numberedTextBoxUC1.Name = "numberedTextBoxUC1"; this.tvOutline.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvOutline_AfterSelect);
this.numberedTextBoxUC1.Size = new System.Drawing.Size(393, 228); this.tvOutline.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvOutline_NodeMouseClick);
this.numberedTextBoxUC1.TabIndex = 4; this.tvOutline.VisibleChanged += new System.EventHandler(this.tvOutline_VisibleChanged);
// //
// EditForm // EditForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(560, 264); this.ClientSize = new System.Drawing.Size(560, 264);
this.Controls.Add(this.tabControl1); this.Controls.Add(this.tabControl1);
this.Name = "EditForm"; this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Text = "EditForm"; this.Name = "EditForm";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.EditForm_FormClosing); this.Text = "EditForm";
this.tabControl1.ResumeLayout(false); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.EditForm_FormClosing);
this.tabPage1.ResumeLayout(false); this.tabControl1.ResumeLayout(false);
this.splitContainer1.Panel1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false);
this.ResumeLayout(false); this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
}
#endregion
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabControl tabControl1;
private NumberedTextBox.NumberedTextBoxUC numberedTextBoxUC1; private System.Windows.Forms.TabPage tabPage1;
public System.Windows.Forms.TreeView tvOutline; private NumberedTextBox.NumberedTextBoxUC numberedTextBoxUC1;
public System.Windows.Forms.SplitContainer splitContainer1; public System.Windows.Forms.TreeView tvOutline;
public System.Windows.Forms.SplitContainer splitContainer1;
}
}
} }

638
source/EditForm.cs Normal file
View file

@ -0,0 +1,638 @@
// <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.Xml;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using LSLEditor.Docking;
using LSLEditor.Helpers;
using System.Collections.Generic;
namespace LSLEditor
{
public partial class EditForm : DockContent
{
public RuntimeConsole runtime;
public List<string> verboseQueue = new List<string>();
private string m_FullPathName;
private Guid m_Guid;
// private bool sOutline = true;
public LSLEditorForm parent;
public Encoding encodedAs = null;
private const int WM_NCACTIVATE = 0x0086;
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_NCACTIVATE) {
if (m.LParam != IntPtr.Zero) {
m.WParam = new IntPtr(1);
} else {
this.numberedTextBoxUC1.TextBox.MakeAllInvis();
}
}
try { base.WndProc(ref m); } catch { }
}
public SyntaxRichTextBox TextBox
{
get
{
return this.numberedTextBoxUC1.TextBox;
}
}
public XmlDocument ConfLSL
{
get
{
return this.parent.ConfLSL;
}
}
public XmlDocument ConfCSharp
{
get
{
return this.parent.ConfCSharp;
}
}
public Guid guid
{
get
{
return m_Guid;
}
set
{
this.m_Guid = value;
}
}
public bool IsScript
{
get
{
return this.TextBox.ToolTipping;
}
set
{
if (value) {
this.tabPage1.Text = "Script";
} else {
this.tabPage1.Text = "Text";
}
this.TextBox.ToolTipping = value;
}
}
public EditForm(LSLEditorForm lslEditorForm)
{
InitializeComponent();
this.guid = new Guid();
this.components = new System.ComponentModel.Container();
this.Icon = lslEditorForm.Icon;
this.parent = lslEditorForm;
this.numberedTextBoxUC1.TextBox.setEditform(this);
this.numberedTextBoxUC1.TextBox.Init(this.parent, this.parent.ConfLSL);
this.numberedTextBoxUC1.TextBox.OnDirtyChanged += new IsDirtyHandler(TextBox_OnDirtyChanged);
this.Move += new EventHandler(EditForm_Position);
this.Resize += new EventHandler(EditForm_Position);
this.Layout += new LayoutEventHandler(EditForm_Layout);
ImageList imageList = new ImageList();
imageList.Images.Add(Images.Images.Unknown);
imageList.Images.Add(Images.Images.Functions);
imageList.Images.Add(Images.Images.Events);
imageList.Images.Add(Images.Images.Constants);
imageList.Images.Add(Images.Images.Class);
imageList.Images.Add(Images.Images.Vars);
imageList.Images.Add(Images.Images.Properties);
imageList.Images.Add(Images.Images.States);
this.tvOutline.ImageList = imageList;
if (lslEditorForm.outlineToolStripMenuItem.Checked) {
splitContainer1.Panel2Collapsed = false;
} else {
splitContainer1.Panel2Collapsed = true;
}
SetFont();
}
public void SetFont()
{
this.numberedTextBoxUC1.Font = Properties.Settings.Default.FontEditor;
}
void EditForm_Layout(object sender, LayoutEventArgs e)
{
if (this.WindowState == FormWindowState.Minimized) {
this.numberedTextBoxUC1.TextBox.MakeAllInvis();
}
}
void EditForm_Position(object sender, EventArgs e)
{
//this.numberedTextBoxUC1.TextBox.SetPosition(this.MdiParent.RectangleToScreen(this.MdiParent.ClientRectangle));
}
void TextBox_OnDirtyChanged(object sender, EventArgs e)
{
if(parent.IsReadOnly(this))
{
Dirty = false;
return;
}
if(this.Text == null || this.ScriptName == null)
{
this.Text = this.ScriptName;
}
if (LSLIPathHelper.GetExpandedTabName(this.ScriptName) == this.Text)
{
if (this.numberedTextBoxUC1.TextBox.Dirty)
{
this.Text = this.Text.Trim() + "* ";
}
}
else
{
this.Text = this.ScriptName;
if (this.numberedTextBoxUC1.TextBox.Dirty) {
this.Text = this.Text.Trim() + "* ";
} else {
this.Text = this.Text.Trim() + " ";
}
}
TabPage tabPage = this.Tag as TabPage;
if (tabPage != null) {
tabPage.Text = this.Text;
}
this.parent.OnDirtyChanged(this.numberedTextBoxUC1.TextBox.Dirty);
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
public string FullPathName
{
get
{
return this.m_FullPathName;
}
set
{
this.m_FullPathName = value;
string strDirectory = Path.GetDirectoryName(this.m_FullPathName);
if (Directory.Exists(strDirectory)) {
Properties.Settings.Default.WorkingDirectory = strDirectory;
} else {
if (!Directory.Exists(Properties.Settings.Default.WorkingDirectory)) {
Properties.Settings.Default.WorkingDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
}
this.m_FullPathName = Path.Combine(Properties.Settings.Default.WorkingDirectory, this.m_FullPathName);
}
this.Text = this.ScriptName;
TabPage tabPage = this.Tag as TabPage;
if (tabPage != null) {
tabPage.Text = this.Text + " ";
}
}
}
public string ScriptName
{
get
{
return Path.GetFileName(this.m_FullPathName);
}
}
public string ProjectName
{
get
{
return parent.SolutionExplorer.GetProjectName(this.guid);
}
}
public string SourceCode
{
get
{
return this.numberedTextBoxUC1.TextBox.Text;
}
set
{
this.numberedTextBoxUC1.TextBox.Text = value;
}
}
private int PercentageIndentTab()
{
int intResult;
int intSpaces = 0;
int intTabs = 0;
StringReader sr = new StringReader(this.TextBox.Text);
while (true) {
string strLine = sr.ReadLine();
if (strLine == null) break;
if (strLine.Length == 0) continue;
if (strLine[0] == ' ') {
intSpaces++;
} else if (strLine[0] == '\t') {
intTabs++;
}
}
if (intTabs == 0 && intSpaces == 0) {
intResult = 50;
} else {
intResult = (int)Math.Round((100.0 * intTabs) / (intTabs + intSpaces));
}
return intResult;
}
public void LoadFile(string strPath)
{
if (strPath.StartsWith("http://")) {
this.FullPathName = Path.GetFileName(strPath);
} else {
this.FullPathName = strPath;
}
this.encodedAs = this.numberedTextBoxUC1.TextBox.LoadFile(strPath);
if (this.IsScript) {
if (Properties.Settings.Default.IndentAutoCorrect) {
this.TextBox.FormatDocument();
this.TextBox.ClearUndoStack();
} else {
if (Properties.Settings.Default.IndentWarning) {
if ((PercentageIndentTab() > 50 && Properties.Settings.Default.SL4SpacesIndent) ||
(PercentageIndentTab() < 50 && !Properties.Settings.Default.SL4SpacesIndent)) {
if (MessageBox.Show("Indent scheme differs from settings\nDo you want to correct it?\nIt can also be corrected by pressing Ctrl-D or turn on Autocorrection (tools menu)", "Indent Warning!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) {
this.TextBox.FormatDocument();
//this.TextBox.ClearUndoStack();
}
}
}
}
}
}
public void SaveCurrentFile(string strPath)
{
// Check if this is an expanded.lsl
if (!LSLIPathHelper.IsExpandedLSL(strPath))
{
this.FullPathName = strPath;
Encoding encodeAs = this.encodedAs;
if (this.IsScript && encodeAs == null)
{
switch (Properties.Settings.Default.OutputFormat)
{
case "UTF8":
encodeAs = Encoding.UTF8;
break;
case "Unicode":
encodeAs = Encoding.Unicode;
break;
case "BigEndianUnicode":
encodeAs = Encoding.BigEndianUnicode;
break;
default:
encodeAs = Encoding.Default;
break;
}
}
else if (encodeAs == null)
{
encodeAs = Encoding.UTF8;
}
this.numberedTextBoxUC1.TextBox.SaveCurrentFile(strPath, encodeAs);
this.encodedAs = encodeAs;
} else if (LSLIPathHelper.IsExpandedLSL(strPath))
{
string LSLIfilePath = LSLIPathHelper.CreateCollapsedPathAndScriptName(strPath);
// Check if an LSLI version of this script exists
if (File.Exists(LSLIfilePath))
{
// Save the LSLI file as well
File.WriteAllText(LSLIfilePath, LSLIConverter.CollapseToLSLI(this.numberedTextBoxUC1.TextBox.Text));
EditForm form = null;
// If it's currently open, then refresh it
for (int i = 0; i < Application.OpenForms.Count; i++)
{
Form openForm = Application.OpenForms[i];
string filename = LSLIPathHelper.TrimStarsAndWhiteSpace(openForm.Text);
if (filename == Path.GetFileName(LSLIfilePath))
{
form = (EditForm)openForm;
}
}
if (form != null && form.Enabled)
{
parent.OpenFile(LSLIfilePath, Guid.NewGuid(), true);
form.Close();
}
}
this.numberedTextBoxUC1.TextBox.Dirty = false;
this.Text = LSLIPathHelper.GetExpandedTabName(strPath);
}
}
public void SaveCurrentFile()
{
this.SaveCurrentFile(this.FullPathName);
}
public bool Dirty
{
get
{
return this.numberedTextBoxUC1.TextBox.Dirty;
}
set
{
this.numberedTextBoxUC1.TextBox.Dirty = value;
}
}
public TabControl tabControl
{
get
{
return this.tabControl1;
}
}
public void SetFocus()
{
this.numberedTextBoxUC1.TextBox.Focus();
}
public void StopCompiler()
{
this.numberedTextBoxUC1.TextBox.MakeAllInvis();
if (runtime != null) {
this.components.Remove(runtime);
if (!runtime.IsDisposed) {
runtime.Dispose();
}
runtime = null;
}
for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--) {
this.tabControl1.TabPages.RemoveAt(intI);
}
}
public SecondLifeHost.SecondLifeHostChatHandler ChatHandler;
public SecondLifeHost.SecondLifeHostMessageLinkedHandler MessageLinkedHandler;
public bool StartCompiler()
{
bool blnResult = false;
//if (this.disableCompilesyntaxCheckToolStripMenuItem.Checked)
// return false;
if (this.IsScript) {
StopCompiler();
if (this.parent != null) {
runtime = new RuntimeConsole(this.parent);
// for disposing
this.components.Add(runtime);
foreach (string message in verboseQueue)
{
runtime.VerboseConsole(message);
if (message.StartsWith("Error: "))
{
StopCompiler();
this.tabControl1.SelectedIndex = 0;
verboseQueue = new List<string>();
return false;
}
}
if (!runtime.Compile(this)) {
this.tabControl1.SelectedIndex = 0;
return false;
}
TabPage tabPage = new TabPage("Debug");
tabPage.Controls.Add(runtime);
this.tabControl1.TabPages.Add(tabPage);
this.tabControl1.SelectedIndex = 1;
blnResult = true;
}
}
return blnResult;
}
public bool SyntaxCheck()
{
bool blnResult = false;
//if (this.disableCompilesyntaxCheckToolStripMenuItem.Checked)
// return false;
if (this.IsScript) {
string lsl = SourceCode;
// If it is LSLI, it needs to import scripts first, before it recognizes imported functions
if (LSLIPathHelper.IsLSLI(this.FullPathName))
{
LSLIConverter converter = new LSLIConverter();
lsl = converter.ExpandToLSL(this);
}
LSL2CSharp translator = new LSL2CSharp(ConfLSL);
string strCSharp = translator.Parse(lsl);
if (System.Diagnostics.Debugger.IsAttached) {
for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--) {
this.tabControl1.TabPages.RemoveAt(intI);
}
// TODO
TabPage tabPage = new TabPage("C#");
NumberedTextBox.NumberedTextBoxUC numberedTextBoxUC1 = new NumberedTextBox.NumberedTextBoxUC();
numberedTextBoxUC1.TextBox.Init(null, this.ConfCSharp);
numberedTextBoxUC1.TextBox.Text = strCSharp;
numberedTextBoxUC1.TextBox.ReadOnly = true;
numberedTextBoxUC1.Dock = DockStyle.Fill;
tabPage.Controls.Add(numberedTextBoxUC1);
this.tabControl.TabPages.Add(tabPage);
}
blnResult = (null != CompilerHelper.CompileCSharp(this, strCSharp));
}
return blnResult;
}
public int Find(string strSearch, int intStart, int intEnd, RichTextBoxFinds options)
{
intStart = this.numberedTextBoxUC1.TextBox.Find(strSearch, intStart, intEnd, options);
this.numberedTextBoxUC1.TextBox.Focus();
return intStart;
}
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
this.numberedTextBoxUC1.TextBox.MakeAllInvis();
}
private void EditForm_FormClosing(object sender, FormClosingEventArgs e)
{
this.parent.CancelClosing = false;
if (this.Dirty) {
string scriptToSave = ScriptName;
if (LSLIPathHelper.IsExpandedLSL(ScriptName))
{
// Expanded scripts will always be saved as LSLI's
scriptToSave = LSLIPathHelper.CreateCollapsedScriptName(scriptToSave);
}
DialogResult dialogResult = MessageBox.Show(this, @"Save """ + scriptToSave + @"""?", "File has changed", MessageBoxButtons.YesNoCancel);
if (dialogResult == DialogResult.Yes) {
e.Cancel = !this.parent.SaveFile(this, false);
} else {
e.Cancel = (dialogResult == DialogResult.Cancel);
}
}
if (!e.Cancel)
{
// Close related readonly's if this is an expanded script
if (LSLIPathHelper.IsExpandedLSL(ScriptName))
{
// Check if a LSLI readonly is open
EditForm readOnlyLSLI = (EditForm)parent.GetForm(Path.GetFileName(LSLIPathHelper.GetReadOnlyTabName(ScriptName)));
if (readOnlyLSLI != null)
{
readOnlyLSLI.Close();
}
}
if(!this.parent.IsReadOnly(this)) // If this is not a readonly (LSLI)
{
// Delete expanded file when closing
string expandedFile = LSLIPathHelper.CreateExpandedPathAndScriptName(FullPathName);
EditForm expandedForm = (EditForm)parent.GetForm(LSLIPathHelper.GetExpandedTabName(Path.GetFileName(expandedFile)));
if (expandedForm != null && !LSLIPathHelper.IsExpandedLSL(ScriptName))
{
expandedForm.Close();
}
if (File.Exists(expandedFile))
{
File.Delete(expandedFile);
}
}
}
this.parent.CancelClosing = e.Cancel;
}
private void disableCompilesyntaxCheckToolStripMenuItem_Click(object sender, EventArgs e)
{
//this.disableCompilesyntaxCheckToolStripMenuItem.Checked = !this.disableCompilesyntaxCheckToolStripMenuItem.Checked;
}
private void tvOutline_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
this.parent.BeginInvoke(new TreeNodeMouseClickEventHandler(
delegate(object sender2, TreeNodeMouseClickEventArgs e2)
{
if (e.Node.Tag is Helpers.OutlineHelper) {
Helpers.OutlineHelper ohOutline = (Helpers.OutlineHelper)e.Node.Tag;
if (ohOutline.line < this.TextBox.Lines.Length) {
//editForm.Focus();
//editForm.TextBox.Select();
//editForm.TextBox.Goto(ohOutline.line + 1);
//TextBox.Focus();
this.TextBox.Select();
this.TextBox.SelectionStart = this.TextBox.GetFirstCharIndexFromLine(ohOutline.line);
}
}
}), sender, e);
}
private void tvOutline_AfterSelect(object sender, TreeViewEventArgs e)
{
//this.TextBox.Select
}
private void splitContainer1_Click(object sender, EventArgs e)
{
}
private void tvOutline_VisibleChanged(object sender, EventArgs e)
{
this.tvOutline.ExpandAll();
}
}
}

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