public StreamChunk(int startTime, int endTime, Mode mode, bool startsNewEpisode) { StartsNewEpisode = startsNewEpisode; StartTime = startTime; EndTime = endTime; Mode = mode; }
//-------------------------------------------------------------------------------- #region MonoBehaviour Events void Update() { if (mode == Mode.Done) return; if (mode == Mode.FadingOut) { float t = (Time.time - startTime) / duration; if (t >= 1) { SetAlpha(0); mode = Mode.Done; events.fadedOut.Invoke(); } else { SetAlpha(1 - t); } } if (mode == Mode.FadingIn) { float t = (Time.time - startTime) / duration; if (t >= 1) { SetAlpha(1); mode = Mode.Done; events.fadedIn.Invoke(); } else { SetAlpha(t); } } }
public IntVector3(Vector3 vector3, Mode mode) { switch (mode) { case Mode.Cast: this.x = (int)vector3.x; this.y = (int)vector3.y; this.z = (int)vector3.z; break; case Mode.Floor: this.x = Mathf.FloorToInt(vector3.x); this.y = Mathf.FloorToInt(vector3.y); this.z = Mathf.FloorToInt(vector3.z); break; case Mode.Ceil: this.x = Mathf.CeilToInt(vector3.x); this.y = Mathf.CeilToInt(vector3.y); this.z = Mathf.CeilToInt(vector3.z); break; case Mode.Round: this.x = Mathf.RoundToInt(vector3.x); this.y = Mathf.RoundToInt(vector3.y); this.z = Mathf.RoundToInt(vector3.z); break; default: this.x = 0; this.y = 0; this.z = 0; break; } }
// 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"); } }
/// <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; }
public void MouseDown(System.Windows.Forms.MouseEventArgs e) { if (dayView.SelectedAppointmentIsNew) { dayView.RaiseNewAppointment(); } if (dayView.CurrentlyEditing) dayView.FinishEditing(false); mode = GetMode(e); if (dayView.SelectedAppointment != null) { DateTime downPos = dayView.GetTimeAt(e.X, e.Y); // Calculate delta time between selection and clicked point delta = dayView.SelectedAppointment.StartDate - downPos; } else { delta = TimeSpan.Zero; } length = TimeSpan.Zero; }
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; }
public Game(GameModel Game) { InitializeComponent(); this.Text = "Snake"; this.WindowState = FormWindowState.Maximized; FormBorderStyle = FormBorderStyle.FixedSingle; this.GameData = Game; panel1.Height = (BoardHeight + 1) * BoxSize; panel1.Width = (BoardWidth + 1) * BoxSize; if (players.Count == 1) mode = Mode.SinglePlayer; else mode = Mode.MultiPlayer; labels = new List<Label>(); foreach (var player in players) { var lb = new Label() { Text = player.Name + ": 0", Font = new Font("Arial", 15), Location = new Point(20 + BoardWidth * BoxSize, 50 * player.Id), ForeColor = player.Color, Width = 150 }; Controls.Add(lb); labels.Add(lb); } KeyPreview = true; KeyDown += Form1_KeyDown; Restart(); }
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); }
public override void Calculate() { if (action == Mode.Flying) { X -= 1; if (X < Game1.SWidth/2) { action = Mode.Stopped; ShootSpeed = 1000; } } else { } if ((DateTime.Now - LastShoot).TotalMilliseconds > ShootSpeed) { WeaponList.Add(new ERocket(X + Width/2, Y + Height/2)); LastShoot = DateTime.Now; } if (GameController.Player.X + GameController.Player.Width < X && GameController.Player.Y < Y+ Height/2 && GameController.Player.Y + GameController.Player.Height > Y + Height/2) { WeaponList.Add(new ELaser(GameController.Player.X + GameController.Player.Width - 10, Y + Height / 2, X - (GameController.Player.X + GameController.Player.Width)+ 15 , 1)); // GameController.Player.Healt -= 1; //FloatingTexts.Add(new DamageText(tmp.X + tmp.Width / 2, tmp.Y, 3)); //var animatedExplosion = new AnimatedExplosion(Vector2.Zero, 0.0f, 0.5f, 1.0f, tmp.X, Player.Y + (Player.Height / 2) - 7, 15, 15, 0); //var res = spriteController.AddExplosion(animatedExplosion, 10); //Explosions.Add(res); } }
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(); } }
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()); }
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); } }
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"); }
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"]; } }
public void SetNormal() { mode = Mode.NORMAL; meshFilter.renderer.material.shader = defaultShader; meshFilter.renderer.material.color = defaultColor; }
public void SetValidFootPrint() { mode = Mode.VALID_FOOTPRINT; meshFilter.renderer.material.shader = Shader.Find("Custom/Footprint"); meshFilter.renderer.material.color = validFootprintColour; }
public NPC(float x, float y, Type type, Mode mode) { position = new Vector2(x, y); this.type = type; this.mode = mode; color = Color.Purple; }
public void SetNormalMode() { if (DeviceState == true) KitchenVentilationdMode = Mode.normal; else throw new Exception("Для выбора режима включите вытяжку"); }
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; }
private void UpdateTouchMode() { if(Input.GetMouseButtonUp(0)) ControlMode = Mode.Idle; if (ControlMode != Mode.Idle) return; switch (Input.touchCount) { case 2: ControlMode = Mode.CameraMovement; break; case 1: ControlMode = Mode.Selecting; break; case 0: default: ControlMode = Mode.Idle; break; } ControlMode = Input.GetMouseButton(0) ? Input.GetMouseButton(1) ? Mode.CameraMovement : Mode.Selecting : Mode.Idle; }
public DirectoryFileMatchConfigurer(ICompactorConfigurer compactorConfiguration, RejuicerConfigurationSource configuration, string directoryPath, Mode mode) { _compactorConfiguration = compactorConfiguration; _configuration = configuration; _directoryPath = directoryPath; _mode = mode; }
// 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; }
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; }
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; } }
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; } }
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"; } } }
public void addBeginingBezierPathPoints(Vector3 origin, Vector3 destination) { this.mode = Mode.Line; points.Add (origin); points.Add (destination); Render (); }
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(); }
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(); } }
public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (Type != null) { hashCode = hashCode * 59 + Type.GetHashCode(); } if (Visible != null) { hashCode = hashCode * 59 + Visible.GetHashCode(); } if (ShowLegend != null) { hashCode = hashCode * 59 + ShowLegend.GetHashCode(); } if (LegendGroup != null) { hashCode = hashCode * 59 + LegendGroup.GetHashCode(); } if (Opacity != null) { hashCode = hashCode * 59 + Opacity.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (UId != null) { hashCode = hashCode * 59 + UId.GetHashCode(); } if (Ids != null) { hashCode = hashCode * 59 + Ids.GetHashCode(); } if (CustomData != null) { hashCode = hashCode * 59 + CustomData.GetHashCode(); } if (Meta != null) { hashCode = hashCode * 59 + Meta.GetHashCode(); } if (MetaArray != null) { hashCode = hashCode * 59 + MetaArray.GetHashCode(); } if (SelectedPoints != null) { hashCode = hashCode * 59 + SelectedPoints.GetHashCode(); } if (HoverLabel != null) { hashCode = hashCode * 59 + HoverLabel.GetHashCode(); } if (Stream != null) { hashCode = hashCode * 59 + Stream.GetHashCode(); } if (Transforms != null) { hashCode = hashCode * 59 + Transforms.GetHashCode(); } if (UiRevision != null) { hashCode = hashCode * 59 + UiRevision.GetHashCode(); } if (Lon != null) { hashCode = hashCode * 59 + Lon.GetHashCode(); } if (Lat != null) { hashCode = hashCode * 59 + Lat.GetHashCode(); } if (Locations != null) { hashCode = hashCode * 59 + Locations.GetHashCode(); } if (LocationMode != null) { hashCode = hashCode * 59 + LocationMode.GetHashCode(); } if (GeoJson != null) { hashCode = hashCode * 59 + GeoJson.GetHashCode(); } if (FeatureIdKey != null) { hashCode = hashCode * 59 + FeatureIdKey.GetHashCode(); } if (Mode != null) { hashCode = hashCode * 59 + Mode.GetHashCode(); } if (Text != null) { hashCode = hashCode * 59 + Text.GetHashCode(); } if (TextArray != null) { hashCode = hashCode * 59 + TextArray.GetHashCode(); } if (TextTemplate != null) { hashCode = hashCode * 59 + TextTemplate.GetHashCode(); } if (TextTemplateArray != null) { hashCode = hashCode * 59 + TextTemplateArray.GetHashCode(); } if (HoverText != null) { hashCode = hashCode * 59 + HoverText.GetHashCode(); } if (HoverTextArray != null) { hashCode = hashCode * 59 + HoverTextArray.GetHashCode(); } if (TextFont != null) { hashCode = hashCode * 59 + TextFont.GetHashCode(); } if (TextPosition != null) { hashCode = hashCode * 59 + TextPosition.GetHashCode(); } if (TextPositionArray != null) { hashCode = hashCode * 59 + TextPositionArray.GetHashCode(); } if (Line != null) { hashCode = hashCode * 59 + Line.GetHashCode(); } if (ConnectGaps != null) { hashCode = hashCode * 59 + ConnectGaps.GetHashCode(); } if (Marker != null) { hashCode = hashCode * 59 + Marker.GetHashCode(); } if (Fill != null) { hashCode = hashCode * 59 + Fill.GetHashCode(); } if (FillColor != null) { hashCode = hashCode * 59 + FillColor.GetHashCode(); } if (Selected != null) { hashCode = hashCode * 59 + Selected.GetHashCode(); } if (Unselected != null) { hashCode = hashCode * 59 + Unselected.GetHashCode(); } if (HoverInfo != null) { hashCode = hashCode * 59 + HoverInfo.GetHashCode(); } if (HoverInfoArray != null) { hashCode = hashCode * 59 + HoverInfoArray.GetHashCode(); } if (HoverTemplate != null) { hashCode = hashCode * 59 + HoverTemplate.GetHashCode(); } if (HoverTemplateArray != null) { hashCode = hashCode * 59 + HoverTemplateArray.GetHashCode(); } if (Geo != null) { hashCode = hashCode * 59 + Geo.GetHashCode(); } if (IdsSrc != null) { hashCode = hashCode * 59 + IdsSrc.GetHashCode(); } if (CustomDataSrc != null) { hashCode = hashCode * 59 + CustomDataSrc.GetHashCode(); } if (MetaSrc != null) { hashCode = hashCode * 59 + MetaSrc.GetHashCode(); } if (LonSrc != null) { hashCode = hashCode * 59 + LonSrc.GetHashCode(); } if (LatSrc != null) { hashCode = hashCode * 59 + LatSrc.GetHashCode(); } if (LocationsSrc != null) { hashCode = hashCode * 59 + LocationsSrc.GetHashCode(); } if (TextSrc != null) { hashCode = hashCode * 59 + TextSrc.GetHashCode(); } if (TextTemplateSrc != null) { hashCode = hashCode * 59 + TextTemplateSrc.GetHashCode(); } if (HoverTextSrc != null) { hashCode = hashCode * 59 + HoverTextSrc.GetHashCode(); } if (TextPositionSrc != null) { hashCode = hashCode * 59 + TextPositionSrc.GetHashCode(); } if (HoverInfoSrc != null) { hashCode = hashCode * 59 + HoverInfoSrc.GetHashCode(); } if (HoverTemplateSrc != null) { hashCode = hashCode * 59 + HoverTemplateSrc.GetHashCode(); } return(hashCode); } }
protected void NoDelete_Command(object sender, CommandEventArgs e) { this.pageMode = Mode.View; }
protected void CancelEdit_Command(object sender, CommandEventArgs e) { this.pageMode = Mode.View; }
string GetVisualizeButtonText() { return(Mode == TextureVisualizeMode.None ? "Visualize" : Mode.ToString()); }
void Awake() { mode = Mode.NORMAL; MoveVector = Vector3.zero; }
public ByteBuffer clear() { mode = Mode.Write; stream.Position = 0; return(this); }
public void setMode(Mode mode) { if (warp != null) { warp.Dispose(); } if (prec != null) { prec.Dispose(); } switch (mode) { /* case Mode.EYEX_ONLY: * warp = new EyeXWarpPointer(mConfiguration); * prec = new EyeXPrecisionPointer(sensitivity); * break; * * case Mode.EYEX_ONLY_LeftEye: * warp = new oneEyeLeft(mConfiguration); * prec = new EyeXPrecisionPointer(sensitivity); * break; * * case Mode.EYEX_ONLY_RightEye: * warp = new OneEyeRight(mConfiguration); * prec = new EyeXPrecisionPointer(sensitivity); * break; * * case Mode.EYEX_ONLY_Head: * prec = new EyeXPrecisionPointer(sensitivity); * break; * * case Mode.EYE_HEAD_COMBINE: * warp = new combineEyes(mConfiguration); * // prec = new EyeXPrecisionPointer(sensitivity); * break;*/ case Mode.BOTH_EYE_AND_HEAD: warp = new combineEyes(mConfiguration); prec = new EyeXPrecisionPointer(sensitivity); break; case Mode.BOTH_EYE: warp = new combineEyes(mConfiguration); // prec = new EyeXPrecisionPointer(sensitivity); break; case Mode.LEFT_EYE_AND_HEAD: warp = new OneEyeLeft(mConfiguration); prec = new EyeXPrecisionPointer(sensitivity); break; case Mode.LEFT_EYE: warp = new OneEyeLeft(mConfiguration); // prec = new EyeXPrecisionPointer(sensitivity); break; case Mode.RIGHT_EYE_AND_HEAD: warp = new OneEyeRight(mConfiguration); prec = new EyeXPrecisionPointer(sensitivity); break; case Mode.RIGHT_EYE: warp = new OneEyeRight(mConfiguration); // prec = new EyeXPrecisionPointer(sensitivity); break; case Mode.JUST_HEAD: prec = new EyeXPrecisionPointer(sensitivity); break; } calibrator = new GazeCalibrator(this, warp); /* if (!warp.IsStarted()) * state = TrackingState.ERROR; * * if (!prec.IsStarted()) * state = TrackingState.ERROR;*/ }
/// <summary> /// The Text Compaction mode includes all the printable ASCII characters /// (i.e. values from 32 to 126) and three ASCII control characters: HT or tab /// (ASCII value 9), LF or line feed (ASCII value 10), and CR or carriage /// return (ASCII value 13). The Text Compaction mode also includes various latch /// and shift characters which are used exclusively within the mode. The Text /// Compaction mode encodes up to 2 characters per codeword. The compaction rules /// for converting data into PDF417 codewords are defined in 5.4.2.2. The sub-mode /// switches are defined in 5.4.2.3. /// /// <param name="textCompactionData">The text compaction data.</param> /// <param name="byteCompactionData">The byte compaction data if there</param> /// was a mode shift. /// <param name="length">The size of the text compaction and byte compaction data.</param> /// <param name="result">The decoded data is appended to the result.</param> /// </summary> private static void decodeTextCompaction(int[] textCompactionData, int[] byteCompactionData, int length, StringBuilder result) { // Beginning from an initial state of the Alpha sub-mode // The default compaction mode for PDF417 in effect at the start of each symbol shall always be Text // Compaction mode Alpha sub-mode (uppercase alphabetic). A latch codeword from another mode to the Text // Compaction mode shall always switch to the Text Compaction Alpha sub-mode. Mode subMode = Mode.ALPHA; Mode priorToShiftMode = Mode.ALPHA; int i = 0; while (i < length) { int subModeCh = textCompactionData[i]; char?ch = null; switch (subMode) { case Mode.ALPHA: // Alpha (uppercase alphabetic) if (subModeCh < 26) { // Upper case Alpha Character ch = (char)('A' + subModeCh); } else { if (subModeCh == 26) { ch = ' '; } else if (subModeCh == LL) { subMode = Mode.LOWER; } else if (subModeCh == ML) { subMode = Mode.MIXED; } else if (subModeCh == PS) { // Shift to punctuation priorToShiftMode = subMode; subMode = Mode.PUNCT_SHIFT; } else if (subModeCh == MODE_SHIFT_TO_BYTE_COMPACTION_MODE) { // TODO Does this need to use the current character encoding? See other occurrences below result.Append((char)byteCompactionData[i]); } else if (subModeCh == TEXT_COMPACTION_MODE_LATCH) { subMode = Mode.ALPHA; } } break; case Mode.LOWER: // Lower (lowercase alphabetic) if (subModeCh < 26) { ch = (char)('a' + subModeCh); } else { if (subModeCh == 26) { ch = ' '; } else if (subModeCh == AS) { // Shift to alpha priorToShiftMode = subMode; subMode = Mode.ALPHA_SHIFT; } else if (subModeCh == ML) { subMode = Mode.MIXED; } else if (subModeCh == PS) { // Shift to punctuation priorToShiftMode = subMode; subMode = Mode.PUNCT_SHIFT; } else if (subModeCh == MODE_SHIFT_TO_BYTE_COMPACTION_MODE) { result.Append((char)byteCompactionData[i]); } else if (subModeCh == TEXT_COMPACTION_MODE_LATCH) { subMode = Mode.ALPHA; } } break; case Mode.MIXED: // Mixed (numeric and some punctuation) if (subModeCh < PL) { ch = MIXED_CHARS[subModeCh]; } else { if (subModeCh == PL) { subMode = Mode.PUNCT; } else if (subModeCh == 26) { ch = ' '; } else if (subModeCh == LL) { subMode = Mode.LOWER; } else if (subModeCh == AL) { subMode = Mode.ALPHA; } else if (subModeCh == PS) { // Shift to punctuation priorToShiftMode = subMode; subMode = Mode.PUNCT_SHIFT; } else if (subModeCh == MODE_SHIFT_TO_BYTE_COMPACTION_MODE) { result.Append((char)byteCompactionData[i]); } else if (subModeCh == TEXT_COMPACTION_MODE_LATCH) { subMode = Mode.ALPHA; } } break; case Mode.PUNCT: // Punctuation if (subModeCh < PAL) { ch = PUNCT_CHARS[subModeCh]; } else { if (subModeCh == PAL) { subMode = Mode.ALPHA; } else if (subModeCh == MODE_SHIFT_TO_BYTE_COMPACTION_MODE) { result.Append((char)byteCompactionData[i]); } else if (subModeCh == TEXT_COMPACTION_MODE_LATCH) { subMode = Mode.ALPHA; } } break; case Mode.ALPHA_SHIFT: // Restore sub-mode subMode = priorToShiftMode; if (subModeCh < 26) { ch = (char)('A' + subModeCh); } else { if (subModeCh == 26) { ch = ' '; } else if (subModeCh == TEXT_COMPACTION_MODE_LATCH) { subMode = Mode.ALPHA; } } break; case Mode.PUNCT_SHIFT: // Restore sub-mode subMode = priorToShiftMode; if (subModeCh < PAL) { ch = PUNCT_CHARS[subModeCh]; } else { if (subModeCh == PAL) { subMode = Mode.ALPHA; } else if (subModeCh == MODE_SHIFT_TO_BYTE_COMPACTION_MODE) { // PS before Shift-to-Byte is used as a padding character, // see 5.4.2.4 of the specification result.Append((char)byteCompactionData[i]); } else if (subModeCh == TEXT_COMPACTION_MODE_LATCH) { subMode = Mode.ALPHA; } } break; } if (ch != null) { // Append decoded character to result result.Append(ch.Value); } i++; } }
/// <summary> Writes the HTML generated by this my sobek html subwriter directly to the response stream </summary> /// <param name="Output"> Stream to which to write the HTML for this subwriter </param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param> /// <returns> Value indicating if html writer should finish the page immediately after this, or if there are other controls or routines which need to be called first </returns> public override bool Write_HTML(TextWriter Output, Custom_Tracer Tracer) { Tracer.Add_Trace("MySobek_HtmlSubwriter.Write_HTML", "Rendering HTML"); if ((HttpContext.Current.Session["agreement_date"] == null) && (currentMode.My_Sobek_Type == My_Sobek_Type_Enum.New_Item) && ((currentMode.My_Sobek_SubMode.Length == 0) || (currentMode.My_Sobek_SubMode[0] != '1'))) { currentMode.My_Sobek_SubMode = "1"; } // A few cases skip the view selectors at the top entirely if (mySobekViewer.Standard_Navigation_Type == MySobek_Included_Navigation_Enum.Standard) { // Add the user-specific main menu MainMenus_Helper_HtmlSubWriter.Add_UserSpecific_Main_Menu(Output, currentMode, user); // Start the page container Output.WriteLine("<div id=\"pagecontainer\">"); Output.WriteLine("<br />"); } else if (mySobekViewer.Standard_Navigation_Type == MySobek_Included_Navigation_Enum.LogOn) { // Add the item views Output.WriteLine("<!-- Add the main user-specific menu -->"); Output.WriteLine("<div id=\"sbkUsm_MenuBar\" class=\"sbkMenu_Bar\">"); Output.WriteLine("<ul class=\"sf-menu\">"); // Get ready to draw the tabs string sobek_home_text = Mode.SobekCM_Instance_Abbreviation + " Home"; // Add the 'SOBEK HOME' first menu option and suboptions Mode.Mode = Display_Mode_Enum.Aggregation; Mode.Aggregation_Type = Aggregation_Type_Enum.Home; Mode.Home_Type = Home_Type_Enum.List; Output.WriteLine("\t\t<li id=\"sbkUsm_Home\" class=\"sbkMenu_Home\"><a href=\"" + Mode.Redirect_URL() + "\" class=\"sbkMenu_NoPadding\"><img src=\"" + Mode.Default_Images_URL + "home.png\" /> <div class=\"sbkMenu_HomeText\">" + sobek_home_text + "</div></a></li>"); Output.WriteLine("\t</ul></div>"); Output.WriteLine("<!-- Initialize the main user menu -->"); Output.WriteLine("<script>"); Output.WriteLine(" jQuery(document).ready(function () {"); Output.WriteLine(" jQuery('ul.sf-menu').superfish();"); Output.WriteLine(" });"); Output.WriteLine("</script>"); Output.WriteLine(); // Restore the current view information type currentMode.Mode = Display_Mode_Enum.My_Sobek; // Start the page container Output.WriteLine("<div id=\"pagecontainer\">"); Output.WriteLine("<br />"); } else if (!Subwriter_Behaviors.Contains(HtmlSubwriter_Behaviors_Enum.MySobek_Subwriter_Mimic_Item_Subwriter)) { // Start the page container Output.WriteLine("<div id=\"pagecontainer\">"); } // Add the text here mySobekViewer.Write_HTML(Output, Tracer); return(false); }
public bool Equals([AllowNull] ScatterGeo other) { if (other == null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) && (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) && (ShowLegend == other.ShowLegend && ShowLegend != null && other.ShowLegend != null && ShowLegend.Equals(other.ShowLegend)) && (LegendGroup == other.LegendGroup && LegendGroup != null && other.LegendGroup != null && LegendGroup.Equals(other.LegendGroup)) && (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) && (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) && (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) && (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) && (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) && (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) && (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) && (SelectedPoints == other.SelectedPoints && SelectedPoints != null && other.SelectedPoints != null && SelectedPoints.Equals(other.SelectedPoints)) && (HoverLabel == other.HoverLabel && HoverLabel != null && other.HoverLabel != null && HoverLabel.Equals(other.HoverLabel)) && (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) && (Equals(Transforms, other.Transforms) || Transforms != null && other.Transforms != null && Transforms.SequenceEqual(other.Transforms)) && (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) && (Equals(Lon, other.Lon) || Lon != null && other.Lon != null && Lon.SequenceEqual(other.Lon)) && (Equals(Lat, other.Lat) || Lat != null && other.Lat != null && Lat.SequenceEqual(other.Lat)) && (Equals(Locations, other.Locations) || Locations != null && other.Locations != null && Locations.SequenceEqual(other.Locations)) && (LocationMode == other.LocationMode && LocationMode != null && other.LocationMode != null && LocationMode.Equals(other.LocationMode)) && (GeoJson == other.GeoJson && GeoJson != null && other.GeoJson != null && GeoJson.Equals(other.GeoJson)) && (FeatureIdKey == other.FeatureIdKey && FeatureIdKey != null && other.FeatureIdKey != null && FeatureIdKey.Equals(other.FeatureIdKey)) && (Mode == other.Mode && Mode != null && other.Mode != null && Mode.Equals(other.Mode)) && (Text == other.Text && Text != null && other.Text != null && Text.Equals(other.Text)) && (Equals(TextArray, other.TextArray) || TextArray != null && other.TextArray != null && TextArray.SequenceEqual(other.TextArray)) && (TextTemplate == other.TextTemplate && TextTemplate != null && other.TextTemplate != null && TextTemplate.Equals(other.TextTemplate)) && (Equals(TextTemplateArray, other.TextTemplateArray) || TextTemplateArray != null && other.TextTemplateArray != null && TextTemplateArray.SequenceEqual(other.TextTemplateArray)) && (HoverText == other.HoverText && HoverText != null && other.HoverText != null && HoverText.Equals(other.HoverText)) && (Equals(HoverTextArray, other.HoverTextArray) || HoverTextArray != null && other.HoverTextArray != null && HoverTextArray.SequenceEqual(other.HoverTextArray)) && (TextFont == other.TextFont && TextFont != null && other.TextFont != null && TextFont.Equals(other.TextFont)) && (TextPosition == other.TextPosition && TextPosition != null && other.TextPosition != null && TextPosition.Equals(other.TextPosition)) && (Equals(TextPositionArray, other.TextPositionArray) || TextPositionArray != null && other.TextPositionArray != null && TextPositionArray.SequenceEqual(other.TextPositionArray)) && (Line == other.Line && Line != null && other.Line != null && Line.Equals(other.Line)) && (ConnectGaps == other.ConnectGaps && ConnectGaps != null && other.ConnectGaps != null && ConnectGaps.Equals(other.ConnectGaps)) && (Marker == other.Marker && Marker != null && other.Marker != null && Marker.Equals(other.Marker)) && (Fill == other.Fill && Fill != null && other.Fill != null && Fill.Equals(other.Fill)) && (FillColor == other.FillColor && FillColor != null && other.FillColor != null && FillColor.Equals(other.FillColor)) && (Selected == other.Selected && Selected != null && other.Selected != null && Selected.Equals(other.Selected)) && (Unselected == other.Unselected && Unselected != null && other.Unselected != null && Unselected.Equals(other.Unselected)) && (HoverInfo == other.HoverInfo && HoverInfo != null && other.HoverInfo != null && HoverInfo.Equals(other.HoverInfo)) && (Equals(HoverInfoArray, other.HoverInfoArray) || HoverInfoArray != null && other.HoverInfoArray != null && HoverInfoArray.SequenceEqual(other.HoverInfoArray)) && (HoverTemplate == other.HoverTemplate && HoverTemplate != null && other.HoverTemplate != null && HoverTemplate.Equals(other.HoverTemplate)) && (Equals(HoverTemplateArray, other.HoverTemplateArray) || HoverTemplateArray != null && other.HoverTemplateArray != null && HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)) && (Geo == other.Geo && Geo != null && other.Geo != null && Geo.Equals(other.Geo)) && (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) && (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) && (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)) && (LonSrc == other.LonSrc && LonSrc != null && other.LonSrc != null && LonSrc.Equals(other.LonSrc)) && (LatSrc == other.LatSrc && LatSrc != null && other.LatSrc != null && LatSrc.Equals(other.LatSrc)) && (LocationsSrc == other.LocationsSrc && LocationsSrc != null && other.LocationsSrc != null && LocationsSrc.Equals(other.LocationsSrc)) && (TextSrc == other.TextSrc && TextSrc != null && other.TextSrc != null && TextSrc.Equals(other.TextSrc)) && (TextTemplateSrc == other.TextTemplateSrc && TextTemplateSrc != null && other.TextTemplateSrc != null && TextTemplateSrc.Equals(other.TextTemplateSrc)) && (HoverTextSrc == other.HoverTextSrc && HoverTextSrc != null && other.HoverTextSrc != null && HoverTextSrc.Equals(other.HoverTextSrc)) && (TextPositionSrc == other.TextPositionSrc && TextPositionSrc != null && other.TextPositionSrc != null && TextPositionSrc.Equals(other.TextPositionSrc)) && (HoverInfoSrc == other.HoverInfoSrc && HoverInfoSrc != null && other.HoverInfoSrc != null && HoverInfoSrc.Equals(other.HoverInfoSrc)) && (HoverTemplateSrc == other.HoverTemplateSrc && HoverTemplateSrc != null && other.HoverTemplateSrc != null && HoverTemplateSrc.Equals(other.HoverTemplateSrc))); }
protected override void Stmt(string expected, LNode input, Action <EcsPrinterOptions> configure = null, Mode mode = Mode.Both) { bool exprMode = (mode & Mode.Expression) != 0; if ((mode & Mode.PrinterTest) == 0) { return; } var options = new EcsPrinterOptions(); options.IndentString = " "; // by default, test the mode that is more difficult to get right options.AllowChangeParentheses = false; // TODO: make round tripping work without this options.NewlineOptions &= ~(NewlineOpt.AfterOpenBraceInNewExpr | NewlineOpt.BeforeCloseBraceInNewExpr); if (configure != null) { configure(options); } var sb = new StringBuilder(); var mode2 = exprMode ? ParsingMode.Expressions : ParsingMode.Statements; if (input.Calls(S.Splice) && !input.HasAttrs) { EcsLanguageService.Value.Print(input.Args, sb, MessageSink.Default, mode2, options); } else { EcsLanguageService.Value.Print(input, sb, MessageSink.Default, mode2, options); } AreEqual(expected, sb.ToString()); }
public void Get(Mode mode) { var hubContext = connectionManager.GetHubContext <TabletHub>(); hubContext.Clients.All.OnAssignedTablet(mode); }
public static void GetClosestDisplayMode(int displayIndex, Mode mode, out Mode closest) { GetError(SDL_GetClosestDisplayMode(displayIndex, mode, out closest)); }
public StringManipulationFunction(Mode mode) { m_mode = mode; }
public static void GetDisplayMode(int displayIndex, int modeIndex, out Mode mode) { GetError(SDL_GetDisplayMode(displayIndex, modeIndex, out mode)); }
public override bool Start(Server server, Mode mode) { //从DLL启动Shaowsocks if (Global.Settings.BootShadowsocksFromDLL && (mode.Type == 0 || mode.Type == 1 || mode.Type == 2 || mode.Type == 3)) { State = State.Starting; var client = Encoding.UTF8.GetBytes($"0.0.0.0:{Global.Settings.Socks5LocalPort}"); var remote = Encoding.UTF8.GetBytes($"{server.Hostname}:{server.Port}"); var passwd = Encoding.UTF8.GetBytes($"{server.Password}"); var method = Encoding.UTF8.GetBytes($"{server.EncryptMethod}"); if (!NativeMethods.Shadowsocks.Info(client, remote, passwd, method)) { State = State.Stopped; Logging.Error("DLL SS INFO 设置失败!"); return(false); } Logging.Info("DLL SS INFO 设置成功!"); if (!NativeMethods.Shadowsocks.Start()) { State = State.Stopped; Logging.Error("DLL SS 启动失败!"); return(false); } Logging.Info("DLL SS 启动成功!"); State = State.Started; return(true); } if (!Ready) { return(false); } Instance = GetProcess("bin\\Shadowsocks.exe"); Instance.StartInfo.Arguments = $"-s {server.Hostname} -p {server.Port} -b {Global.Settings.LocalAddress} -l {Global.Settings.Socks5LocalPort} -m {server.EncryptMethod} -k \"{server.Password}\" -u"; if (!string.IsNullOrWhiteSpace(server.Plugin) && !string.IsNullOrWhiteSpace(server.PluginOption)) { Instance.StartInfo.Arguments += $" --plugin {server.Plugin} --plugin-opts \"{server.PluginOption}\""; } if (mode.BypassChina) { Instance.StartInfo.Arguments += " --acl default.acl"; } Instance.OutputDataReceived += OnOutputDataReceived; Instance.ErrorDataReceived += OnOutputDataReceived; State = State.Starting; Instance.Start(); Instance.BeginOutputReadLine(); Instance.BeginErrorReadLine(); for (var i = 0; i < 1000; i++) { Thread.Sleep(10); if (State == State.Started) { return(true); } if (State == State.Stopped) { Logging.Error("SS 进程启动失败"); Stop(); return(false); } } Logging.Error("SS 进程启动超时"); Stop(); return(false); }
private static extern int SDL_GetCurrentDisplayMode(int displayIndex, out Mode mode);
private static extern int SDL_GetClosestDisplayMode(int displayIndex, Mode mode, out Mode closest);
private static extern Result FMOD_ChannelGroup_GetMode(IntPtr channelgroup, out Mode mode);
private static extern int SDL_GetDisplayMode(int displayIndex, int modeIndex, out Mode mode);
public Result SetMode(Mode mode) { return(FMOD_ChannelGroup_SetMode(RawPtr, mode)); }
private CollectionOfBloomFilters(Mode mode, Tree tree, TransactionOperationContext context) { _mode = mode; _context = context; _tree = tree; }
public IrqDescriptor(int[] interruptNumbers, bool sharable, Polarity polarity, Mode mode) { this.interruptNumbers = interruptNumbers; this.sharable = sharable; this.polarity = polarity; this.mode = mode; }
public Result GetMode(out Mode mode) { return(FMOD_ChannelGroup_GetMode(RawPtr, out mode)); }
// Use this for initialization void Start() { mode = ma2MaComManager.modeManagerNew.GetOrCreateModeByName("Pause"); }
public Scanner(ref ptr <token.File> file = default, @string dir = default, slice <byte> src = default, ErrorHandler err = default, Mode mode = default, int ch = default, long offset = default, long rdOffset = default, long lineOffset = default, bool insertSemi = default, long ErrorCount = default) { this.file = file; this.dir = dir; this.src = src; this.err = err; this.mode = mode; this.ch = ch; this.offset = offset; this.rdOffset = rdOffset; this.lineOffset = lineOffset; this.insertSemi = insertSemi; this.ErrorCount = ErrorCount; }
public IEnumerable <Modedt> GetMododeEnvio() { return(Mode.MododeEnvio()); }
private static async Task <string> UpdateQueryQnABot( string newQuestion, string newAnswer, Mode paramMode) { string strResponse = ""; // Create the QnAKnowledgeBase that contains the new entry QnAKnowledgeBase objQnAKnowledgeBase = new QnAKnowledgeBase(); QnaPair objQnaPair = new QnaPair(); objQnaPair.question = newQuestion; objQnaPair.answer = newAnswer; if (paramMode == Mode.Add) { Add objAdd = new Add(); objAdd.qnaPairs = new List <QnaPair>(); objAdd.urls = new List <string>(); objAdd.urls.Add(@"https://azure.microsoft.com/en-us/support/faq/"); objAdd.qnaPairs.Add(objQnaPair); objQnAKnowledgeBase.add = objAdd; } if (paramMode == Mode.Delete) { Delete objDelete = new Delete(); objDelete.qnaPairs = new List <QnaPair>(); objDelete.urls = new List <string>(); objDelete.urls.Add(@"http://localhost"); objDelete.qnaPairs.Add(objQnaPair); objQnAKnowledgeBase.delete = objDelete; } using (System.Net.Http.HttpClient client = new System.Net.Http.HttpClient()) { string RequestURI = String.Format("{0}{1}{2}{3}? ", @"https://westus.api.cognitive.microsoft.com/", @"qnamaker/v2.0/", @"knowledgebases/", _KnowledgeBase); using (HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("PATCH"), RequestURI)) { request.Content = new StringContent( JsonConvert.SerializeObject(objQnAKnowledgeBase), System.Text.Encoding.UTF8, "application/json"); request.Content.Headers.Add( "Ocp-Apim-Subscription-Key", _OcpApimSubscriptionKey); HttpResponseMessage response = await client.SendAsync(request); if (response.IsSuccessStatusCode) { strResponse = $"Operation {paramMode} completed."; } else { string responseContent = await response.Content.ReadAsStringAsync(); strResponse = responseContent; } } } return(strResponse); }
public ShimTableMemberVisibility(ShimTableMember owner, Mode mode) { m_owner = owner; m_mode = mode; }
// Fully changes the mode, timespans and colors private void SendCommand(Color color1, TimeSpan blinkTime1, Color color2, TimeSpan blinkTime2, Mode mode) { long time1 = blinkTime1.Ticks / 1000; long time2 = blinkTime2.Ticks / 1000; // send the parameters with mode off to avoid side effects of previous mode if (GreenBlueSwapped) { WriteParams((byte)(DaisyLinkOffset + Registers.Configuration), (byte)Mode.Off, 0x00, color1.R, color1.B, color1.G, color2.R, color2.B, color2.G, (byte)(time1 >> 0), (byte)(time1 >> 8), (byte)(time1 >> 16), (byte)(time1 >> 24), (byte)(time2 >> 0), (byte)(time2 >> 8), (byte)(time2 >> 16), (byte)(time2 >> 24)); } else { WriteParams((byte)(DaisyLinkOffset + Registers.Configuration), (byte)Mode.Off, 0x00, color1.R, color1.G, color1.B, color2.R, color2.G, color2.B, (byte)(time1 >> 0), (byte)(time1 >> 8), (byte)(time1 >> 16), (byte)(time1 >> 24), (byte)(time2 >> 0), (byte)(time2 >> 8), (byte)(time2 >> 16), (byte)(time2 >> 24)); } // now activate the correct mode WriteParams((byte)(DaisyLinkOffset + Registers.Configuration), (byte)mode, 0x1); }