本文整理汇总了C#中Shell.Connect方法的典型用法代码示例。如果您正苦于以下问题:C# Shell.Connect方法的具体用法?C# Shell.Connect怎么用?C# Shell.Connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shell
的用法示例。
在下文中一共展示了Shell.Connect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle_Connect
private static void Handle_Connect (
Shell Dispatch, string[] args, int index) {
Connect Options = new Connect ();
var Registry = new Goedel.Registry.Registry ();
Options.Portal.Register ("portal", Registry, (int) TagType_Connect.Portal);
Options.PIN.Register ("pin", Registry, (int) TagType_Connect.PIN);
Options.Verbose.Register ("verbose", Registry, (int) TagType_Connect.Verbose);
Options.Report.Register ("report", Registry, (int) TagType_Connect.Report);
Options.DeviceNew.Register ("new", Registry, (int) TagType_Connect.DeviceNew);
Options.DeviceUDF.Register ("dudf", Registry, (int) TagType_Connect.DeviceUDF);
Options.DeviceID.Register ("did", Registry, (int) TagType_Connect.DeviceID);
Options.DeviceDescription.Register ("dd", Registry, (int) TagType_Connect.DeviceDescription);
// looking for parameter Param.Name}
if (index < args.Length && !IsFlag (args [index][0] )) {
// Have got the parameter, call the parameter value method
Options.Portal.Parameter (args [index]);
index++;
}
#pragma warning disable 162
for (int i = index; i< args.Length; i++) {
if (!IsFlag (args [i][0] )) {
throw new System.Exception ("Unexpected parameter: " + args[i]);}
string Rest = args [i].Substring (1);
TagType_Connect TagType = (TagType_Connect) Registry.Find (Rest);
// here have the cases for what to do with it.
switch (TagType) {
case TagType_Connect.PIN : {
int OptionParams = Options.PIN.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.PIN.Parameter (args[i]);
}
}
break;
}
case TagType_Connect.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;
}
case TagType_Connect.Report : {
int OptionParams = Options.Report.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.Report.Parameter (args[i]);
}
}
break;
}
case TagType_Connect.DeviceNew : {
int OptionParams = Options.DeviceNew.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.DeviceNew.Parameter (args[i]);
}
}
break;
}
case TagType_Connect.DeviceUDF : {
int OptionParams = Options.DeviceUDF.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.DeviceUDF.Parameter (args[i]);
}
}
break;
}
case TagType_Connect.DeviceID : {
int OptionParams = Options.DeviceID.Tag (Rest);
if (OptionParams>0 && ((i+1) < args.Length)) {
if (!IsFlag (args [i+1][0] )) {
i++;
Options.DeviceID.Parameter (args[i]);
}
}
break;
}
case TagType_Connect.DeviceDescription : {
//.........这里部分代码省略.........