public void CreateCircle(User user) { Circles myCircles = new Circles(); myCircles.Circle_members.Add(user.User_ID); _Circles.InsertOne(myCircles); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { //if (Frame.BackStack.Count != 0 && Frame.BackStack.First().SourcePageType == typeof(LoginPage)) // Frame.BackStack.Remove(Frame.BackStack.First()); // TODO: Create an appropriate data model for your problem domain to replace the sample data //var sampleDataGroups = await SampleDataSource.GetGroupsAsync(); //this.DefaultViewModel["Groups"] = sampleDataGroups; //var posts = await Posts.GetActivities(null, null, null); //FontIcon icon = new FontIcon(); //icon.Glyph = (await Notifications.GetNotificationCount()).ToString(); //notificationAppBarButton.Icon = icon; //itemGridView.ItemsSource = posts.posts; var squares = await Squares.GetSquares(); //communitiesGridView.Source = squares; communitiesHub.DataContext = squares; var circles = await Circles.GetCircles(); circlesHub.DataContext = circles; FontIcon icon = new FontIcon(); icon.Glyph = (await Notifications.GetNotificationCount()).ToString(); notificationAppBarButton.Icon = icon; favouritesHub.DataContext = commands; }
public CircleClass DrawCircle(string name, Point centerPoint, double radius) { Points.AddPoint(centerPoint); CircleClass circ = new CircleClass(name, centerPoint, radius); Circles.Add(circ); using (Application.DocumentManager.MdiActiveDocument.LockDocument()) { using (Transaction trans = db.TransactionManager.StartTransaction()) { BlockTableRecord space = (BlockTableRecord)trans.GetObject(db.CurrentSpaceId, OpenMode.ForWrite); Circle circle = new Circle(); circle.Center = new Point3d(centerPoint.X, centerPoint.Y, 0); circle.Radius = radius; space.AppendEntity(circle); trans.AddNewlyCreatedDBObject(circle, true); trans.Commit(); } } return(circ); }
public MarkGeometriesWrapper(IMarkGeometry[] geometries) { foreach (var geometry in geometries) { if (geometry is MarkGeometryPoint point) { Points.Add(point); } else if (geometry is MarkGeometryLine line) { Lines.Add(line); } else if (geometry is MarkGeometryPath path) { Paths.Add(path); } else if (geometry is MarkGeometryArc arc) { Arcs.Add(arc); } else if (geometry is MarkGeometryCircle circle) { Circles.Add(circle); } } Update(); }
/// <summary> /// Adding Circles inside given frame /// </summary> /// <param name="frame"></param> /// <returns></returns> public bool DrawShapeInsideFrame(IShape shape) { if (shape as Circle != null) { var circle = shape as Circle; //Only If same circle is present we can resize if (Circles.ContainsValue(circle)) { circle.DrawShape(); return(true); } } else if (shape as Rectangle != null) { var rectangle = shape as Rectangle; //Only If same circle is present we can resize if (Rectangles.ContainsValue(rectangle)) { rectangle.DrawShape(); return(true); } } return(false); }
public void StyleCopCircleTask() { logger.Info("StyleCop. Task : Circles"); writer.Write("\n\t\tStyleCop. Task : Circles"); try { Circle circleOne = new Circle(new Point(2, 1), 5); Circle circleTwo = new Circle(new Point(5, 3), 6); writer.Write("\nThe data of first circle:"); writer.Write(circleOne.ToString()); writer.Write("\nMove circle along x-axis: 1. Move rectangle along y-axis: 3."); writer.Write("The data of modified circle:"); writer.Write(circleOne.MoveAlongAxis(0, 3).ToString()); writer.Write("\nThe data of second circle:"); writer.Write(circleTwo.ToString()); writer.Write("\nCircle resize. Radius : 3."); writer.Write("The data of modified second circle:"); writer.Write(circleTwo.Resize(3).ToString()); Circles circles = new Circles(circleOne, circleTwo); writer.Write("\nFind Intersection of circles: "); if (circles.DoShapesOverlap()) { writer.Write(circles.FindIntersectionOfShapes().ToString()); } } catch (ArgumentException ex) { logger.Error(ex.Message); } }
void SetFrom(ShapeCollectionSave shapeCollectionSave) { Clear(); foreach (var saveObject in shapeCollectionSave.AxisAlignedRectangleSaves) { var runtime = saveObject.ToAxisAlignedRectangle(); var vm = new AxisAlignedRectangleViewModel(runtime); Rectangles.Add(vm); } foreach (var saveObject in shapeCollectionSave.CircleSaves) { var runtime = saveObject.ToCircle(); var vm = new CircleViewModel(runtime); Circles.Add(vm); } foreach (var saveObject in shapeCollectionSave.PolygonSaves) { var runtime = saveObject.ToPolygon(); var vm = new PolygonViewModel(runtime); Polygons.Add(vm); } }
public void SeedingCircles() { var users = _databaseServices.GetUsers(); //A Bunch of circles Circles c1 = new Circles { circleName = "Thebois", UserIds = new List <string> { users[0].Id, users[1].Id, users[2].Id } }; Circles c2 = new Circles { circleName = "HighfivesAreforpussies", UserIds = new List <string> { users[2].Id, users[3].Id, users[4].Id } }; Circles c3 = new Circles { circleName = "MenInBlackisthebestmovieEVER", UserIds = new List <string> { users[0].Id, users[2].Id, users[4].Id } }; _databaseServices.CreateCircle(c1); _databaseServices.CreateCircle(c2); _databaseServices.CreateCircle(c3); }
public ViewModel() { StopWatch.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(StopWatch.Time)) { Notify(nameof(Time)); } }; StartStop = new Command((o) => { if (StopWatch.IsRunning) { AddCircle(StopWatch.Stop()); } else { StopWatch.Start(); } }); CircleReset = new Command((o) => { if (StopWatch.IsRunning) { AddCircle(StopWatch.StartNew()); } else { StopWatch.Reset(); Circles.Clear(); } }); }
public static void minCircleOutput(IList <IFeature> features) { IList <ILineString> circles = new List <ILineString>(); for (int i = 0; i < features.Count; i++) { ILineString minLine = MinPoints.getMinVector(features[i]); ILineString circle = Circles.getCircle(minLine.Coordinates[0], minLine.Coordinates[1]); circles.Add(circle); } string path1 = @"H:\test\结果\MinCircle1.shp"; var shapefileWriter = new ShapefileWriter(path1, ShapeGeometryType.LineString); foreach (var circle in circles) { shapefileWriter.Write(circle); } string path2 = @"H:\test\结果\MinCircle1.dbf"; ShapefileWriter.WriteDummyDbf(path2, features.Count); shapefileWriter.Close(); Console.WriteLine("生成成功"); Console.ReadKey(); }
public void Load(List <ThumbElement> thumbElements, int model) { if (thumbElements == null || !thumbElements.Any()) { return; } Circles.Clear(); var imageCount = thumbElements.Count; if (model == 0) { CircleCount = (int)Math.Ceiling(imageCount / (CircleParameter.MaxCapacityInCircle * 1d)); if (CircleCount > CircleParameter.MaxCircleCapacity) { CircleCount = CircleParameter.MaxCircleCapacity; } CapacityInCircle = (int)Math.Ceiling(imageCount / (CircleCount * 1d)); if (CapacityInCircle > CircleParameter.MaxCapacityInCircle) { CapacityInCircle = CircleParameter.MaxCapacityInCircle; } } else { CircleCount = CircleParameter.MaxCircleCapacity; CapacityInCircle = (int)Math.Ceiling(imageCount / (CircleCount * 1d)); if (CapacityInCircle > CircleParameter.MaxCapacityInCircle) { CapacityInCircle = CircleParameter.MaxCapacityInCircle; } } var startPoint = new Point(CircleParameter.OrginalCenter.X, CircleParameter.OrginalCenter.Y - (int)(CircleCount - 1) * CircleParameter.CircleVerInterval / 2); for (var i = 0; i < CircleCount; i++) { var center = new Point(startPoint.X, startPoint.Y + i * CircleParameter.CircleVerInterval); var circle = new ImageCircle() { Index = i, HoverColor = Color.White, SelectedColor = Color.GreenYellow, Perspective = 4, CircleCenter = center, MaxCapacity = CapacityInCircle, RevolveType = RevolveTypes.Fixed, Radius = CircleParameter.Radius, FixedAlphaAccel = CircleParameter.Alpha, BackgroundColor = CircleParameter.BackgroundColor, MaxImageLength = CircleParameter.MaxImageLength, ScalingOption = CircleParameter.ScalingOption, DestinationSize = CircleParameter.DestinationSize, }; Circles.Add(circle); circle.Load(thumbElements.Skip(i * CapacityInCircle).Take(CapacityInCircle).ToList()); } }
public void AddEntity(IEntityG entity) { switch (entity.Type) { case EntityGType.line: Lines.Add((LineG)entity); break; case EntityGType.arc: Circles.Add((CircleG)entity); break; case EntityGType.loop: Loops.Add((LoopG)entity); break; case EntityGType.surf: Surfaces.Add((PlaneSurface)entity); break; case EntityGType.phsurf: PhySurfaces.Add((PhysicalSurface)entity); break; case EntityGType.phcurve: PhyCurves.Add((PhysicalCurve)entity); break; case EntityGType.point: Points.Add((PointG)entity); break; } }
private void Start() { audioSource = GetComponent <AudioSource>(); circles = FindObjectOfType <Circles>(); shake = Camera.main.GetComponent <Animator>(); }
private void AddCircle(Circle circle) { if (Circles.Count == circle.Number) { Circles.RemoveAt(Circles.Count - 1); } Circles.Add(circle); }
public void Clear() { Points.Clear(); Lines.Clear(); Arcs.Clear(); Circles.Clear(); Paths.Clear(); }
private void CreateCircles() { Circles.Clear(); for (int i = 0; i < predeterminedPoints.Count; i++) { Circles.Add(new Circle(predeterminedPoints[i].X, predeterminedPoints[i].Y, 10, 3, Color.Red)); } }
//void container_CalculatorChanged() //{ // InsideRadius = Container.Calculator.radius; // OutsideRadius = InsideRadius + DefaultLoopWidthInPoints / Container.UnitSize; // Clear(); // Initialize(); //} //void Container_UnitSizeChanged(float oldSize, float newSize) //{ // OutsideRadius = InsideRadius + DefaultLoopWidthInPoints / newSize; // Clear(); // Initialize(); //} //void Container_MaxCycleChanged(int oldMax, int newMax) //{ // InsideRadius = Container.Calculator.radius; // OutsideRadius = InsideRadius + DefaultLoopWidthInPoints / Container.UnitSize; // Clear(); // Initialize(); //} public void Draw(Graphics g) { if (IsVisible) { Circles.Draw(g); TicksAndLables.Draw(g); } }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { var circles = await Circles.GetCircles(); itemGridView.ItemsSource = circles; // TODO: Assign a bindable group to this.DefaultViewModel["Group"] // TODO: Assign a collection of bindable items to this.DefaultViewModel["Items"] }
public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + TitleUnicode.GetHashCode(); hash = hash * 23 + TitleRoman.GetHashCode(); hash = hash * 23 + ArtistUnicode.GetHashCode(); hash = hash * 23 + ArtistRoman.GetHashCode(); hash = hash * 23 + Creator.GetHashCode(); hash = hash * 23 + DiffName.GetHashCode(); hash = hash * 23 + Mp3Name.GetHashCode(); hash = hash * 23 + Md5.GetHashCode(); hash = hash * 23 + OsuFileName.GetHashCode(); hash = hash * 23 + Tags.GetHashCode(); hash = hash * 23 + Somestuff.GetHashCode(); hash = hash * 23 + _state.GetHashCode(); hash = hash * 23 + Circles.GetHashCode(); hash = hash * 23 + Sliders.GetHashCode(); hash = hash * 23 + Spinners.GetHashCode(); hash = hash * 23 + EditDate.GetHashCode(); hash = hash * 23 + ApproachRate.GetHashCode(); hash = hash * 23 + CircleSize.GetHashCode(); hash = hash * 23 + HpDrainRate.GetHashCode(); hash = hash * 23 + OverallDifficulty.GetHashCode(); hash = hash * 23 + SliderVelocity.GetHashCode(); hash = hash * 23 + DrainingTime.GetHashCode(); hash = hash * 23 + TotalTime.GetHashCode(); hash = hash * 23 + PreviewTime.GetHashCode(); hash = hash * 23 + MapId.GetHashCode(); hash = hash * 23 + MapSetId.GetHashCode(); hash = hash * 23 + ThreadId.GetHashCode(); hash = hash * 23 + OsuGrade.GetHashCode(); hash = hash * 23 + TaikoGrade.GetHashCode(); hash = hash * 23 + CatchGrade.GetHashCode(); hash = hash * 23 + ManiaGrade.GetHashCode(); hash = hash * 23 + Offset.GetHashCode(); hash = hash * 23 + StackLeniency.GetHashCode(); hash = hash * 23 + PlayMode.GetHashCode(); hash = hash * 23 + Source.GetHashCode(); hash = hash * 23 + AudioOffset.GetHashCode(); hash = hash * 23 + LetterBox.GetHashCode(); hash = hash * 23 + Played.GetHashCode(); hash = hash * 23 + LastPlayed.GetHashCode(); hash = hash * 23 + IsOsz2.GetHashCode(); hash = hash * 23 + Dir.GetHashCode(); //hash = hash * 23 + LastSync.GetHashCode(); //This value is updated by osu even if no changes were made to the actual data hash = hash * 23 + DisableHitsounds.GetHashCode(); hash = hash * 23 + DisableSkin.GetHashCode(); hash = hash * 23 + DisableSb.GetHashCode(); hash = hash * 23 + BgDim.GetHashCode(); hash = hash * 23 + ModPpStars.GetHashCode(); hash = hash * 23 + MaxBpm.GetHashCode(); hash = hash * 23 + MinBpm.GetHashCode(); hash = hash * 23 + MainBpm.GetHashCode(); return(hash); } }
public void RemoveCircle() { if (Circles.Count > Settings.ActivePolygonsMin) { int index = Tools.GetRandomNumber(0, Circles.Count); Circles.RemoveAt(index); SetDirty(); } }
public override void Create() { // Baseline is the bottom hole because most shapes are arcs with it as their center Children.Add(Circles.CutCircle(FastenerDiameter, 0, 0)); Children.Add(CreateAngleMarks()); Children.Add(CreateSlotPath()); Children.Add(CreateAngleText()); Children.Add(CreateOutline()); }
public void Initialize() { Circles.Mapper = this.ToPhysicalAngle; TicksAndLables.Mapper = this.ToPhysicalAngle; Circles.Add(new PointF(), OutsideRadius, false, new SolidBrush(LoopColor), new Pen(BorderColor, BorderWidth)); Circles.Add(new PointF(), InsideRadius, false, IsTransparent ? new SolidBrush(Color.Transparent) : new SolidBrush(FaceColor), new Pen(BorderColor, BorderWidth)); #region Add Ticks if (MajorTickStep > 0) { Pen majorPen = new Pen(ScaleColor, 3); TicksAndLables.AddLines(InsideRadius, 0, -0.4f, MajorTickStep, majorPen, null, false); TicksAndLables.AddLines(OutsideRadius - 0.2f, 0, -0.4f, MajorTickStep, majorPen, null, false); } if (MiddleTickStep > 0) { Pen middlePen = new Pen(ScaleColor, 2); AngleFilterDelegate filter = new AngleFilterDelegate(x => x % MajorTickStep == 0); TicksAndLables.AddLines(InsideRadius, 0, -0.2f, MiddleTickStep, middlePen, filter, false); TicksAndLables.AddLines(OutsideRadius - 0.1f, 0, -0.2f, MiddleTickStep, middlePen, filter, false); } if (MinorTickStep > 0) { Pen minorPen = new Pen(ScaleColor, 1); //AngleFilterDelegate filter = new AngleFilterDelegate(x => x % MiddleTickStep == 0); TicksAndLables.AddLines(InsideRadius, 0, -0.2f, MinorTickStep, minorPen, (x => x % MiddleTickStep == 0), true); TicksAndLables.AddLines(OutsideRadius - 0.1f, 0, -0.2f, MinorTickStep, minorPen, (x => x % MiddleTickStep == 0), true); } #endregion float middle = (InsideRadius + OutsideRadius) / 2f; if (LabelStep > 0) { TicksAndLables.AddLables(new Font("AstroGadget", 9f, FontStyle.Regular), new SolidBrush(LabelColor), middle, 0, 0, 12, null, null); } if (SignOffset > 0) { List <string> signs = new List <string>(); for (char c = 'a'; c < 'm'; c++) { signs.Add(c.ToString()); } TicksAndLables.AddLables(signs, new Font("AstroGadget", 24f, FontStyle.Bold), new SolidBrush(IsTransparent ? Color.FromArgb(127, Color.Crimson) : Color.Crimson), middle, SignOffset, -90f, null, null); } }
public void Draw(Point point1, Point point2) { var diametr = (int)Math.Sqrt(Math.Pow(point1.X - point2.X, 2) + Math.Pow(point1.Y - point2.Y, 2)) * 2; Graphics.DrawRectangle(Pen, point1.X, point1.Y, 2, 2); Graphics.DrawEllipse(Pen, point1.X - diametr / 2, point1.Y - diametr / 2, diametr, diametr); Circles.Add(new List <Point> { point1, point2 }, Pen.Color); }
public Jinx() { Q = new Spell(SpellSlot.Q, 600); W = new Spell(SpellSlot.W, 1500f); W.SetSkillshot(0.6f, 60f, 3300f, true, SkillshotType.SkillshotLine); E = new Spell(SpellSlot.E, 900f); E.SetSkillshot(1.0f, 1f, 1750f, false, SkillshotType.SkillshotCircle); R = new Spell(SpellSlot.R, 2000); R.SetSkillshot(0.6f, 140f, 1700f, false, SkillshotType.SkillshotLine); //Drawings Circles.Add("W Range", W); //Spell usage. var cMenu = new Menu("Combo", "combo"); cMenu.AddItem(new MenuItem("combomana", "Minimum mana %")).SetValue(new Slider(5)); cMenu.AddItem(new MenuItem("usecomboq", "Use Switcheroo", true).SetValue(true)); cMenu.AddItem(new MenuItem("usecombow", "Use Zap", true).SetValue(true)); cMenu.AddItem(new MenuItem("usecomboe", "Use Flame Chompers", true).SetValue(true)); cMenu.AddItem(new MenuItem("usecombor", "Use Mega Death Rocket", true).SetValue(true)); cMenu.AddItem(new MenuItem("usecombo", "Combo (active)")).SetValue(new KeyBind(32, KeyBindType.Press)); ProSeries.Config.AddSubMenu(cMenu); var hMenu = new Menu("Harass", "harass"); hMenu.AddItem(new MenuItem("harassmana", "Minimum mana %")).SetValue(new Slider(55)); hMenu.AddItem(new MenuItem("useharassq", "Use Switcheroo", true).SetValue(true)); hMenu.AddItem(new MenuItem("useharassw", "Use Zap", true).SetValue(true)); hMenu.AddItem(new MenuItem("useharass", "Harass (active)")).SetValue(new KeyBind(67, KeyBindType.Press)); ProSeries.Config.AddSubMenu(hMenu); var wMenu = new Menu("Farming", "farming"); wMenu.AddItem(new MenuItem("clearmana", "Minimum mana %")).SetValue(new Slider(75)); wMenu.AddItem(new MenuItem("useclearq", "Use Switcheroo", true).SetValue(true)); wMenu.AddItem(new MenuItem("clearqmin", "Minimum minion count", true)).SetValue(new Slider(3, 2, 6)); wMenu.AddItem(new MenuItem("useclear", "Wave/Jungle (active)")).SetValue(new KeyBind(86, KeyBindType.Press)); ProSeries.Config.AddSubMenu(wMenu); var mMenu = new Menu("Misc", "misc"); mMenu.AddItem(new MenuItem("maxrdist", "Max R distance", true)).SetValue(new Slider(1500, 0, 3000)); mMenu.AddItem(new MenuItem("useeimm", "Use E on Immobile", true)).SetValue(true); mMenu.AddItem(new MenuItem("useedash", "Use E on Dashing", true)).SetValue(true); ProSeries.Config.AddSubMenu(mMenu); //Events Game.OnUpdate += Game_OnGameUpdate; Orbwalking.AfterAttack += OrbwalkingOnAfterAttack; }
public void DrawImages(Graphics g) { //foreach (var obj in Circles) //{ // obj.DrawImages(g); //} for (int i = Circles.Count() - 1; i >= 0; i--) { Circles[i].DrawImages(g); } }
public void Clear() { Circles.Clear(); Rectangles.Clear(); Triangles.Clear(); WarningSigns.Clear(); ProhibitingSigns.Clear(); RegulatorySigns.Clear(); InformationSigns.Clear(); TemporarySigns.Clear(); }
public void AddCircle() { if (Circles.Count < Settings.ActivePolygonsMax) { var newCircle = new DnaCircle(); newCircle.Init(); int index = Tools.GetRandomNumber(0, Circles.Count); Circles.Insert(index, newCircle); SetDirty(); } }
public void RemoveTests(List <Circle> circles, Circle c) { Circles circleList = new Circles(); foreach (var circle in circles) { circleList.Add(circle); } circleList.Remove(c); Assert.False(circleList.Contains(c)); }
public void SetOrginalCenter(Point orginalCenter) { this.OrginalCenter = orginalCenter; if (Circles.Any()) { var startPoint = new Point(OrginalCenter.X, OrginalCenter.Y - (int)(CircleCount - 1) * CircleVerInterval / 2); for (var i = 0; i < CircleCount; i++) { var center = new Point(startPoint.X, startPoint.Y + i * CircleVerInterval); Circles[i].CircleCenter = center; } } }
private void ButtonClickClone(object sender, RoutedEventArgs e) { IFigure figure = new Rectangles(30, 40); IFigure clonedFigure = figure.Clone(); figure.GetInfo(); clonedFigure.GetInfo(); IFigure figures = new Circles(30); IFigure clonedFigures = figures.Clone(); tb.Text = System.String.Format(" {0} \n {1} \n {2} \n {3}", figures.GetInfo(), clonedFigures.GetInfo(), figure.GetInfo(), clonedFigure.GetInfo()); }
void Awake() { _instance = this; data = new List<Circle>(GetComponentsInChildren<Circle>()); }