本文整理汇总了C#中ContextType类的典型用法代码示例。如果您正苦于以下问题:C# ContextType类的具体用法?C# ContextType怎么用?C# ContextType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ContextType类属于命名空间,在下文中一共展示了ContextType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParserContext
public ParserContext(bool objectsAllowed, LineTypes.Property[] properties, LineTypes.Component[] components, ContextType type)
{
this.ObjectsAllowed = objectsAllowed;
this.Properties = properties;
this.Components = components;
this.Type = type;
}
示例2: getConfig
/// <summary>
/// Get Configuration data for selected context.
/// </summary>
/// <param name="context">Context for using.</param>
/// <returns></returns>
public ISolutionEvents getConfig(ContextType context)
{
if(configs.ContainsKey(context)) {
return configs[context];
}
return new SolutionEvents();
}
示例3: WriteContextInitialization
public void WriteContextInitialization(ContextType contextType)
{
_transport.SendOperation(OperationCode.SetupContext, new Dictionary<byte, object>
{
[(byte) OperationParameterCode.ContextType] = contextType
});
}
示例4: GetContext
public IFiber GetContext(ContextType contextType)
{
IFiber fiber = null;
switch (contextType)
{
case ContextType.New:
fiber = new PoolFiber();
fiber.Start();
//poolfibers.Add(fiber);
break;
case ContextType.Gui:
//if(formFiber == null)
//{
// if (marshaler == null) marshaler = new MarshalingControl();
// formFiber = new FormFiber(marshaler, new BatchAndSingleExecutor());
// formFiber.Start();
//}
//fiber = formFiber;
fiber = GetStartedGuiFiber();
break;
}
return fiber;
}
示例5: JsonReaderContext
internal JsonReaderContext(
JsonReaderContext parentContext,
ContextType contextType
) {
this.parentContext = parentContext;
this.contextType = contextType;
}
示例6: getUserConfig
/// <summary>
/// Get User-Configuration data for selected context.
/// </summary>
/// <param name="context">Context for using.</param>
/// <returns></returns>
public IUserData getUserConfig(ContextType context)
{
if(userConfigs.ContainsKey(context)) {
return userConfigs[context];
}
return new UserData();
}
示例7: BsonBinaryReaderContext
// constructors
internal BsonBinaryReaderContext(BsonBinaryReaderContext parentContext, ContextType contextType, int startPosition, int size)
{
this.parentContext = parentContext;
this.contextType = contextType;
this.startPosition = startPosition;
this.size = size;
}
示例8: GetDateFromDay
/// <summary>
/// This method accepts a day of the week and returns the corresponding date depending on what the preposition is.
/// </summary>
/// <param name="preposition">The prefix specifying how many weeks to add to the next found day.</param>
/// <param name="desiredDay">The required day.</param>
/// <returns>Date on which the <var>preposition</var> <var>desiredDay</var> is found.</returns>
private static DateTime GetDateFromDay(ContextType preposition, DayOfWeek desiredDay)
{
DateTime startDate;
DateTime todayDate = DateTime.Today;
int daysToAdd = GetDaysToAdd(todayDate.DayOfWeek, desiredDay);
switch (preposition)
{
case ContextType.CURRENT:
break;
case ContextType.NEXT:
Logger.Info("preposition is NEXT", "GetDateFromDay::TokenDay");
daysToAdd += 7;
break;
case ContextType.FOLLOWING:
Logger.Info("preposition is FOLLOWING", "GetDateFromDay::TokenDay");
daysToAdd += 14;
break;
default:
Logger.Error("Fell through preposition switch statement.", "GetDateFromDay::TokenDay");
Debug.Assert(false, "Fell through switch statement in GetDateFromDay!");
break;
}
startDate = todayDate.AddDays(daysToAdd);
Logger.Info("Updated startDate", "GetDateFromDay::TokenDay");
return startDate;
}
示例9: BsonDocumentReaderContext
// used by Clone
private BsonDocumentReaderContext(BsonDocumentReaderContext parentContext, ContextType contextType, BsonDocument document, BsonArray array, int index)
{
this.parentContext = parentContext;
this.contextType = contextType;
this.document = document;
this.array = array;
this.index = index;
}
示例10: NotifierRule
public NotifierRule(HotItem item, RuleType type, int value, ContextType contextType, INotificationHost host)
{
this.Host = host;
this.Money = new Money(0, 0, value) { Name = "Rule" };
this.Item = item;
this.SelectedRuleType = type;
this.ContextType = contextType;
}
示例11: ChangePasswordController
public ChangePasswordController()
{
_domainDisplayName = ConfigurationManager.AppSettings["domainDisplayName"];
_contextType = (ContextType)Enum.Parse(typeof(ContextType), ConfigurationManager.AppSettings["contextType"], true);
_domain = ConfigurationManager.AppSettings["domain"];
_container = ConfigurationManager.AppSettings["container"];
_identityType = (IdentityType)Enum.Parse(typeof(IdentityType), ConfigurationManager.AppSettings["identityType"], true);
}
示例12: BsonDocumentReaderContext
// used by Clone
private BsonDocumentReaderContext(BsonDocumentReaderContext parentContext, ContextType contextType, BsonDocument document, BsonArray array, int index)
{
_parentContext = parentContext;
_contextType = contextType;
_document = document;
_array = array;
_index = index;
}
示例13: DurableInstanceContextReplyChannel
public DurableInstanceContextReplyChannel(ChannelManagerBase channelManager,
ContextType contextType,
IReplyChannel innerChannel)
: base(channelManager, innerChannel)
{
this.contextType = contextType;
this.innerReplyChannel = innerChannel;
}
示例14: ContextSpan
public ContextSpan(int start, int end, Context context, Context parentContext, ContextType type)
{
Start = start;
End = end;
Context = context;
ParentContext = parentContext;
Type = type;
}
示例15: BsonDocumentWriterContext
// constructors
internal BsonDocumentWriterContext(
BsonDocumentWriterContext parentContext,
ContextType contextType,
BsonDocument document)
{
_parentContext = parentContext;
_contextType = contextType;
_document = document;
}