本文整理汇总了C#中Modes类的典型用法代码示例。如果您正苦于以下问题:C# Modes类的具体用法?C# Modes怎么用?C# Modes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Modes类属于命名空间,在下文中一共展示了Modes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configure
private void Configure()
{
var validLabels = new Regex("^(data|css):");
if (validLabels.IsMatch(Parameters[0]))
{
string[] subParm = Parameters[0].Split(':');
string methodName = subParm[0];
if (methodName == "data")
{
Mode = Modes.Data;
}
else if (methodName == "css")
{
Mode = Modes.Css;
}
else
{
throw new ArgumentException("Unknown mode for regex pseudoselector.");
}
Property = subParm[1];
}
else
{
Mode = Modes.Attr;
Property = Parameters[0];
}
// The expression trims whitespace the same way as the original
// Trim() would work just as well but left this way to demonstrate
// the CsQuery "RegexReplace" extension method
Expression = new Regex(Parameters[1].RegexReplace(@"^\s+|\s+$", ""), RegexOptions.IgnoreCase | RegexOptions.Multiline);
}
示例2: Streaming
/**
* Constructor.
*/
public Streaming()
{
log.Trace("Creating streaming server");
this.livePublishingPoint = null;
this.onDemandPublishingPoint = null;
this.onDemandState = State.Stopped;
this.liveState = State.Stopped;
this.mode = Modes.None;
this.wmServer = new WMSServerClass();
// Remove existing publishing points
for (int i = 0; i < this.wmServer.PublishingPoints.length; ++i)
{
log.Trace("Existing publishing points = " + this.wmServer.PublishingPoints.length);
if (this.wmServer.PublishingPoints[i].Type == WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST ||
this.wmServer.PublishingPoints[i].Type == WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_ON_DEMAND)
{
try
{
this.wmServer.PublishingPoints.Remove(i);
i--;
}
catch (Exception e)
{
log.ErrorException("Exception raised while removing publishing point: " + e.Message, e);
}
}
}
}
示例3: getInternetURL
protected override string getInternetURL(int x, int y, int zoom, Modes mode, int server_balance)
{
string url;
int max = 1 << zoom;
switch (mode)
{
case Modes.MAP: // Microsoft MAP http://r2.ortho.tiles.virtualearth.net/tiles/r033110?g=81&shading=hill
url = "http://r"+server_balance+".ortho.tiles.virtualearth.net/tiles/r";
url += Pos2StrMicrosoft(x, y, zoom) + ".png?g=81&shading=hill";
break;
case Modes.SAT: // Microsoft SAT http://a2.ortho.tiles.virtualearth.net/tiles/a0.jpeg?g=81
url = "http://a" + server_balance + ".ortho.tiles.virtualearth.net/tiles/a";
url += Pos2StrMicrosoft(x, y, zoom) + ".jpeg?g=81";
break;
case Modes.MAP_SAT: // Microsoft MAP+OVL! http://h2.ortho.tiles.virtualearth.net/tiles/h0.jpeg?g=81
url = "http://h" + server_balance + ".ortho.tiles.virtualearth.net/tiles/h";
url += Pos2StrMicrosoft(x, y, zoom) + ".jpeg?g=81";
break;
default:
url = "";
break;
}
return url;
}
示例4: HardMode
public HardMode(Modes mode, Random rnd, City[] cities)
{
this.mode = mode;
this.rnd = rnd;
this.cities = cities;
this.removedEdges = new HashSet<Edge>();
}
示例5: ReadArguments
private static void ReadArguments(string[] args)
{
if (args.Length >= 3 && args[0] == "refill")
{
_mode = Modes.Refill;
_refillName = args[1];
_refillAmount = args[2];
}
else if (args.Length > 0 && args[0] == "spend")
{
_mode = Modes.Spend;
}
else
{
Console.Error.WriteLine(@"Usage:
refill <name> <amount>
Reader will save name and amount to any cards inserted.
spend
Once a card is inserted, ""<name>/<amount>"" is sent to stdout.
The reader waits for a line on stdin - if this line has the form ""charge/<amount>"", the amount is charged from the card.
No validation is performed; this must be done on the client side.");
Environment.Exit(2);
}
}
示例6: ImageQuery
public ImageQuery(int x, int y, int zoom, Modes mode)
{
this.x = x;
this.y = y;
this.zoom = zoom;
this.mode = mode;
}
示例7: putImage
public void putImage(int x, int y, int zoom, Modes mode, Bitmap img)
{
int older = 0, i;
bool encontrado = false;
try
{
if (img != null && img.Height * img.Width > 0)
{
for (i = 0; i < cacheSize && !encontrado; i++)
{
if (cachelastaccess[i] < cachelastaccess[older])
older = i;
if (cacheQuery[i].x == x && cacheQuery[i].y == y && cacheQuery[i].zoom == zoom && cacheQuery[i].mode.Equals(mode))
{
cachelastaccess[i] = cachetimer;
cacheImage[i] = img;
encontrado = true;
}
}
if (!encontrado)
{
cacheImage[older] = img;
cachelastaccess[older] = cachetimer;
cacheQuery[older].x = x;
cacheQuery[older].y = y;
cacheQuery[older].zoom = zoom;
cacheQuery[older].mode = mode;
}
}
}
catch (Exception) { Console.WriteLine("Rafa"); }
}
示例8: Editor
public Editor(Viewport view, ContentManager content, int screenWidth, int screenHeight)
{
mode = Modes.View;
currentLevel = new Level(new Vector2(100, 100), "");
currentLevel.populateWithGrid(content);
Width = 32 * 100;
Height = 32 * 100;
EditorCamera = new EditorCamera(view, Width, Height, 1.0f);
Margin = 2; // MAGIC NUMBERS YAY
Layer = 2;
initDialogBoxes(content, screenWidth, screenHeight);
CursorPosition = Vector2.Zero;
TileText = new InfoText(content, "Tilesheet", new Vector2(370, -315)); // again, MAGIC NUMBERS!
SelectedTile = null;
HelpDiag = false;
}
示例9: GetModeChanges
private static Modes GetModeChanges(string[] parameterWords)
{
var modes = new Modes();
var modeWord = parameterWords[0];
var currentModifier = modeWord[0];
for (var i = 1; i < modeWord.Length; i++)
{
if (modeWord[i] == '+' || modeWord[i] == '-')
{
if (modeWord[i] != currentModifier)
{
currentModifier = modeWord[i];
}
}
else
{
var isOn = currentModifier == '+';
var mode = new Mode() { Identifier = modeWord[i].ToString(), IsOn = isOn };
modes.Add(mode);
}
}
return modes;
}
示例10: EbayBaseRepository
public EbayBaseRepository(IUnitOfWork context, Modes mode, SiteCodeType siteCode)
: base(context)
{
if (context == null) { throw new NotImplementedException("IUnitOfWork"); }
_mode = mode;
_siteCode = siteCode;
}
示例11: hasMode
public bool hasMode(Modes m)
{
Modes[] modos = getModes();
for (int i = 0; i < modos.Length; i++)
if (modos[i] == m)
return true;
return false;
}
示例12: RelativeVector
/// <summary>
/// value is relative to unit's position
/// </summary>
/// <param name="RelativeUnit">unit to be used as a pivot</param>
/// <param name="Angle">angle between pivot.forward and direction from pivot to this vector</param>
/// <param name="Dist">dist from pivot to this vector</param>
public RelativeVector(IUnit RelativeUnit, float Angle, float Dist)
{
relativeUnit1 = RelativeUnit;
dist = Dist;
angle = Angle;
rotationOnAngle = Matrix.CreateRotation(angle);
mode = Modes.UnitsSideAndDist;
}
示例13: ScriptEngine
public ScriptEngine()
{
_inDo = false;
_mode = Modes.Simple;
ExecutionMode = ExecutionModes.Normal;
CurrentScript = new Script();
CurrentDecision = new DecisionOrList();
}
示例14: NotificationBattle
private void NotificationBattle(Modes.BattleResult battleResult)
{
AMing.Plugins.Core.GenericMessager.Current.SendToNotification(new Plugins.Core.Models.MessageItem
{
Title = string.Format("战斗结束 {0}", battleResult.WinRank),
Content = battleResult.GetShip == null ? "没有捞到船" : string.Format("捕获到野生的 {0}", battleResult.GetShip.Name)
});
}
示例15: RequestModeChange
public void RequestModeChange(Modes requestedMode, IView viewRegisterRequest)
{
if (this.registeredViews != null && this.registeredViews.Contains(viewRegisterRequest))
{
modeChangeRequest = true;
modeRequested = requestedMode;
}
}