public void ButtonClick7(object sender, EventArgs e) { if (points.Count == 4) { if (bt7.BackColor != Color.Green) { bt7.BackColor = Color.Green; bt8.BackColor = Color.Empty; bt6.BackColor = Color.Empty; bt5.BackColor = Color.Empty; } else { bt7.BackColor = Color.Empty; } if (choice != flags.bBeizers) { choice = flags.bBeizers; } else { choice = flags.bInitial; } Refresh(); } }
: super( xmlElementName, uri, flags, version) { }
public MainWindow(Icon ic, string v, IntPtr hWnd, flags f) { this.ic = ic; this.title = v; this.hWnd = hWnd; this.flag = f; }
/// <summary> /// 创建URI并修复绝对URI /// </summary> /// <param name="url">URI字符串</param> /// <param name="removeFlags">删除状态,比如flags.ShouldBeCompressed | flags.E_QueryNotCanonical</param> /// <returns>创建的URI</returns> public static Uri CreateAbsolute(string url, flags removeFlags) { Uri uri; if (Uri.TryCreate(url, UriKind.Absolute, out uri) && IsUriField && uri.AbsoluteUri != url) { setAbsolute(uri, url, removeFlags); } return(uri); }
/// <summary> /// 创建URI并修复绝对URI /// </summary> /// <param name="url">URI字符串</param> /// <param name="removeFlags">删除状态,比如flags.ShouldBeCompressed | flags.E_QueryNotCanonical</param> /// <returns>创建的URI</returns> public static Uri CreateAbsolute(string url, flags removeFlags) {//#uri.m_Info.Offset.Fragment = uri.m_Info.Offset.End Uri uri; if (Uri.TryCreate(url, UriKind.Absolute, out uri) && uri.AbsoluteUri != url) { setAbsolute(uri, url, removeFlags); } return(uri); }
public UIObject(string name, UIAlignment boundsAlign, UIAlignment alignment, flags flag) { //default values (this will be overwritten in derived classes) bounds = new Rectangle(0, 0, 0, 0); childObjects = new List <UIObject>(); this.Name = name; this.flag = flag; origin = alignment.GetAlignment(this, this); }
public UIObject(string name, Rectangle bounds, UIAlignment boundsAlign, UIAlignment alignment, flags flag) { childObjects = new List <UIObject>(); this.Name = name; this.bounds = bounds; this.flag = flag; Vector2 boundsAlignment = boundsAlign.GetAlignment(this, parent); this.bounds.X = (int)boundsAlignment.X; this.bounds.Y = (int)boundsAlignment.Y; origin = alignment.GetAlignment(this, this); }
public void ButtonClick10(object sender, EventArgs e) { choice = flags.bClear; t.Enabled = false; points.Clear(); speeds.Clear(); bt5.BackColor = Color.Empty; bt7.BackColor = Color.Empty; bt6.BackColor = Color.Empty; bt8.BackColor = Color.Empty; bt9.BackColor = Color.Empty; Refresh(); }
/// <summary> /// The only methods on the public interface used for getting the description. /// </summary> /// <param name="what_part">or-ed enum values teling us what caller wants described</param> /// <returns>report in a string</returns> public string describe(fm.Itypeinfo.WHAT what_part) { lock (this) { fm.flags what = new flags(what_part); bool SHOW_ATTR = what.contains(Itypeinfo.WHAT.ATTRIBUTES); Type type = this.specimen_.GetType(); System.Text.StringBuilder retval = new System.Text.StringBuilder(); // this info we return always retval.AppendFormat("{0}{1}", Environment.NewLine, STRNGS.NME); retval.AppendFormat("{0}\t{1}", Environment.NewLine, base_data(type, true)); if (what == Itypeinfo.WHAT.INTERFACES) { bool show_m = what.contains(Itypeinfo.WHAT.INTERFACE_METHODS); retval.Append(interfaces(this.specimen_, SHOW_ATTR, show_m)); } if (what == Itypeinfo.WHAT.PARENT) { if (type.BaseType != null) { retval.Append(STRNGS.BTP); retval.AppendFormat("{0}\t{1}", Environment.NewLine, base_data(type.BaseType, SHOW_ATTR)); } } if (what == Itypeinfo.WHAT.FIELDS) { retval.Append(fields(this.specimen_)); } if (what == Itypeinfo.WHAT.PROPERTIES) { retval.Append(propertys(this.specimen_)); } if (what == Itypeinfo.WHAT.METHODS) { retval.Append(methods(this.specimen_.GetType(), SHOW_ATTR)); } return(retval.ToString()); } }
public UIText(string name, UIAlignment boundsAlign, UIAlignment alignment, flags flag, string fontName, string text, int fontSize, string targetName = null) : base(name, boundsAlign, alignment, flag) { textRenderer = TextRenderer.MakeTextRenderer(name, fontName, targetName); textRenderer.Size = fontSize; textRenderer.Text = text; //textRenderer.Font = Resources.LoadAsset(new Font().GetType(), fontName, SceneManager.activeScene) as Font; //get the width and height of the string being drawn bounds.Width = (int)((float)textRenderer.Font.GetFont(fontSize).MeasureString(text).X *(float)fontSize / (float)textRenderer.Font.GetSize(fontSize)); bounds.Height = (int)((float)textRenderer.Font.GetFont(fontSize).MeasureString(text).Y *(float)fontSize / (float)textRenderer.Font.GetSize(fontSize)); Vector2 boundsAlignment = boundsAlign.GetAlignment(this, parent); bounds.X = (int)boundsAlignment.X; bounds.Y = (int)boundsAlignment.Y; textRenderer.Position = new Vector2(bounds.X, bounds.Y); }
public void ButtonClick8(object sender, EventArgs e) { if (bt8.BackColor != Color.Green) { bt8.BackColor = Color.Green; bt7.BackColor = Color.Empty; bt6.BackColor = Color.Empty; bt5.BackColor = Color.Empty; } else { bt8.BackColor = Color.Empty; } if (choice != flags.bFilled) { choice = flags.bFilled; } else { choice = flags.bInitial; } Refresh(); }
public void ButtonClick(object sender, EventArgs e) { if (bt1.BackColor != Color.Green) { bt1.BackColor = Color.Green; bt5.BackColor = Color.Empty; bt7.BackColor = Color.Empty; bt6.BackColor = Color.Empty; bt8.BackColor = Color.Empty; } else { bt1.BackColor = Color.Empty; bt5.BackColor = Color.Empty; bt7.BackColor = Color.Empty; bt6.BackColor = Color.Empty; bt8.BackColor = Color.Empty; } mClick = !mClick; choice = flags.bInitial; Refresh(); }
return(new ConditionMessage(condition, db, flags, command, key, value));
public static extern Int32 BASS_StreamCreateURL(string url, int offset, flags Flag, IntPtr dproc, IntPtr user );
ref keventt ev = ref heap(new keventt(filter: _EVFILT_READ, flags: _EV_ADD, ) * (uintptr.val)(@unsafe.Pointer(_addr_ev.ident)), out ptr <keventt> _addr_ev);
/// <summary> /// 修复绝对URI /// </summary> /// <param name="uri">URI</param> /// <param name="absoluteUri">绝对URI</param> /// <param name="removeFlags">删除状态</param> private static void setAbsolute(Uri uri, string absoluteUri, flags removeFlags) { uriAbsolute(uriMoreInfo(uriInfo(uri)), absoluteUri); uriFlags.Setter(uri, (ulong)uriFlags.Getter(uri) & (ulong.MaxValue ^ (ulong)removeFlags)); }
/// <summary> /// 修复绝对URI /// </summary> /// <param name="uri">URI</param> /// <param name="absoluteUri">绝对URI</param> /// <param name="removeFlags">删除状态</param> private static void setAbsolute(Uri uri, string absoluteUri, flags removeFlags) { setFlags(uri, setAbsoluteUri(uri, absoluteUri) & (ulong.MaxValue ^ (ulong)removeFlags)); }
public Form1() { myPen = new Pen(Color.Red, lines); myBrush = Brushes.Yellow; this.Size = new Size(800, 500); this.Text = "Движение"; InitializeComponent(); #region КНОПКИ bt1 = new Button() { Text = "Точки", Size = new Size(90, 30), Location = new Point(10, 10), }; this.Controls.Add(bt1); bt1.Click += ButtonClick; bt4 = new Button() { Text = "Параметры", Left = bt1.Left, Top = bt1.Top + 40, Size = bt1.Size }; this.Controls.Add(bt4); bt4.Click += ButtonClick4; bt5 = new Button() { Text = "Кривая", Left = bt1.Left, Top = bt4.Top + 40, Size = bt1.Size }; this.Controls.Add(bt5); bt5.Click += ButtonClick5; bt6 = new Button() { Text = "Ломаная", Left = bt1.Left, Top = bt5.Top + 40, Size = bt1.Size }; this.Controls.Add(bt6); bt6.Click += ButtonClick6; bt7 = new Button() { Text = "Безьеры", Left = bt1.Left, Top = bt6.Top + 40, Size = bt1.Size }; this.Controls.Add(bt7); bt7.Click += ButtonClick7; bt8 = new Button() { Text = "Закрашенная", Left = bt1.Left, Top = bt7.Top + 40, Size = bt1.Size }; this.Controls.Add(bt8); bt8.Click += ButtonClick8; bt9 = new Button() { Text = "Движение", Left = bt1.Left, Top = bt8.Top + 40, Size = bt1.Size }; this.Controls.Add(bt9); bt9.Click += ButtonClick9; bt10 = new Button() { Text = "Отчистить", Left = bt1.Left, Top = bt9.Top + 40, Size = bt1.Size }; Refresh(); this.Controls.Add(bt10); bt10.Click += ButtonClick10; #endregion t.Interval = 30; t.Tick += TickHandler; MouseClick += (o, e) => { if (mClick) { Point p = e.Location; points.Add(p); Random r = new Random(); speeds.Add(new Point(r.Next(-3, 3), r.Next(-3, 3))); if (choice == flags.bBeizers) { choice = flags.bInitial; bt7.BackColor = Color.Empty; } Refresh(); } }; MouseDown += Form1_MouseDown; void Form1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { for (int i = 0; i < points.Count; i++) { Point p = points[i]; // Сравниваем положение курсора мышки с // координатами точки p (пользовательский метод) if (IsOnPoint(e.Location, p)) { // Сохраняем индекс перемещаемой точки iDraggingPoint = i; // Устанавливаем флаг перемещения точки bDrag = true; } } } }; void Form1_MouseMove(object sender, MouseEventArgs e) { // Проверяем флаг перемещения if (bDrag) { // Изменяем координаты выбранной точки points[iDraggingPoint] = new Point(e.Location.X, e.Location.Y); Refresh(); } }; MouseMove += Form1_MouseMove; void Form1_MouseUp(object sender, MouseEventArgs e) { // Сбрасываем флаг перемещения bDrag = false; } MouseUp += Form1_MouseUp; bool IsOnPoint(Point a, Point e) { return(a.X <= e.X + 20 && a.X >= e.X - 20 && a.Y <= e.Y + 20 && a.Y >= e.Y - 20); } Paint += Form1_Paint; KeyPreview = true; KeyDown += Form1_KeyDown; DoubleBuffered = true; //Mouse }
: super(flags) { this.typeSystem = typeSystem; }
public UIImage(string name, Rectangle bounds, UIAlignment boundsAlign, UIAlignment alignment, flags flags, string imageName, string targetName = null) : base(name, bounds, boundsAlign, alignment, flags) { spriteRenderer = SpriteRenderer.MakeSpriteRenderer(name, imageName, targetName); spriteRenderer.Name = name; spriteRenderer.sprite = Resources.LoadAsset(new Sprite().GetType(), imageName, SceneManager.activeScene) as Sprite; spriteRenderer.sprite.DestinationRect = new Rectangle((int)origin.X, (int)origin.Y, this.bounds.Width, this.bounds.Height); }
//public static extern Int32 BASS_StreamCreateURL(string url,int offset, flags flag, IntPtr user); public static extern Int32 BASS_StreamCreateURL(string url, int offset, flags Flag, IntPtr dproc, IntPtr user);
Types = new GenTypes(new GeneratorOptions(flags, includeCpuid, excludeCpuid), new GeneratorDirs(baseDir));
/// <summary> /// 创建URI并修复绝对URI /// </summary> /// <param name="url">URI字符串</param> /// <param name="removeFlags">删除状态,比如flags.ShouldBeCompressed | flags.E_QueryNotCanonical</param> /// <returns>创建的URI</returns> public static Uri CreateAbsolute(string url, flags removeFlags) { Uri uri; if (Uri.TryCreate(url, UriKind.Absolute, out uri) && IsUriField && uri.AbsoluteUri != url) setAbsolute(uri, url, removeFlags); return uri; }