本文整理汇总了C#中TypedValue类的典型用法代码示例。如果您正苦于以下问题:C# TypedValue类的具体用法?C# TypedValue怎么用?C# TypedValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypedValue类属于命名空间,在下文中一共展示了TypedValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例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));
}
示例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;
}