本文整理汇总了C#中Module类的典型用法代码示例。如果您正苦于以下问题:C# Module类的具体用法?C# Module怎么用?C# Module使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Module类属于命名空间,在下文中一共展示了Module类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Build
protected override IHeader Build(Module module, params Value[] parameterArray)
{
var udpHeader = CreateHeader<UdpHeader>(parameterArray);
udpHeader.PseudoDestinationPort1 = (IPAddress)parameterArray.First(p => p.Scope.Equals("IPHeader") && p.Name.Equals("DestinationAddress")).AsObject;
udpHeader.PseudoSourcePort = (IPAddress)parameterArray.First(p => p.Scope.Equals("IPHeader") && p.Name.Equals("SourceAddress")).AsObject;
return udpHeader;
}
开发者ID:davidbetz,项目名称:netrouter,代码行数:7,代码来源:UdpHandler.cs
示例2: ModuleModel
public ModuleModel(Module module)
{
Id = module.Id;
Name = module.Name;
Description = module.Description;
AccessTypeId = module.AccessTypeId;
}
开发者ID:Tyre88,项目名称:Gradera,代码行数:7,代码来源:ModuleModel.cs
示例3: Displace
public Displace(Module sourceModule, Module displaceModuleX, Module displaceModuleY, Module displaceModuleZ)
{
SourceModule = sourceModule;
DisplaceModuleX = displaceModuleX;
DisplaceModuleY = displaceModuleY;
DisplaceModuleZ = displaceModuleZ;
}
开发者ID:Earthmark,项目名称:Libnoise,代码行数:7,代码来源:Displace.cs
示例4: Create
public ActionResult Create(PDCPMS.Modules.Authority.Model.BlockAddModel model)
{
if (model == null || model.block == null)
{
TempData["HintMessage"] = new PDCPMS.Application.HintMessage { Content = "操作失败,系统发生了一个错误" };
return RedirectToAction("Add");
}
Module domainmodel = new Module(model.block.Name, model.block.AddDate, model.block.Description, model.block.Status);
ReadOnlyCollection<BrokenRule> brokenRules = domainmodel.GetBrokenRules();
if (brokenRules.Count != 0)
{
TempData["HintMessage"] = new PDCPMS.Application.HintMessage { Content = "你的输入有误,模块添加失败" };
TempData["BrokenRules"] = brokenRules;
TempData["InvalidModel"] = model;
}
repository.Add(domainmodel);
unitOfWork.Commit();
TempData["HintMessage"] = new PDCPMS.Application.HintMessage { Content = string.Format("模块({0})添加成功", model.block.Name) };
return RedirectToAction("Index");
}
开发者ID:dalinhuang,项目名称:cy-pdcpms,代码行数:27,代码来源:BlockController.cs
示例5: GivenModuleHasUrlReference_ThenCreateModuleContainersGeneratesExternalModuleForTheUrl
public void GivenModuleHasUrlReference_ThenCreateModuleContainersGeneratesExternalModuleForTheUrl()
{
var module = new Module("~/test");
module.AddReferences(new[] { "http://test.com/api.js" });
var externalModule = new Module("http://test.com/api.js");
var moduleFactory = new Mock<IModuleFactory<Module>>();
moduleFactory.Setup(f => f.CreateExternalModule("http://test.com/api.js"))
.Returns(externalModule);
var moduleFactories = new Dictionary<Type, object>
{
{ typeof(Module), moduleFactory.Object }
};
var moduleSource = new Mock<IModuleSource<Module>>();
moduleSource
.Setup(s => s.GetModules(It.IsAny<IModuleFactory<Module>>(), It.IsAny<ICassetteApplication>()))
.Returns(new[] { module });
var config = new ModuleConfiguration(
Mock.Of<ICassetteApplication>(),
Mock.Of<IDirectory>(),
Mock.Of<IDirectory>(),
moduleFactories,
""
);
config.Add(moduleSource.Object);
var containers = config.CreateModuleContainers(false, "");
var generatedModule = containers[typeof(Module)].FindModuleContainingPath("http://test.com/api.js");
generatedModule.ShouldBeSameAs(externalModule);
}
开发者ID:romanych,项目名称:cassette,代码行数:31,代码来源:ModuleConfiguration.cs
示例6: Label
public Label(Module parent, string text, Point position)
: base(parent)
{
var stringSize = GameManager.Instance.MenuFont.MeasureString(text);
Bounds = new Rectangle(position.X, position.Y, (int)stringSize.X, (int)stringSize.Y);
Text = text;
}
开发者ID:ndssia,项目名称:WindowsRobotGame,代码行数:7,代码来源:Label.cs
示例7: SetUp
public static void SetUp(Module module, Grammar grammar)
{
if (pattern == null)
{
BlockCommentPrototype.pattern
= new AbstractPattern(null, "BlockCommentPrototype");
BlockCommentPrototype.pattern.SetType(typeof(BlockCommentPrototype));
grammar.PatternDefined(BlockCommentPrototype.pattern);
string expression = "s('/*' *(s(!('*/') a(0 any))) '*/')";
ParseGraphNode parseGraph = BootstrapParser.Parse(expression,
new Pattern[]{BlockCommentPrototype.pattern});
pattern = new ConcretePattern(null, "BlockComment",
parseGraph);
pattern.SetType(typeof(BlockComment));
BlockCommentPrototype.pattern.AddAltPattern(pattern);
}
module.SetName("BlockComment", typeof(BlockComment));
grammar.PatternDefined(pattern);
}
开发者ID:KevinKelley,项目名称:katahdin,代码行数:25,代码来源:BlockComment.cs
示例8: CallInfo
public CallInfo(Module vmModule, Method method, int instructionPointer)
{
Module = vmModule;
Class = null;
Method = method;
InstructionPointer = instructionPointer;
}
开发者ID:DatZach,项目名称:Xi,代码行数:7,代码来源:CallInfo.cs
示例9: CreateMutant
/// <summary>
/// Performs the actual code mutations, returning each with
/// <c>yield</c> for the calling code to use.
/// </summary>
/// <remarks>
/// Implementing classes should yield the result obtained by calling
/// the <see mref="DoYield" /> method.
/// </remarks>
/// <param name="method">
/// A <see cref="MethodDefinition" /> for the method on which mutation
/// testing is to be carried out.
/// </param>
/// <param name="module">
/// A <see cref="Module" /> representing the main module of the
/// containing assembly.
/// </param>
/// <param name="originalOffsets"></param>
/// <returns>
/// An <see cref="IEnumerable{T}" /> of
/// <see cref="MutantMetaData" /> structures.
/// </returns>
protected override IEnumerable<MutantMetaData> CreateMutant(MethodDefinition method, Module module, int[] originalOffsets)
{
for (int index = 0; index < method.Body.Instructions.Count; index++)
{
var instruction = method.Body.Instructions[index];
if (instruction.OpCode == OpCodes.Clt
|| instruction.OpCode == OpCodes.Cgt)
{
var originalCode = instruction.OpCode.Code;
var loadZero = method.Body.GetILProcessor().Create(OpCodes.Ldc_I4_0);
var compareEqual = method.Body.GetILProcessor().Create(OpCodes.Ceq);
method.Body.Instructions.Insert(index + 1, compareEqual);
method.Body.Instructions.Insert(index + 1, loadZero);
instruction.OpCode = instruction.OpCode == OpCodes.Clt ? OpCodes.Cgt : OpCodes.Clt;
var description = string.Format("{0:x4}: {1} => not {2}", originalOffsets[index], originalCode, instruction.OpCode.Code);
yield return DoYield(method, module, description, index);
instruction.OpCode = instruction.OpCode == OpCodes.Clt ? OpCodes.Cgt : OpCodes.Clt;
method.Body.Instructions.Remove(compareEqual);
method.Body.Instructions.Remove(loadZero);
}
}
}
开发者ID:dbremner,项目名称:ninjaturtles,代码行数:49,代码来源:ConditionalBoundaryTurtle.cs
示例10: Log
public static void Log(Module module, string message, Exception ex)
{
#if APPVERSE_EMULATOR
Trace.WriteLine(module + ": " + message);
if (ex!=null) {
Trace.WriteLine(module + ": Exception=[" + ex.Message + "] Source=[" + ex.Source + "]");
Trace.WriteLine(module + ": Stacktrace ---------------------");
Trace.WriteLine(module + ": " + ex.StackTrace);
}
#endif
#if DEBUG && !WP8
Console.WriteLine(module+": "+message);
if (ex!=null) {
Console.WriteLine(module+": Exception=["+ex.Message+"] Source=["+ex.Source+"]");
Console.WriteLine(module+": Stacktrace ---------------------");
Console.WriteLine(module+": "+ex.StackTrace);
}
#endif
#if DEBUG && WP8
Debug.WriteLine(module + ": " + message);
if (ex == null) return;
Debug.WriteLine(module + ": Exception=[" + ex.Message + "] Source=[" + ex.Source + "]");
Debug.WriteLine(module + ": Stacktrace ---------------------");
Debug.WriteLine(module + ": " + ex.StackTrace);
#endif
}
开发者ID:Appverse,项目名称:appverse-mobile,代码行数:29,代码来源:SystemLogger.cs
示例11: ModuleMetadataInfo
public ModuleMetadataInfo(Module module, Mono.Cecil.ModuleDefinition cecilModule)
{
this.Module = module;
this.CecilModule = cecilModule;
typeRefLoader = new CecilLoader();
typeRefLoader.SetCurrentModule(cecilModule);
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:7,代码来源:TypeSystemExtensions.cs
示例12: Execute
public void Execute(IContext context)
{
Module module = ModuleUtilities.LoadModule(this.modname, context);
IValues values = context;
int nname = 0;
foreach (var name in this.names)
{
string normname = name.Trim();
if (nname == this.names.Length - 1)
values.SetValue(normname, module);
else if (!values.HasValue(normname))
{
var mod = new Module(context.GlobalContext);
values.SetValue(normname, mod);
values = mod;
}
else
values = (IValues)values.GetValue(normname);
nname++;
}
}
开发者ID:Refandler,项目名称:PythonSharp,代码行数:25,代码来源:ImportCommand.cs
示例13: FillMessageMergeVars
public void FillMessageMergeVars(MandrillMessage message, Module.Models.LinkOrderCampaignProductRecord record)
{
var products = new Dictionary<string, object>
{
{"quantity", record.Count},
{"name", record.CampaignProductRecord.ProductRecord.Name},
{"description", record.CampaignProductRecord.ProductRecord.Details},
{"price", record.CampaignProductRecord.Price},
{"total_price", record.OrderRecord.TotalPrice}
};
message.AddRcptMergeVars(record.OrderRecord.Email, "FNAME", record.OrderRecord.FirstName);
message.AddRcptMergeVars(record.OrderRecord.Email, "LNAME", record.OrderRecord.LastName);
message.AddRcptMergeVars(record.OrderRecord.Email, "CITY", record.OrderRecord.City);
message.AddRcptMergeVars(record.OrderRecord.Email, "STATE", record.OrderRecord.State);
message.AddRcptMergeVars(record.OrderRecord.Email, "COUNTRY", record.OrderRecord.Country);
if (record.OrderRecord.TotalPriceWithPromo > 0.0)
{
message.AddRcptMergeVars(record.OrderRecord.Email, "TOTALPRICE", record.OrderRecord.TotalPriceWithPromo.ToString());
}
else
{
message.AddRcptMergeVars(record.OrderRecord.Email, "TOTALPRICE", record.OrderRecord.TotalPrice.ToString());
}
message.AddRcptMergeVars(record.OrderRecord.Email, "PRODUCTS", products);
}
开发者ID:omidam81,项目名称:Ver1.0,代码行数:26,代码来源:MandrillService.cs
示例14: ControlLine
public ControlLine(Module module, byte address, byte modes, ControlLineMode mode)
{
Module = module;
Address = address;
Modes = modes;
Mode = mode;
}
开发者ID:KonstantinKolesnik,项目名称:SmartHub,代码行数:7,代码来源:ControlLine.cs
示例15: Read
public override void Read(Module[] modules)
{
StringReader sr = new StringReader (csv);
int idx = 0;
string line = null;
while ((line = sr.ReadLine()) != null) {
int c = 0;
string[] ss = line.Split (',');
if (idx >= modules.Length)
continue;
Module m = modules [idx];
m.moduleName = ss [c++];
int num = (ss.Length - 1) / 4;
m.partials = new Module.Partial[num];
for (int i=0; i<num; i++) {
Module.Partial p = new Module.Partial ();
p.start = int.Parse (ss [c++]);
p.sColor = ToColor (int.Parse (ss [c++]));
p.end = int.Parse (ss [c++]);
p.eColor = ToColor (int.Parse (ss [c++]));
m.partials [i] = p;
}
idx++;
}
}
开发者ID:shinobushiva,项目名称:Takeakari-System,代码行数:32,代码来源:FileReaderModule.cs
示例16: CreateModule
/// <summary>
/// Builds the module for Serenity.
/// </summary>
/// <returns></returns>
public override Module CreateModule()
{
Module m = new Module("serenity");
m.Resources.AddRange(this.BuildResourceTree(ResourceNamespace));
return m;
}
开发者ID:cathode,项目名称:Serenity,代码行数:11,代码来源:__SerenityModuleFactory.cs
示例17: BuildModule
public Module BuildModule(Module module, Context context)
{
module.Context = context;
module.Response = this.responseFormatterFactory.Create(context);
return module;
}
开发者ID:gaochundong,项目名称:Happer,代码行数:7,代码来源:ModuleBuilder.cs
示例18: TranslatePoint
public TranslatePoint(Module connectedModule)
{
ConnectedModule = connectedModule;
XTranslation = DefaultTranslatePointX;
YTranslation = DefaultTranslatePointY;
ZTranslation = DefaultTranslatePointZ;
}
开发者ID:Earthmark,项目名称:Libnoise,代码行数:7,代码来源:TranslatePoint.cs
示例19: HtmlContentService
/// <summary>
/// Initializes a new instance of the <see cref="HtmlContentService" /> class.
/// </summary>
/// <param name="repository">The repository.</param>
/// <param name="unitOfWork">The unit of work.</param>
/// <param name="contentService">The content service.</param>
/// <param name="securityService">The security service.</param>
public HtmlContentService(IRepository repository, IUnitOfWork unitOfWork, Module.Root.Services.IContentService contentService, ISecurityService securityService)
{
this.repository = repository;
this.unitOfWork = unitOfWork;
this.contentService = contentService;
this.securityService = securityService;
}
开发者ID:k4gdw,项目名称:BetterCMS,代码行数:14,代码来源:HtmlContentService.cs
示例20: btnUpdate_Click
protected void btnUpdate_Click(object sender, EventArgs e)
{
string loginID = "1";
try
{
if (Session["Login"] == null) { Session["PreviousPage"] = HttpContext.Current.Request.Url.AbsoluteUri; Response.Redirect("../LoginPage.aspx"); }
loginID = ((Login)Session["Login"]).LoginID.ToString();
}
catch (Exception ex)
{ }
Module module = new Module();
module = ModuleManager.GetModuleByID(Int32.Parse(hfModuleID.Value));
Module tempModule = new Module();
tempModule.ModuleID = module.ModuleID;
tempModule.ModuleName = txtModuleName.Text;
tempModule.FolderName = txtFolderName.Text;
tempModule.DefaultURL = txtDefaultURL.Text;
tempModule.MenuOrder = decimal.Parse(txtMenuOrder.Text);
tempModule.AddedBy = loginID;
tempModule.AddedDate = DateTime.Now;
tempModule.UpdatedBy = loginID;
tempModule.UpdatedDate = DateTime.Now;
tempModule.RowStatusID = Int32.Parse(ddlRowStatus.SelectedValue);
bool result = ModuleManager.UpdateModule(tempModule);
showModuleGrid();
btnClear_Click(this, new EventArgs());
}
开发者ID:anam,项目名称:gp-HO,代码行数:29,代码来源:ModuleManagement.aspx.cs
注:本文中的Module类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论