本文整理汇总了C#中Region类的典型用法代码示例。如果您正苦于以下问题:C# Region类的具体用法?C# Region怎么用?C# Region使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Region类属于命名空间,在下文中一共展示了Region类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegionTag
public RegionTag(Region parent, string reference, int index, Region ownregion)
{
_Parent = parent;
_Index = index;
_Reference = reference;
_OwnRegion = ownregion;
}
示例2: AddRegion
public void AddRegion(Region region)
{
if (!regions.Contains(region))
{
regions.Add(region);
}
}
示例3: Column
/// <summary>
/// Initializes a new Column for the given parent <see cref="Region"/> at source
/// row/column position srcPos and column grid position pos.
/// </summary>
/// <param name="region">The parent Region this Column belongs to.</param>
/// <param name="centralPositionInInput">A Point(x,y) of this Column's 'center' position in
/// terms of the proximal-synapse input space.</param>
/// <param name="positionInRegion">A Point(x,y) of this Column's position within the Region's
/// column grid.</param>
public Column(Region region, Point centralPositionInInput, Point positionInRegion)
{
// Set fields
this.Region = region;
this.CentralPositionInInput = centralPositionInInput;
this.PositionInRegion = positionInRegion;
this.Overlap = 0;
this.Boost = 1.0f;
this.ActiveDutyCycle = 1;
this.OverlapDutyCycle = 1.0f;
this._random = new Random((positionInRegion.Y * this.Region.Size.Width) + positionInRegion.X);
// Initialize state vectors with fixed lenght = T
for (int t = 0; t <= Global.T; t++)
{
this.ActiveState.Add(false);
this.InhibitedState.Add(false);
}
// Fill Column with contextual cells
this.Cells = new BindingList<Cell>();
for (int i = 0; i < region.CellsPerColumn; i++)
{
this.Cells.Add(new Cell(this, i));
}
// The list of potential proximal synapses and their permanence values.
this.ProximalSegment = new ProximalSegment ( this );
}
示例4: frmLogin
public frmLogin()
{
InitializeComponent();
foreach (Button btn in this.Controls.OfType<Button>())
{//this will controll all button inside form
btn.FlatStyle = FlatStyle.Standard;
btn.ForeColor = Color.Black;
btn.BackColor = Color.White;
}
foreach (TextBox txtbox in this.Controls.OfType<TextBox>())
{//this will controll all textbox inside form
txtbox.BorderStyle = BorderStyle.None;
}
//background
this.BackgroundImage = Properties.Resources.bg;
this.BackgroundImageLayout = ImageLayout.Stretch;
System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
gp.AddEllipse(0, 0, pictureBox1.Width - 3, pictureBox1.Height - 3);
Region rg = new Region(gp);
pictureBox1.Region = rg;
}
示例5: ItemAutoSubscription
/// <summary>
/// Initializes a new instance of the <see cref = "ItemAutoSubscription" /> class.
/// </summary>
/// <param name = "item">
/// The subscribed item.
/// </param>
/// <param name = "itemPosition">
/// The item position.
/// </param>
/// <param name = "itemRegion">
/// The item Region.
/// </param>
/// <param name = "subscription">
/// The subscription.
/// </param>
public ItemAutoSubscription(Item item, Vector itemPosition, Region itemRegion, IDisposable subscription)
{
this.ItemPosition = itemPosition;
this.item = item;
this.subscription = subscription;
this.WorldRegion = itemRegion;
}
示例6: Contains
public bool Contains( Region reg )
{
if ( reg == null || ( m_ForceMap != null && reg.Map != m_ForceMap ) )
return false;
return reg.IsPartOf( m_RegionName );
}
示例7: OnExitRegionComplete
private void OnExitRegionComplete(Region region)
{
if (ExitRegionComplete != null)
{
ExitRegionComplete(this, new MonitorEventArgs{ Region = region });
}
}
示例8: Acc_Delete_Simple
public void Acc_Delete_Simple()
{
//insert a test product
Region r = new Region();
r.RegionDescription = "Test";
r.Save("test");
int records = DB.Select()
.From(Region.Schema)
.Where("regiondescription").IsEqualTo("Test")
.GetRecordCount();
Assert.IsTrue(records == 1);
DB.Delete()
.From(Region.Schema)
.Where("regiondescription").IsEqualTo("Test")
.Execute();
records = DB.Select()
.From(Region.Schema)
.Where("regiondescription").IsEqualTo("Test")
.GetRecordCount();
Assert.IsTrue(records == 0);
}
示例9: DidExitRegion
public void DidExitRegion(Region region)
{
if (ExitBeaconRegion != null)
{
ExitBeaconRegion(RegionBeaconConverter.ConvertRegionToBeacon(region));
}
}
示例10: TestLoadRegion
public void TestLoadRegion()
{
Region region = new Region(Vector3.Zero, null, Path.Combine("TestWorld", "region", "r.0.0.mca"));
var chunk = region.GetChunk(Vector3.Zero);
for (int y = 0; y < Chunk.Height - 1; y++ )
Assert.AreEqual(new GoldBlock(), chunk.GetBlock(new Vector3(0, y, 0)));
}
示例11: Process
private Int32 width; //delete
#endregion Fields
#region Methods
public List<Region> Process(Region input, Int32 h = 1)
{
try
{
this.level = Convert.ToByte(input.Level + h);
this.input = input;
this.width = input.GrayscaleMask.Width;
this.height = input.GrayscaleMask.Height;
this.board = new int[width, height];
Dictionary<int, List<Pixel>> patterns = Find();
var regions = new List<Region>();
foreach (KeyValuePair<int, List<Pixel>> pattern in patterns)
{
//var region = CreateRegion(pattern.Value);
//if (region == null)
//{
// continue;
//}
//regions.Add(region);
regions.Add(CreateRegion(pattern.Value));
}
return regions;
}
catch (OverflowException)
{
return new List<Region>();
}
}
示例12: CreateRequestAsync
public virtual async Task<string> CreateRequestAsync(string relativeUrl, Region region,
List<string> addedArguments = null)
{
RootDomain = "global.api.pvp.net";
var request = PrepareRequest(relativeUrl, addedArguments);
return await GetResponseAsync(request);
}
示例13: QuestCompleteObjectiveRegion
public QuestCompleteObjectiveRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
{
XmlElement questEl = xml["quest"];
ReadType( questEl, "type", ref m_Quest );
ReadType( questEl, "complete", ref m_Objective );
}
示例14: InitializeBeaconManager
private BeaconManager InitializeBeaconManager()
{
// Enable the BeaconManager
BeaconManager bm = BeaconManager.GetInstanceForApplication(Xamarin.Forms.Forms.Context);
#region Set up Beacon Simulator if testing without a BLE device
// var beaconSimulator = new BeaconSimulator();
// beaconSimulator.CreateBasicSimulatedBeacons();
//
// BeaconManager.BeaconSimulator = beaconSimulator;
#endregion
var iBeaconParser = new BeaconParser();
// Estimote > 2013
iBeaconParser.SetBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24");
bm.BeaconParsers.Add(iBeaconParser);
_monitorNotifier.EnterRegionComplete += EnteredRegion;
_monitorNotifier.ExitRegionComplete += ExitedRegion;
_monitorNotifier.DetermineStateForRegionComplete += DeterminedStateForRegionComplete;
_rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
_tagRegion = new AltBeaconOrg.BoundBeacon.Region("myUniqueBeaconId", Identifier.Parse("E4C8A4FC-F68B-470D-959F-29382AF72CE7"), null, null);
_tagRegion = new AltBeaconOrg.BoundBeacon.Region("myUniqueBeaconId", Identifier.Parse("B9407F30-F5F8-466E-AFF9-25556B57FE6D"), null, null);
_emptyRegion = new AltBeaconOrg.BoundBeacon.Region("myEmptyBeaconId", null, null, null);
bm.SetBackgroundMode(false);
bm.Bind((IBeaconConsumer)Xamarin.Forms.Forms.Context);
return bm;
}
示例15: Create
public ActionResult Create(Region Region)
{
Context.Regions.Add(Region);
Context.SaveChanges();
return this.RedirectToAction("Index");
}