有人能帮忙一起搞定一下以下的代码片断吗?这是Code Rush中的SmartTemplate的核心部分...

None.gif bool  flag1;
None.gif            
string  text1;
None.gif            
string  text2;
None.gif            
string  text3;
None.gif            Method method1;
None.gif            Property property1;
None.gif            DateTime time1;
None.gif            TimeSpan span1;
None.gif            TimeSpan span2;
None.gif            LanguageElementType type1;
None.gif            MethodTypeEnum enum1;
None.gif            LanguageElement element1 
=  CodeRush.Source.ActiveMethodOrPropertyAccessor;
None.gif            
if  (element1  !=   null )
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif {
InBlock.gif                
goto Label_0213;
ExpandedBlockEnd.gif            }

None.gif            
goto  Label_00FA;
None.gif        Label_0016:
None.gif            text3 
=   string .Concat(text3,  " ; " );
None.gif            
goto  Label_0158;
None.gif        Label_0029:
None.gif            text2 
=   string .Concat( " «BlockAnchor» " , text2,  " «Cursor» " );
None.gif            
goto  Label_019C;
None.gif        Label_003F:
None.gif            text3 
=   string .Concat(text3,  " return " );
None.gif            
goto  Label_009D;
None.gif        Label_0052:
None.gif            
if  (time1.Second  >   43 )
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif {
InBlock.gif                
goto Label_0287;
ExpandedBlockEnd.gif            }

None.gif            
goto  Label_0145;
None.gif        Label_0065:
None.gif            
goto  Label_0241;
None.gif        Label_006A:
None.gif            
if  ( ! flag1)
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif {
InBlock.gif                
goto Label_0158;
ExpandedBlockEnd.gif            }

None.gif            
goto  Label_0016;
None.gif            
return ;
None.gif            
do
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif {
InBlock.gif                text1 
= property1.MemberType;
InBlock.gif                text2 
= this.a(property1, text1);
InBlock.gif                
if (text2 == "")
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_024C;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
goto Label_0029;
InBlock.gif            Label_009D:
InBlock.gif                
if (text3 != "")
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_006A;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
goto Label_01B0;
InBlock.gif            Label_00B3:
InBlock.gif                span1 
= DateTime.op_Subtraction(DateTime.Now, new DateTime(200461));
InBlock.gif                
if (span1.TotalSeconds >= 0f)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_0257;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
return;
InBlock.gif            Label_00E6:
InBlock.gif                text3 
= string.Concat(text3, "return ", text2);
InBlock.gif                
goto Label_006A;
InBlock.gif            Label_00FA:
InBlock.gif                Log.SendError(
"Can't expand smart return inside anything but a method or a property accessor.");
InBlock.gif                
return;
InBlock.gif            Label_0105:
InBlock.gif                
goto Label_009D;
InBlock.gif            Label_0107:
InBlock.gif                method1 
= ((Method) element1);
InBlock.gif                enum1 
= method1.MethodType;
InBlock.gif                
switch (enum1)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
case MethodTypeEnum.Constructor:
InBlock.gif                    
case MethodTypeEnum.Void:
InBlock.gif                    
case MethodTypeEnum.Destructor:
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
goto Label_003F;
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                }

InBlock.gif                
goto Label_0105;
InBlock.gif            Label_0132:
InBlock.gif                text2 
= string.Concat("«BlockAnchor»", text2, "«Cursor»");
InBlock.gif                
goto Label_00E6;
InBlock.gif            Label_0145:
InBlock.gif                
if (time1.Second < 23)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_0287;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
goto Label_00B3;
InBlock.gif            Label_0158:
InBlock.gif                time1 
= DateTime.Now;
InBlock.gif                
if (time1.DayOfWeek == DayOfWeek.Sunday)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_00B3;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
goto Label_01EB;
InBlock.gif            Label_0170:
InBlock.gif                text3 
= string.Concat(text3, "return");
InBlock.gif                
goto Label_006A;
InBlock.gif            Label_0183:
InBlock.gif                property1 
= ((Property) element1.Parent);
ExpandedBlockEnd.gif            }

None.gif            
while  ((property1  !=   null ));
None.gif            
goto  Label_0208;
None.gif        Label_019C:
None.gif            text3 
=   string .Concat(text3,  " return  " , text2);
None.gif            
goto  Label_006A;
None.gif        Label_01B0:
None.gif            text1 
=  method1.MemberType;
None.gif            text2 
=   this .a(method1, text1);
None.gif            
if  (text2  ==   "" )
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif {
InBlock.gif                
goto Label_01FD;
ExpandedBlockEnd.gif            }

