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

C# TypedValue类代码示例

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

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



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

示例1: GetCircles

 private PromptSelectionResult GetCircles(Transaction trans)
 {
     TypedValue[] types = new TypedValue[] { new TypedValue((int)DxfCode.Start, "Circle") };
     SelectionFilter selectionFilter = new SelectionFilter(types);
     PromptSelectionResult selectedObject = editor.GetSelection(selectionFilter);
     return selectedObject;
 }
开发者ID:anielii,项目名称:Acommands,代码行数:7,代码来源:AScaleCircles.cs


示例2: ActualValues

 public TypedValue[] ActualValues(CellProcessor processor, object theActualRow)
 {
     var actuals = (object[]) theActualRow;
     var result = new TypedValue[actuals.Length];
     for (int i = 0; i < actuals.Length; i++) result[i] = new TypedValue(actuals[i]);
     return result;
 }
开发者ID:vaibhavsapre,项目名称:fitsharp,代码行数:7,代码来源:UnnamedCollectionFixtureBase.cs


示例3: SlidingTabStrip1

        public SlidingTabStrip1(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            SetWillNotDraw(false);

            float density = Resources.DisplayMetrics.Density;

            TypedValue outValue = new TypedValue();
            context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true);
            int themeForeGround = outValue.Data;
            mDefaultBottomBorderColor = SetColorAlpha(themeForeGround, DEFAULT_BOTTOM_BORDER_COLOR_ALPHA);

            mDefaultTabColorizer = new SimpleTabColorizer1();
            mDefaultTabColorizer.IndicatorColors = INDICATOR_COLORS;
            mDefaultTabColorizer.DividerColors = DIVIDER_COLORS;

            mBottomBorderThickness = (int)(DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density);
            mBottomBorderPaint = new Paint();
            mBottomBorderPaint.Color = GetColorFromInteger(0xC5C5C5); //Gray

            mSelectedIndicatorThickness = (int)(SELECTED_INDICATOR_THICKNESS_DIPS * density);
            mSelectedIndicatorPaint = new Paint();

            mDividerHeight = DEFAULT_DIVIDER_HEIGHT;
            mDividerPaint = new Paint();
            mDividerPaint.StrokeWidth = (int)(DEFAULT_DIVIDER_THICKNESS_DIPS * density);
        }
开发者ID:ThanhBui92,项目名称:OrigamiApp,代码行数:27,代码来源:SlidingTabStrip1.cs


示例4: ActualValues

 public TypedValue[] ActualValues(CellProcessor processor, object theActualRow)
 {
     if (myColumnsUsed == null) myColumnsUsed = new bool[myHeaderRow.Parts.Size];
     var result = new TypedValue[myHeaderRow.Parts.Size];
     int column = 0;
     foreach (Parse headerCell in new CellRange(myHeaderRow.Parts).Cells) {
         TypedValue memberResult = new CellOperationImpl(processor).TryInvoke(theActualRow, headerCell);
         if (memberResult.IsValid) {
             result[column] = memberResult;
             myColumnsUsed[column] = true;
         }
         else {
             TypedValue itemResult = new CellOperationImpl(processor).TryInvoke(theActualRow,
                                                          new StringCellLeaf("getitem"),
                                                          new CellRange(headerCell, 1));
             if (itemResult.IsValid) {
                 result[column] = itemResult;
                 myColumnsUsed[column] = true;
             }
             else {
                 result[column] = TypedValue.Void;
             }
         }
         column++;
     }
     return result;
 }
开发者ID:vaibhavsapre,项目名称:fitsharp,代码行数:27,代码来源:NamedMatchStrategy.cs


