本文整理汇总了C#中Registry.Find方法的典型用法代码示例。如果您正苦于以下问题:C# Registry.Find方法的具体用法?C# Registry.Find怎么用?C# Registry.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registry
的用法示例。
在下文中一共展示了Registry.Find方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle_Unbind
private static void Handle_Unbind(
OBPClient Dispatch, string[] args, int index)
{
Unbind Options = new Unbind ();
Registry Registry = new Registry ();
#pragma warning disable 162
for (int i = index; i< args.Length; i++) {
if (!IsFlag (args [i][0] )) {
throw new Exception ("Unexpected parameter: " + args[i]);}
string Rest = args [i].Substring (1);
TagType_Unbind TagType = (TagType_Unbind) Registry.Find (Rest);
// here have the cases for what to do with it.
switch (TagType) {
default : throw new Exception ("Internal error");
}
}
#pragma warning restore 162
Dispatch.Unbind (Options);
}
示例2: Handle_Resolve
private static void Handle_Resolve(
OBPClient Dispatch, string[] args, int index)
{
Resolve Options = new Resolve ();
Registry Registry = new Registry ();
Options.Domain.Register ("domain", Registry, (int) TagType_Resolve.Domain);
Options.Service.Register ("service", Registry, (int) TagType_Resolve.Service);
Options.Verbose.Register ("verbose", Registry, (int) TagType_Resolve.Verbose);
// looking for parameter Param.Name}
if (index < args.Length && !IsFlag (args [index][0] )) {
// Have got the parameter, call the parameter value method
Options.Domain.Parameter (args [index]);
index++;
}
// looking for parameter Param.Name}
if (index < args.Length && !IsFlag (args [index][0] )) {
// Have got the parameter, call the parameter value method
Options.Service.Parameter (args [index]);
index++;
}
#pragma warning disable 162
for (int i = index; i< args.Length; i++) {
if (!IsFlag (args [i][0] )) {
throw new Exception ("Unexpected parameter: " + args[i]);}
string Rest = args [i].Substring (1);
TagType_Resolve TagType = (TagType_Resolve) Registry.Find (Rest);
// here have the cases for what to do with it.
switch (TagType) {
case TagType_Resolve.Verbose : {
int OptionParams = Options.Verbose.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.Verbose.Parameter (args[i]);
}
}
break;
}
default : throw new Exception ("Internal error");
}
}
#pragma warning restore 162
Dispatch.Resolve (Options);
}
示例3: Handle_Server
private static void Handle_Server(
OBPConnect Dispatch, string[] args, int index)
{
Server Options = new Server ();
Registry Registry = new Registry ();
Options.Configuration.Register ("config", Registry, (int) TagType_Server.Configuration);
Options.Log.Register ("log", Registry, (int) TagType_Server.Log);
Options.Detach.Register ("detach", Registry, (int) TagType_Server.Detach);
Options.WebService.Register ("ws", Registry, (int) TagType_Server.WebService);
Options.UDP.Register ("udp", Registry, (int) TagType_Server.UDP);
Options.DNS.Register ("dns", Registry, (int) TagType_Server.DNS);
// looking for parameter Param.Name}
if (index < args.Length && !IsFlag (args [index][0] )) {
// Have got the parameter, call the parameter value method
Options.Configuration.Parameter (args [index]);
index++;
}
#pragma warning disable 162
for (int i = index; i< args.Length; i++) {
if (!IsFlag (args [i][0] )) {
throw new Exception ("Unexpected parameter: " + args[i]);}
string Rest = args [i].Substring (1);
TagType_Server TagType = (TagType_Server) Registry.Find (Rest);
// here have the cases for what to do with it.
switch (TagType) {
case TagType_Server.Log : {
int OptionParams = Options.Log.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.Log.Parameter (args[i]);
}
}
break;
}
case TagType_Server.Detach : {
int OptionParams = Options.Detach.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.Detach.Parameter (args[i]);
}
}
break;
}
case TagType_Server.WebService : {
int OptionParams = Options.WebService.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.WebService.Parameter (args[i]);
}
}
break;
}
case TagType_Server.UDP : {
int OptionParams = Options.UDP.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.UDP.Parameter (args[i]);
}
}
break;
}
case TagType_Server.DNS : {
int OptionParams = Options.DNS.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.DNS.Parameter (args[i]);
}
}
break;
}
default : throw new Exception ("Internal error");
}
}
#pragma warning restore 162
Dispatch.Server (Options);
}
示例4: Handle_Bind
private static void Handle_Bind(
OBPClient Dispatch, string[] args, int index)
{
Bind Options = new Bind ();
Registry Registry = new Registry ();
Options.Account.Register ("account", Registry, (int) TagType_Bind.Account);
Options.PIN.Register ("pin", Registry, (int) TagType_Bind.PIN);
Options.Server.Register ("server", Registry, (int) TagType_Bind.Server);
Options.Port.Register ("port", Registry, (int) TagType_Bind.Port);
// looking for parameter Param.Name}
if (index < args.Length && !IsFlag (args [index][0] )) {
// Have got the parameter, call the parameter value method
Options.Account.Parameter (args [index]);
index++;
}
// looking for parameter Param.Name}
if (index < args.Length && !IsFlag (args [index][0] )) {
// Have got the parameter, call the parameter value method
Options.PIN.Parameter (args [index]);
index++;
}
#pragma warning disable 162
for (int i = index; i< args.Length; i++) {
if (!IsFlag (args [i][0] )) {
throw new Exception ("Unexpected parameter: " + args[i]);}
string Rest = args [i].Substring (1);
TagType_Bind TagType = (TagType_Bind) Registry.Find (Rest);
// here have the cases for what to do with it.
switch (TagType) {
case TagType_Bind.Server : {
int OptionParams = Options.Server.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.Server.Parameter (args[i]);
}
}
break;
}
case TagType_Bind.Port : {
int OptionParams = Options.Port.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.Port.Parameter (args[i]);
}
}
break;
}
default : throw new Exception ("Internal error");
}
}
#pragma warning restore 162
Dispatch.Bind (Options);
}
示例5: Handle_PIN
private static void Handle_PIN(
OBPConnect Dispatch, string[] args, int index)
{
PIN Options = new PIN ();
Registry Registry = new Registry ();
Options.Configuration.Register ("config", Registry, (int) TagType_PIN.Configuration);
Options.Account.Register ("account", Registry, (int) TagType_PIN.Account);
Options.Handle.Register ("id", Registry, (int) TagType_PIN.Handle);
// looking for parameter Param.Name}
if (index < args.Length && !IsFlag (args [index][0] )) {
// Have got the parameter, call the parameter value method
Options.Configuration.Parameter (args [index]);
index++;
}
// looking for parameter Param.Name}
if (index < args.Length && !IsFlag (args [index][0] )) {
// Have got the parameter, call the parameter value method
Options.Account.Parameter (args [index]);
index++;
}
#pragma warning disable 162
for (int i = index; i< args.Length; i++) {
if (!IsFlag (args [i][0] )) {
throw new Exception ("Unexpected parameter: " + args[i]);}
string Rest = args [i].Substring (1);
TagType_PIN TagType = (TagType_PIN) Registry.Find (Rest);
// here have the cases for what to do with it.
switch (TagType) {
case TagType_PIN.Handle : {
int OptionParams = Options.Handle.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.Handle.Parameter (args[i]);
}
}
break;
}
default : throw new Exception ("Internal error");
}
}
#pragma warning restore 162
Dispatch.PIN (Options);
}