本文整理汇总了C#中System.Util类的典型用法代码示例。如果您正苦于以下问题:C# Util类的具体用法?C# Util怎么用?C# Util使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Util类属于System命名空间,在下文中一共展示了Util类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
/// <summary>
/// This adds a LinkedList of objects
/// </summary>
/// <param name="actorList">The list of objects</param>
public void Add(Util.LinkedList actorList)
{
foreach(DXMAN.Base.xRenderable obj in xObjects)
{
Add(obj);
}
}
示例2: ValidOutcome
/// <summary>
/// This method determines whether the outcome is valid for the preceding sequence.
/// This can be used to implement constraints on what sequences are valid.
/// </summary>
/// <param name="outcome">
/// The outcome.
/// </param>
/// <param name="sequence">
/// The preceding sequence of outcome assignments.
/// </param>
/// <returns>
/// true if the outcome is valid for the sequence, false otherwise.
/// </returns>
protected internal override bool ValidOutcome(string outcome, Util.Sequence sequence)
{
if (outcome.StartsWith("I-"))
{
string[] tags = sequence.Outcomes.ToArray();
int lastTagIndex = tags.Length - 1;
if (lastTagIndex == - 1)
{
return (false);
}
else
{
string lastTag = tags[lastTagIndex];
if (lastTag == "O")
{
return false;
}
if (lastTag.Substring(2) != outcome.Substring(2))
{
return false;
}
}
}
return true;
}
示例3: FileSystemRepository
public FileSystemRepository(ILogger logger, ISettings settings, IEncryption encryption, Util.Util util)
{
_logger = logger;
_settings = settings;
_encryption = encryption;
_util = util;
}
示例4: DHSha
public DHSha(HashAlgorithm algorithm, Util.Func<Protocol, string> getName) {
if (algorithm == null) throw new ArgumentNullException("algorithm");
if (getName == null) throw new ArgumentNullException("getName");
GetName = getName;
Algorithm = algorithm;
}
示例5: getGraph
public System.Windows.Controls.Image getGraph(Util.TimeType duration)
{
if (currentSearch == null)
return null;
try
{
string query = currentSearch + CHART_TIME;
query += timeFilter[duration];
Uri url = new Uri(CHART_BASE + query);
//Debugging
//Console.Write(CHART_BASE + query);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
//See the response that yahoo creates
WebResponse response = request.GetResponse();
Stream sr = response.GetResponseStream();
System.Drawing.Image chart = System.Drawing.Image.FromStream(sr);
//Debugging
//chart.Save("h:\\chartTest" + query + ".bmp");
sr.Close();
return convertDrawingImgToWindowImg(chart);
}
catch (Exception)
{
MessageBox.Show("Error downloading the graph.");
return null;
}
}
示例6: Search
public List<INVITATION> Search(INVITATION Entity, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, Util.SortDirection SortDirection)
{
var result = Context.INVITATION.AsQueryable();
if (Entity != null)
{
if (Entity.ID != 0)
{
result = result.Where(b => b.ID == Entity.ID);
}
if (Entity.CustomerID.HasValue)
{
result = result.Where(i => i.CustomerID == Entity.CustomerID);
}
if (!String.IsNullOrEmpty(Entity.InvitedMail))
{
result = result.Where(i => i.InvitedMail.Contains(Entity.InvitedMail));
}
if (Entity.RegistrationDate != null)
{
result = result.Where(i => i.RegistrationDate == (Entity.RegistrationDate));
}
}
TotalRecords = result.Count();
GenericSorterCaller<INVITATION> sorter = new GenericSorterCaller<INVITATION>();
result = sorter.Sort(result, string.IsNullOrEmpty(OrderExp) ? DEFAULT_ORDER_EXP : OrderExp, SortDirection);
// pagination
return result.Skip(PageIndex * PageSize).Take(PageSize).ToList();
}
示例7: SyncServerMessage
public int SyncServerMessage(Util.DBHelper db)
{
var shutdownDoc = db.GetDocument("Server", "Shutdown");
if (shutdownDoc == null)
{
shutdownDoc = db.CreateDocument("Server", "Shutdown",
new BsonDocument()
{
{ "Flag", false },
{ "Message", "" }
});
}
else
{
var flag = shutdownDoc["Flag"].AsBoolean;
var msg = shutdownDoc["Message"].AsString;
this.ShutdownFlag = flag;
this.ShutdownMessage = msg;
// 메세지가 있고 이전 메세지와 다르면 이벤트 발생
if (msg.Length > 0 && m_prevShutMsg != msg && this.WhenShutdownMessageChanged != null)
this.WhenShutdownMessageChanged(msg, flag);
m_prevShutMsg = msg;
}
return 0;
}
示例8: World
public World(Dictionary<String, Block> bl, String n)
{
this.name = n;
this.blocks = bl;
this.util = new Util();
this.xLength = (int)(Game1.graphics.GraphicsDevice.Viewport.Bounds.Width / 32);
this.yLength = (int)(Game1.graphics.GraphicsDevice.Viewport.Bounds.Height / 32);
}
示例9: MapDataHeight
public MapDataHeight(Util.Map.Location map)
{
this.map = map;
this.file = WorldConfig.FILE_HEIGHT;
byte[] bytes = Load();
if (bytes!=null) Parse(bytes);
}
示例10: Button
public Button(string text, Util.Rect rect, Font font, VisualRectangle vsSelected, VisualRectangle vsUnselected)
{
this.font = font;
this.vsSelected = vsSelected;
this.vsUnselected = vsUnselected;
this.rect = rect;
this.text = text;
}
示例11: UserControl_Loaded
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
util = new Util();
DatabaseConnection dbc = new DatabaseConnection();
c = dbc.getConnection();
cmd = c.CreateCommand();
updatePane();
}
示例12: Mention
public Mention(Util.Span span, Util.Span headSpan, int entityId, IParse parse, string extentType)
{
mSpan = span;
mHeadSpan = headSpan;
mId = entityId;
mType = extentType;
mParse = parse;
}
示例13: MapTypeInfo
public MapTypeInfo(Type type, Util.AttributeExtCollection attributes, bool isFwdDeclPossible) {
if ((type == null) || (attributes == null)) {
throw new ArgumentException("type and attributes must be != null");
}
m_type = type;
m_attributes = attributes;
m_isFwdDeclPossible = isFwdDeclPossible;
}
示例14: Process
public override void Process(Util.Commands.CmdTrigger<ToolCmdArgs> trigger)
{
using (var wowFile = new WoWFile(trigger.Text.NextWord()))
{
GameObjectTypeExtractor.Extract(wowFile);
}
//base.Process(trigger);
}
示例15: GetEffect
protected override Effect GetEffect(Util.FastBitmap source)
{
return new ColorTintEffect
{
Amount = Amount/100.0,
RequiredColor = Color
};
}