None.gif            
goto  Label_0132;
None.gif        Label_01D4:
None.gif            
switch  (type1)
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif {
InBlock.gif                
case LanguageElementType.PropertyAccessorGet:
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_0183;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
case LanguageElementType.PropertyAccessorSet:
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_0170;
ExpandedSubBlockEnd.gif                }

ExpandedBlockEnd.gif            }

None.gif            
goto  Label_0065;
None.gif        Label_01EB:
None.gif            
if  (time1.DayOfWeek  !=  DayOfWeek.Thursday)
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif {
InBlock.gif                
goto Label_0287;
ExpandedBlockEnd.gif            }

None.gif            
goto  Label_0052;
None.gif        Label_01FD:
None.gif            text2 
=   " «Cursor» " ;
None.gif            
goto  Label_00E6;
None.gif        Label_0208:
None.gif            Log.SendError(
" Invalid LanguageElement returned. Can't expand smart return inside anything but a method or a property accessor. " );
None.gif            
return ;
None.gif        Label_0213:
None.gif            flag1 
=  (CodeRush.Caret.CharRight  !=   ' ; ' );
None.gif            text3 
=   "" ;
None.gif            type1 
=  element1.ElementType;
None.gif            
if  (type1  ==  LanguageElementType.Method)
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif {
InBlock.gif                
goto Label_0107;
ExpandedBlockEnd.gif            }

None.gif            
goto  Label_01D4;
None.gif        Label_0241:
None.gif            Log.SendError(
" Invalid LanguageElement returned. Can't expand smart return inside anything but a method or a property accessor. " );
None.gif            
return ;
None.gif        Label_024C:
None.gif            text2 
=   " «Cursor» " ;
None.gif            
goto  Label_019C;
None.gif        Label_0257:
None.gif            span2 
=  DateTime.op_Subtraction(DateTime.Now,  new  DateTime( 2004 7 30 ));
None.gif            
if  (span2.TotalSeconds  >  0f)
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif {
InBlock.gif                
return;
ExpandedBlockEnd.gif            }

None.gif        Label_0287:
None.gif            CodeRush.Templates.InsertExpansion(text3);
None.gif        }
None.gif
None.gif        
private   string  a(LanguageElement A_0,  string  A_1)
ExpandedBlockStart.gifContractedBlock.gif        
dot.gif {
InBlock.gif            LanguageElement element1;
InBlock.gif            
string text1;
InBlock.gif            IEnumerator enumerator1;
InBlock.gif            IDisposable disposable1;
InBlock.gif            ClipboardEntry entry1 
= CodeRush.Clipboard.LastEntry;
InBlock.gif            
if (entry1 != null)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
goto Label_0028;
ExpandedSubBlockEnd.gif            }

InBlock.gif        Label_0013:
InBlock.gif            enumerator1 
= CodeRush.Source.Identifiers.GetEnumerator();
InBlock.gif            
goto Label_0048;
InBlock.gif        Label_0028:
InBlock.gif            
if (entry1.BestGuessType != A_1)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
goto Label_0013;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
goto Label_0041;
InBlock.gif        Label_003B:
InBlock.gif            
return "";
InBlock.gif        Label_0041:
InBlock.gif            
return entry1.Text;
InBlock.gif        Label_0048:
InBlock.gif            
try
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif            Label_004A:
InBlock.gif                
if (enumerator1.MoveNext())
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_006F;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
goto Label_003B;
InBlock.gif            Label_0057:
InBlock.gif                
if (((Member) element1).MemberType != A_1)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_004A;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
goto Label_0088;
InBlock.gif            Label_006F:
InBlock.gif                element1 
= ((LanguageElement) enumerator1.Current);
InBlock.gif                
if ((element1 as Member) == null)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_004A;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
goto Label_0091;
InBlock.gif            Label_0088:
InBlock.gif                
return element1.Name;
InBlock.gif            Label_0091:
InBlock.gif                
if (element1 == A_0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
goto Label_004A;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
goto Label_0057;
InBlock.gif                
goto Label_003B;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
finally
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                disposable1 
= (enumerator1 as IDisposable);
InBlock.gif                
if (disposable1 != null)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    disposable1.Dispose();
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
return text1;

如果能够解决,那么大家就可以免费使用smartTemplate了。

转载于:https://www.cnblogs.com/William_Fire/archive/2004/07/06/21814.html

1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 、4下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合;、下载 4使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合;、 4下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码
1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.m或d论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 、1资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码
1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。、资源 5来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。、资 5源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值