本文整理汇总了C#中Mode类的典型用法代码示例。如果您正苦于以下问题:C# Mode类的具体用法?C# Mode怎么用?C# Mode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Mode类属于命名空间,在下文中一共展示了Mode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DisplayHelp
// returns whether help was displayed
static void DisplayHelp(Mode mode)
{
if (options.Mode == Mode.NotSpecified)
{
DisplayUsage();
}
else if (options.Mode == Mode.Install)
{
ToolConsole.WriteLine(SR.GetString(SR.HelpUsage4, Cmd.Install, Abbr.Install));
ToolConsole.WriteLine(SR.GetString(SR.HelpUsageExamples));
ToolConsole.WriteLine(" ComSvcConfig.exe /install /application:TestApp /contract:* /hosting:complus");
ToolConsole.WriteLine(" ComSvcConfig.exe /install /application:TestApp /contract:TestComponent,ITest /hosting:was /webDirectory:testdir /mex");
ToolConsole.WriteLine(" ComSvcConfig.exe /install /application:TestApp /contract:TestComponent,ITest.{Method1} /hosting:was /webDirectory:testdir /mex");
ToolConsole.WriteLine(" ComSvcConfig.exe /install /application:TestApp /contract:TestComponent,ITest.{Method2,Method3} /hosting:was /webDirectory:testdir /mex");
}
else if (options.Mode == Mode.Uninstall)
{
ToolConsole.WriteLine(SR.GetString(SR.HelpUsage5, Cmd.Uninstall, Abbr.Uninstall));
ToolConsole.WriteLine(SR.GetString(SR.HelpUsageExamples));
ToolConsole.WriteLine(" ComSvcConfig.exe /uninstall /application:OnlineStore /contract:* /hosting:complus");
ToolConsole.WriteLine(" ComSvcConfig.exe /uninstall /application:OnlineStore /contract:* /hosting:was /mex");
ToolConsole.WriteLine(" ComSvcConfig.exe /uninstall /application:OnlineStore /contract:TestComponent,ITest.{Method1} /hosting:was /mex");
ToolConsole.WriteLine(" ComSvcConfig.exe /uninstall /application:OnlineStore /contract:TestComponent,ITest.{Method2,Method3} /hosting:was /mex");
}
else if (options.Mode == Mode.List)
{
ToolConsole.WriteLine(SR.GetString(SR.HelpUsage6, Cmd.List, Abbr.List));
ToolConsole.WriteLine(SR.GetString(SR.HelpUsageExamples));
ToolConsole.WriteLine(" ComSvcConfig.exe /list");
ToolConsole.WriteLine(" ComSvcConfig.exe /list /hosting:complus");
ToolConsole.WriteLine(" ComSvcConfig.exe /list /hosting:was");
}
}
开发者ID:JianwenSun,项目名称:cc,代码行数:36,代码来源:Tool.cs
示例2: CreateTextFrame
public GuideFrame CreateTextFrame(Mode mode, FrameType type )
{
Bounds newBounds = contentBounds.Clone();
newBounds.top = GetNextTop();
newBounds.height = 10;
TextFrame textFrame = page.TextFrames.Add(miss, idLocationOptions.idAtEnd, miss);
textFrame.GeometricBounds = newBounds.raw;
textFrame.TextFramePreferences.FirstBaselineOffset = idFirstBaseline.idLeadingOffset;
if (mode==Mode.TwoColumns)
{
textFrame.TextFramePreferences.TextColumnCount = 2;
}
//$.global.textFrames.push( myTextFrame );
GuideFrame frame = new GuideFrame(textFrame, this.guide, this, mode, type);
frame.bounds = newBounds;
//currentFrame = frame;
frames.Add(frame);
//currentMode = mode;
return frame;
}
开发者ID:jonnermut,项目名称:thesarvo,代码行数:27,代码来源:GuidePage.cs
示例3: ComboChoiceWindow
/// <summary>
/// Initializes a new instance of the <see cref="ComboChoiceWindow" /> class.
/// </summary>
/// <param name="mode">The Mode enum instance which determines what choices should be offered.</param>
/// <param name="index">The default choice.</param>
public ComboChoiceWindow(Mode mode, int index = 0)
: this()
{
_mode = mode;
if (mode == Mode.Versus)
{
label1.Content = "Pick the two teams";
cmbSelection2.Visibility = Visibility.Visible;
foreach (var kvp in MainWindow.TST)
{
cmbSelection1.Items.Add(kvp.Value.DisplayName);
cmbSelection2.Items.Add(kvp.Value.DisplayName);
}
}
else if (mode == Mode.Division)
{
label1.Content = "Pick the new division for the team:";
cmbSelection2.Visibility = Visibility.Hidden;
foreach (Division div in MainWindow.Divisions)
{
Conference conf = MainWindow.Conferences.Find(conference => conference.ID == div.ConferenceID);
cmbSelection1.Items.Add(string.Format("{0}: {1}", conf.Name, div.Name));
}
}
cmbSelection1.SelectedIndex = index;
cmbSelection2.SelectedIndex = index != 0 ? 0 : 1;
}
开发者ID:rainierpunzalan,项目名称:nba-stats-tracker,代码行数:33,代码来源:ComboChoiceWindow.xaml.cs
示例4: MainWindow
public MainWindow(Mode Panel)
{
SetStyle(ControlStyles.ResizeRedraw, true);
this.DoubleBuffered = true;
InitializeComponent();
ListView.CheckForIllegalCrossThreadCalls = false;
this.CenterToScreen();
if (Panel == Mode.Encryption)
{
LoadEncryption(null);
}
else if (Panel == Mode.Decryption)
{
LoadDecryption(null);
}
else if (Panel == Mode.Options)
{
LoadHistory();
LoadOptions();
}
else
{
LoadUserInterface();
}
}
开发者ID:autarchprinceps,项目名称:Chiave,代码行数:26,代码来源:MainWindow.cs
示例5: GodMode
public GodMode()
{
if (!Keys.TryParse(IniAPI.ReadIni("GodMode", "Key", "G", writeIt: true), out key)) key = Keys.G;
if (!Mode.TryParse(IniAPI.ReadIni("GodMode", "Mode", "Off", writeIt: true), out mode)) mode = Mode.Off;
Color green = Color.Green;
Action update = () =>
{
IniAPI.WriteIni("GodMode", "Mode", mode.ToString());
Main.NewText("God Mode: " + mode, green.R, green.G, green.B, false);
};
Loader.RegisterHotkey(() =>
{
if (mode == Mode.God) mode = Mode.Off;
else mode++;
update();
}, key);
Loader.RegisterHotkey(() =>
{
if (mode == Mode.Off) mode = Mode.God;
else mode--;
update();
}, key, shift: true);
}
开发者ID:Reuged,项目名称:TerrariaPatcher,代码行数:26,代码来源:GodMode.cs
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//Init Data
EnumUtil.BindEnumData2ListControl<DashPageLayout>(this.rdlLayout, false);
EnumUtil.BindEnumData2ListControl<DashPageType>(this.rdlType, false);
EnumUtil.BindEnumData2ListControl<DashStatus>(this.rdlStatus, false);
//Init Controls Data before do query
using (_session = new Session())
{
_actionMode = WebUtil.GetActionMode(this);
if (_actionMode == Mode.Edit)
{
LoadData();
}
}
}
if (Request["return"] != null)
{
this.toolbarup["Return"].NavigateUrl = Request["return"];
this.toolbarbottom["Return"].NavigateUrl = Request["return"];
}
}
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:25,代码来源:DashPageEdit.aspx.cs
示例7: addEmploye
public static void addEmploye(Mode settings)
{
var bd = new dbProjetE2ProdEntities();
var add = new tblMode();
// add.PrenomEmp = settings.prenomEmp;
// add.NomEmp = settings.nomEmp;
// add.CourrielEmp = settings.courrielEmp;
// add.NoTelPrincipal = settings.noTelPrincipal;
// add.NoTelSecondaire = settings.noTelSecondaire;
// add.AdressePostale = settings.adressePostale;
// add.DateEmbaucheEmp = settings.dateEmbaucheEmp;
// add.CompetenceParticuliere = settings.competenceParticuliere;
// add.Actif = settings.actif;
// add.CommentaireEmp = settings.commentaireEmp;
bd.tblMode.Add(add);
try
{
bd.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
开发者ID:kelodiek,项目名称:Projet_v2,代码行数:27,代码来源:rEmployeSQL.cs
示例8: SwitchModes
// Master controller for switching modes. Mode switching is done by simply changing PuppetMaster.mode and can not be interrupted.
protected virtual void SwitchModes()
{
if (mode == lastMode) return;
if (isBlending) return;
if (isKilling && mode != Mode.Active) return;
if (state != State.Alive && mode != Mode.Active) return;
foreach (BehaviourBase behaviour in behaviours) {
if (behaviour.forceActive) {
mode = Mode.Active;
if (lastMode == mode) return;
break;
}
}
isBlending = true;
if (lastMode == Mode.Disabled) {
if (mode == Mode.Kinematic) DisabledToKinematic();
else if (mode == Mode.Active) StartCoroutine(DisabledToActive());
}
else if (lastMode == Mode.Kinematic) {
if (mode == Mode.Disabled) KinematicToDisabled();
else if (mode == Mode.Active) StartCoroutine(KinematicToActive());
}
else if (lastMode == Mode.Active) {
if (mode == Mode.Disabled) StartCoroutine(ActiveToDisabled());
else if (mode == Mode.Kinematic) StartCoroutine(ActiveToKinematic());
}
lastMode = mode;
}
开发者ID:cupsster,项目名称:ExtremeBusiness,代码行数:34,代码来源:PuppetMasterModes.cs
示例9: addBeginingBezierPathPoints
public void addBeginingBezierPathPoints(Vector3 origin, Vector3 destination)
{
this.mode = Mode.Line;
points.Add (origin);
points.Add (destination);
Render ();
}
开发者ID:khill25,项目名称:Carbon-editor,代码行数:7,代码来源:SFLineRenderer.cs
示例10: ChangeVisibility
public void ChangeVisibility(Side side, Mode mode)
{
Transform sideObject = this.transform.FindChild(SidesNames [(int)side]);
Mesh leftMesh, rightMesh, midMesh;
switch (mode)
{
case Mode.Full:
leftMesh = fullMeshLeft;
rightMesh = fullMeshRight;
midMesh = fullMesh;
break;
case Mode.Half:
leftMesh = halfMeshLeft;
rightMesh = halfMeshRight;
midMesh = halfMesh;
break;
case Mode.Empty:
leftMesh = null;
rightMesh = null;
midMesh = emptyMesh;
break;
default:
throw new ArgumentException();
}
sideObject.FindChild("LeftSide").GetComponent<MeshFilter>().sharedMesh= leftMesh;
sideObject.FindChild("LeftSide").GetComponent<MeshCollider>().sharedMesh = leftMesh;
sideObject.FindChild("RightSide").GetComponent<MeshFilter>().sharedMesh = rightMesh;
sideObject.FindChild("RightSide").GetComponent<MeshCollider>().sharedMesh = rightMesh;
sideObject.FindChild("Middle").GetComponent<MeshFilter>().sharedMesh = midMesh;
sideObject.FindChild("Middle").GetComponent<MeshCollider>().sharedMesh = midMesh;
}
开发者ID:DormantDreams,项目名称:video-game-level-scanner,代码行数:31,代码来源:MultiWallScript.cs
示例11: VersionCheck
public static VersionCheckStatus VersionCheck(int versionNum, int numDataBits, Mode mode, ErrorCorrectionLevel level, string encodingName)
{
int TotalDataBits = numDataBits;
ECISet eciSet = new ECISet(ECISet.AppendOption.NameToValue);
if(mode == Mode.EightBitByte)
{
if(encodingName != DEFAULT_ENCODING)
{
int eciValue = eciSet.GetECIValueByName(encodingName);
TotalDataBits += ECISet.NumOfECIHeaderBits(eciValue);
}
}
int bitCharCountIndicator = CharCountIndicatorTable.GetBitCountInCharCountIndicator(mode, versionNum);
TotalDataBits += (4 + bitCharCountIndicator);
int expectContainer = DataBits(versionNum, level);
int lowerContainer = versionNum == 1 ? 0 : DataBits(versionNum - 1, level);
if(expectContainer < TotalDataBits)
{
return VersionCheckStatus.SmallerThanExpect;
}
else if(lowerContainer >= TotalDataBits)
{
return VersionCheckStatus.LargerThanExpect;
}
else
{
return VersionCheckStatus.Efficient;
}
}
开发者ID:fengdc,项目名称:QrCode.Net,代码行数:31,代码来源:VersionTest.cs
示例12: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//返回用户列表页面的URL(包含了用户列表页面的查询条件)
if (Request["return"] != null) this.toolbarbottom["Return"].NavigateUrl = Request["return"];
if (!IsPostBack)
{
using (_session = new Session())
{
//有些情况下客户的组织结构没有什么要求,不需要选择组织结构,因此使用默认值
if (Org.UseDefaultOrg(_session)) this.trOrg.Visible = false;
InitializeDropDownList();
_actionMode = WebUtil.GetActionMode(this);
if (_actionMode == Mode.Edit) RetrieveUserData(_session); //如果时编辑用户,则加载显示用户资料
}
//不允许编辑帐号,但新增的时候需要输入
if (this.IsAddNew())
{
this.txtUserName.ReadOnly = false;
this.txtUserName.CssClass = "input";
}
else
{
this.txtUserName.ReadOnly = true;
this.txtUserName.CssClass = "input readonly";
}
}
}
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:29,代码来源:UserEdit.aspx.cs
示例13: FormB64Editor
public FormB64Editor(Mode mode = Mode.Save)
{
InitializeComponent();
Icon = Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetEntryAssembly().Location);
// saveFileDialogB64
saveFileDialogB64.DefaultExt = Program.textFiles[0];
saveFileDialogB64.Filter = string.Format(saveFileDialogB64.Filter,
string.Join(", *", Program.textFiles.ToArray()),
string.Join("; *", Program.textFiles.ToArray()));
OpenMode = mode;
switch (OpenMode)
{
case Mode.Open:
buttonAction.Text = "&Process";
break;
case Mode.Save:
buttonAction.Text = "&Save...";
break;
default:
break;
}
}
开发者ID:ennerperez,项目名称:image-toolkit,代码行数:26,代码来源:FormB64Editor.cs
示例14: OfficeConsole
public OfficeConsole(OfficeConsole.Mode mode)
{
this.mode = mode;
OfficeConsole.officeConsole = this;
switch (mode)
{
case Mode.InternetExplorer:
this.ie = new InternetExplorer();
this.control = this.ie;
this.ie.start();
break;
case Mode.Word:
this.word = new Word();
this.control = this.word;
this.word.start();
break;
case Mode.PowerPoint:
this.powerpoint = new PowerPoint();
this.control = this.powerpoint;
this.powerpoint.start();
break;
case Mode.Excel:
this.excel = new Excel();
this.control = this.excel;
this.excel.start();
break;
default:
Application.Exit();
break;
}
//readThread = new Thread(new ParameterizedThreadStart(this.reader));
//readThread.Start();
}
开发者ID:dwickeroth,项目名称:covise,代码行数:35,代码来源:OfficeConsole.cs
示例15: SetValidFootPrint
public void SetValidFootPrint()
{
mode = Mode.VALID_FOOTPRINT;
meshFilter.renderer.material.shader = Shader.Find("Custom/Footprint");
meshFilter.renderer.material.color = validFootprintColour;
}
开发者ID:pyro-dragon,项目名称:Clan-PoC,代码行数:7,代码来源:Footprint.cs
示例16: DirectoryFileMatchConfigurer
public DirectoryFileMatchConfigurer(ICompactorConfigurer compactorConfiguration, RejuicerConfigurationSource configuration, string directoryPath, Mode mode)
{
_compactorConfiguration = compactorConfiguration;
_configuration = configuration;
_directoryPath = directoryPath;
_mode = mode;
}
开发者ID:skroonenburg,项目名称:Rejuicer,代码行数:7,代码来源:DirectoryFileMatchConfigurer.cs
示例17: GenerateDispAngerExpressionsMorphs
public GenerateDispAngerExpressionsMorphs()
{
this.menu = new GenerateDispAngerExpressionsMorphsControl();
this.ignoreList = new List<int>();
this.weights = new Dictionary<Expression, Dictionary<Morph, double>>();
this.expressions = new Dictionary<Expression, MeshBase>();
this.menu.openOBJFileButton.Click += new EventHandler(openOBJFileButton_Click);
this.menu.openIgnoreListButton.Click += new EventHandler(openIgnoreListButton_Click);
this.menu.applyButton.Click += new EventHandler(applyButton_Click);
this.menu.clearIgnoreListButton.Click += new EventHandler(clearIgnoreListButton_Click);
this.menu.openWeightsButton.Click += new EventHandler(openWeightsButton_Click);
this.menu.accuracyNumericUpDown.ValueChanged += new EventHandler(accuracyNumericUpDown_ValueChanged);
this.menu.absoluteRadioButton.CheckedChanged += new EventHandler(absoluteRadioButton_CheckedChanged);
this.menu.relativeRadiobutton.CheckedChanged += new EventHandler(relativeRadiobutton_CheckedChanged);
this.menu.expressionsListView.MouseDoubleClick += new MouseEventHandler(expressionsListView_MouseDoubleClick);
for (int i = 0; i < 5; i++)
{
Expression exp = (Expression)i;
ListViewItem item = new ListViewItem(exp.ToString());
item.SubItems.Add("None");
item.SubItems.Add("None");
this.menu.expressionsListView.Items.Add(item);
}
this.applied = false;
this.accuracy = (double)this.menu.accuracyNumericUpDown.Value;
this.mode = Mode.Relative;
this.menu.relativeRadiobutton.Checked = true;
this.LoadWeights(Environment.CurrentDirectory + "\\Defaults\\DispAnger.txt");
}
开发者ID:V-Italy,项目名称:FaceMix,代码行数:29,代码来源:GenerateDispAngerExpressionsMorphs.cs
示例18: MyReceiveQueue
public MyReceiveQueue(int channel, Mode readMode = Mode.Synchronized, int defaultMessageCount = 1, Func<TimeSpan> timestampProvider = null)
{
#if !XB1
Trace.Assert(readMode != Mode.Spin, "Spin mode should be used only for testing purposes, it keeps CPU under heavy load!");
#else // XB1
System.Diagnostics.Debug.Assert(readMode != Mode.Spin, "Spin mode should be used only for testing purposes, it keeps CPU under heavy load!");
#endif // XB1
Disposed = false;
Channel = channel;
ReadMode = readMode;
m_messagePool = new MyConcurrentPool<Message>(defaultMessageCount, true);
m_receiveQueue = new MyConcurrentQueue<Message>(defaultMessageCount);
m_timestampProvider = timestampProvider;
if (readMode == Mode.Spin)
{
m_readThread = new Thread(ReceiveThread);
m_readThread.CurrentCulture = CultureInfo.InvariantCulture;
m_readThread.CurrentUICulture = CultureInfo.InvariantCulture;
m_readThread.Start();
}
else if (readMode == Mode.Timer)
{
m_timerAction = new Action(ReceiveTimer);
m_timer = new MyTimer(1, m_timerAction);
m_timer.Start();
}
}
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:30,代码来源:MyReceiveQueue.cs
示例19: CreateMemberValue
public static IValue CreateMemberValue(Mode mode, object value, Options options = null)
{
return ValueFactory.Create(mode,
new SimpleValue(value, value.GetType().ToCachedType()),
new CachedMember(value.GetType().GetProperty("Value")),
options ?? Options.Create());
}
开发者ID:carl-berg,项目名称:Bender,代码行数:7,代码来源:ValueFactoryTests.cs
示例20: Kernel
public static MyCudaKernel Kernel(int nGPU, Mode mode)
{
uint outSize = 0;
MyCudaKernel kernel = null;
switch (mode)
{
case Mode.i_Sum_i: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI7i_Sum_iiLj1024EEvPvPVKvjjjj"); outSize = 4; break;
case Mode.i_MinIdx_2i: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI11i_MinIdx_2iiLj1024EEvPvPVKvjjjj"); outSize = 8; break;
case Mode.i_MaxIdx_2i: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI11i_MaxIdx_2iiLj1024EEvPvPVKvjjjj"); outSize = 8; break;
case Mode.i_MinIdxMaxIdx_4i: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI17i_MinIdxMaxIdx_4iiLj1024EEvPvPVKvjjjj"); outSize = 16; break;
case Mode.f_Sum_f: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI7f_Sum_ffLj1024EEvPvPVKvjjjj"); outSize = 4; break;
case Mode.f_MinIdx_fi: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI11f_MinIdx_fifLj1024EEvPvPVKvjjjj"); outSize = 8; break;
case Mode.f_MinIdx_ff: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI11f_MinIdx_fffLj1024EEvPvPVKvjjjj"); outSize = 8; break;
case Mode.f_MaxIdx_fi: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI11f_MaxIdx_fifLj1024EEvPvPVKvjjjj"); outSize = 8; break;
case Mode.f_MaxIdx_ff: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI11f_MaxIdx_fffLj1024EEvPvPVKvjjjj"); outSize = 8; break;
case Mode.f_MinMax_2f: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI11f_MinMax_2ffLj1024EEvPvPVKvjjjj"); outSize = 8; break;
case Mode.f_MinIdxMaxIdx_fifi: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z9ReductionI19f_MinIdxMaxIdx_fififLj1024EEvPvPVKvjjjj"); outSize = 16; break;
case Mode.i_DotProduct_i: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z10DotProductI7i_Dot_iiLj1024EEvPvjPVKvS3_j"); outSize = 4; break;
case Mode.f_DotProduct_f: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z10DotProductI7f_Dot_ffLj1024EEvPvjPVKvS3_j"); outSize = 4; break;
case Mode.f_Cosine_f: kernel = MyKernelFactory.Instance.Kernel(nGPU, @"Common\Reduction\Reduction", "_Z10DotProductI10f_Cosine_ffLj1024EEvPvjPVKvS3_j"); outSize = 16; break;
}
kernel.DynamicSharedMemory = 1024 * outSize;
kernel.BlockDimensions = 1024;
kernel.GridDimensions = 10;
return kernel;
}
开发者ID:Jlaird,项目名称:BrainSimulator,代码行数:26,代码来源:MyReduction.cs
注:本文中的Mode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论