示例5: SlidingTabStrip

        public SlidingTabStrip(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            SetWillNotDraw(false);

            var density = Resources.DisplayMetrics.Density;

            var outValue = new TypedValue();
            context.Theme.ResolveAttribute(Resource.Attribute.ColorForeground, outValue, true);
            var themeForeGround = outValue.Data;
            _mDefaultBottomBorderColor = SetColorAlpha(themeForeGround, DefaultBottomBorderColorAlpha);

            _mDefaultTabColorizer = new SimpleTabColorizer();
            _mDefaultTabColorizer.IndicatorColors = _indicatorColors;
            _mDefaultTabColorizer.DividerColors = _dividerColors;

            _mBottomBorderThickness = (int) (DefaultBottomBorderThicknessDips*density);
            _mBottomBorderPaint = new Paint();
            _mBottomBorderPaint.Color = GetColorFromInteger(0xC5C5C5); //Gray

            _mSelectedIndicatorThickness = (int) (SelectedIndicatorThicknessDips*density);
            _mSelectedIndicatorPaint = new Paint();

            _mDividerHeight = DefaultDividerHeight;
            _mDividerPaint = new Paint();
            _mDividerPaint.StrokeWidth = (int) (DefaultDividerThicknessDips*density);
        }
开发者ID:BenjaminSheffield,项目名称:AndroidFragranceApp,代码行数:27,代码来源:SlidingTabStrip.cs


示例6: TestBrepUnion

        public void TestBrepUnion()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            var tvs = new TypedValue[] { new TypedValue((int)DxfCode.Start, "LWPOLYLINE") };
            var selFilter = new SelectionFilter(tvs);
            var sel = ed.GetSelection(selFilter);
            if (sel.Status != PromptStatus.OK) return;

            using (var t = db.TransactionManager.StartTransaction())
            {
                var idsPls = sel.Value.GetObjectIds();
                List<Polyline> pls = new List<Polyline>();
                foreach (var item in idsPls)
                {
                    var pl = item.GetObject(OpenMode.ForRead) as Polyline;
                    pls.Add(pl);
                }

                Region union = BrepExtensions.Union(pls, null);

                //var cs = db.CurrentSpaceId.GetObject(OpenMode.ForWrite) as BlockTableRecord;
                //if (union != null)
                //{
                //    cs.AppendEntity(union);
                //    t.AddNewlyCreatedDBObject(union, true);
                //}

                t.Commit();
            }
        }
开发者ID:vildar82,项目名称:AcadLib,代码行数:33,代码来源:TestBrep.cs


示例7: SlidingTabStrip

		public SlidingTabStrip(Context context, IAttributeSet Attrs):base(context, Attrs) {
			SetWillNotDraw(false);

			float density = Resources.DisplayMetrics.Density;

			TypedValue outValue = new TypedValue();
			context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true);
			int themeForegroundColor =  outValue.Data;

			_defaultBottomBorderColor = SetColorAlpha(themeForegroundColor,0x26);

			_defaultTabColorizer = new SimpleTabColorizer();
			_defaultTabColorizer.SetIndicatorColors(0xFF33B5);
			_defaultTabColorizer.SetDividerColors(SetColorAlpha(themeForegroundColor,0x20));

			_bottomBorderThickness = (int) (2 * density);
			_bottomBorderPaint = new Paint();
			_bottomBorderPaint.Color = Color.White;

			_selectedIndicatorThickness = (int) (6 * density);
			_selectedIndicatorPaint = new Paint();

			_dividerHeight = 0.5f;
			_dividerPaint = new Paint();
			_dividerPaint.StrokeWidth=((int) (1 * density));
		}
开发者ID:jeedey93,项目名称:xamarin-android-samples,代码行数:26,代码来源:SlidingTabStrip.cs


示例8: InvokeOperation

 public InvokeOperation(CellProcessor processor, TypedValue target, Tree<Cell> member, Tree<Cell> parameters, Tree<Cell> cells)
 {
     this.processor = processor;
     Target = target;
     Member = member;
     Parameters = parameters;
     Cells = cells;
 }
开发者ID:nhajratw,项目名称:fitsharp,代码行数:8,代码来源:InvokeOperation.cs


示例9: GetAccentColor

 public static int GetAccentColor(Context context)
 {
     var typedValue = new TypedValue();
     TypedArray a = context.ObtainStyledAttributes(typedValue.Data, new int[] { Resource.Attribute.colorAccent });
     int color = a.GetColor(0, 0);
     a.Recycle();
     return color;
 }
