OSDN Git Service

SlimDXの改造後コード。(June2010を変更したもの。)
[dtxmania/dtxmania.git] / SlimDXc_Jun2010(VC++2008) / source / design / Vector2Converter.h
1 /*\r
2 * Copyright (c) 2007-2010 SlimDX Group\r
3\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy\r
5 * of this software and associated documentation files (the "Software"), to deal\r
6 * in the Software without restriction, including without limitation the rights\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
8 * copies of the Software, and to permit persons to whom the Software is\r
9 * furnished to do so, subject to the following conditions:\r
10\r
11 * The above copyright notice and this permission notice shall be included in\r
12 * all copies or substantial portions of the Software.\r
13\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
20 * THE SOFTWARE.\r
21 */\r
22 #pragma once\r
23 \r
24 namespace SlimDX\r
25 {\r
26         value class Vector2;\r
27 \r
28         namespace Design\r
29         {\r
30                 /// <summary>\r
31                 /// Provides a type converter to convert <see cref="Vector2"/> objects to and from various \r
32                 /// other representations.\r
33                 /// </summary>\r
34                 public ref class Vector2Converter : System::ComponentModel::ExpandableObjectConverter\r
35                 {\r
36                 private:\r
37                         System::ComponentModel::PropertyDescriptorCollection^ m_Properties;\r
38 \r
39                 public:\r
40                         /// <summary>\r
41                         /// Initializes a new instance of the <see cref="Vector2Converter"/> class.\r
42                         /// </summary>\r
43                         Vector2Converter();\r
44 \r
45                         /// <summary>\r
46                         /// Returns whether this converter can convert the object to the specified type, using the specified context.\r
47                         /// </summary>\r
48                         /// <param name="context">A <see cref="System::ComponentModel::ITypeDescriptorContext"/> that provides a format context.</param>\r
49                         /// <param name="destinationType">A <see cref="System::Type"/> that represents the type you want to convert to.</param>\r
50                         /// <returns><c>true</c> if this converter can perform the conversion; otherwise, <c>false</c>.</returns>\r
51                         virtual bool CanConvertTo(System::ComponentModel::ITypeDescriptorContext^ context, \r
52                                 System::Type^ destinationType) override;\r
53 \r
54                         /// <summary>\r
55                         /// Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.\r
56                         /// </summary>\r
57                         /// <param name="context">A <see cref="System::ComponentModel::ITypeDescriptorContext"/> that provides a format context.</param>\r
58                         /// <param name="sourceType">A System::Type that represents the type you want to convert from.</param>\r
59                         /// <returns><c>true</c> if this converter can perform the conversion; otherwise, <c>false</c>.</returns>\r
60                         virtual bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext^ context, \r
61                                 System::Type^ sourceType) override;\r
62 \r
63                         /// <summary>\r
64                         /// Converts the given value object to the specified type, using the specified context and culture information.\r
65                         /// </summary>\r
66                         /// <param name="context">A <see cref="System::ComponentModel::ITypeDescriptorContext"/> that provides a format context.</param>\r
67                         /// <param name="culture">A <see cref="System::Globalization::CultureInfo"/>. If <c>null</c> is passed, the current culture is assumed.</param>\r
68                         /// <param name="value">The <see cref="System::Object"/> to convert.</param>\r
69                         /// <param name="destinationType">A <see cref="System::Type"/> that represents the type you want to convert to.</param>\r
70                         /// <returns>An <see cref="System::Object"/> that represents the converted value.</returns>\r
71                         virtual System::Object^ ConvertTo(System::ComponentModel::ITypeDescriptorContext^ context, \r
72                                 System::Globalization::CultureInfo^ culture, System::Object^ value, System::Type^ destinationType) override;\r
73 \r
74                         /// <summary>\r
75                         /// Converts the given object to the type of this converter, using the specified context and culture information.\r
76                         /// </summary>\r
77                         /// <param name="context">A <see cref="System::ComponentModel::ITypeDescriptorContext"/> that provides a format context.</param>\r
78                         /// <param name="culture">A <see cref="System::Globalization::CultureInfo"/>. If <c>null</c> is passed, the current culture is assumed.</param>\r
79                         /// <param name="value">The <see cref="System::Object"/> to convert.</param>\r
80                         /// <returns>An <see cref="System::Object"/> that represents the converted value.</returns>\r
81                         virtual System::Object^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext^ context, \r
82                                 System::Globalization::CultureInfo^ culture, System::Object^ value) override;\r
83 \r
84                         /// <summary>\r
85                         /// Returns whether changing a value on this object requires a call to <c>System::ComponentModel::TypeConverter::CreateInstance(System::Collections::IDictionary^)</c>\r
86                         /// to create a new value, using the specified context.\r
87                         /// </summary>\r
88                         /// <param name="context">A <see cref="System::ComponentModel::ITypeDescriptorContext"/> that provides a format context.</param>\r
89                         /// <returns><c>false</c> if changing a property on this object requires a call to <c>System::ComponentModel::TypeConverter::CreateInstance(System::Collections::IDictionary^)</c> to create a new value; otherwise, <c>false</c>.</returns>\r
90                         virtual bool GetCreateInstanceSupported(System::ComponentModel::ITypeDescriptorContext^ context) override;\r
91                 \r
92                         /// <summary>\r
93                         /// Creates an instance of the type that this <see cref="System::ComponentModel::TypeConverter"/> is associated with, using the specified context, given a set of property values for the object.\r
94                         /// </summary>\r
95                         /// <param name="context">A <see cref="System::ComponentModel::ITypeDescriptorContext"/> that provides a format context.</param>\r
96                         /// <param name="propertyValues">An <see cref="System::Collections::IDictionary"/> of new property values.</param>\r
97                         /// <returns>An <see cref="System::Object"/> representing the given <see cref="System::Collections::IDictionary"/>, or <c>null</c> if the object cannot be created.</returns>\r
98                         virtual System::Object^ CreateInstance(System::ComponentModel::ITypeDescriptorContext^ context, \r
99                                 System::Collections::IDictionary^ propertyValues) override;\r
100 \r
101                         /// <summary>\r
102                         /// Returns whether this object supports properties, using the specified context.\r
103                         /// </summary>\r
104                         /// <param name="context">A <see cref="System::ComponentModel::ITypeDescriptorContext"/> that provides a format context.</param>\r
105                         /// <returns><c>true</c> if GetProperties should be called to find the properties of this object; otherwise, <c>false</c>.</returns>\r
106                         virtual bool GetPropertiesSupported(System::ComponentModel::ITypeDescriptorContext^ context) override;\r
107 \r
108                         /// <summary>\r
109                         /// Creates an instance of the type that this <see cref="System::ComponentModel::TypeConverter"/> is associated with, using the specified context, given a set of property values for the object.\r
110                         /// </summary>\r
111                         /// <param name="context">A <see cref="System::ComponentModel::ITypeDescriptorContext"/> that provides a format context.</param>\r
112                         /// <param name="value">An <see cref="System::Object"/> that specifies the type of array for which to get properties. </param>\r
113                         /// <param name="attributes">An array of type <see cref="System::Attribute"/> that is used as a filter.</param>\r
114                         /// <returns>A <see cref="System::ComponentModel::PropertyDescriptorCollection"/> with the properties that are exposed for this data type, or a null reference (<c>Nothing</c> in Visual Basic) if there are no properties.</returns>\r
115                         virtual System::ComponentModel::PropertyDescriptorCollection^ GetProperties(System::ComponentModel::ITypeDescriptorContext^ context,\r
116                                 System::Object^ value, array<System::Attribute^>^ attributes ) override;\r
117                 };\r
118         }\r
119 }