本文整理汇总了C#中Code类的典型用法代码示例。如果您正苦于以下问题:C# Code类的具体用法?C# Code怎么用?C# Code使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Code类属于命名空间,在下文中一共展示了Code类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CodeViewModel
public CodeViewModel(Code codeModel)
{
var View = new CodeView();
View.DataContext = this;
foreach (var backProp in codeModel.BackingProperties)
{
FullCode += backProp;
}
FullCode += "/r";
foreach (var backDel in codeModel.BackingDelegates)
{
FullCode += backDel;
}
FullCode += "/r/r";
foreach (var con in codeModel.Constructors)
{
FullCode += con;
}
FullCode += "/r/r #region DelegateMethods/r";
foreach (var delMethod in codeModel.DelegateMethods)
{
FullCode += delMethod;
}
FullCode += "#endregion/r/r#region Properties/r";
foreach (var foreProp in codeModel.ForegroundProperties)
{
FullCode += foreProp;
}
FullCode += "#endregion";
FullCode = FullCode.Replace("/r", Environment.NewLine);
View.Show();
}
开发者ID:XxWOLFxX1337,项目名称:VMBuilder,代码行数:32,代码来源:CodeViewModel.cs
示例2: GetLanguageCodeAsString
public static string GetLanguageCodeAsString(Code languageCode)
{
switch (languageCode)
{
case Code.EN:
return "EN";
case Code.FR:
return "FR";
case Code.IT:
return "IT";
case Code.DE:
return "DE";
case Code.ES:
return "ES";
case Code.AR:
return "AR";
case Code.ZHCN:
return "ZH-CN";
case Code.JA:
return "JA";
case Code.KO:
return "KO";
case Code.VI:
return "VI";
case Code.RU:
return "RU";
case Code.NL:
return "NL";
case Code.PT:
return "PT";
}
return "Invalid Language";
}
开发者ID:joenarus,项目名称:Stressident,代码行数:34,代码来源:Google2uLanguages.cs
示例3: Instruction
public Instruction(int offset, Code opcode, object operand, object operand2)
{
this.offset = offset;
this.opcode = opcode;
Operand = operand;
this.operand2 = operand2;
}
开发者ID:Xtremrules,项目名称:dot42,代码行数:7,代码来源:Instruction.cs
示例4: CanBeEqual
public void CanBeEqual()
{
var code1 = new Code("code");
var code2 = new Code("code");
Assert.AreEqual(code1,code2);
}
开发者ID:jango2015,项目名称:MongoDB_Client_.Net,代码行数:7,代码来源:TestCode.cs
示例5: power_search_doctor_pageloaddata
public void power_search_doctor_pageloaddata()
{
Code cd = new Code();
DataSet ds = cd.power_search_doctor_pageloaddata();
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
// Health center Names
DropDownList1.DataTextField = ds.Tables[0].Columns["Name"].ToString();
DropDownList1.DataValueField = ds.Tables[0].Columns["ID"].ToString();
DropDownList1.DataSource = ds.Tables[0];
DropDownList1.DataBind();
DropDownList1.Items.Insert(0, "Any");
// Studied at - Country table
DropDownList7.DataTextField = ds.Tables[1].Columns["Name"].ToString();
DropDownList7.DataValueField = ds.Tables[1].Columns["ID"].ToString();
DropDownList7.DataSource = ds.Tables[1];
DropDownList7.DataBind();
DropDownList7.Items.Insert(0, "Any");
// Worked at - Country table
DropDownList2.DataTextField = ds.Tables[1].Columns["Name"].ToString();
DropDownList2.DataValueField = ds.Tables[1].Columns["ID"].ToString();
DropDownList2.DataSource = ds.Tables[1];
DropDownList2.DataBind();
DropDownList2.Items.Insert(0, "Any");
// Specialist - Specifications table
DropDownList4.DataTextField = ds.Tables[2].Columns["Name"].ToString();
DropDownList4.DataValueField = ds.Tables[2].Columns["ID"].ToString();
DropDownList4.DataSource = ds.Tables[2];
DropDownList4.DataBind();
DropDownList4.Items.Insert(0, "Any");
}
}
开发者ID:adusumillipranavi,项目名称:Doctor-Project,代码行数:32,代码来源:Power_Search_Doctor.aspx.cs
示例6: GetSingleField
static FieldDefinition GetSingleField(PropertyDefinition property, Code code, MethodDefinition methodDefinition)
{
if (methodDefinition?.Body == null)
{
return null;
}
FieldReference fieldReference = null;
foreach (var instruction in methodDefinition.Body.Instructions)
{
if (instruction.OpCode.Code == code)
{
//if fieldReference is not null then we are at the second one
if (fieldReference != null)
{
return null;
}
var field = instruction.Operand as FieldReference;
if (field != null)
{
if (field.DeclaringType != property.DeclaringType)
{
continue;
}
if (field.FieldType != property.PropertyType)
{
continue;
}
fieldReference = field;
}
}
}
return fieldReference?.Resolve();
}
开发者ID:Fody,项目名称:PropertyChanging,代码行数:33,代码来源:MappingFinder.cs
示例7: getInitializedArray
public static Value[] getInitializedArray(int arraySize, MethodDefinition method, ref int newarrIndex, Code stelemOpCode)
{
var resultValueArray = new Value[arraySize];
var emulator = new InstructionEmulator(method.HasThis, false, method.Parameters, method.Body.Variables);
var theArray = new UnknownValue();
emulator.push(theArray);
var instructions = method.Body.Instructions;
int i;
for (i = newarrIndex + 1; i < instructions.Count; i++) {
var instr = instructions[i];
if (instr.OpCode.FlowControl != FlowControl.Next)
break;
if (instr.OpCode.Code == Code.Newarr)
break;
if (instr.OpCode.Code == stelemOpCode) {
var value = emulator.pop();
var index = emulator.pop() as Int32Value;
var array = emulator.pop();
if (ReferenceEquals(array, theArray) && index != null && index.allBitsValid()) {
if (0 <= index.value && index.value < resultValueArray.Length)
resultValueArray[index.value] = value;
}
}
else
emulator.emulate(instr);
}
if (i != newarrIndex + 1)
i--;
newarrIndex = i;
return resultValueArray;
}
开发者ID:Perplexity,项目名称:de4dot,代码行数:35,代码来源:ArrayFinder.cs
示例8: Is_Ldarg_C
private static Boolean Is_Ldarg_C(VirtualOpCode ins, Code code)
{
// Ldarg_C delegates will reference the arguments field in their Ldfld, which sets them apart from
// other very similar delegates
return ins.Matches(ins.ModifyPattern(Pattern_Ldarg_C, Code.Ldc_I4, code))
&& ((FieldDef)ins.DelegateMethod.Body.Instructions[2].Operand).MDToken == ins.VType.ArgumentsField.MDToken;
}
开发者ID:misharcrack,项目名称:eazdevirt,代码行数:7,代码来源:Detection.Arg.cs
示例9: feedControl_FeedbackReceived
async void feedControl_FeedbackReceived(Code.FeedbackObject feedbackObj)
{
ShowProgressBar(true);
// send the feedback to the server from here
var feedbackResult = await MyILPClient.RegisterFacultyFeedback(currentSelectedSchedule, feedbackObj);
string title = "Information";
string content = "";
switch (feedbackResult.FeedStatus)
{
case FeedbackResult.FeedbackStatusType.NEW:
content = "Thank you giving your valuable feedback!";
break;
case FeedbackResult.FeedbackStatusType.OLD:
content = "Feedback has already been given for the selected slot";
break;
case FeedbackResult.FeedbackStatusType.ERROR:
title = "Error";
content = "Some error has occured while trying to send feedback. Please try again later.";
break;
}
MessageDialog md = new MessageDialog(content, title);
await md.ShowAsync();
#if DEBUG
System.Diagnostics.Debug.WriteLine("Feedback result: " + feedbackResult.FeedStatus);
#endif
ShowProgressBar(false);
}
开发者ID:ilpinnovations,项目名称:MyILPWindowsPhone8.1,代码行数:30,代码来源:SchedulePage.xaml.cs
示例10: TestCanAddAFunctionStrCode
public void TestCanAddAFunctionStrCode()
{
const string name = "faddsc";
var func = new Code("function(x, y){return x + y;}");
_javascript.Add(name, func);
Assert.IsNotNull(_javascript[name]);
}
开发者ID:jango2015,项目名称:MongoDB_Client_.Net,代码行数:7,代码来源:TestDatabaseJavascript.cs
示例11: LoadUI
private void LoadUI(Code.Playlist.Playlist playlist)
{
this.StackMedia.Children.Clear();
if (playlist != null)
{
this.UITitle.Text = playlist.Name;
List<MediaEvent> Medias = playlist.LoadMediaEvent();
if (Medias != null)
{
foreach (MediaEvent e in Medias)
{
UIMediaEvent UIE = new UIMediaEvent();
UIE.Height = 50;
UIE.Width = 395;
UIE.Event = e;
UIE.DeleteEvent += UIE_DeleteEvent;
UIE.ViewMediaEvent += UIE_ViewMediaEvent;
this.StackMedia.Children.Add(UIE);
}
}
}
else
{
this.UITitle.Text = string.Empty;
}
}
开发者ID:iceriver102,项目名称:alta-mtc-version-2,代码行数:28,代码来源:Playlist_Media.xaml.cs
示例12: Convert
public void Convert(string inputFileName, string outputFileName)
{
VersionableBase.DefaultAgencyId = "example.org";
if (string.IsNullOrWhiteSpace(inputFileName))
{
throw new ArgumentNullException("inputFileName");
}
if (string.IsNullOrWhiteSpace(outputFileName))
{
throw new ArgumentNullException("outputFileName");
}
InitializeDdiElements();
// Go through each row of the spreadsheet.
DataTable iscoTable = GetSpreadsheetContents(inputFileName);
foreach (DataRow row in iscoTable.Rows)
{
// Create a category and map information from each column.
Category category = new Category();
category.Label["en"] = row["description EN"].ToString();
category.Label["fr"] = row["description FR"].ToString();
category.Label["de"] = row["description DE"].ToString();
category.Description["en"] = row["texte auto EN"].ToString();
category.Description["fr"] = row["texte auto FR"].ToString();
category.Description["de"] = row["texte auto DE"].ToString();
categoryScheme.Categories.Add(category);
// Create a code.
Code code = new Code();
code.Category = category;
code.Value = row["code"].ToString();
// First level codes are added directly the CodeScheme.
int level = code.Value.Length;
if (level == 1)
{
codeScheme.Codes.Add(code);
}
else
{
// For child codes, look up the parent code.
// The parent's value will be the same as this new code's value,
// minus the last character.
var flatCodes = codeScheme.GetFlattenedCodes();
Code parent = flatCodes.SingleOrDefault(c => c.Value == code.Value.Substring(0, code.Value.Length - 1));
parent.ChildCodes.Add(code);
}
Console.WriteLine(string.Format("{0} {1}", code.Value, category.Label["en"]));
}
// Save the DDI XML.
DDIWorkflowSerializer serializer = new DDIWorkflowSerializer();
serializer.UseConciseBoundedDescription = false;
XmlDocument doc = serializer.Serialize(this.instance);
DDIWorkflowSerializer.SaveXml(outputFileName, doc);
}
开发者ID:Colectica,项目名称:isco-ddi,代码行数:59,代码来源:IscoToDdiConverter.cs
示例13: Field
public Code Field(Code baseExpr, String name) {
Type scope = (baseExpr == null) ? cls : ((Node)baseExpr).Type;
FieldInfo f = QueryImpl.lookupField(scope, name);
if (f == null) {
throw new CodeGeneratorException("No such field " + name + " in class " + scope);
}
return new LoadNode((Node)baseExpr, f);
}
开发者ID:yan122725529,项目名称:TripRobot.Crawler,代码行数:8,代码来源:CodeGeneratorImpl.cs
示例14: TestCanAddFunctionByAssignment
public void TestCanAddFunctionByAssignment()
{
const string name = "fassignadd";
var func = new Code("function(x,y){return x + y;}");
var doc = new Document().Add("_id", name).Add("value", func);
_javascript[name] = doc;
Assert.IsNotNull(_javascript[name]);
}
开发者ID:jango2015,项目名称:MongoDB_Client_.Net,代码行数:8,代码来源:TestDatabaseJavascript.cs
示例15: CodeRunner
public CodeRunner(IDebugger debugger, string source)
{
_debugger = debugger;
_source = source;
Context = new Context(new Scope());
CodeGenerator = new Code();
}
开发者ID:Diullei,项目名称:Storm,代码行数:8,代码来源:CodeRunner.cs
示例16: ScanData
public ScanData(int count, int retCode, int d9, int d324)
{
this.count = count;
this.retCode = retCode;
this.priority = (Code)retCode;
this.patternD9 = d9;
this.patternD3D2D4 = d324;
}
开发者ID:mtotheikle,项目名称:EWU-OIT-SSN-Scanner,代码行数:8,代码来源:ScanData.cs
示例17: BranchShort
public static void BranchShort(this List<object> codeList, Code op, int label)
{
Debug.Assert((codeList.Count() - label) < SByte.MaxValue);
// +2, op code + address code, as backward jump start from first byte of the end of branch command with address
var address = (byte) -(codeList.Count() - label + 2);
codeList.Add(op);
codeList.Add(address);
}
开发者ID:afrog33k,项目名称:csnative,代码行数:9,代码来源:OpCodeExtentions.cs
示例18: feedControl_FeedbackCancelled
void feedControl_FeedbackCancelled(Code.FeedbackObject feedbackObj)
{
string fdString = string.Format("Cancelled feedback for {0}\nCourse: {1}\n",
feedbackObj.FacultyName, feedbackObj.CourseName);
#if DEBUG
System.Diagnostics.Debug.WriteLine(fdString);
#endif
}
开发者ID:ilpinnovations,项目名称:MyILPWindowsPhone8.1,代码行数:9,代码来源:TestPage.xaml.cs
示例19: feedControl_FeedbackReceived
void feedControl_FeedbackReceived(Code.FeedbackObject feedbackObj)
{
string fdString = string.Format("Received feedback for {0}\nCourse: {1}\nRating: {2}\nComments: {3}\n",
feedbackObj.FacultyName, feedbackObj.CourseName, feedbackObj.Rating, feedbackObj.Comments);
#if DEBUG
System.Diagnostics.Debug.WriteLine(fdString);
#endif
}
开发者ID:ilpinnovations,项目名称:MyILPWindowsPhone8.1,代码行数:9,代码来源:TestPage.xaml.cs
示例20: GetInstructionKind
private static InstructionKindEnum GetInstructionKind(Code value)
{
var xName = value.ToString();
if (xName.EndsWith("_S"))
{
xName = xName.Substring(0, xName.Length - 2);
}
return (InstructionKindEnum)Enum.Parse(typeof(InstructionKindEnum), xName);
}
开发者ID:Orvid,项目名称:Cosmos,代码行数:9,代码来源:Reader.MonoHelpers.cs
注:本文中的Code类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论