Search is not available for this dataset
id
stringlengths 1
8
| text
stringlengths 72
9.81M
| addition_count
int64 0
10k
| commit_subject
stringlengths 0
3.7k
| deletion_count
int64 0
8.43k
| file_extension
stringlengths 0
32
| lang
stringlengths 1
94
| license
stringclasses 10
values | repo_name
stringlengths 9
59
|
---|---|---|---|---|---|---|---|---|
10056850 | <NME> text.log
<BEF> 03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
03/22 08:51:01 INFO :.main: Using log level 511
03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
03/22 08:51:02 INFO :..reg_process: registering process with the system
03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
03/22 08:51:02 INFO :..reg_process: return from registration rc=0
03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
<MSG> Add a stack trace to visualize an italic text example in the log file, for the demo application
<DFF> @@ -14,6 +14,43 @@
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
+03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
+03/22 08:51:01 INFO :.main: Using log level 511
+03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
+03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
+03/22 08:51:02 INFO :..reg_process: registering process with the system
+03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
+03/22 08:51:02 INFO :..reg_process: return from registration rc=0
+03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
+03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
+03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
+03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
+03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
+03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
+03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
+03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:06 ERROR :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+ConsoleApplication1.MyCustomException: some message .... ---> System.Exception: Oh noes, something went wrong
+ at ConsoleApplication1.SomeObject.OtherMethod() in C:\ConsoleApplication1\SomeObject.cs:line 24
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 14
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 18
+ at ConsoleApplication1.Program.DoSomething() in C:\ConsoleApplication1\Program.cs:line 23
+ at ConsoleApplication1.Program.Main(String[] args) in C:\ConsoleApplication1\Program.cs:line 13
+03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
+03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
| 37 | Add a stack trace to visualize an italic text example in the log file, for the demo application | 0 | .log | Demo/Resources/SampleFiles/text | mit | AvaloniaUI/AvaloniaEdit |
10056851 | <NME> text.log
<BEF> 03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
03/22 08:51:01 INFO :.main: Using log level 511
03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
03/22 08:51:02 INFO :..reg_process: registering process with the system
03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
03/22 08:51:02 INFO :..reg_process: return from registration rc=0
03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
<MSG> Add a stack trace to visualize an italic text example in the log file, for the demo application
<DFF> @@ -14,6 +14,43 @@
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
+03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
+03/22 08:51:01 INFO :.main: Using log level 511
+03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
+03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
+03/22 08:51:02 INFO :..reg_process: registering process with the system
+03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
+03/22 08:51:02 INFO :..reg_process: return from registration rc=0
+03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
+03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
+03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
+03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
+03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
+03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
+03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
+03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:06 ERROR :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+ConsoleApplication1.MyCustomException: some message .... ---> System.Exception: Oh noes, something went wrong
+ at ConsoleApplication1.SomeObject.OtherMethod() in C:\ConsoleApplication1\SomeObject.cs:line 24
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 14
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 18
+ at ConsoleApplication1.Program.DoSomething() in C:\ConsoleApplication1\Program.cs:line 23
+ at ConsoleApplication1.Program.Main(String[] args) in C:\ConsoleApplication1\Program.cs:line 13
+03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
+03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
| 37 | Add a stack trace to visualize an italic text example in the log file, for the demo application | 0 | .log | Demo/Resources/SampleFiles/text | mit | AvaloniaUI/AvaloniaEdit |
10056852 | <NME> text.log
<BEF> 03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
03/22 08:51:01 INFO :.main: Using log level 511
03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
03/22 08:51:02 INFO :..reg_process: registering process with the system
03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
03/22 08:51:02 INFO :..reg_process: return from registration rc=0
03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
<MSG> Add a stack trace to visualize an italic text example in the log file, for the demo application
<DFF> @@ -14,6 +14,43 @@
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
+03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
+03/22 08:51:01 INFO :.main: Using log level 511
+03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
+03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
+03/22 08:51:02 INFO :..reg_process: registering process with the system
+03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
+03/22 08:51:02 INFO :..reg_process: return from registration rc=0
+03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
+03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
+03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
+03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
+03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
+03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
+03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
+03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:06 ERROR :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+ConsoleApplication1.MyCustomException: some message .... ---> System.Exception: Oh noes, something went wrong
+ at ConsoleApplication1.SomeObject.OtherMethod() in C:\ConsoleApplication1\SomeObject.cs:line 24
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 14
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 18
+ at ConsoleApplication1.Program.DoSomething() in C:\ConsoleApplication1\Program.cs:line 23
+ at ConsoleApplication1.Program.Main(String[] args) in C:\ConsoleApplication1\Program.cs:line 13
+03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
+03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
| 37 | Add a stack trace to visualize an italic text example in the log file, for the demo application | 0 | .log | Demo/Resources/SampleFiles/text | mit | AvaloniaUI/AvaloniaEdit |
10056853 | <NME> text.log
<BEF> 03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
03/22 08:51:01 INFO :.main: Using log level 511
03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
03/22 08:51:02 INFO :..reg_process: registering process with the system
03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
03/22 08:51:02 INFO :..reg_process: return from registration rc=0
03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
<MSG> Add a stack trace to visualize an italic text example in the log file, for the demo application
<DFF> @@ -14,6 +14,43 @@
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
+03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
+03/22 08:51:01 INFO :.main: Using log level 511
+03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
+03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
+03/22 08:51:02 INFO :..reg_process: registering process with the system
+03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
+03/22 08:51:02 INFO :..reg_process: return from registration rc=0
+03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
+03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
+03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
+03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
+03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
+03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
+03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
+03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:06 ERROR :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+ConsoleApplication1.MyCustomException: some message .... ---> System.Exception: Oh noes, something went wrong
+ at ConsoleApplication1.SomeObject.OtherMethod() in C:\ConsoleApplication1\SomeObject.cs:line 24
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 14
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 18
+ at ConsoleApplication1.Program.DoSomething() in C:\ConsoleApplication1\Program.cs:line 23
+ at ConsoleApplication1.Program.Main(String[] args) in C:\ConsoleApplication1\Program.cs:line 13
+03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
+03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
| 37 | Add a stack trace to visualize an italic text example in the log file, for the demo application | 0 | .log | Demo/Resources/SampleFiles/text | mit | AvaloniaUI/AvaloniaEdit |
10056854 | <NME> text.log
<BEF> 03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
03/22 08:51:01 INFO :.main: Using log level 511
03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
03/22 08:51:02 INFO :..reg_process: registering process with the system
03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
03/22 08:51:02 INFO :..reg_process: return from registration rc=0
03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
<MSG> Add a stack trace to visualize an italic text example in the log file, for the demo application
<DFF> @@ -14,6 +14,43 @@
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
+03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
+03/22 08:51:01 INFO :.main: Using log level 511
+03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
+03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
+03/22 08:51:02 INFO :..reg_process: registering process with the system
+03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
+03/22 08:51:02 INFO :..reg_process: return from registration rc=0
+03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
+03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
+03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
+03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
+03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
+03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
+03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
+03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:06 ERROR :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+ConsoleApplication1.MyCustomException: some message .... ---> System.Exception: Oh noes, something went wrong
+ at ConsoleApplication1.SomeObject.OtherMethod() in C:\ConsoleApplication1\SomeObject.cs:line 24
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 14
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 18
+ at ConsoleApplication1.Program.DoSomething() in C:\ConsoleApplication1\Program.cs:line 23
+ at ConsoleApplication1.Program.Main(String[] args) in C:\ConsoleApplication1\Program.cs:line 13
+03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
+03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
| 37 | Add a stack trace to visualize an italic text example in the log file, for the demo application | 0 | .log | Demo/Resources/SampleFiles/text | mit | AvaloniaUI/AvaloniaEdit |
10056855 | <NME> text.log
<BEF> 03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
03/22 08:51:01 INFO :.main: Using log level 511
03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
03/22 08:51:02 INFO :..reg_process: registering process with the system
03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
03/22 08:51:02 INFO :..reg_process: return from registration rc=0
03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
<MSG> Add a stack trace to visualize an italic text example in the log file, for the demo application
<DFF> @@ -14,6 +14,43 @@
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
+03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
+03/22 08:51:01 INFO :.main: Using log level 511
+03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
+03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
+03/22 08:51:02 INFO :..reg_process: registering process with the system
+03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
+03/22 08:51:02 INFO :..reg_process: return from registration rc=0
+03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
+03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
+03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
+03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
+03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
+03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
+03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
+03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+03/22 08:51:06 ERROR :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
+ConsoleApplication1.MyCustomException: some message .... ---> System.Exception: Oh noes, something went wrong
+ at ConsoleApplication1.SomeObject.OtherMethod() in C:\ConsoleApplication1\SomeObject.cs:line 24
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 14
+ at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 18
+ at ConsoleApplication1.Program.DoSomething() in C:\ConsoleApplication1\Program.cs:line 23
+ at ConsoleApplication1.Program.Main(String[] args) in C:\ConsoleApplication1\Program.cs:line 13
+03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
+03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
+03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
+03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
+03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
+03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
| 37 | Add a stack trace to visualize an italic text example in the log file, for the demo application | 0 | .log | Demo/Resources/SampleFiles/text | mit | AvaloniaUI/AvaloniaEdit |
10056856 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056857 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056858 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056859 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056860 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056861 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056862 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056863 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056864 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056865 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056866 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056867 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056868 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056869 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056870 | <NME> TextViewTests.cs
<BEF> ADDFILE
<MSG> Merge pull request #208 from AvaloniaUI/fix-word-wrap
Fix word wrap
<DFF> @@ -0,0 +1,69 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+
+using AvaloniaEdit.AvaloniaMocks;
+using AvaloniaEdit.Document;
+using AvaloniaEdit.Rendering;
+using AvaloniaEdit.Text;
+
+using NUnit.Framework;
+
+namespace AvaloniaEdit.Tests.Rendering
+{
+ [TestFixture]
+ internal class TextViewTests
+ {
+ [Test]
+ public void Visual_Line_Should_Create_Two_Text_Lines_When_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 8;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(2, visualLine.TextLines.Count);
+ Assert.AreEqual("hello ", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+ Assert.AreEqual("world", ((TextLineImpl)visualLine.TextLines[1]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+
+ [Test]
+ public void Visual_Line_Should_Create_One_Text_Lines_When_Not_Wrapping()
+ {
+ using var app = UnitTestApplication.Start(TestServices.StyledWindow);
+
+ TextView textView = new TextView();
+
+ TextDocument document = new TextDocument("hello world".ToCharArray());
+
+ textView.Document = document;
+ textView.EnsureVisualLines();
+ ((ILogicalScrollable)textView).CanHorizontallyScroll = false;
+ textView.Width = MockGlyphTypeface.GlyphAdvance * 500;
+
+ Window window = new Window();
+ window.Content = textView;
+ window.Show();
+
+ VisualLine visualLine = textView.GetOrConstructVisualLine(document.Lines[0]);
+
+ Assert.AreEqual(1, visualLine.TextLines.Count);
+ Assert.AreEqual("hello world", ((TextLineImpl)visualLine.TextLines[0]).LineRuns[0].StringRange.ToString());
+
+ window.Close();
+ }
+ }
+}
| 69 | Merge pull request #208 from AvaloniaUI/fix-word-wrap | 0 | .cs | Tests/Rendering/TextViewTests | mit | AvaloniaUI/AvaloniaEdit |
10056871 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056872 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056873 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056874 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056875 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056876 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056877 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056878 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056879 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056880 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056881 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056882 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056883 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056884 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056885 | <NME> .gitattributes
<BEF> ADDFILE
<MSG> add git attributes to keep line feeds consistent for windows users.
<DFF> @@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
| 63 | add git attributes to keep line feeds consistent for windows users. | 0 | gitattributes | mit | AvaloniaUI/AvaloniaEdit |
|
10056886 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056887 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056888 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056889 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056890 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056891 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056892 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056893 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056894 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056895 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056896 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056897 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056898 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056899 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056900 | <NME> CollapsedLineSection.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Diagnostics.CodeAnalysis;
using AvaloniaEdit.Document;
namespace AvaloniaEdit.Rendering
{
/// <summary>
/// Represents a collapsed line section.
/// Use the Uncollapse() method to uncollapse the section.
/// </summary>
public sealed class CollapsedLineSection
{
private readonly HeightTree _heightTree;
#if DEBUG
internal string Id;
private static int _nextId;
internal string Id;
private static int _nextId;
#else
internal const string ID = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
Start = start;
End = end;
#if DEBUG
unchecked {
Id = " #" + (_nextId++);
}
#endif
}
/// <summary>
/// Gets if the document line is collapsed.
/// This property initially is true and turns to false when uncollapsing the section.
/// </summary>
public bool IsCollapsed => Start != null;
/// <summary>
/// Gets the start line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine Start { get; internal set; }
/// <summary>
/// Gets the end line of the section.
/// When the section is uncollapsed or the text containing it is deleted,
/// this property returns null.
/// </summary>
public DocumentLine End { get; internal set; }
/// <summary>
/// Uncollapses the section.
/// This causes the Start and End properties to be set to null!
/// Does nothing if the section is already uncollapsed.
/// </summary>
public void Uncollapse()
{
if (Start == null)
return;
if (!_heightTree.IsDisposed) {
_heightTree.Uncollapse(this);
#if DEBUG
_heightTree.CheckProperties();
#endif
}
Start = null;
End = null;
}
/// <summary>
/// Gets a string representation of the collapsed section.
/// </summary>
[SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")]
public override string ToString()
{
return "[CollapsedSection" + Id + " Start=" + (Start != null ? Start.LineNumber.ToString() : "null")
+ " End=" + (End != null ? End.LineNumber.ToString() : "null") + "]";
}
}
}
<MSG> Merge pull request #4 from danwalmsley/features/build-scripts
Features/build scripts
<DFF> @@ -35,7 +35,7 @@ namespace AvaloniaEdit.Rendering
internal string Id;
private static int _nextId;
#else
- internal const string ID = "";
+ internal const string Id = "";
#endif
internal CollapsedLineSection(HeightTree heightTree, DocumentLine start, DocumentLine end)
| 1 | Merge pull request #4 from danwalmsley/features/build-scripts | 1 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056901 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056902 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056903 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056904 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056905 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056906 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056907 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056908 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056909 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056910 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056911 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056912 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056913 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056914 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056915 | <NME> SearchPanel.cs
<BEF> // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.VisualTree;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Rendering;
namespace AvaloniaEdit.Search
{
/// <summary>
/// Provides search functionality for AvalonEdit. It is displayed in the top-right corner of the TextArea.
/// </summary>
public class SearchPanel : TemplatedControl, IRoutedCommandBindable
{
private TextArea _textArea;
private SearchInputHandler _handler;
private TextDocument _currentDocument;
private SearchResultBackgroundRenderer _renderer;
private TextBox _searchTextBox;
private TextEditor _textEditor { get; set; }
private Border _border;
#region DependencyProperties
/// <summary>
/// Dependency property for <see cref="UseRegex"/>.
/// </summary>
public static readonly StyledProperty<bool> UseRegexProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(UseRegex));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex
{
get => GetValue(UseRegexProperty);
set => SetValue(UseRegexProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MatchCase"/>.
/// </summary>
public static readonly StyledProperty<bool> MatchCaseProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(MatchCase));
/// <summary>
/// Gets/sets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase
{
get => GetValue(MatchCaseProperty);
set => SetValue(MatchCaseProperty, value);
}
/// <summary>
/// Dependency property for <see cref="WholeWords"/>.
/// </summary>
public static readonly StyledProperty<bool> WholeWordsProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(WholeWords));
/// <summary>
/// Gets/sets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords
{
get => GetValue(WholeWordsProperty);
set => SetValue(WholeWordsProperty, value);
}
/// <summary>
/// Dependency property for <see cref="SearchPattern"/>.
/// </summary>
public static readonly StyledProperty<string> SearchPatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(SearchPattern), "");
/// <summary>
/// Gets/sets the search pattern.
/// </summary>
public string SearchPattern
{
get => GetValue(SearchPatternProperty);
set => SetValue(SearchPatternProperty, value);
}
public static readonly StyledProperty<bool> IsReplaceModeProperty =
AvaloniaProperty.Register<SearchPanel, bool>(nameof(IsReplaceMode));
/// <summary>
/// Checks if replacemode is allowed
/// </summary>
/// <returns>False if editor is not null and readonly</returns>
private static bool ValidateReplaceMode(SearchPanel panel, bool v1)
{
if (panel._textEditor == null || !v1) return v1;
return !panel._textEditor.IsReadOnly;
}
public bool IsReplaceMode
{
get => GetValue(IsReplaceModeProperty);
set => SetValue(IsReplaceModeProperty, _textEditor?.IsReadOnly ?? false ? false : value);
}
public static readonly StyledProperty<string> ReplacePatternProperty =
AvaloniaProperty.Register<SearchPanel, string>(nameof(ReplacePattern));
public string ReplacePattern
{
get => GetValue(ReplacePatternProperty);
set => SetValue(ReplacePatternProperty, value);
}
/// <summary>
/// Dependency property for <see cref="MarkerBrush"/>.
/// </summary>
public static readonly StyledProperty<IBrush> MarkerBrushProperty =
AvaloniaProperty.Register<SearchPanel, IBrush>(nameof(MarkerBrush), Brushes.LightGreen);
/// <summary>
/// Gets/sets the Brush used for marking search results in the TextView.
/// </summary>
public IBrush MarkerBrush
{
get => GetValue(MarkerBrushProperty);
set => SetValue(MarkerBrushProperty, value);
}
#endregion
private static void MarkerBrushChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel._renderer.MarkerBrush = (IBrush)e.NewValue;
}
}
private ISearchStrategy _strategy;
private static void SearchPatternChangedCallback(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is SearchPanel panel)
{
panel.ValidateSearchText();
panel.UpdateSearch();
}
}
private void UpdateSearch()
{
// only reset as long as there are results
// if no results are found, the "no matches found" message should not flicker.
// if results are found by the next run, the message will be hidden inside DoSearch ...
if (_renderer.CurrentResults.Any())
_messageView.IsOpen = false;
_strategy = SearchStrategyFactory.Create(SearchPattern ?? "", !MatchCase, WholeWords, UseRegex ? SearchMode.RegEx : SearchMode.Normal);
OnSearchOptionsChanged(new SearchOptionsChangedEventArgs(SearchPattern, MatchCase, UseRegex, WholeWords));
DoSearch(true);
}
static SearchPanel()
{
UseRegexProperty.Changed.Subscribe(SearchPatternChangedCallback);
MatchCaseProperty.Changed.Subscribe(SearchPatternChangedCallback);
WholeWordsProperty.Changed.Subscribe(SearchPatternChangedCallback);
SearchPatternProperty.Changed.Subscribe(SearchPatternChangedCallback);
MarkerBrushProperty.Changed.Subscribe(MarkerBrushChangedCallback);
}
/// <summary>
/// Creates a new SearchPanel.
/// </summary>
private SearchPanel()
{
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextEditor's TextArea.
/// </summary>
/// <remarks>This is a convenience wrapper.</remarks>
public static SearchPanel Install(TextEditor editor)
{
if (editor == null) throw new ArgumentNullException(nameof(editor));
SearchPanel searchPanel = Install(editor.TextArea);
searchPanel._textEditor = editor;
return searchPanel;
}
/// <summary>
/// Creates a SearchPanel and installs it to the TextArea.
/// </summary>
public static SearchPanel Install(TextArea textArea)
{
if (textArea == null) throw new ArgumentNullException(nameof(textArea));
var panel = new SearchPanel();
panel.AttachInternal(textArea);
panel._handler = new SearchInputHandler(textArea, panel);
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel._handler);
((ISetLogicalParent)panel).SetParent(textArea);
return panel;
}
/// <summary>
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
/// </summary>
public void RegisterCommands(ICollection<RoutedCommandBinding> commandBindings)
{
_handler.RegisterGlobalCommands(commandBindings);
}
/// <summary>
/// Removes the SearchPanel from the TextArea.
/// </summary>
public void Uninstall()
{
Close();
_textArea.DocumentChanged -= TextArea_DocumentChanged;
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_textArea.DefaultInputHandler.NestedInputHandlers.Remove(_handler);
}
private void AttachInternal(TextArea textArea)
{
_textArea = textArea;
_renderer = new SearchResultBackgroundRenderer();
_currentDocument = textArea.Document;
if (_currentDocument != null)
_currentDocument.TextChanged += TextArea_Document_TextChanged;
textArea.DocumentChanged += TextArea_DocumentChanged;
KeyDown += SearchLayerKeyDown;
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindNext, (sender, e) => FindNext()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.FindPrevious, (sender, e) => FindPrevious()));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.CloseSearchPanel, (sender, e) => Close()));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Find, (sender, e) =>
{
IsReplaceMode = false;
Reactivate();
}));
CommandBindings.Add(new RoutedCommandBinding(ApplicationCommands.Replace, (sender, e) => IsReplaceMode = true));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceNext, (sender, e) => ReplaceNext(), (sender, e) => e.CanExecute = IsReplaceMode));
CommandBindings.Add(new RoutedCommandBinding(SearchCommands.ReplaceAll, (sender, e) => ReplaceAll(), (sender, e) => e.CanExecute = IsReplaceMode));
IsClosed = true;
}
private void TextArea_DocumentChanged(object sender, EventArgs e)
{
if (_currentDocument != null)
_currentDocument.TextChanged -= TextArea_Document_TextChanged;
_currentDocument = _textArea.Document;
if (_currentDocument != null)
{
_currentDocument.TextChanged += TextArea_Document_TextChanged;
DoSearch(false);
}
}
private void TextArea_Document_TextChanged(object sender, EventArgs e)
{
DoSearch(false);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
_border = e.NameScope.Find<Border>("PART_Border");
_searchTextBox = e.NameScope.Find<TextBox>("PART_searchTextBox");
_messageView = e.NameScope.Find<Popup>("PART_MessageView");
_messageViewContent = e.NameScope.Find<ContentPresenter>("PART_MessageContent");
}
private void ValidateSearchText()
{
if (_searchTextBox == null)
return;
try
{
UpdateSearch();
_validationError = null;
}
catch (SearchPatternException ex)
{
_validationError = ex.Message;
}
}
/// <summary>
/// Reactivates the SearchPanel by setting the focus on the search box and selecting all text.
/// </summary>
public void Reactivate()
{
if (_searchTextBox == null)
return;
_searchTextBox.Focus();
_searchTextBox.SelectionStart = 0;
_searchTextBox.SelectionEnd = _searchTextBox.Text?.Length ?? 0;
}
/// <summary>
/// Moves to the next occurrence in the file.
/// </summary>
public void FindNext()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset + 1) ??
_renderer.CurrentResults.FirstSegment;
if (result != null)
{
SelectResult(result);
}
}
/// <summary>
/// Moves to the previous occurrence in the file.
/// </summary>
public void FindPrevious()
{
var result = _renderer.CurrentResults.FindFirstSegmentWithStartAfter(_textArea.Caret.Offset);
if (result != null)
result = _renderer.CurrentResults.GetPreviousSegment(result);
if (result == null)
result = _renderer.CurrentResults.LastSegment;
if (result != null)
{
SelectResult(result);
}
}
public void ReplaceNext()
{
if (!IsReplaceMode) return;
FindNext();
if (!_textArea.Selection.IsEmpty)
{
_textArea.Selection.ReplaceSelectionWithText(ReplacePattern ?? string.Empty);
}
UpdateSearch();
}
public void ReplaceAll()
{
if (!IsReplaceMode) return;
var replacement = ReplacePattern ?? string.Empty;
var document = _textArea.Document;
using (document.RunUpdate())
{
var segments = _renderer.CurrentResults.OrderByDescending(x => x.EndOffset).ToArray();
foreach (var textSegment in segments)
{
document.Replace(textSegment.StartOffset, textSegment.Length,
new StringTextSource(replacement));
}
}
}
private Popup _messageView;
private ContentPresenter _messageViewContent;
private string _validationError;
private void DoSearch(bool changeSelection)
{
if (IsClosed)
return;
_renderer.CurrentResults.Clear();
if (!string.IsNullOrEmpty(SearchPattern))
{
var offset = _textArea.Caret.Offset;
if (changeSelection)
{
_textArea.ClearSelection();
}
// We cast from ISearchResult to SearchResult; this is safe because we always use the built-in strategy
foreach (var result in _strategy.FindAll(_textArea.Document, 0, _textArea.Document.TextLength).Cast<SearchResult>())
{
if (changeSelection && result.StartOffset >= offset)
{
SelectResult(result);
changeSelection = false;
}
_renderer.CurrentResults.Add(result);
}
}
if (_messageView != null)
{
if (!_renderer.CurrentResults.Any())
{
_messageViewContent.Content = SR.SearchNoMatchesFoundText;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
else
_messageView.IsOpen = false;
}
_textArea.TextView.InvalidateLayer(KnownLayer.Selection);
}
private void SelectResult(TextSegment result)
{
_textArea.Caret.Offset = result.StartOffset;
_textArea.Selection = Selection.Create(_textArea, result.StartOffset, result.EndOffset);
double distanceToViewBorder = _border == null ?
Caret.MinimumDistanceToViewBorder :
_border.Bounds.Height + _textArea.TextView.DefaultLineHeight;
_textArea.Caret.BringCaretToView(distanceToViewBorder);
// show caret even if the editor does not have the Keyboard Focus
_textArea.Caret.Show();
}
private void SearchLayerKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
e.Handled = true;
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
FindPrevious();
}
else
{
FindNext();
}
if (_searchTextBox != null)
{
if (_validationError != null)
{
_messageViewContent.Content = SR.SearchErrorText + " " + _validationError;
_messageView.PlacementTarget = _searchTextBox;
_messageView.IsOpen = true;
}
}
break;
case Key.Escape:
e.Handled = true;
Close();
break;
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
public void Close()
{
_textArea.RemoveChild(this);
_messageView.IsOpen = false;
_textArea.TextView.BackgroundRenderers.Remove(_renderer);
IsClosed = true;
// Clear existing search results so that the segments don't have to be maintained
_renderer.CurrentResults.Clear();
_textArea.Focus();
}
/// <summary>
/// Opens the an existing search panel.
/// </summary>
public void Open()
{
if (!IsClosed) return;
_textArea.AddChild(this);
_textArea.TextView.BackgroundRenderers.Add(_renderer);
IsClosed = false;
DoSearch(false);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
e.Handled = true;
base.OnPointerPressed(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
Cursor = Cursor.Default;
base.OnPointerMoved(e);
}
protected override void OnGotFocus(GotFocusEventArgs e)
{
e.Handled = true;
base.OnGotFocus(e);
}
/// <summary>
/// Fired when SearchOptions are changed inside the SearchPanel.
/// </summary>
public event EventHandler<SearchOptionsChangedEventArgs> SearchOptionsChanged;
/// <summary>
/// Raises the <see cref="SearchOptionsChanged" /> event.
/// </summary>
protected virtual void OnSearchOptionsChanged(SearchOptionsChangedEventArgs e)
{
SearchOptionsChanged?.Invoke(this, e);
}
public IList<RoutedCommandBinding> CommandBindings { get; } = new List<RoutedCommandBinding>();
}
/// <summary>
/// EventArgs for <see cref="SearchPanel.SearchOptionsChanged"/> event.
/// </summary>
public class SearchOptionsChangedEventArgs : EventArgs
{
/// <summary>
/// Gets the search pattern.
/// </summary>
public string SearchPattern { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted case-sensitive.
/// </summary>
public bool MatchCase { get; }
/// <summary>
/// Gets whether the search pattern should be interpreted as regular expression.
/// </summary>
public bool UseRegex { get; }
/// <summary>
/// Gets whether the search pattern should only match whole words.
/// </summary>
public bool WholeWords { get; }
/// <summary>
/// Creates a new SearchOptionsChangedEventArgs instance.
/// </summary>
public SearchOptionsChangedEventArgs(string searchPattern, bool matchCase, bool useRegex, bool wholeWords)
{
SearchPattern = searchPattern;
MatchCase = matchCase;
UseRegex = useRegex;
WholeWords = wholeWords;
}
}
}
<MSG> Create IsOpened property in the SearchPanel
<DFF> @@ -483,6 +483,11 @@ namespace AvaloniaEdit.Search
/// </summary>
public bool IsClosed { get; private set; }
+ /// <summary>
+ /// Gets whether the Panel is currently opened.
+ /// </summary>
+ public bool IsOpened => !IsClosed;
+
/// <summary>
/// Closes the SearchPanel.
/// </summary>
| 5 | Create IsOpened property in the SearchPanel | 0 | .cs | cs | mit | AvaloniaUI/AvaloniaEdit |
10056916 | <NME> events.md
<BEF> ## Events
Events are at the core of fruitmachine. They allows us to decouple View interactions from one another. By default *FruitMachine* fires the following events on View module instances:
- `before initialize` Before the module is instantiated
- `initialize` On instantiation
- `before setup` Before the module is setup
- `setup` When `.setup()` is called (remember 'setup' is recursive)
- `before teardown` Before the module is torn down
- `teardown` When `.teardown()` or `.destroy()` are called (remember 'destroy' calls 'teardown' which recurses)
- `before destroy` Before the module is destroyed
- `destroy` When `.setup()` is called (remember 'teardown' recurses)
- `before tohtml` Before toHTML is called. `render` events are only fired on the node being rendered - not any of the children so if you want to manipulate a module's data model prior to rendering, hook into this event)
- `render` When `.render()` is called
#### Bubbling
FruitMachine events are interesting as they propagate (or bubble) up the view chain. This means that parent Views way up the view chain can still listen to events that happen in deeply nested View modules.
This is useful because it means your app's controllers can listen and decide what to do when specific things happen within your views. The response logic doesn't have to be in the view module itself, meaning modules are decoupled from your app, and easily reused elsewhere.
```js
var layout = new Layout();
var apple = new Apple();
layout.add(apple);
layout.on('shout', function() {
alert('layout heard apple shout');
});
apple.fire('shout');
//=> alert 'layout heard apple shout'
```
#### Passing parameters
```js
var layout = new Layout();
var apple = new Apple();
layout.add(apple);
layout.on('shout', function(param) {
alert('layout heard apple shout ' + param);
});
apple.fire('shout', 'hello');
// alert - 'layout heard apple shout hello'
```
#### Listening only for specific modules
```js
var layout = new Layout();
var apple = new Apple();
var orange = new Orange();
layout
.add(apple)
.add(orange);
layout.on('shout', 'apple', function() {
alert('layout heard apple shout');
});
apple.fire('shout');
//=> alert 'layout heard apple shout'
orange.fire('shout');
//=> nothing
```
#### Utilising the event object
The event object can be found on under `this.event`. It holds a reference to the target view, where the event originated.
```js
var layout = new Layout();
var apple = new Apple();
var orange = new Orange();
layout
.add(apple)
.add(orange);
layout.on('shout', function() {
var module = this.event.target.module();
alert('layout heard ' + module + ' shout');
});
apple.fire('shout');
//=> alert 'layout heard apple shout'
orange.fire('shout');
//=> alert 'layout heard orange shout'
```
It also allows you to stop the event propagating (bubbling) up the view by calling `this.event.stopPropagation()`, just like DOM events!
```js
var layout = new Layout();
var apple = new Apple();
var orange = new Orange();
layout
.add(apple)
.add(orange);
layout.on('shout', function() {
alert('layout heard apple shout');
});
apple.on('shout', function() {
this.event.stopPropagation(); /* 1 */
});
apple.fire('shout');
//=> nothing
```
1. *By stopping propagation here, we stop the event from ever reaching the parent view `layout`, and thus the alert is never fired.*
<MSG> List events in order of firing, clarify `.setup`, clarify bubbling
<DFF> @@ -1,17 +1,20 @@
## Events
-Events are at the core of fruitmachine. They allows us to decouple View interactions from one another. By default *FruitMachine* fires the following events on View module instances:
+Events are at the core of fruitmachine. They allows us to decouple View interactions from one another. By default *FruitMachine* fires the following events on View module instances during creation, in the following order:
- `before initialize` Before the module is instantiated
- `initialize` On instantiation
+- `before render` At the very start of the render process, triggered by the view having `.render()` called on it
+- `before tohtml` Before toHTML is called. `render` events are only fired on the node being rendered - not any of the children so if you want to manipulate a module's data model prior to rendering, hook into this event)
+- `render` When the `.render()` process is complete
- `before setup` Before the module is setup
-- `setup` When `.setup()` is called (remember 'setup' is recursive)
+- `setup` When `.setup()` is called to set up events after render (remember 'setup' is recursive)
+
+And during destruction, in the following order:
- `before teardown` Before the module is torn down
- `teardown` When `.teardown()` or `.destroy()` are called (remember 'destroy' calls 'teardown' which recurses)
- `before destroy` Before the module is destroyed
-- `destroy` When `.setup()` is called (remember 'teardown' recurses)
-- `before tohtml` Before toHTML is called. `render` events are only fired on the node being rendered - not any of the children so if you want to manipulate a module's data model prior to rendering, hook into this event)
-- `render` When `.render()` is called
+- `destroy` When `.destroy()` is called (remember 'teardown' recurses)
#### Bubbling
@@ -33,6 +36,8 @@ apple.fire('shout');
//=> alert 'layout heard apple shout'
```
+The FruitMachine default events (eg `initialize`, `setup`, `teardown`) do not bubble.
+
#### Passing parameters
```js
| 10 | List events in order of firing, clarify `.setup`, clarify bubbling | 5 | .md | md | mit | ftlabs/fruitmachine |
10056917 | <NME> fruitmachine.js
<BEF> /*jslint browser:true, node:true*/
/**
* FruitMachine
*
* Renders layouts/modules from a basic layout definition.
* If views require custom interactions devs can extend
* the basic functionality.
*
* @version 0.3.3
* @copyright The Financial Times Limited [All Rights Reserved]
* @author Wilson Page <[email protected]>
*/
'use strict';
/**
* Module Dependencies
*/
var mod = require('./module');
var define = require('./define');
var utils = require('utils');
var events = require('evt');
/**
* Creates a fruitmachine
*
* Options:
*
* - `Model` A model constructor to use (must have `.toJSON()`)
*
* @param {Object} options
*/
module.exports = function(options) {
/**
* Shortcut method for
* creating lazy views.
*
* @param {Object} options
* @return {Module}
*/
function fm(options) {
var Module = fm.modules[options.module];
if (Module) return new Module(options);
}
fm.create = module.exports;
fm.Model = options.Model;
fm.Events = events;
fm.Module = mod(fm);
fm.define = define(fm);
fm.util = utils;
fm.modules = {};
fm.config = {
templateIterator: 'children',
templateInstance: 'child'
};
// Mixin events and return
return events(fm);
};
<MSG> Report error when module is not defined
<DFF> @@ -43,7 +43,10 @@ module.exports = function(options) {
*/
function fm(options) {
var Module = fm.modules[options.module];
- if (Module) return new Module(options);
+ if (Module) {
+ return new Module(options);
+ }
+ throw new Error("Unable to find module '" + options.module + "'");
}
fm.create = module.exports;
| 4 | Report error when module is not defined | 1 | .js | js | mit | ftlabs/fruitmachine |
10056918 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056919 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056920 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056921 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056922 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056923 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056924 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056925 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056926 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056927 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056928 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056929 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056930 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056931 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056932 | <NME> AvaloniaEdit.sln
<BEF>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit", "src\AvaloniaEdit\AvaloniaEdit.csproj", "{4B04026F-BA96-4721-AE28-0970CB5806A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Demo", "src\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj", "{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\AvaloniaEdit.Tests\AvaloniaEdit.Tests.csproj", "{9E5D4372-D362-44A2-984D-578288870AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Debug|x64.Build.0 = Debug|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.ActiveCfg = Release|Any CPU
{4B04026F-BA96-4721-AE28-0970CB5806A9}.Release|x64.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.ActiveCfg = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Debug|x64.Build.0 = Debug|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|Any CPU.Build.0 = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.ActiveCfg = Release|Any CPU
{03763F37-9BD9-4D1D-ADC9-1050F6F8C062}.Release|x64.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Debug|x64.Build.0 = Debug|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.ActiveCfg = Release|Any CPU
{9E5D4372-D362-44A2-984D-578288870AB8}.Release|x64.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.ActiveCfg = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Debug|x64.Build.0 = Debug|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DCA3703C-8F8E-4AC5-81D7-65131FEBA631}
EndGlobalSection
EndGlobal
<MSG> update sln
<DFF> @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.Tests", "test\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9668961-BD19-4360-8ABE-B9BD55EB52CA}"
ProjectSection(SolutionItems) = preProject
+ appveyor.yml = appveyor.yml
+ build.cake = build.cake
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
| 2 | update sln | 0 | .sln | sln | mit | AvaloniaUI/AvaloniaEdit |
10056933 | <NME> LumenPassport.php
<BEF> <?php
namespace Dusterio\LumenPassport;
use Illuminate\Support\Arr;
use Laravel\Passport\Passport;
use DateTimeInterface;
use Carbon\Carbon;
use Laravel\Lumen\Application;
use Laravel\Lumen\Routing\Router;
class LumenPassport
{
/**
* Allow simultaneous logins for users
*
* @var bool
*/
public static $allowMultipleTokens = false;
/**
* The date when access tokens expire (specific per password client).
*
* @var array
*/
public static $tokensExpireAt = [];
/**
* Instruct Passport to keep revoked tokens pruned.
*/
public static function allowMultipleTokens()
{
static::$allowMultipleTokens = true;
}
/**
* Delete older tokens or just mark them as revoked?
*/
public static function prunePreviousTokens()
{
Passport::$pruneRevokedTokens = true;
}
/**
* Get or set when access tokens expire.
*
* @param \DateTimeInterface|null $date
* @param int $clientId
* @return \DateInterval|static
*/
public static function tokensExpireIn(DateTimeInterface $date = null, $clientId = null)
{
if (! $clientId) return Passport::tokensExpireIn($date);
if (is_null($date)) {
return isset(static::$tokensExpireAt[$clientId])
? Carbon::now()->diff(static::$tokensExpireAt[$clientId])
: Passport::tokensExpireIn();
} else {
static::$tokensExpireAt[$clientId] = $date;
}
return new static;
}
/**
* Get a Passport route registrar.
*
* @param callable|Router|Application $callback
* @param array $options
* @return RouteRegistrar
*/
public static function routes($callback = null, array $options = [])
{
if ($callback instanceof Application && preg_match('/(5\.[5-8]\..*)|(6\..*)|(7\..*)|(8\..*)|(9\..*)/', $callback->version())) $callback = $callback->router;
$callback = $callback ?: function ($router) {
$router->all();
};
$defaultOptions = [
'prefix' => 'oauth',
'namespace' => '\Laravel\Passport\Http\Controllers',
];
$options = array_merge($defaultOptions, $options);
$callback->group(Arr::except($options, ['namespace']), function ($router) use ($callback, $options) {
$routes = new RouteRegistrar($router, $options);
$routes->all();
});
}
}
<MSG> Merge pull request #135 from JuanDMeGon/master
[FIX] Removing deprecated functionalities
<DFF> @@ -33,14 +33,6 @@ class LumenPassport
static::$allowMultipleTokens = true;
}
- /**
- * Delete older tokens or just mark them as revoked?
- */
- public static function prunePreviousTokens()
- {
- Passport::$pruneRevokedTokens = true;
- }
-
/**
* Get or set when access tokens expire.
*
| 0 | Merge pull request #135 from JuanDMeGon/master | 8 | .php | php | mit | dusterio/lumen-passport |
10056934 | <NME> README.md
<BEF> # LoadJS
<img src="https://www.muicss.com/static/images/loadjs.svg" width="250px">
LoadJS is a tiny async loader for modern browsers (899 bytes).
[](https://david-dm.org/muicss/loadjs)
[](https://david-dm.org/muicss/loadjs?type=dev)
[](https://cdnjs.com/libraries/loadjs)
## Introduction
LoadJS is a tiny async loading library for modern browsers (IE9+). It has a simple yet powerful dependency management system that lets you fetch JavaScript, CSS and image files in parallel and execute code after the dependencies have been met. The recommended way to use LoadJS is to include the minified source code of [loadjs.js](https://raw.githubusercontent.com/muicss/loadjs/master/dist/loadjs.min.js) in your <html> (possibly in the <head> tag) and then use the `loadjs` global to manage JavaScript dependencies after pageload.
LoadJS is based on the excellent [$script](https://github.com/ded/script.js) library by [Dustin Diaz](https://github.com/ded). We kept the behavior of the library the same but we re-wrote the code from scratch to add support for success/error callbacks and to optimize the library for modern browsers. LoadJS is 899 bytes (minified + gzipped).
Here's an example of what you can do with LoadJS:
```html
<script src="//unpkg.com/loadjs@latest/dist/loadjs.min.js"></script>
<script>
// define a dependency bundle and execute code when it loads
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar');
loadjs.ready('foobar', function() {
/* foo.js & bar.js loaded */
});
</script>
```
You can also use more advanced syntax for more options:
```html
<script src="//unpkg.com/loadjs@latest/dist/loadjs.min.js"></script>
<script>
// define a dependency bundle with advanced options
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
before: function(path, scriptEl) { /* execute code before fetch */ },
async: true, // load files synchronously or asynchronously (default: true)
numRetries: 3 // see caveats about using numRetries with async:false (default: 0),
returnPromise: false // return Promise object (default: false)
});
loadjs.ready('foobar', {
success: function() { /* foo.js & bar.js loaded */ },
error: function(depsNotFound) { /* foobar bundle load failed */ },
});
</script>
```
The latest version of LoadJS can be found in the `dist/` directory in this repository:
* [https://cdn.rawgit.com/muicss/loadjs/4.2.0/dist/loadjs.js](https://cdn.rawgit.com/muicss/loadjs/4.2.0/dist/loadjs.js) (for development)
* [https://cdn.rawgit.com/muicss/loadjs/4.2.0/dist/loadjs.min.js](https://cdn.rawgit.com/muicss/loadjs/4.2.0/dist/loadjs.min.js) (for production)
It's also available from these public CDNs:
* UNPKG
* [https://unpkg.com/[email protected]/dist/loadjs.js](https://unpkg.com/[email protected]/dist/loadjs.js) (for development)
* [https://unpkg.com/[email protected]/dist/loadjs.min.js](https://unpkg.com/[email protected]/dist/loadjs.min.js) (for production)
* CDNJS
* [https://cdnjs.cloudflare.com/ajax/libs/loadjs/4.2.0/loadjs.js](https://cdnjs.cloudflare.com/ajax/libs/loadjs/4.2.0/loadjs.js) (for development)
* [https://cdnjs.cloudflare.com/ajax/libs/loadjs/4.2.0/loadjs.min.js](https://cdnjs.cloudflare.com/ajax/libs/loadjs/4.2.0/loadjs.min.js) (for production)
You can also use it as a CJS or AMD module:
```bash
$ npm install --save loadjs
```
```javascript
var loadjs = require('loadjs');
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar');
loadjs.ready('foobar', function() {
/* foo.js & bar.js loaded */
});
```
## Browser Support
* IE9+ (`async: false` support only works in IE10+)
* Opera 12+
* Safari 5+
* Chrome
* Firefox
* iOS 6+
* Android 4.4+
LoadJS also detects script load failures from AdBlock Plus and Ghostery in:
* Safari
* Chrome
Note: LoadJS treats empty CSS files as load failures in IE9-11 and uses `rel="preload"` to load CSS files in Edge (to get around lack of support for onerror events on `<link rel="stylesheet">` tags)
## Documentation
1. Load a single file
```javascript
loadjs('/path/to/foo.js', function() {
1. Add a bundle id
```javascript
// add a bundle id
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
success: function() { /* foo.js & bar.js loaded */ }
});
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], function() {
/* foo.js and bar.js loaded */
});
```
1. Fetch JavaScript, CSS and image files
```javascript
loadjs(['/path/to/foo.css', '/path/to/bar.png', 'path/to/thunk.js'], function() {
/* foo.css, bar.png and thunk.js loaded */
});
```
1. Force treat file as CSS stylesheet
```javascript
loadjs(['css!/path/to/cssfile.custom'], function() {
/* cssfile.custom loaded as stylesheet */
});
```
1. Force treat file as image
```javascript
loadjs(['img!/path/to/image.custom'], function() {
/* image.custom loaded */
});
```
1. Add a bundle id
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', function() {
/* foo.js & bar.js loaded */
});
```
1. Use .ready() to define bundles and callbacks separately
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar');
loadjs.ready('foobar', function() {
/* foo.js & bar.js loaded */
});
```
1. Use multiple bundles in .ready() dependency lists
```javascript
loadjs('/path/to/foo.js', 'foo');
loadjs(['/path/to/bar1.js', '/path/to/bar2.js'], 'bar');
loadjs.ready(['foo', 'bar'], function() {
/* foo.js & bar1.js & bar2.js loaded */
});
```
1. Chain .ready() together
```javascript
loadjs('/path/to/foo.js', 'foo');
loadjs('/path/to/bar.js', 'bar');
loadjs
.ready('foo', function() {
/* foo.js loaded */
})
.ready('bar', function() {
/* bar.js loaded */
});
```
1. Use Promises to register callbacks
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], {returnPromise: true})
.then(function() { /* foo.js & bar.js loaded */ })
.catch(function(pathsNotFound) { /* at least one didn't load */ });
```
1. Check if bundle has already been defined
```javascript
if (!loadjs.isDefined('foobar')) {
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', function() {
/* foo.js & bar.js loaded */
});
}
```
1. Fetch files in parallel and load them in series
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], {
success: function() { /* foo.js and bar.js loaded in series */ },
async: false
});
```
1. Add an error callback
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
success: function() { /* foo.js & bar.js loaded */ },
error: function(pathsNotFound) { /* at least one path didn't load */ }
});
```
1. Retry files before calling the error callback
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
success: function() { /* foo.js & bar.js loaded */ },
error: function(pathsNotFound) { /* at least one path didn't load */ },
numRetries: 3
});
// NOTE: Using `numRetries` with `async: false` can cause files to load out-of-sync on retries
```
1. Execute a callback before script tags are embedded
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], {
success: function() {},
error: function(pathsNotFound) {},
before: function(path, scriptEl) {
/* called for each script node before being embedded */
if (path === '/path/to/foo.js') scriptEl.crossOrigin = true;
}
});
```
1. Bypass LoadJS default DOM insertion mechanism (DOM `<head>`)
```javascript
loadjs(['/path/to/foo.js'], {
success: function() {},
error: function(pathsNotFound) {},
before: function(path, scriptEl) {
document.body.appendChild(scriptEl);
/* return `false` to bypass default DOM insertion mechanism */
return false;
}
});
```
1. Use bundle ids in error callback
```javascript
loadjs('/path/to/foo.js', 'foo');
loadjs('/path/to/bar.js', 'bar');
loadjs(['/path/to/thunkor.js', '/path/to/thunky.js'], 'thunk');
// wait for multiple depdendencies
loadjs.ready(['foo', 'bar', 'thunk'], {
success: function() {
// foo.js & bar.js & thunkor.js & thunky.js loaded
},
error: function(depsNotFound) {
if (depsNotFound.indexOf('foo') > -1) {}; // foo failed
if (depsNotFound.indexOf('bar') > -1) {}; // bar failed
if (depsNotFound.indexOf('thunk') > -1) {}; // thunk failed
}
});
```
1. Use .done() for more control
```javascript
loadjs.ready(['dependency1', 'dependency2'], function() {
/* run code after dependencies have been met */
});
function fn1() {
loadjs.done('dependency1');
}
function fn2() {
loadjs.done('dependency2');
}
```
1. Reset dependency trackers
```javascript
loadjs.reset();
```
1. Implement a require-like dependency manager
```javascript
var bundles = {
'bundleA': ['/file1.js', '/file2.js'],
'bundleB': ['/file3.js', '/file4.js']
};
function require(bundleIds, callbackFn) {
bundleIds.forEach(function(bundleId) {
if (!loadjs.isDefined(bundleId)) loadjs(bundles[bundleId], bundleId);
});
loadjs.ready(bundleIds, callbackFn);
}
require(['bundleA'], function() { /* bundleA loaded */ });
require(['bundleB'], function() { /* bundleB loaded */ });
require(['bundleA', 'bundleB'], function() { /* bundleA and bundleB loaded */ });
```
## Directory structure
<pre>
loadjs/
├── dist
│ ├── loadjs.js
│ ├── loadjs.min.js
│ └── loadjs.umd.js
├── examples
├── gulpfile.js
├── LICENSE.txt
├── package.json
├── README.md
├── src
│ └── loadjs.js
├── test
└── umd-templates
</pre>
## Development Quickstart
1. Install dependencies
* [nodejs](http://nodejs.org/)
* [npm](https://www.npmjs.org/)
* http-server (via npm)
1. Clone repository
```bash
$ git clone [email protected]:muicss/loadjs.git
$ cd loadjs
```
1. Install node dependencies using npm
```bash
$ npm install
```
1. Build examples
```bash
$ npm run build-examples
```
To view the examples you can use any static file server. To use the `nodejs` http-server module:
```bash
$ npm install http-server
$ npm run http-server -- -p 3000
```
Then visit [http://localhost:3000/examples](http://localhost:3000/examples)
1. Build distribution files
```bash
$ npm run build-dist
```
The files will be located in the `dist` directory.
1. Run tests
To run the browser tests first build the `loadjs` library:
```bash
$ npm run build-tests
```
Then visit [http://localhost:3000/test](http://localhost:3000/test)
1. Build all files
```bash
$ npm run build-all
```
<MSG> Update README.md
<DFF> @@ -102,7 +102,6 @@ Note: LoadJS treats empty CSS files as load failures (as a workaround for the la
1. Add a bundle id
```javascript
- // add a bundle id
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
success: function() { /* foo.js & bar.js loaded */ }
});
| 0 | Update README.md | 1 | .md | md | mit | muicss/loadjs |
10056935 | <NME> README.md
<BEF> # LoadJS
<img src="https://www.muicss.com/static/images/loadjs.svg" width="250px">
LoadJS is a tiny async loader for modern browsers (899 bytes).
[](https://david-dm.org/muicss/loadjs)
[](https://david-dm.org/muicss/loadjs?type=dev)
[](https://cdnjs.com/libraries/loadjs)
## Introduction
LoadJS is a tiny async loading library for modern browsers (IE9+). It has a simple yet powerful dependency management system that lets you fetch JavaScript, CSS and image files in parallel and execute code after the dependencies have been met. The recommended way to use LoadJS is to include the minified source code of [loadjs.js](https://raw.githubusercontent.com/muicss/loadjs/master/dist/loadjs.min.js) in your <html> (possibly in the <head> tag) and then use the `loadjs` global to manage JavaScript dependencies after pageload.
LoadJS is based on the excellent [$script](https://github.com/ded/script.js) library by [Dustin Diaz](https://github.com/ded). We kept the behavior of the library the same but we re-wrote the code from scratch to add support for success/error callbacks and to optimize the library for modern browsers. LoadJS is 899 bytes (minified + gzipped).
Here's an example of what you can do with LoadJS:
```html
<script src="//unpkg.com/loadjs@latest/dist/loadjs.min.js"></script>
<script>
// define a dependency bundle and execute code when it loads
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar');
loadjs.ready('foobar', function() {
/* foo.js & bar.js loaded */
});
</script>
```
You can also use more advanced syntax for more options:
```html
<script src="//unpkg.com/loadjs@latest/dist/loadjs.min.js"></script>
<script>
// define a dependency bundle with advanced options
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
before: function(path, scriptEl) { /* execute code before fetch */ },
async: true, // load files synchronously or asynchronously (default: true)
numRetries: 3 // see caveats about using numRetries with async:false (default: 0),
returnPromise: false // return Promise object (default: false)
});
loadjs.ready('foobar', {
success: function() { /* foo.js & bar.js loaded */ },
error: function(depsNotFound) { /* foobar bundle load failed */ },
});
</script>
```
The latest version of LoadJS can be found in the `dist/` directory in this repository:
* [https://cdn.rawgit.com/muicss/loadjs/4.2.0/dist/loadjs.js](https://cdn.rawgit.com/muicss/loadjs/4.2.0/dist/loadjs.js) (for development)
* [https://cdn.rawgit.com/muicss/loadjs/4.2.0/dist/loadjs.min.js](https://cdn.rawgit.com/muicss/loadjs/4.2.0/dist/loadjs.min.js) (for production)
It's also available from these public CDNs:
* UNPKG
* [https://unpkg.com/[email protected]/dist/loadjs.js](https://unpkg.com/[email protected]/dist/loadjs.js) (for development)
* [https://unpkg.com/[email protected]/dist/loadjs.min.js](https://unpkg.com/[email protected]/dist/loadjs.min.js) (for production)
* CDNJS
* [https://cdnjs.cloudflare.com/ajax/libs/loadjs/4.2.0/loadjs.js](https://cdnjs.cloudflare.com/ajax/libs/loadjs/4.2.0/loadjs.js) (for development)
* [https://cdnjs.cloudflare.com/ajax/libs/loadjs/4.2.0/loadjs.min.js](https://cdnjs.cloudflare.com/ajax/libs/loadjs/4.2.0/loadjs.min.js) (for production)
You can also use it as a CJS or AMD module:
```bash
$ npm install --save loadjs
```
```javascript
var loadjs = require('loadjs');
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar');
loadjs.ready('foobar', function() {
/* foo.js & bar.js loaded */
});
```
## Browser Support
* IE9+ (`async: false` support only works in IE10+)
* Opera 12+
* Safari 5+
* Chrome
* Firefox
* iOS 6+
* Android 4.4+
LoadJS also detects script load failures from AdBlock Plus and Ghostery in:
* Safari
* Chrome
Note: LoadJS treats empty CSS files as load failures in IE9-11 and uses `rel="preload"` to load CSS files in Edge (to get around lack of support for onerror events on `<link rel="stylesheet">` tags)
## Documentation
1. Load a single file
```javascript
loadjs('/path/to/foo.js', function() {
1. Add a bundle id
```javascript
// add a bundle id
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
success: function() { /* foo.js & bar.js loaded */ }
});
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], function() {
/* foo.js and bar.js loaded */
});
```
1. Fetch JavaScript, CSS and image files
```javascript
loadjs(['/path/to/foo.css', '/path/to/bar.png', 'path/to/thunk.js'], function() {
/* foo.css, bar.png and thunk.js loaded */
});
```
1. Force treat file as CSS stylesheet
```javascript
loadjs(['css!/path/to/cssfile.custom'], function() {
/* cssfile.custom loaded as stylesheet */
});
```
1. Force treat file as image
```javascript
loadjs(['img!/path/to/image.custom'], function() {
/* image.custom loaded */
});
```
1. Add a bundle id
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', function() {
/* foo.js & bar.js loaded */
});
```
1. Use .ready() to define bundles and callbacks separately
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar');
loadjs.ready('foobar', function() {
/* foo.js & bar.js loaded */
});
```
1. Use multiple bundles in .ready() dependency lists
```javascript
loadjs('/path/to/foo.js', 'foo');
loadjs(['/path/to/bar1.js', '/path/to/bar2.js'], 'bar');
loadjs.ready(['foo', 'bar'], function() {
/* foo.js & bar1.js & bar2.js loaded */
});
```
1. Chain .ready() together
```javascript
loadjs('/path/to/foo.js', 'foo');
loadjs('/path/to/bar.js', 'bar');
loadjs
.ready('foo', function() {
/* foo.js loaded */
})
.ready('bar', function() {
/* bar.js loaded */
});
```
1. Use Promises to register callbacks
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], {returnPromise: true})
.then(function() { /* foo.js & bar.js loaded */ })
.catch(function(pathsNotFound) { /* at least one didn't load */ });
```
1. Check if bundle has already been defined
```javascript
if (!loadjs.isDefined('foobar')) {
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', function() {
/* foo.js & bar.js loaded */
});
}
```
1. Fetch files in parallel and load them in series
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], {
success: function() { /* foo.js and bar.js loaded in series */ },
async: false
});
```
1. Add an error callback
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
success: function() { /* foo.js & bar.js loaded */ },
error: function(pathsNotFound) { /* at least one path didn't load */ }
});
```
1. Retry files before calling the error callback
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
success: function() { /* foo.js & bar.js loaded */ },
error: function(pathsNotFound) { /* at least one path didn't load */ },
numRetries: 3
});
// NOTE: Using `numRetries` with `async: false` can cause files to load out-of-sync on retries
```
1. Execute a callback before script tags are embedded
```javascript
loadjs(['/path/to/foo.js', '/path/to/bar.js'], {
success: function() {},
error: function(pathsNotFound) {},
before: function(path, scriptEl) {
/* called for each script node before being embedded */
if (path === '/path/to/foo.js') scriptEl.crossOrigin = true;
}
});
```
1. Bypass LoadJS default DOM insertion mechanism (DOM `<head>`)
```javascript
loadjs(['/path/to/foo.js'], {
success: function() {},
error: function(pathsNotFound) {},
before: function(path, scriptEl) {
document.body.appendChild(scriptEl);
/* return `false` to bypass default DOM insertion mechanism */
return false;
}
});
```
1. Use bundle ids in error callback
```javascript
loadjs('/path/to/foo.js', 'foo');
loadjs('/path/to/bar.js', 'bar');
loadjs(['/path/to/thunkor.js', '/path/to/thunky.js'], 'thunk');
// wait for multiple depdendencies
loadjs.ready(['foo', 'bar', 'thunk'], {
success: function() {
// foo.js & bar.js & thunkor.js & thunky.js loaded
},
error: function(depsNotFound) {
if (depsNotFound.indexOf('foo') > -1) {}; // foo failed
if (depsNotFound.indexOf('bar') > -1) {}; // bar failed
if (depsNotFound.indexOf('thunk') > -1) {}; // thunk failed
}
});
```
1. Use .done() for more control
```javascript
loadjs.ready(['dependency1', 'dependency2'], function() {
/* run code after dependencies have been met */
});
function fn1() {
loadjs.done('dependency1');
}
function fn2() {
loadjs.done('dependency2');
}
```
1. Reset dependency trackers
```javascript
loadjs.reset();
```
1. Implement a require-like dependency manager
```javascript
var bundles = {
'bundleA': ['/file1.js', '/file2.js'],
'bundleB': ['/file3.js', '/file4.js']
};
function require(bundleIds, callbackFn) {
bundleIds.forEach(function(bundleId) {
if (!loadjs.isDefined(bundleId)) loadjs(bundles[bundleId], bundleId);
});
loadjs.ready(bundleIds, callbackFn);
}
require(['bundleA'], function() { /* bundleA loaded */ });
require(['bundleB'], function() { /* bundleB loaded */ });
require(['bundleA', 'bundleB'], function() { /* bundleA and bundleB loaded */ });
```
## Directory structure
<pre>
loadjs/
├── dist
│ ├── loadjs.js
│ ├── loadjs.min.js
│ └── loadjs.umd.js
├── examples
├── gulpfile.js
├── LICENSE.txt
├── package.json
├── README.md
├── src
│ └── loadjs.js
├── test
└── umd-templates
</pre>
## Development Quickstart
1. Install dependencies
* [nodejs](http://nodejs.org/)
* [npm](https://www.npmjs.org/)
* http-server (via npm)
1. Clone repository
```bash
$ git clone [email protected]:muicss/loadjs.git
$ cd loadjs
```
1. Install node dependencies using npm
```bash
$ npm install
```
1. Build examples
```bash
$ npm run build-examples
```
To view the examples you can use any static file server. To use the `nodejs` http-server module:
```bash
$ npm install http-server
$ npm run http-server -- -p 3000
```
Then visit [http://localhost:3000/examples](http://localhost:3000/examples)
1. Build distribution files
```bash
$ npm run build-dist
```
The files will be located in the `dist` directory.
1. Run tests
To run the browser tests first build the `loadjs` library:
```bash
$ npm run build-tests
```
Then visit [http://localhost:3000/test](http://localhost:3000/test)
1. Build all files
```bash
$ npm run build-all
```
<MSG> Update README.md
<DFF> @@ -102,7 +102,6 @@ Note: LoadJS treats empty CSS files as load failures (as a workaround for the la
1. Add a bundle id
```javascript
- // add a bundle id
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
success: function() { /* foo.js & bar.js loaded */ }
});
| 0 | Update README.md | 1 | .md | md | mit | muicss/loadjs |
10056936 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056937 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056938 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056939 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056940 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056941 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056942 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056943 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056944 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056945 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056946 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056947 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056948 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
10056949 | <NME> MainWindow.xaml
<BEF> <Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="500"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
x:Class="AvaloniaEdit.Demo.MainWindow"
Background="#1E1E1E">
<DockPanel>
<StackPanel Orientation="Horizontal"
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
<Button Content="Copy" />
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
<ToggleButton Name="viewColumnRules" Content="View columns rulers" IsChecked="{Binding #Editor.Options.ShowColumnRulers}" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="addControlBtn" Content="Add Button" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="clearControlBtn" Content="Clear Buttons" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<ComboBox Name="syntaxModeCombo" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
<Button Name="changeThemeBtn" Content="Change theme" VerticalAlignment="Stretch" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Name="StatusBar" Background="Purple" Height="25" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Name="StatusText" Text="Ready" Margin="5 0 0 0" VerticalAlignment="Center" FontSize="12"/>
</StackPanel>
<AvalonEdit:TextEditor Name="Editor"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Margin="30"
Foreground="#D4D4D4"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Visible"
FontWeight="Light"
FontSize="14" />
</DockPanel>
</Window>
<MSG> Added a "word wrap" button in the Demo application
<DFF> @@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:AvalonEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- MinWidth="500"
+ MinWidth="0"
MinHeight="300"
Width="950"
Title="AvaloniaEdit Demo"
@@ -12,7 +12,11 @@
DockPanel.Dock="Top"
Spacing="5"
Margin="3">
- <Button Content="Copy" />
+ <ToggleButton Name="wordWrap" ToolTip.Tip="Word wrap" IsChecked="{Binding #Editor.WordWrap}">
+ <ToggleButton.Content>
+ <Path Fill="White" Data="M2.75 5C2.33579 5 2 5.33579 2 5.75C2 6.16421 2.33579 6.5 2.75 6.5H21.25C21.6642 6.5 22 6.16421 22 5.75C22 5.33579 21.6642 5 21.25 5H2.75Z M2.75 11.5C2.33579 11.5 2 11.8358 2 12.25C2 12.6642 2.33579 13 2.75 13H19C20.3807 13 21.5 14.1193 21.5 15.5C21.5 16.8807 20.3807 18 19 18H14.5607L15.2803 17.2803C15.5732 16.9874 15.5732 16.5126 15.2803 16.2197C14.9874 15.9268 14.5126 15.9268 14.2197 16.2197L12.2197 18.2197C11.9268 18.5126 11.9268 18.9874 12.2197 19.2803L14.2197 21.2803C14.5126 21.5732 14.9874 21.5732 15.2803 21.2803C15.5732 20.9874 15.5732 20.5126 15.2803 20.2197L14.5607 19.5H19C21.2091 19.5 23 17.7091 23 15.5C23 13.2909 21.2091 11.5 19 11.5H2.75Z M2 18.75C2 18.3358 2.33579 18 2.75 18H9.25C9.66421 18 10 18.3358 10 18.75C10 19.1642 9.66421 19.5 9.25 19.5H2.75C2.33579 19.5 2 19.1642 2 18.75Z" />
+ </ToggleButton.Content>
+ </ToggleButton>
<Button Name="addControlBtn" Content="Add Button" />
<Button Name="clearControlBtn" Content="Clear Buttons" />
<ComboBox Name="syntaxModeCombo" />
| 6 | Added a "word wrap" button in the Demo application | 2 | .xaml | Demo/MainWindow | mit | AvaloniaUI/AvaloniaEdit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.