本文整理汇总了C#中System.Utils类的典型用法代码示例。如果您正苦于以下问题:C# Utils类的具体用法?C# Utils怎么用?C# Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Utils类属于System命名空间,在下文中一共展示了Utils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddOrbOptionButton
public static void AddOrbOptionButton(Utils.Controls.Ribbon.Ribbon ribbon, AbstractCommand command)
{
var oob = new RibbonOrbOptionButtonEx(command);
ribbon.OrbDropDown.OptionItems.Add(oob);
CommandManager.Instance.Register(command);
}
示例2: serialize
public void serialize(Utils.Objects.Packet sender)
{
// --------------- //
// --- MINIMAL --- //
// --------------- //
sender.WriteInt(_character.Guid);
sender.WriteByte( (byte)_character.Level );
sender.WriteUTF(_character.Name);
// ------------ //
// --- LOOK --- //
// ------------ //
sender.WriteShort(1); // bones ID
sender.WriteShort(1); // nSkins
sender.WriteShort( (short)( (int)_character.Classe * 10 + (int)_character.Sexe) );
sender.WriteShort((short)5);
for (int i = 0; i < 5; ++i)
sender.WriteInt(_character.Colors[i] | (i + 1) * 0x1000000);
sender.WriteShort(1); // nScales
sender.WriteShort( (short)140 );
sender.WriteShort(0); // nSubEntities
// ------------ //
// --- BASE --- //
// ------------ //
sender.WriteByte( (byte)_character.Classe );
sender.WriteByte( (byte)_character.Sexe );
}
示例3: serialize
public static void serialize(Utils.Objects.Packet sender, List<int> path, Global.Character actor)
{
sender.WriteShort( (short)path.Count );
foreach (int cell in path)
sender.WriteShort((short)cell);
sender.WriteInt(actor.Guid);
}
示例4: SearchEmployeeOp
public List<EmployeeDto> SearchEmployeeOp(Utils.AppCommand appComandUser)
{
List<EmployeeDto> allEmployeesList = null;
switch (appComandUser)
{
case Utils.AppCommand.InvalidInput:
ErrorOp();
break;
case Utils.AppCommand.OrderByName:
allEmployeesList = _employeeAppService.GetAllEmployeesBy("FirstName");
PrintDataTable(allEmployeesList);
break;
case Utils.AppCommand.OrderByPosition:
allEmployeesList = _employeeAppService.GetAllEmployeesBy("Position");
PrintDataTable(allEmployeesList);
break;
case Utils.AppCommand.OrderByLastName:
allEmployeesList = _employeeAppService.GetAllEmployeesBy("LastName");
PrintDataTable(allEmployeesList);
break;
}
return allEmployeesList;
}
示例5: ADTChunk
/// <summary>
/// Initializes all parameters of the chunk without performing any load operation.
/// </summary>
/// <param name="parent">The parent large terrain file of this chunk</param>
/// <param name="baseFile">The MPQ-file which contains the general information about placement and doodads</param>
/// <param name="texFile">The MPQ-stream which contains all the texture related information (MCLY, MCAL, ...)</param>
/// <param name="offset">The offset inside baseFile and texFile where this chunks MCNK is located</param>
public ADTChunk(ADTFile parent, Stormlib.MPQFile baseFile, Utils.StreamedMpq texFile, ChunkOffset offset)
{
mFile = baseFile;
mTexFile = texFile;
mOffset = offset;
mParent = parent;
}
示例6: serialize
public static void serialize(Utils.Objects.Packet sender)
{
int wrapper1 = 0;
Utils.BooleanByteWrapper.setFlag(ref wrapper1, 0, false); // cantBeAggressed
Utils.BooleanByteWrapper.setFlag(ref wrapper1, 1, false); // cantBeChallenged
Utils.BooleanByteWrapper.setFlag(ref wrapper1, 2, false); // cantTrade
Utils.BooleanByteWrapper.setFlag(ref wrapper1, 3, false); // cantBeAttackedByMutant
Utils.BooleanByteWrapper.setFlag(ref wrapper1, 4, false); // cantRun
Utils.BooleanByteWrapper.setFlag(ref wrapper1, 5, false); // forceSlowWalk
Utils.BooleanByteWrapper.setFlag(ref wrapper1, 6, false); // cantMinimize
Utils.BooleanByteWrapper.setFlag(ref wrapper1, 7, false); // cantMove
sender.WriteByte((byte)wrapper1);
int wrapper2 = 0;
Utils.BooleanByteWrapper.setFlag(ref wrapper2, 0, false); // cantAggress
Utils.BooleanByteWrapper.setFlag(ref wrapper2, 1, false); // cantChallenge
Utils.BooleanByteWrapper.setFlag(ref wrapper2, 2, false); // cantExchange
Utils.BooleanByteWrapper.setFlag(ref wrapper2, 3, false); // cantAttack
Utils.BooleanByteWrapper.setFlag(ref wrapper2, 4, false); // cantChat
Utils.BooleanByteWrapper.setFlag(ref wrapper2, 5, false); // cantBeMerchant
Utils.BooleanByteWrapper.setFlag(ref wrapper2, 6, false); // cantUseObject
Utils.BooleanByteWrapper.setFlag(ref wrapper2, 7, false); // cantUseTaxCollector
sender.WriteByte((byte)wrapper2);
int wrapper3 = 0;
Utils.BooleanByteWrapper.setFlag(ref wrapper3, 0, false); // cantUseInteractive
Utils.BooleanByteWrapper.setFlag(ref wrapper3, 1, false); // cantSpeakToNPC
Utils.BooleanByteWrapper.setFlag(ref wrapper3, 2, false); // cantChangeZone
Utils.BooleanByteWrapper.setFlag(ref wrapper3, 3, false); // cantAttackMonster
Utils.BooleanByteWrapper.setFlag(ref wrapper3, 4, false); // cantWalk8Directions
sender.WriteByte((byte)wrapper3);
}
示例7: OfflineLogForm
public OfflineLogForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core, Utils.API.GeocachingLiveV6 client) :
this()
{
_core = core;
_client = client;
_plugin = plugin;
this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDGEOCACHES);
this.label5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODE);
this.button6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADD);
this.button7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDALLSELECTED);
this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OFFLINELOGS);
this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GEOCACHES);
this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTYPE);
this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGDATE);
this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTEXT);
this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGSELECTED);
this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGALL);
this.button8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OK);
this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGONLINE);
int[] ids = new int[] { 2, 3, 4, 7, 45 };
comboBoxLogType1.SetLogTypes(core, (from Framework.Data.LogType l in core.LogTypes join a in ids on l.ID equals a select l).ToList());
if (core.ActiveGeocache != null)
{
textBox2.Text = core.ActiveGeocache.Code;
}
button7.Enabled = Utils.DataAccess.GetSelectedGeocaches(core.Geocaches).Count > 0;
loadOfflineLogs();
}
示例8: serialize
public static void serialize(Utils.Objects.Packet sender, int accountId)
{
sender.WriteInt(accountId);
sender.WriteBool(false); // tutorial available
sender.WriteShort(8191); // breeds visible
sender.WriteShort(2047); // breeds available
}
示例9: serialize
public static void serialize(Utils.Objects.Packet sender)
{
int nFlags = 0;
sender.WriteShort((short)nFlags);
for (int i = 0; i < nFlags; ++i)
sender.WriteInt(0);
}
示例10: Read
/// <summary>
/// 反序列化
/// </summary>
/// <param name="formatter"></param>
public void Read(Utils.IFormatter formatter)
{
this.ProtocolVersion = formatter.ReadInt32();
this.SessionTimeOut = formatter.ReadInt32();
this.SessionID = formatter.ReadInt64();
this.SessionPassword = formatter.ReadBuffer();
}
示例11: Write
/// <summary>
/// write
/// </summary>
/// <param name="formatter"></param>
public void Write(Utils.IFormatter formatter)
{
formatter.Write(this.RelativeZxid);
formatter.Write(this.DataWatches);
formatter.Write(this.ExistWatches);
formatter.Write(this.ChildWatches);
}
示例12: serialize
public void serialize(Utils.Objects.Packet sender)
{
// MINIMAL INFO
sender.WriteInt(Member.Guid);
sender.WriteByte((byte)Member.Level);
sender.WriteUTF(Member.Name);
// LOOK
sender.WriteShort(1); // bones ID
sender.WriteShort(1); // nSkins
sender.WriteShort((short)((int)Member.Classe * 10 + (int)Member.Sexe));
sender.WriteShort((short)5);
for (int i = 0; i < 5; ++i)
sender.WriteInt(Member.Colors[i] | (i + 1) * 0x1000000);
sender.WriteShort(1); // nScales
sender.WriteShort((short)140);
sender.WriteShort(0); // nSubEntities
// PARTY
sender.WriteInt(Member.Characteristics.lifePoints);
sender.WriteInt(Member.Characteristics.maxLifePoints);
sender.WriteShort((short)Member.Characteristics.prospecting.Total);
sender.WriteByte(0); // regenRate
sender.WriteShort((short)Member.Characteristics.initiative.Total);
sender.WriteBool(false); // pvp enabled
sender.WriteByte(0); // alignment side
}
示例13: VisitMyFindsForm
public VisitMyFindsForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core): this()
{
_plugin = plugin;
_core = core;
_context = SynchronizationContext.Current;
if (_context == null)
{
_context = new SynchronizationContext();
}
dateTimePicker1.Value = new DateTime(2000, 1, 1);
this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_EXPLANATION);
this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_EXPLANATIONTXT);
this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTTRACKABLE);
this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TRACKINGNUMBER);
this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CHECK);
this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OR);
this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GETOWNED);
this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ICON);
this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODE);
this.listView1.Columns[2].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME);
this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AVAILABLELOGS);
this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MISSING);
this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PRESENT);
this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GETALLLOGS);
this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTEXT);
this.label9.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_BETWEEN);
this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DOLOG);
this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MESSAGES);
}
示例14: serialize
public void serialize(Utils.Objects.Packet sender)
{
sender.WriteInt(_target.Guid);
////// ENTITY LOOK //////
sender.WriteShort(1); // bones ID
sender.WriteShort(1); // nSkins
sender.WriteShort( (short)( (int)_target.Classe * 10 + (int)_target.Sexe) );
sender.WriteShort((short)5);
for (int i = 0; i < 5; ++i)
sender.WriteInt(_target.Colors[i] | (i + 1) * 0x1000000);
sender.WriteShort(1); // nScales
sender.WriteShort( (short)140 );
sender.WriteShort(0); // nSubEntities
////// ENTITY DISPOSITION
sender.WriteShort((short)Types.game.context.EntityDispositionInformations.ProtocolID);
_target.Disposition.serialize(sender);
}
示例15: UpdatesForm
public UpdatesForm(Languages.Language language, Utils.AppSettings settings)
{
// Windows Forms designer support.
InitializeComponent();
// Show first panel
ShowPanel(panChecking);
// Setup settings reference
Settings = settings;
// Setup language for the form
Lang = language;
Text = Lang.Get("updates");
btnClose.Text = Lang.Get("close");
// Language setup
lblChecking.Text = Lang.Get("updates_checking") + "...";
lblUpdated.Text = Lang.Get("updates_updated");
lblError.Text = Lang.Get("updates_error");
chkAuto.Text = Lang.Get("updates_auto");
// Auto check
chkAuto.Checked = (Settings.Get("updates_auto").ToString() == "1");
chkAuto.CheckedChanged += delegate { Settings.Set("updates_auto", chkAuto.Checked ? 1 : 0); };
}