Visual C# 2010 Recipes solution_9

Chia sẻ: Up Upload | Ngày: | Loại File: PDF | Số trang:67

0
46
lượt xem
6
download

Visual C# 2010 Recipes solution_9

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Tham khảo tài liệu 'visual c# 2010 recipes solution_9', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả

Chủ đề:
Lưu

Nội dung Text: Visual C# 2010 Recipes solution_9

  1. ■ INDEX EndGetContext method, HttpListener environment variable, 688–690 class, 493 Environment.SpecialFolder enumeration, EndGetHostEntry method, Dns class, 505 685 EndInvoke method, 155, 156, 355 EnvironmentVariableTarget enumeration, 688 EndPoint property, 876 equality, testing two files for, 231–233 endpoints, 510 Equality (==) operator, 75 EndPrint event, PrintDocument class, 401 equality operator ==, 15 Enter method, Monitor class, 172–173 Error value, EventLogEntryType entity classes, 471 enumeration, 690 entity types, performing LINQ query with, ErrorDialog property, ProcessStartInfo 471–473 class, 197 entropy, 594 ErrorProvider component, 348 EntryPoint portion, DllImportAttribute errors class, 598 retrieving unmanaged error Enum class, 129 information, 608–610 enumerable collection, implementing, Ethernet value, NetworkInterfaceType 636–640 enumeration, 481 enumerable type, implementing using event argument, custom, 659–661 custom iterator, 640–647 event handling, with anonymous Enumerable.OrderBy method, 77–78 functions, 46–47 enumerators, 640 event logs, writing event to Windows, 690– 692 EnumWindows function, 606–608 Event pattern, 663 Environment class EventArg class, 659 CommandLine property, 12 EventArgs class, 663 example, 686–690 EventLog class ExpandEnvironmentVariables method, 688 example, 691–692 GetCommandLineArgs() method, 12 System.Diagnostics namespace, 690 GetEnvironmentVariable method, 688 WriteEntry method, 690 GetEnvironmentVariables method, 688 EventLog property, ServiceBase class, 701 members, 684 EventLogEntryType enumeration, 690 System namespace, 12, 684 EventResetMode enumeration, 179 925
  2. ■ INDEX EventTrigger property, 899 execution permission checks, 548–549 EventWaitHandle class, 178–179 Exists method, 235 Evidence class, 104, 562 Exists property, 206 Evidence property, Assembly class, 562 Exit method, Monitor class, 172–173 evidence types, 560 ExpandEnvironmentVariables method, Environment class, 685, 688 Except method, 474, 477 ExpandoObject dynamic type, creating, Exception class, 655–656 37–38 exception class, custom, 655–659 explicit keyword, 44 exception handling, in tasks, 741–743 Explicit property, LayoutKind class, 604 ExceptionState property, Explicit value, 835 ThreadAbortException class, 192 expression syntax table, XPath, 276 Exchange method, Interlocked class, 188 extension methods, 759–760 Execute method, 836, 842, 843 aggregation, 778–780 ExecuteAssembly method, AppDomain class, 114, 115, 116 creating custom, 782–784 ExecuteAssemlyByName method, implementing and calling, 675–677 AppDomain class, 114 LINQ, 757 Executed event handler, 824 Extension property, 206 ExecuteNonQuery method IDbCommand interface, 437–438 ■F SqlCommand class, 453 FailureAudit value, EventLogEntryType enumeration, 690 ExecuteReader method Families property, FontCollection class, IDbCommand interface, 437, 438, 445, 370 457 FastEthernetTvalue, SqlCommand class, 453 NetworkInterfaceType ExecuteScalar method, IDbCommand enumeration, 481 interface, 437–438 FieldCount property, data reader classes, ExecuteXmlReader method, SqlCommand 446 class, 448–450, 453 FieldOffsetAttribute class, 604 Execution element, SecurityPermission File class class, 548 Exists method, 235 GetAccessControl method, 250 926
  3. ■ INDEX SetAccessControl method, 250 accessing a COM port end, 249 System.IO namespace, 235 attribute setting, 211–212 file system classes, 205 calculating size of directory end, 217 File.ReadLines method, 256 calculating size of, 216–217 File.WriteAllLines method, 255 creating a temporary file, 238–239 FileAttributes enumeration, System.IO determining if path is directory or file, namespace, 206 235–236 FileInfo class, 205, 230 determining whether contents have changed, 581–583 Attributes property, 211 downloading, 490–492 derives from FileSystemInfo class, 207 finding files matching wildcard Length property, 216 expressions, 230–231 members, 206 getting a random filename end, 249 methods, 213 getting total free space on drive, 239– 241 Refresh method, 208 log, 254–255 System.IO namespace, 206, 211, 213, 312 manipulating access control lists of file or directory, 250–253 FileInputControl class, 829 manipulating strings representing FileInputControl control, 824, 826 filenames, 233–235 FileInputControl control, 821 monitoring file system for changes, 246 FileIOPermission class, 243, 244 moving, copying or deleting a file and FileLoadException class, System.IO directory, 213–216 namespace, 23, 550 processing using stream, 490–492 FileName property reading a file asynchronously, 226–230 ProcessStartInfo class, 197 reading and writing a binary file, 224– SaveFileDialog class, 241 226 FileName value, NotifyFilters reading and writing a text file, 222–224 enumeration, 246 retrieving information about, 206–211 filenames, generating random, 249, 250 retrieving version information for a file, FileNames collection, 241 217–219 FileNotFoundException class, 10, 112, 208 setting file and directory attributes, 211 files, 205 927
  4. ■ INDEX showing common file dialog boxes, FlipX value, 883 241–243 FlipXY value, 883 showing JIT directory tree in the FlipY value, 883 TreeView control, 219–222 FlowDirection property, FlowLayoutPanel testing two files for equality, 231–231 container, 335 using an isolated store, 243–246 FlowDocument element, 813 working with relative paths, 236–238 FlowDocument object, 813 FileSecurity class, 251 FlowDocument property, 815 FileStream class FlowLayoutPanel container, 335 Handle property, 601 FolderBrowserDialog class, 241 System.IO namespace, 87, 222, 225 FontCollection class, Families property, FileStream.BeginRead method, 226 370 FileStream.EndRead, 226 FontFamily class, 370 FileSystemEventArgs class, 246 fonts, finding all installed fonts, 370–372 FileSystemWatcher class, 246–247 FOR XML AUTO clause, 449 FileVersionInfo class, 217 FOR XML clause, 448, 450 FileWebRequest class, 490 FOR XML EXPLICIT syntax, 449 FilgraphManager class, 395 ForegroundColor property, Console class, 32 Fill method, TreeView control, 220 Form class Fill property, 873– 879 BackgroundImage property, 378 Fill value, 880 ControlBox property, 341 Filter property Controls property, 314 FileSystemWatcher class, 246 DoubleBuffered property, 386 OpenFileDialog class, 241 extending, 5 finalizer, 647 FormBorderStyle property, 341 finally block, 173 Language property, 339 FinalReleaseComObject method, Marshal class, 613 Load event, 220 Find method, Certificates class, 498 Localizable property, 339 FindTypes method, MaximizeBox property, 341 SystemReflection.Module class, MdiChildren property, 319 125 928
  5. ■ INDEX MdiParent property, 319 From property, 502, 886 MinimizeBox property, 341 from statement, 765 MouseMove event, 373 FromArgb method, 874 OnClosed method, 319 FromAValues method, 874 OnClosing method, 319 FromBase64CharArray method, 62 OnLoad method, 319 FromBase64String method, 62 Paint event handler, 373, 387 FromDays property, TimeSpan structure, 166 Region property, 376, 377 FromFile method, Image class, 389 SetStyle method, 387 FromRgb method, 874 System.Windows.Forms namespace, 5 FromScRgb method, 874 Text property, 341 FromValues method, 874 TopMost property, 601 FTP, downloading data over, 486–490 TransparentKey property, 378 FtpWebRequest class, 490 Form.Handle property, 601 Full Unicode (UTF-16), 223 format argument, 652 FullName property Format method, String class, 652 DirectoryInfo class, 206 format string, 652 FileInfo class, 206 FormatException class, System namespace, 73, 656 FullTrust permission, 545, 547 FormatMessage function, 608 functions formatProvider argument, 652 anonymous, 46–47 formattable type, implementing, 651–655 calling in unmanaged DLLs, 597–601 formatters, 87 ■G FormBorderStyle property, Form class, 341 G property, 874 FormCollection class, 315–316 GAC (global assembly cache), 29–30, 545 forms. See Windows forms GC class FrameworkElement class, 827 SuppressFinalize method, 648 FrameworkPropertyMetadataOptions enumeration, 791 System namespace, 647 free space on drive, calculating, 239–241 GDI32.dll, 598 from keyword, 98, 301, 750 929
  6. ■ INDEX generic types GetCurrentProcess method, 199 creating, 83–87 GetCustomAttributes method, 136 creating variant, 679–681 GetData method, AppDomain class, 121– 122 Generic.xaml resource dictionary, 828–829 GetDataSources method, GeometryGroup class, 866 SqlDataSourceEnumerator class, 460 GeometryGroup element, 866 GetDataTypeName method, data reader GetAccessControl method, File class, 250 classes, 446 GetAddressBytes method, PhysicalAddress GetDirectories method, DirectoryInfo class, 482 class, 230 GetAllNetworkInterfaces method, GetDirectories property, DirectoryInfo NetworkInterface class, 480, 484 class, 207 GetAssemblyEnumerator method, GetDirectoryName method, Path class, Evidence class, 562 234 GetAttribute method, XmlReader class, 279 GetDrives method, DriveInfo class, 239 GetAvailableThreads method, ThreadPool GetDrives property, DriveInfo class, 207 class, 154 GetElementsByTagName method GetBytes method XmlDocument class, 271 BitConverter class, 59 XmlElement class, 272, 273 Encoding class, 57 GetEncoding method, 57 RandomNumberGenerator class, 576 GetEnumerator method GetCommandLineArgs method, Environment class, 12, 685 Evidence class, 562 GetConstructor method IEnumerable interface, 636, 640, 641 compared to Activator class, 133 GetEnvironmentVariable method, Environment class, 685, 688 Type class, 130 GetEnvironmentVariables method, GetConstructors method, System.Type Environment class, 685, 688 class, 138 GetFactory method, DbProviderFactories GetContext method, HttpListener class, class, 458 493 GetFactoryClasses method, GetCurrent method, WindowsIdentity DbProviderFactories class, 458 class, 564 GetFieldType method, data reader classes, GetCurrentDirectory method, Directory 446 class, 236 930
  7. ■ INDEX GetFileName method, Path class, 233 GetNestedType method, Type class, 125 GetFileNameWithoutExtension method, GetNestedTypes method, Type class, 125 Path class, 234 GetNetworks method, 716 GetFiles method, DirectoryInfo class, 230 GetNonZeroBytes method, GetFiles property, DirectoryInfo class, 207 RandomNumberGenerator class, 576 GetFolderPath method, Environment class, 685 GetObjectData method, ISerializable interface, 622, 656 GetForegroundWindow function, 601 GetOracleLob method, OracleDataReader GetFullPath method, Path class, 234 class, 446 GetHostByName method, Dns class, 504 GetOracleMonthSpan method, OracleDataReader class, 446 GetHostEntry method, Dns class, 504 GetOracleNumber method, GetHostEnumerator method, Evidence OracleDataReader class, 446 class, 562 GetOrdinal method, data reader classes, GetHostName method, Dns class, 505 446 GetInvalidPathChars method, Path class, GetPhysicalAddress method, 234 NetworkInterface class, 482 GetIPProperties method, GetPrivateProfileString method, 598 NetworkInterface class, 481 GetPrivateProfileString method, 600 GetIPv4Statistics method, NetworkInterface class, 482 GetProcessById method, 199 GetIsNetworkAvailable method, GetProcesses method, 199 NetworkInterface class, 482 GetProcessesByName method, 199 GetLastWin32Error method, Marshal class, 608 GetPropertiesmethod, 138 GetLogicalDrives method, GetRandomFileName method, 249 Directory class, 239 GetResponse method, WebRequest class, 490 Environment class, 685 GetResponseStream method, GetMemberBinder class, 144 WebResponse class, 491 GetMembers method, System.Type class, GetSchemaTable method, data reader 138 classes, 446 GetMethods method, System.Type class, GetSqlByte method, SqlDataReader class, 138 446 GetName method, data reader classes, 446 931
  8. ■ INDEX GetSqlDecimal method, SqlDataReader GetWindowText function, 601 class, 446 GetXXX methods GetSqlMoney method, SqlDataReader data reader classes, 446 class, 446 SerializationInfo class, 622 GetString method, Encoding class, 57 Global Assembly Cache (GAC), 11, 29–30, GetSubKeyNames method, RegistryKey 112, 545 class, 696 Global Assembly Cache tool (gacutil.exe), GetTable method, 471 30 GetTempFileName method, Path class, GoBack method, WebBrowser control, 357 238, 249 GoForward method, WebBrowser control, GetTemplateChild class, 830 357 GetThumbnailImage method, Image class, GoHome method, WebBrowser control, 389 357 GetType method, 91 GradientOrigin property, 877 Assembly class, 125 GradientStop element, 877 Object class, 127 graphics, 369 System.Type class, 125 Graphics class SystemReflection.Module class, 125 CopyFromScreen method, 385 GetTypes method, 125 DrawImage method, 401 GetUnderlyingType method, Enum class, DrawString method, 383, 401, 408 129 System.Drawing namespace, 401 GetValue method GraphicsPath class Registry class, 692 adding shapes to, 377 RegistryKey class, 696 CloseAllFigures method, 377 GetValueKind method, RegistryKey class, 696 IsVisible method, 372 GetValueNames method, RegistryKey System.Drawing.Drawing2D class, 697 namespace, 372, 373, 377 GetVersionEx function greater than (>) operator, 75 declaring and using, 604 grid layout, UI elements, 809–811 Kernel32.dll file, 603 Grid.Column property, 809 GetVersionInfo method, FileVersionInfo Grid.ColumnDefinitions element, 810 class, 217 Grid.Row property, 809 932
  9. ■ INDEX Grid.RowDefinitions element, 810 calculating, of password, 577–581 group...by... keywords, 769, 772 ensuring data integrity using keyed, 586–589 GrowStyle property, TableLayoutPanel container, 335 verifying, 583–586 Guest value, WindowsBuiltInRole HashAlgorithm class, 582 enumeration, 565 ComputeHash method, 232, 579, 581, GuidAttribute class, 587 System.Runtime.InteropServices Create method, 232, 579, 581 namespace, 617 System.Security.Cryptography GZipStream class, 253 namespace, 231, 577, 581, 586 Hashtable class, 195 ■H HasMorePages property, Handle method, AggregateException class, PrintPageEventArgs class, 404, 406 742, 743 HasShutdownStarted property, Handle property Environment class, 684 classes that use this property, 601 Height property, 810, 859, 867, 899, 903 Control class, 395, 601 Hidden value, ProcessWindowStyle enumeration, 197 FileStream class, 601 High property, 804 PictureBox control, 395 hit testing, performing with shapes, 372– Process class, 601 376 Handled property, KeyPressEventArgs HMACSHA1 class, 587 class, 329 horizontal stacks, 805–806 handles, 601–603 HorizontalAlignment property, 806 HasAttributes property, XmlReader class, 279 HorizontalScrollBarVisibility property, 814 HasExited property, Process class, 200 host evidence, Evidence class, 562 HasExtension method, Path class, 234 host name, resolving to an IP address, 504– 507 Hash class, 560 HTML pages, getting from site that hash code requires authentication, 497–499 algorithms, 232 HtmlDocument class, 358 calculating, of file, 581–583 933
  10. ■ INDEX HTTP implementation, 632, 634 downloading data over, 486–490 System.Collections namespace, 332 responding to requests from within System.Collections.Generic application, 492–497 namespace, 631 HttpListener class, 493–494 Icon property, NotifyIcon control, 346, 348 HttpListenerContext class, 493–494 ICredentialsByHost interface, 500 HttpListenerException class, 493 ICustomAttributeProvider interface, 136 HttpListenerPrefixCollection class, 493 Id property, NetworkInterface Class, 481 HttpListenerRequest class, 493 IDataParameter interface HttpListenerResponse class, 493 creating, 457 HttpWebRequest class data provider implementations, 441, 445 ClientCertificates collection, 498 System.Data namespace, 441, 445 creating instance, 490 IDataParameterCollection interface, System.Data namespace, 438 ■I IDataReader interface, 457 I/O classes, 205 ExecuteReader returns, 438 IAsyncResult interface, System extends IDataRecord interface, 445 namespace, 452 extends System.IDisposable, 447 ICloneable interface IDataRecord interface, IDataReader Clone method, 626, 628 interface extends, 445 System namespace, 626 IDbCommand interface, 457 ICollection interface CommandText property, 437 CopyTo method, 79 CommandType property, 437 IsSynchronized property, 194 CreateParameter method, 442, 457 SyncRoot property, 194, 195 data provider implementations, 437 ICommand object, 842, 843 ExecuteNonQuery method, 437, 438 IComparable interface, 634 ExecuteReader method, 437, 438, 445, CompareTo method, 631 457 implementation, 632 ExecuteScalar method, 437, 438 IComparer interface Parameters collection, 441, 442, 457 Compare method, 332, 631, 632 System.Data namespace, 437 934
  11. ■ INDEX IDbConnection interface, 457 IFormatProvider interface, 73 ConnectionString property, 425, 432 IFormattable interface, 651–652 CreateCommand method, 438, 457 IFormatter interface, 87 data provider implementations, 425 IIdentity interface, 564 System.Data namespace, 425 Image class, 389 IDbDataAdapter interface, 457 ImageBrush class, 879, 880 IDbTransaction interface, System.Data ImageBrush element, 879 namespace, 438 ImageBrush objects, 881–883 identity permissions, 560, 561 images IDisposable interface creating scrollable, 383–385 Dispose method, 647, 648, 697 filling shapes with, 879–882 extended by IDataReader interface, 447 recognizing characters in, 419, 421 RegistryKey class implements, 697 showing thumbnails for, 389–391 System namespace, 84, 426, 590, 647 thumbnail, 389–391 IEnumerable interface, 641, 750 IMediaControl interface, 395 converting from, 784–787 loading and playing a movie, 395 GetEnumerator method, 636, 640, 641 RenderFile method, 394 System.Collections namespace, 640 Impersonate method, WindowsIdentity System.Collections.Generic class, 572–573 namespace, 636 impersonation, 572–575 IEnumerator interface, 641 implicit keyword, 44 Current property, 641 in modifier, 679 GetEnumerator method, 636 Increment method, Interlocked class, 188 members, 640 indexer, custom, 48, 51 MoveNext method, 641 inequality (!=) operator, 75 Reset method, 641 inequality operator !=, 15 System.Collections namespace, 562, Infinite property, Timeout class, 164, 166 640 information retrieval System.Collections.Generic namespace, 636 files, directories or drives, 206–211 IEqualityComparer, 100, 776 version information for a file, 217–219 935
  12. ■ INDEX Information value, EventLogEntryType System.Configuration.Install enumeration, 690 namespace, 704 InheritanceDemand value InstallerCollection class, 705 implementing, 561 Installers property, Installer class, 705 SecurityAction enumeration, 560 Instance property, SqlDataSourceEnumerator class, Inherited property, 461 AttributeUsageAttribute class, 134 instantiation using reflection, 129–133 Inherits property, 792 int type initialization Base64 encoding and decoding using eager, 672 Convert class, 62 lazy, 672–673 converting to and from byte array using BitConverter class, 60–61 InitializeComponent method, 309 Int32 value, DbType enumeration, 442 in-memory cache, creating, 462–466 integer values, large, using, 96 InnerException class, 508 interfaces and patterns, implementing, 619 InnerText property, XmlNode class, 262 cloneable type, 626–631 InnerXml property, XmlNode class, 263 comparable type, 631–636 INotifyPropertyChanged interface, 839, 841, 849, 850 custom event argument, 659–661 input validation, 65–69, 348–350 custom exception class, 655–659 Input value, ParameterDirection disposable class, 647–651 enumeration, 442 formattable type, 651–655 InputOutput value, ParameterDirection enumeration, 442 serializable type, 620–626 InsertAfter method, XmlNode class, 266 enumerable collection, 636–640 InsertAt method, SecureString class, 589 enumerable type using custom iterator, 640–647 InsertBefore method, XmlNode class, 266 Observer pattern, 663–668 InstalledFontCollection class, 370 parallel Producer-Consumer pattern, InstalledPrinters collection, 669–671 PrinterSettings class, 398–399 Singleton pattern, 661–663 Installer class Interlock class, 188 Installers property, 705 Interlocked class, 187–188 936
  13. ■ INDEX intermediate language (IL), 150 System.Security.Principal namespace, 564, 573 Internet connectivity, checking, 716–717 WindowsPrincipal class implements, Interop class, 394 564 interoperability features, 597 IProducerConsumerCollection interface, 669 interoperability. See unmanaged code interoperability IPStatus enumeration, 508 interpolation methods, 892 irregularly shaped control, creating, 376– 379 Intersect method, 474, 477 is operator, 127 IntPtr class, System namespace, 590, 601 IsAlive property, Thread class, 190 IntPtr type, System namespace, 573 IsBodyHtml property, MailMessage class, invalid data, preventing in forms, 326 502 InvalidCastException class, System IsBusy property, WebBrowser control, 357 namespace, 128 IsCancellationRequested property, 744 InvalidOperationException class, System namespace, 508, 590, 641 IsChecked property, 801 Invoke method, 354 IsClosed property, 446 ConstructorInfo class, 130 IsCompleted property, 734 MemberInfo class, 140 IsConnectedToInternet property, 716 Parallel class, 729, 730, 732 IsDBNull method, data reader classes, 446 InvokeMember method, System.Type IsDefined method, 136 class, 140 IsEnabled property, 836 InvokeRequired property, 354 ISerializable class, IP address System.Runtime.Serialization namespace, 660 pinging, 507–510 ISerializable interface resolving host name to, 504–507 Exception class implements, 656 IPGlobalProperties class, System.Net.NetworkInformation GetObjectData method, 622, 656 namespace, 481 implementing, 622, 623 IPrincipal class, System.Security.Principal namespace, 494 System.Runtime.Serialization namespace, 620, 656 IPrincipal interface, 569 IsExpanded property, 801 representing user, 568 937
  14. ■ INDEX IsFinalizingForUnload method, Item property, data reader classes, 446 AppDomain class, 124 ItemContainerStyleSelector property, 856 IsGranted method, SecurityManager class, ItemsSource property, 845, 848, 849 558–559 ItemTemplate property, 845, 849 IsInRole method, WindowsPrincipal class, 564, 565 IValueConverter, to debug data bindings, 801–803 IsKeyDown method, 904 IVideoWindow interface, 395 IsKeyToggled method, 904 IWshShortcut interface, 707 IsLargeArc property, 868 IsMatch method, Regex class, 68–69 ■J IsMouseOver property, 854 JavaScript Object Notation (JSON), 90–93 IsNullable property, parameter objects, JIT directory tree, showing in TreeView 442 control, 219–222 isolated stores, 243–246 Join method, Thread class, 190 IsolatedStorageFile class, 244 join...in...on...equals... keyword sequence, IsolatedStorageFileStream class, 244 762 IsolatedStoragePermission class, 244 Journal property, 792 IsPathRooted method, Path class, 234 JumpList class, 709–711 IsPublic property, RegexCompilationInfo class, 71 ■K IsReadOnly property, 206, 814 Kernel32.dll file, 598 IsReady property, 208 FormatMessage function, 608 IsReceiveOnly property, 481 GetVersionEx function, 603 IsSelected property, 903 /keycontainer compiler switch, 22 IsSmoothJoin property, 868 key pairs, creating and managing strongly named, 19–20 IsSupported property, 493 Key property IsSynchronized property, 194 ConsoleKeyInfo class, 94 IsSynchronizedWithCurrentItem property, 849, 850 KeyedHashAlgorithm class, 587 IsVisible method KeyAvailable method, Console class, 94 GraphicsPath class, 372 Keyboard class, 903 Region class, 372, 373 keyboard state, querying, 902–904 938
  15. ■ INDEX KeyChar property LastChildFill property, 808 ConsoleKeyInfo class, 94 LastWrite value, NotifyFilters enumeration, 246 KeyPressEventArgs class, 329 LastWriteTime property keyed hash code, ensuring data integrity, 586–589 DirectoryInfo class, 206 KeyedHashAlgorithm class, 586–587 FileInfo class, 206 /keyfile compiler switch, 22 Layout class, 421 keyframe-based animation, 892–894 layout management KeyPress event, TextBox control, 329 UI elements KeyPressEventArgs class, 329 docking to edge of form, 807–808 keywords, accessing program element that grid layout, 809–811 has same name as keyword, 18 horizontal or vertical stacking, 805– Kill method, Process class, 199–200 806 positioning to exact coordinates, 811–812 ■L LayoutKind class, 604 Label class, 343 LayoutTransform property, 818 Label control, adding to Panel control, 370 LayoutTransform property, 818 lambda expressions, event handling with, 46 lazy initialization, 672 lambda operator, 46 lazy object initialization, 671–673 Language property, Form class, 339 LeftButton property, 861 Language-Integrated Query (LINQ), 97–98 Length property, large integer values, 96 FileInfo class, 206, 216 LargestWindowHeight property, Console StringBuilder class, 54 class, 32 Less than (
  16. ■ INDEX LinearGradientBrush class, 876–877 using permutations of data sources, 765–767 LineGeometry class, 866 LINQ queries LineGeometry element, 866 from keyword, 750 LinkDemand, FullTrust permission, 545 from statements, using multiple, 765 LinkedList class, 82 group result elements by attribute, 769– LINQ 772 aggregating data sources, 778–780 group...by... keywords, 769, 772 comparing data sources, 776–778 join...in...on...equals... keyword sequence, 762 comparing LINQ dataset results, 473– 474, 477 let keyword, 781 concatenate data sources, 767–769 new keyword, 760 converting from IEnumerable, 784– orderby keyword, 774 787 performing simple, 749–755 creating custom extension methods, 782–784 select keyword, 750 creating new XML tree to use with, 298– sharing results within, 780–782 300 sorting results, 774–775 extension methods, 473, 759, 760 where keyword, 755 features, 749 LINQ to XML operations, 296, 298 filtering and selecting from multiple list boxes, scrolling, 325–326 data sources, 762–765 List class, 82 filtering contents from data source, 755–757 list items, changing appearance of alternate, 856–857 filtering data source by type, 757–759 ListBox class, 325 filtering range of elements, 759–760 ListBox property, 858–862 modifying XML tree with, 303 ListBoxItem property, 859–861 OfType extension method, 757, 758 lists, dragging items from, and dropping performing LINQ queries, 468–470 on canvas, 858–861 performing LINQ queries with entity ListView control types, 471, 472, 473 ListViewItemSorter property, 332 query XML with, 300–303 Sort method, 332 selecting multiple member values, 760– 762 sorting by any column, 332–335 940
  17. ■ INDEX ListViewItem class, 312 long-running operations, displaying progress of, 862–866 ListViewItemSorter property, ListView control, 332 lookless custom controls, 826–831 literals, 66 LoopbackInterfaceIndex property, NetworkInterface class, 482 Load event, Form class, 220 Loopbackvalue, NetworkInterfaceType Load method enumeration, 481 Assembly class, 112, 113, 117 LostFocus value, 835 SoundPlayer class, 392 Low property, 804 XmlDocument class, 262 XslCompiledTransform class, 292 ■M LoadFrom method, Assembly class, 111, MachineName property, Environment 113 class, 684 LoadSync method, SoundPlayer class, 392 MACTripleDES class, 587 LoadUserProfile property, MailAddress class, 502 ProcessStartInfo class, 197 MailAddressCollection class, 501–502 LoadXML method, XmlDocument class, MailMessage class 262 properties, 501 local network interface, 480–484 Send method, 502 Localizable property, Form class, 339 SendAsync method, 502 localization, multilingual forms, 338–341 SendCompleted event, 502 LocalMachine field, Registry class, 695 System.Net.Mail namespace, 500 LocalMachine value, DataProtectionScope enumeration, 593 main menu, using for context menu, 336– 338 locations, 712 Main method, 12, 149 lock statements, 173, 194 /main switch, 3 log files MainWindow.Rotation property, 796, 798 logging data to, 254–256 MainWindow.xaml file, 800 processing, 256–257 MainWindowHandle property, Process logical AND (&&) operator, 15 class, 601 logical operators, 15 makecert.exe. See Certificate Creation tool LogonUser function, 573 MakeReadOnly method, SecureString class, 590 941
  18. ■ INDEX manipulating strings representing MatrixAnimationUsingPath object, 896 filenames, 233–235 Max Pool Size setting, 429 ManualResetEvent class Max extension method, 778 Reset method, 179 MaxCapacity property, StringBuilder class, Set method, 179 54 System.Threading namespace, 178 MaxDegreeOfParallelism property, 737 used as a trigger, 168 MaximizeBox property, Form class, 341 MappingMode property, 876 Maximized value, ProcessWindowStyle enumeration, 197 Marshal class Maximum property, 863 FinalReleaseComObject method, 613 MBR types, 106 GetLastWin32Error method, 608 MBV types ReleaseComObject method, 613 introduction, 106 SizeOf method, 603, 604 passing MBV references across System.Runtime.InteropServices application domains, 109 namespace, 590, 603 MD5CryptoServiceProvider class, 579 MarshalAsAttribute class, 604 MDI applications marshal-by-reference types. See MBR types finding forms displayed in, 319 MarshalByRefObject class finding forms displayed in end, 321 classes that derive from, 111 MdiParent property, Form class, 319 creating a type that does not derive media files, playing, 898–901 from, 111 MediaCommands command, 823 System namespace, 106 MediaElement property, 900 marshal-by-value types. See MBV types MediaTimeline.CurrentTimeInvalidated Mask property, MaskedTextBox control, event, 898 326 Medium property, 804 MaskedTextBox control, 326–329, 348 MemberInfo class, 140 MaskInputRejected event, MaskedTextBox MemberwiseClone method, Object class, control, 327 627–628 master-detail pattern, collections with, MemoryProtectionScope enumeration, 848–854 593 942
  19. ■ INDEX MemoryStream class, 91 Microsoft.Win32 namespace converting decimal type to byte array, Registry class, 692, 695 59, 60 RegistryKey class, 695 System.IO namespace, 627 RegistryValueKind enumeration, 696 ToArray method, 59 RegistyValueKind enumeration, 693 MenuItem class Microsoft.Win32.OpenFileDialog file, 823 CloneMenu method, 336 Microsoft.WindowsAPICodePack.Dialogs. Tag property, 312 TaskDialog class, 717–718 menus, context, 336–338 Microsoft.WindowsAPICodePack.Net.Net workListManager class, 716 MessageBox class, Show method, 312 MIME standards, 65 metacharacters, 66 Min Pool Size setting, 429 metadata, 103–104 Min extension method, 778 MethodBase class, 136 MinimizeBox property, Form class, 341 methods Minimized value, ProcessWindowStyle adding to types, without modifying, enumeration, 197 675–677 minimum permission requests, 558 asynchronous execution of, 154–163 Missing field, Type class, 614 dynamically calling, 677–679 MissingMethodException class, 115 executing, at specific time, 166, 167 Mode attribute, 833,–835 executing, using new thread, 169–172 Mode property, 833 executing, using Thread Pool class, 151–154 MODI. See Microsoft Office Document Imaging (MODI) executing, with WaitHandle class, 167– 169 Modifiers property, ConsoleKeyInfo class, 94 periodic execution of, 163–166 Module.FindTypes method, 126 Microsoft .NET Framework. See .NET Framework Module.GetType method, 126 Microsoft ADO.NET, 423 Module.GetTypes method, 126 Microsoft Office Document Imaging modules, 9–10 (MODI), 420–421 Monitor class Microsoft Root Certificate Program compared to Mutex class, 182 Members, 27 constructing in a using statement, 203 943
  20. ■ INDEX Enter method, 172–173 using a Semaphore, 185–187 Exit method, 172–173 using an event, 178–182 Pulse method, 173–174 Multiselect property, OpenFileDialog class, 241 PulseAll method, 173–174 multitasking, 730 synchronize the execution of multiple threads using a Monitor, 172 multithreaded applications System.Threading namespace, 173 BackgroundWorker threads, executing methods asynchronously using, Wait method, 174 862–866 monitoring file system, 246 creating, 149 Monitors, 173 updating user interface, 354–356 MouseDown event, 343, 351 mutable strings, 600 MouseMove event, 343, 373 Mutex, 184 MouseUp event, 343 compared to Monitor, 182 moveable sprite, creating, 379–383 execution synchronization using, 201 MoveNext method, IEnumerator interface, ReleaseMutex method, 182 641 syncronization execution of multiple MoveTo method, 214 threads using, 182–184 multilingual forms, 338–341 System.Threading namespace, 182, 201 multimedia, 369 used as a trigger, 168 user input and MyCertificate.pfx file, 27 dragging items from lists and dropping them on canvas, 858–861 ■N playing media files, 898–901 Name property querying keyboard state, 902–904 DirectoryInfo class, 206 multiple document interface (MDI) FileInfo class, 206 applications, 307 NetworkInterface Class, 481 multiple threads RegexCompilationInfo class, 71 execution of, 149 XmlNode class, 262 synchronize execution of XmlReader class, 278 using a Monitor, 172–178 named pipes, 257 using a Mutex, 182–184 944
Đồng bộ tài khoản