• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IArea类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



IArea类属于命名空间,在下文中一共展示了IArea类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ApplyArea

		public IBitmap ApplyArea(IArea area)
		{
			//todo: performance can be improved by only creating a bitmap the size of the area, and not the entire background.
			//This will require to change the rendering as well to offset the location
			byte zero = (byte)0;
			Bitmap output = new Bitmap(Width, Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
			using (FastBitmap inBmp = new FastBitmap (_bitmap, ImageLockMode.ReadOnly))
			{
				using (FastBitmap outBmp = new FastBitmap (output, ImageLockMode.WriteOnly, true))
				{
					for (int y = 0; y < Height; y++)
					{
						int bitmapY = Height - y - 1;
						for (int x = 0; x < Width; x++)
						{
							System.Drawing.Color color = inBmp.GetPixel(x, bitmapY);
							byte alpha = area.IsInArea(new AGS.API.PointF(x, y)) ? color.A : zero;
							outBmp.SetPixel(x, bitmapY, System.Drawing.Color.FromArgb(alpha, color));
						}
					}
				}
			}

            return new DesktopBitmap(output, _graphics);
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:25,代码来源:DesktopBitmap.cs


示例2: AreaStream

        public AreaStream(IArea area)
        {
            if (area == null)
                throw new ArgumentNullException("area");

            this.area = area;
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:AreaStream.cs


示例3: ApplyArea

		public IBitmap ApplyArea(IArea area)
		{
			//todo: performance can be improved by only creating a bitmap the size of the area, and not the entire background.
			//This will require to change the rendering as well to offset the location
			byte zero = (byte)0;
			Bitmap output = Bitmap.CreateBitmap(Width, Height, Bitmap.Config.Argb8888);
			using (FastBitmap inBmp = new FastBitmap (_bitmap))
			{
				using (FastBitmap outBmp = new FastBitmap (output, true))
				{
					for (int y = 0; y < Height; y++)
					{
						int bitmapY = Height - y - 1;
						for (int x = 0; x < Width; x++)
						{
							global::Android.Graphics.Color color = inBmp.GetPixel(x, bitmapY);
							byte alpha = area.IsInArea(new AGS.API.PointF(x, y)) ? color.A : zero;
							outBmp.SetPixel(x, bitmapY, new global::Android.Graphics.Color(color.R, color.G, color.B, alpha));
						}
					}
				}
			}

            return new AndroidBitmap(output, _graphics);
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:25,代码来源:AndroidBitmap.cs


示例4: SolidAngleBase

 /// <summary>
 /// 
 /// </summary>
 /// <param name="abbreviation"></param>
 /// <param name="toBase"></param>
 /// <param name="fromBase"></param>
 /// <param name="surfaceArea"></param>
 /// <param name="squareRadius"></param>
 protected SolidAngleBase(string abbreviation,
     IUnitConversion toBase, IUnitConversion fromBase,
     IArea surfaceArea, ILength squareRadius)
     : base(abbreviation, toBase, fromBase, surfaceArea, squareRadius)
 {
     VerifyDimensions();
 }
开发者ID:mwpowellhtx,项目名称:clockworks,代码行数:15,代码来源:SolidAngleBase.cs


示例5: GetRealThemeName

        public string GetRealThemeName(IArea area, string theme)
        {
            if (string.IsNullOrEmpty(theme))
                theme = "default";

            string dir = Path.Combine(ServerUtil.MapPath(area.VirtualPath), "themes");

            string format = theme;
            if (format.IndexOf('.') != -1)
                format = format.Split('.')[0];

            if (IsMobile)
            {
                if (Directory.Exists(Path.Combine(dir, string.Format("{0}_mobile", theme))))
                    return string.Format("{0}_mobile", theme);

                if (format != theme && Directory.Exists(Path.Combine(dir, string.Format("{0}_mobile", format))))
                    return string.Format("{0}_mobile", format);

                if (format != "default" && Directory.Exists(Path.Combine(dir, "default_mobile")))
                    return "default_mobile";

                return "default";
            }
            else
            {
                if (Directory.Exists(Path.Combine(dir, theme)))
                    return theme;

                if (format != theme && Directory.Exists(Path.Combine(dir, format)))
                    return format;

                return "default";
            }
        }
开发者ID:Aliceljm1,项目名称:kiss-project.web,代码行数:35,代码来源:MobileDetect.cs


示例6: New

        public CoreDataSetProvider New(IArea area)
        {
            Area _area =  area as Area;

            if (_area == null)
            {
                CategoryArea categoryArea = area as CategoryArea;
                if (categoryArea.IsGpDeprivationDecile)
                {
                    return new GpDeprivationDecileCoreDataSetProvider(categoryArea, PracticeDataAccess);
                }
                return new CategoryAreaCoreDataSetProvider(categoryArea, GroupDataReader);
            }

            // Area 
            if (_area.IsCcg)
            {
                return new CcgCoreDataSetProvider(_area,
                    CcgPopulationProvider, CoreDataSetListProvider, GroupDataReader);
            }

            if (_area.IsShape)
            {
                return new ShapeCoreDataSetProvider(_area, PracticeDataAccess);
            }

            return new SimpleCoreDataSetProvider(_area, GroupDataReader);
        }
开发者ID:PublicHealthEngland,项目名称:fingertips-open,代码行数:28,代码来源:CoreDataSetProviderFactory.cs


示例7: RegisterLogicalActuator

        public LogicalBinaryStateActuator RegisterLogicalActuator(IArea area, Enum id)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));

            var actuator = new LogicalBinaryStateActuator(ComponentIdGenerator.Generate(area.Id, id), _timerService);
            area.AddComponent(actuator);

            return actuator;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:9,代码来源:ActuatorFactory.cs


示例8: CheckOnlyOneCoreDataSetFound

 private static void CheckOnlyOneCoreDataSetFound(Grouping grouping, IArea area,
     IList<CoreDataSet> dataList)
 {
     if (dataList.Count > 1)
     {
         throw new FingertipsException(string.Format("More than one CoreDataSet row for: IndicatorId={0} Area={1}",
             grouping.IndicatorId, area.Code));
     }
 }
开发者ID:PublicHealthEngland,项目名称:fingertips-open,代码行数:9,代码来源:BenchmarkDataProvider.cs


示例9: Create

		public static void Create(IArea area, float minScaling, float maxScaling, bool scaleObjectsX = true, bool scaleObjectsY = true, bool scaleVolume = true)
		{
            var component = area.AddComponent<IScalingArea>();
            component.MinScaling = minScaling;
            component.MaxScaling = maxScaling;
            component.ScaleObjectsX = scaleObjectsX;
            component.ScaleObjectsY = scaleObjectsY;
            component.ScaleVolume = scaleVolume;
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:9,代码来源:AGSScalingArea.cs


示例10: GetNationalArea

 protected IArea GetNationalArea(IArea area)
 {
     if (_nationalArea == null)
     {
         _nationalArea = area.IsCountry
             ? area
             : AreaFactory.NewArea(_areasReader, AreaCodes.England);
     }
     return _nationalArea;
 }
开发者ID:PublicHealthEngland,项目名称:fingertips-open,代码行数:10,代码来源:PartitionDataBuilderBase.cs


示例11: RegisterLamp

        public ILamp RegisterLamp(IArea area, Enum id, IBinaryOutput output)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (output == null) throw new ArgumentNullException(nameof(output));

            var lamp = new Lamp(ComponentIdGenerator.Generate(area.Id, id), new PortBasedBinaryStateEndpoint(output));
            area.AddComponent(lamp);

            return lamp;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:10,代码来源:ActuatorFactory.cs


示例12: RegisterHumiditySensor

        public IHumiditySensor RegisterHumiditySensor(IArea area, Enum id, INumericValueSensorEndpoint endpoint)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));

            var humditySensor = new HumiditySensor(ComponentIdGenerator.Generate(area.Id, id), _settingsService, endpoint);
            area.AddComponent(humditySensor);

            return humditySensor;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:10,代码来源:SensorFactory.cs


示例13: GetDrawable

        public IObject GetDrawable(IArea area, IBitmap bg)
		{
            IWalkBehindArea walkBehind = area.GetComponent<IWalkBehindArea>();
            if (walkBehind == null) return null;
			AreaKey key = new AreaKey (area, bg);
			IObject obj = _objects.GetOrAdd(key, () => createObject());
			obj.Z = walkBehind.Baseline == null ? area.Mask.MinY : walkBehind.Baseline.Value;
			obj.Image = _images.GetOrAdd(key, () => createImage(area, bg));
			return obj;
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:10,代码来源:AGSWalkBehindsMap.cs


示例14: AreaInputStream

        public AreaInputStream(IArea area, int buffer_size)
        {
            if (buffer_size <= 0)
             				throw new ArgumentOutOfRangeException("buffer_size", "The buffer size cannot be smaller or equal to 0.");

             			this.area = area;
             			this.buffer = new byte[buffer_size];
             			this.count = 0;
             			this.pos = 0;
        }
开发者ID:erpframework,项目名称:cloudb,代码行数:10,代码来源:AreaInputStream.cs


示例15: RegisterSocket

        public ISocket RegisterSocket(IArea area, Enum id, IBinaryOutput output)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (output == null) throw new ArgumentNullException(nameof(output));

            var socket = new Socket(ComponentIdGenerator.Generate(area.Id, id), new PortBasedBinaryStateEndpoint(output));
            area.AddComponent(socket);

            return socket;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:10,代码来源:ActuatorFactory.cs


示例16: IndicatorComparisonHelper

        public IndicatorComparisonHelper(IndicatorMetadata indicatorMetadata, Grouping grouping,
            IGroupDataReader groupDataReader, PholioReader pholioReader, IArea nationalArea)
        {
            // Assign constructor parameter to instance variables
            this.indicatorMetadata = indicatorMetadata;
            this.grouping = grouping;
            this.groupDataReader = groupDataReader;

            InitComparer(pholioReader, nationalArea);
        }
开发者ID:PublicHealthEngland,项目名称:fingertips-open,代码行数:10,代码来源:IndicatorComparisonHelper.cs


示例17: Require

        /// <summary>
        /// 依赖的资源名称,多个资源名称使用逗号分隔
        /// </summary>
        /// <param name="resourceName"></param>
        public void Require(IArea area, string resourceName)
        {
            if (string.IsNullOrEmpty(resourceName)) return;

            JContext jc = JContext.Current;

            foreach (var res in StringUtil.Split(resourceName, StringUtil.Comma, true, true))
            {
                if (res == "jquery.js")
                {
                    Head.RequireJquery = true;
                    continue;
                }

                string resourceUrl = string.Empty;

                string key = string.Format("define_{0}", res);

                if (area != null && !string.IsNullOrEmpty(area[key]))
                {
                    resourceUrl = jc.CombinUrl(area, area[key], false);
                }
                else
                {
                    foreach (IArea item in jc.Host.AllAreas)
                    {
                        if (area != null && item.AreaKey == area.AreaKey) continue;

                        if (!string.IsNullOrEmpty(item[key]))
                        {
                            resourceUrl = jc.CombinUrl(item, item[key], false);
                            break;
                        }
                    }

                    if (string.IsNullOrEmpty(resourceUrl))
                    {
                        if (res == "kiss.js" || res == "kiss.css" || res == "jqueryui.js" || res == "jqueryui.css")
                        {
                            resourceUrl = Resources.Utility.GetResourceUrl(GetType(), "Kiss.Web.jQuery." + res, true);
                        }
                        else
                        {
                            throw new WebException("未找到{0}的定义。", res);
                        }
                    }
                }

                if (res.EndsWith(".js"))
                    RegisterJs(resourceUrl);
                else if (res.EndsWith(".css"))
                    RegisterCss(resourceUrl);
            }
        }
开发者ID:Aliceljm1,项目名称:kiss-project.web,代码行数:58,代码来源:ClientScriptProxy.cs


示例18: GetChildAreasCount

        public int GetChildAreasCount(IArea parentArea, int childAreaTypeId)
        {
            var categoryArea = parentArea as CategoryArea;
            if (categoryArea != null)
            {
                return _areasReader.GetChildAreaCount(categoryArea, childAreaTypeId);
            }

            return parentArea.IsCountry
                    ? _areasReader.GetAreaCountForAreaType(childAreaTypeId) // NOTE ignored areas not considered here
                    : _areasReader.GetChildAreaCount(parentArea.Code, childAreaTypeId);
        }
开发者ID:PublicHealthEngland,项目名称:fingertips-open,代码行数:12,代码来源:ChildAreaCounter.cs


示例19: GetMenuItemsBySite

        public Dictionary<int, NavigationItem> GetMenuItemsBySite(IArea site)
        {
            RefreshUrlMappingData();

            if (!_menuItems.ContainsKey(site.AreaKey))
            {
                logger.Info("menu not exist! area={0}", site.VirtualPath);
                return new Dictionary<int, NavigationItem>();
            }

            return _menuItems[site.AreaKey];
        }
开发者ID:Aliceljm1,项目名称:kiss-project.web,代码行数:12,代码来源:AreaUrlMappingProvider.cs


示例20: GetParentAreaWithChildAreas

        public ParentAreaWithChildAreas GetParentAreaWithChildAreas(IArea parentArea, 
            int childAreaTypeId, bool retrieveIgnoredAreas)
        {
            _areaListProvider.CreateChildAreaList(parentArea.Code, childAreaTypeId);

            if (retrieveIgnoredAreas == false)
            {
                _areaListProvider.RemoveAreasIgnoredEverywhere(ignoredAreasFilter);
            }
            _areaListProvider.SortByOrderOrName();

            return new ParentAreaWithChildAreas(parentArea,  _areaListProvider.Areas, childAreaTypeId);
        }
开发者ID:PublicHealthEngland,项目名称:fingertips-open,代码行数:13,代码来源:ParentChildAreaRelationshipBuilder.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IArgs类代码示例发布时间:2022-05-24
下一篇:
C# IArchiveStorage类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap