ObsoleteAttribute コンストラクタ (String, Boolean)
アセンブリ: mscorlib (mscorlib.dll 内)



Imports System Public Class ObsoleteAttrib_Cons1 ' Mark the method as 'Obsolete' with message and IsError as parameters. <ObsoleteAttribute("This function will be removed from future Versions.Use another function 'NewFunction'", False)> _ Public Function OldFunction() As String OldFunction= "This is the String from old function." End Function 'OldFunction ' Create the another function which is replacement to the 'OldFunction'. Public Function NewFunction() As String Return "This is the String from new function." End Function 'NewFunction End Class 'ObsoleteAttrib_Cons1 Public Class TestObsolete3 'Entry point which delegates to C-style main Private Function Public Overloads Shared Sub Main() Main(System.Environment.GetCommandLineArgs()) End Sub Overloads Shared Sub Main(args() As String) Try Dim myObsolete As New ObsoleteAttrib_Cons1() Console.WriteLine(myObsolete.OldFunction()) Console.WriteLine(myObsolete.NewFunction()) Catch e As Exception Console.WriteLine(("The Exception is :" + e.Message)) End Try End Sub 'Main End Class 'TestObsolete3
using System; public class ObsoleteAttrib_Cons1 { // Mark the method as 'Obsolete' with message and IsError as parameters. [ObsoleteAttribute("This function will be removed from future Versions.Use another function 'NewFunction'",false)] public string OldFunction() { return "This is the String from old function."; } // Create the another function which is replacement to the 'OldFunction'. public string NewFunction() { return "This is the String from new function."; } } public class TestObsolete3 { static void Main(string[] args) { try { ObsoleteAttrib_Cons1 myObsolete = new ObsoleteAttrib_Cons1(); Console.WriteLine(myObsolete.OldFunction()); Console.WriteLine(myObsolete.NewFunction()); } catch(Exception e) { Console.WriteLine("The Exception is :"+e.Message); } } }
using namespace System; public ref class ObsoleteAttrib_Cons1 { public: // Mark the method as 'Obsolete' with message and IsError as parameters. [ObsoleteAttribute("This function will be removed from future Versions. Use another function 'NewFunction'",false)] String^ OldFunction() { return "This is the String from old function."; } // Create another function which is replacement to the 'OldFunction'. String^ NewFunction() { return "This is the String from new function."; } }; int main() { try { ObsoleteAttrib_Cons1^ myObsolete = gcnew ObsoleteAttrib_Cons1; Console::WriteLine( myObsolete->OldFunction() ); Console::WriteLine( myObsolete->NewFunction() ); } catch ( Exception^ e ) { Console::WriteLine( "The Exception is : {0}", e->Message ); } }
import System.*; public class ObsoleteAttrib_Cons1 { // Mark the method as 'Obsolete' with message and IsError as parameters. /** @attribute ObsoleteAttribute("This function will be removed from future" + "Versions.Use another function 'NewFunction'", false) */ public String OldFunction() { return "This is the String from old function."; } //OldFunction // Create the another function which is replacement to the 'OldFunction'. public String NewFunction() { return "This is the String from new function."; } //NewFunction } //ObsoleteAttrib_Cons1 public class TestObsolete3 { public static void main(String[] args) { try { ObsoleteAttrib_Cons1 myObsolete = new ObsoleteAttrib_Cons1(); Console.WriteLine(myObsolete.OldFunction()); Console.WriteLine(myObsolete.NewFunction()); } catch (System.Exception e) { Console.WriteLine("The Exception is :" + e.get_Message()); } } //main } //TestObsolete3

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ObsoleteAttribute コンストラクタ (String)
アセンブリ: mscorlib (mscorlib.dll 内)



Imports System Public Class ObsoleteAttrib_Cons1 ' Mark the method as 'Obsolete' with message as parameter. <ObsoleteAttribute("This function will be removed from future Versions.Use another function 'NewFunction'")> _ Public Function OldFunction() As String OldFunction= "This is the String from old function." End Function 'OldFunction ' Create the another function which is replacement to the 'OldFunction'. Public Function NewFunction() As String NewFunction= "This is the String from new function." End Function 'NewFunction End Class 'ObsoleteAttrib_Cons1 Public Class TestObsolete2 'Entry point which delegates to C-style main Private Function Public Overloads Shared Sub Main() Main(System.Environment.GetCommandLineArgs()) End Sub Overloads Shared Sub Main(args() As String) Try Dim myObsolete As New ObsoleteAttrib_Cons1() Console.WriteLine(myObsolete.OldFunction()) Console.WriteLine(myObsolete.NewFunction()) Catch e As Exception Console.WriteLine(("The Exception is :" + e.Message)) End Try End Sub 'Main End Class 'TestObsolete2
using System; public class ObsoleteAttrib_Cons1 { // Mark the method as 'Obsolete' with message as parameter. [ObsoleteAttribute("This function will be removed from future Versions.Use another function 'NewFunction'")] public string OldFunction() { return "This is the String from old function."; } // Create the another function which is replacement to the 'OldFunction'. public string NewFunction() { return "This is the String from new function."; } } public class TestObsolete2 { static void Main(string[] args) { try { ObsoleteAttrib_Cons1 myObsolete = new ObsoleteAttrib_Cons1(); Console.WriteLine(myObsolete.OldFunction()); Console.WriteLine(myObsolete.NewFunction()); } catch(Exception e) { Console.WriteLine("The Exception is :"+e.Message); } } }
using namespace System; public ref class ObsoleteAttrib_Cons1 { public: // Mark the method as 'Obsolete' with message as parameter. [ObsoleteAttribute("This function will be removed from future Versions. Use another function 'NewFunction'")] String^ OldFunction() { return "This is the String from old function."; } // Create another function which is replacement to the 'OldFunction'. String^ NewFunction() { return "This is the String from new function."; } }; int main() { try { ObsoleteAttrib_Cons1^ myObsolete = gcnew ObsoleteAttrib_Cons1; Console::WriteLine( myObsolete->OldFunction() ); Console::WriteLine( myObsolete->NewFunction() ); } catch ( Exception^ e ) { Console::WriteLine( "The Exception is : {0}", e->Message ); } }
import System.*; public class ObsoleteAttrib_Cons1 { // Mark the method as 'Obsolete' with message as parameter. /** @attribute ObsoleteAttribute("This function will be removed from future" + "Versions.Use another function 'NewFunction'") */ public String OldFunction() { return "This is the String from old function."; } //OldFunction // Create the another function which is replacement to the 'OldFunction'. public String NewFunction() { return "This is the String from new function."; } //NewFunction } //ObsoleteAttrib_Cons1 public class TestObsolete2 { public static void main(String[] args) { try { ObsoleteAttrib_Cons1 myObsolete = new ObsoleteAttrib_Cons1(); Console.WriteLine(myObsolete.OldFunction()); Console.WriteLine(myObsolete.NewFunction()); } catch (System.Exception e) { Console.WriteLine("The Exception is :" + e.get_Message()); } } //main } //TestObsolete2

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ObsoleteAttribute コンストラクタ

名前 | 説明 |
---|---|
ObsoleteAttribute () | ObsoleteAttribute クラスの新しいインスタンスを既定のプロパティを使用して初期化します。 .NET Compact Framework によってサポートされています。 |
ObsoleteAttribute (String) | 代替手段メッセージを指定して、ObsoleteAttribute クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
ObsoleteAttribute (String, Boolean) | 代替手段メッセージと、今後使用しないとマークされた要素を使用するとエラーになるかどうかを示す Boolean 値を指定して、ObsoleteAttribute クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |

ObsoleteAttribute コンストラクタ ()
アセンブリ: mscorlib (mscorlib.dll 内)



Imports System Public Class ObsoleteAttrib_Cons1 ' Mark the method as 'Obsolete'. <ObsoleteAttribute()> Public Function OldFunction() As String Return "This is the String from old function." End Function 'OldFunction ' Create the another function which is replacement to the 'OldFunction'. Public Function NewFunction() As String Return "This is the String from new function." End Function 'NewFunction End Class 'ObsoleteAttrib_Cons1 Public Class TestObsolete1 'Entry point which delegates to C-style main Private Function Public Overloads Shared Sub Main() Main(System.Environment.GetCommandLineArgs()) End Sub Overloads Shared Sub Main(args() As String) Try Dim myObsolete As New ObsoleteAttrib_Cons1() Console.WriteLine(myObsolete.OldFunction()) Catch e As Exception Console.WriteLine(("The Exception is :" + e.Message)) End Try End Sub 'Main End Class 'TestObsolete1
using System; public class ObsoleteAttrib_Cons1 { // Mark the method as 'Obsolete'. [ObsoleteAttribute()] public string OldFunction() { return "This is the String from old function."; } // Create the another function which is replacement to the 'OldFunction'. public string NewFunction() { return "This is the String from new function."; } } public class TestObsolete1 { static void Main(string[] args) { try { ObsoleteAttrib_Cons1 myObsolete = new ObsoleteAttrib_Cons1(); Console.WriteLine(myObsolete.OldFunction()); } catch(Exception e) { Console.WriteLine("The Exception is :"+e.Message); } } }
using namespace System; public ref class ObsoleteAttrib_Cons1 { public: // Mark the method as 'Obsolete'. [Obsolete] String^ OldFunction() { return "This is the String from old function."; } // Create the another function which is replacement to the 'OldFunction'-> String^ NewFunction() { return "This is the String from new function."; } }; int main() { try { ObsoleteAttrib_Cons1^ myObsolete = gcnew ObsoleteAttrib_Cons1; Console::WriteLine( myObsolete->OldFunction() ); } catch ( Exception^ e ) { Console::WriteLine( "The Exception is : {0}", e->Message ); } }
import System.*; public class ObsoleteAttrib_Cons1 { // Mark the method as 'Obsolete'.\ /** @attribute ObsoleteAttribute() */ public String OldFunction() { return "This is the String from old function."; } //OldFunction // Create the another function which is replacement to the 'OldFunction'. public String NewFunction() { return "This is the String from new function."; } //NewFunction } //ObsoleteAttrib_Cons1 public class TestObsolete1 { public static void main(String[] args) { try { ObsoleteAttrib_Cons1 myObsolete = new ObsoleteAttrib_Cons1(); Console.WriteLine(myObsolete.OldFunction()); } catch (System.Exception e) { Console.WriteLine("The Exception is :" + e.get_Message()); } } //main } //TestObsolete1

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からObsoleteAttribute コンストラクタを検索する場合は、下記のリンクをクリックしてください。

- ObsoleteAttribute コンストラクタのページへのリンク