当前位置: 首页>>代码示例>>C#>>正文


C# Mode类代码示例

本文整理汇总了C#中Mode的典型用法代码示例。如果您正苦于以下问题:C# Mode类的具体用法?C# Mode怎么用?C# Mode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Mode类属于命名空间,在下文中一共展示了Mode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的Mode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。