开发者ID:akshay2000,项目名称:MonocleGiraffe,代码行数:8,代码来源:Utils.cs


示例10: ProxyExplodeToBlock

        public static TypedValue ProxyExplodeToBlock(ResultBuffer rbArgs)
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            TypedValue res = new TypedValue((int)LispDataType.Text,"");

            if (rbArgs.AsArray().Length == 2)
            {
                TypedValue entity = rbArgs.AsArray()[0];
                TypedValue blkPrefix = rbArgs.AsArray()[1];

                if ((entity.TypeCode == (int)LispDataType.ObjectId) && (blkPrefix.TypeCode == (int)LispDataType.Text))
                {
                    using (Transaction tr = doc.TransactionManager.StartTransaction())
                    {
                        try
                        {
                            ObjectId id = (ObjectId)entity.Value;
                            DBObjectCollection objs = new DBObjectCollection();
                            BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);

                            Entity entx = (Entity)tr.GetObject(id, OpenMode.ForWrite);
                            entx.Explode(objs);

                            string blkName = blkPrefix.Value.ToString() + entx.Handle.ToString();

                            if (bt.Has(blkName) == false)
                            {
                                BlockTableRecord btr = new BlockTableRecord();
                                btr.Name = blkName;

                                bt.UpgradeOpen();
                                ObjectId btrId = bt.Add(btr);
                                tr.AddNewlyCreatedDBObject(btr, true);

                                foreach (DBObject obj in objs)
                                {
                                    Entity ent = (Entity)obj;
                                    btr.AppendEntity(ent);
                                    tr.AddNewlyCreatedDBObject(ent, true);
                                }
                            }
                            res = new TypedValue((int)LispDataType.Text, blkName);

                            tr.Commit();
                        }
                        catch (Autodesk.AutoCAD.Runtime.Exception ex)
                        {
                            tr.Abort();
                            ed.WriteMessage(ex.Message);
                        }
                    }
                }
            }
            return res;
        }
开发者ID:alexeispirit,项目名称:ExplodeProxyMgd,代码行数:58,代码来源:ExplodeProxy.cs


示例11: DoInvoke

 public TypedValue DoInvoke(CellProcessor processor)
 {
     var targetInstance = new TypedValue(target);
     var targetObjectProvider = target as TargetObjectProvider;
     var name = GetMemberName(processor);
     return processor.Invoke(
             targetObjectProvider != null ? new TypedValue(targetObjectProvider.GetTargetObject()) : targetInstance,
             name, parameters);
 }
开发者ID:nhajratw,项目名称:fitsharp,代码行数:9,代码来源:CellOperation.cs


示例12: getXdataAllText

 private string getXdataAllText(TypedValue[] typedValues)
 {
     StringBuilder sbText = new StringBuilder();
      foreach (var item in typedValues)
      {
     sbText.AppendLine(string.Format("TypeCode: {0}; Value: {1}", item.TypeCode, item.Value));
      }
      return sbText.ToString();
 }
开发者ID:vildar82,项目名称:GP_XDataViewer,代码行数:9,代码来源:FormXDataView.cs


示例13: FunctionResolveResult

			public FunctionResolveResult(string functionName, bool treatAsOperator, TypedValue[] argsBefore, TypedValue[] argsAfter, IReadOnlyList<Expression> arguments)
			{
				this.functionPrefix = null;
				this.functionSuffix = null;
				this.functionName = functionName;
				this.treatAsOperator = treatAsOperator;
				this.argsBefore = argsBefore;
				this.argsAfter = argsAfter;
				this.arguments = arguments;
				this.excludeParenthesis = false;
			}
开发者ID:tumtumtum,项目名称:Shaolinq,代码行数:11,代码来源:Sql92QueryFormatter.cs


示例14: Initialize

        public static void Initialize(Context context)
        {
            var wm = context.GetSystemService(Context.WindowService).JavaCast<IWindowManager>();
            var displayMetrics = new DisplayMetrics();
            wm.DefaultDisplay.GetMetrics(displayMetrics);
            density = displayMetrics.Density;

            var bg = new TypedValue();
            context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorBackground, bg, true);
            DefaultBackground = new ColorDrawable(new Color(bg.Data));
        }
开发者ID:thomasgalliker,项目名称:CrossPlatformLibrary,代码行数:11,代码来源:AndroidExtensions.cs


示例15: GetColor

		Android.Graphics.Color GetColor()
		{
			int[] colorAttribute = { Android.Resource.Attribute.ColorButtonNormal };

			var typedValue = new TypedValue();
			var a = Context.ObtainStyledAttributes(typedValue.Data, colorAttribute);
			var color = a.GetColor(0, -1);
			a.Recycle();

			return color;
		}
开发者ID:JudoPay,项目名称:Judo-Xamarin,代码行数:11,代码来源:JudoButtonRenderer.cs


示例16: MakeArguments

			public static TypedValue[] MakeArguments(params object[] args)
			{
				var retval = new TypedValue[args.Length];

				for (var i = 0; i < args.Length; i++)
				{
					retval[i] = new TypedValue(args[i].GetType(), args[i]);
				}

				return retval;
			}
开发者ID:tumtumtum,项目名称:Shaolinq,代码行数:11,代码来源:Sql92QueryFormatter.cs


示例17: Do

        public void Do(Tree<Cell> cell) {
            var instance = new TypedValue(targetProvider.GetTargetObject());
            if (cell.IsLeaf && cell.Value.Text.Length == 0) {
	            var actual = processor.Invoke(instance, GetMemberName(memberCell), new CellTree());
	            if (actual.IsValid) ShowActual(cell.Value, actual.Value);
            }
            else {
                var beforeCounts = new TestCounts(processor.TestStatus.Counts);
                processor.InvokeWithThrow(instance, GetMemberName(memberCell), new CellTree(cell));
                processor.TestStatus.MarkCellWithLastResults(cell.Value, beforeCounts);
            }
        }
开发者ID:GibSral,项目名称:fitsharp,代码行数:12,代码来源:Binding.cs


示例18: TextAppearanceHeight

		int TextAppearanceHeight(int textAppearance) {

			TypedValue typedValue = new TypedValue(); 
			activity.Theme.ResolveAttribute(textAppearance, typedValue, true);
			int[] textSizeAttr = new int[] { Android.Resource.Attribute.TextSize };
			int indexOfAttrTextSize = 0;
			TypedArray a = activity.ObtainStyledAttributes(typedValue.Data, textSizeAttr);
			int textSize = a.GetDimensionPixelSize(indexOfAttrTextSize, -1);
			a.Recycle();

			return textSize;
		}
开发者ID:Trojka,项目名称:monoCPVanity,代码行数:12,代码来源:CodeProjectMemberAdapter.cs


示例19: GetThemeAttributeDp

		internal static double GetThemeAttributeDp(this Context self, int resource)
		{
			using (var value = new TypedValue())
			{
				if (!self.Theme.ResolveAttribute(resource, value, true))
					return -1;

				var pixels = (double)TypedValue.ComplexToDimension(value.Data, self.Resources.DisplayMetrics);

				return self.FromPixels(pixels);
			}
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:12,代码来源:ContextExtensions.cs


示例20: GetActionTextColorStateList

 public static ColorStateList GetActionTextColorStateList(Context context, int colorId)
 {
     TypedValue value = new TypedValue();
     context.Resources.GetValue(colorId, value, true);
     if (value.Type >= DataType.FirstColorInt && value.Type <= DataType.LastColorInt)
     {
         return GetActionTextStateList(context, new Color(value.Data));
     }
     else
     {
         return context.Resources.GetColorStateList(colorId);
     }
 }
开发者ID:devxiaruwei,项目名称:MaterialDialogs,代码行数:13,代码来源:DialogUtils.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TypedefDecl类代码示例发布时间:2022-05-24
下一篇:
C# TypedPtr类代码示例发布时间: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