public Figure CreateFigure() { Figure figure = null; propSet = new PropSet(); switch (figureType) { case FigureType.RECT: propSet.Add(fillProps.GetClone()); propSet.Add(lineProps.GetClone()); figure = new Rect(propSet); break; case FigureType.LINE: propSet.Add(lineProps.GetClone()); figure = new Line(propSet); break; case FigureType.ELLIPSE: propSet.Add(fillProps.GetClone()); propSet.Add(lineProps.GetClone()); figure = new Ellipse(propSet); break; default: break; } return(figure); }
void OnEnable() { _target = (PropSet)target; if (_target.target == null || System.Array.IndexOf(TargetProperties(), _target.propName) == -1) { _target.propID = 0; _target.propName = ""; } }
public void LookupNPID(UInt16 npid, Property p) { if (Entries == null) { Initialise(); } PropSet ps = null; try { var entry = Entries.First(e => e.wPropIdx == npid - 0x8000); if (entry.wGuid == 1 || entry.wGuid == 2) { ps = IndexedPropertySets[entry.wGuid - 1]; p.Guid = ps.Guid; p.GuidName = ps.GuidName; } else if (entry.wGuid >= 3) { var bytes = new byte[16]; Array.Copy(StreamGuid, (entry.wGuid - 3) * 16, bytes, 0, 16); p.Guid = (new Guid(bytes)).ToString(); if (GuidToPropertySet.TryGetValue(p.Guid, out ps)) { p.GuidName = ps.GuidName; } } if (entry.N) { var len = Map.MapType <UInt32>(StreamString, (int)entry.dwPropertyID); p.Name = Encoding.Unicode.GetString(StreamString, (int)entry.dwPropertyID + 4, (int)len); } else { string name; p.Lid = entry.dwPropertyID; if (ps != null && ps.PropDesc != null && ps.PropDesc.TryGetValue(entry.dwPropertyID, out name)) { p.Name = name; } } } catch (InvalidOperationException) { // not found //name = "Named property not found"; } }
public ScrollHeaderPanel() { this.InitializeComponent(); this.DataContext = this; if (!DesignMode.DesignModeEnabled) { PropSet = Compositor.CreatePropertySet(); PropSet.InsertScalar("progress", 0f); PropSet.InsertScalar("DeltaY", 0f); PropSet.InsertScalar("Threshold", Convert.ToSingle(Threshold)); hostVisual = ElementCompositionPreview.GetElementVisual(RootBorder); } }
public void DropProps(PropSet props) { switch (props) { case PropSet.BOMBER_ONBOARDING: _bomberHatInstance = Instantiate(BomberHat, BomberHatSpawnPos.position, Quaternion.identity); _bomberManualInstance = Instantiate(BomberManual, BomberManualSpawnPos.position, Quaternion.identity); break; case PropSet.BOMBER_TOOLS: _cuttersInstance = Instantiate(Cutters, CuttersSpawnPos.position, Quaternion.identity); break; case PropSet.DEFUSER_ONBOARDING: Invoke("DropDefuserProps", 2); break; } }
private void _getViewProps(CswNbtView TempView, CswNbtViewEditorData Return) { foreach (CswNbtMetaDataNodeType NodeType in _CswNbtResources.MetaData.getNodeTypes() .Where(nt => _CswNbtResources.Permit.canNodeType(CswEnumNbtNodeTypePermission.View, nt))) { CswNbtViewRelationship Relationship = TempView.AddViewRelationship(NodeType, true); //CswNbtViewNode foundNode = CurrentView.FindViewNodeByArbitraryId( Relationship.ArbitraryId ); Return.Step2.Relationships.Add(Relationship); _addNameTemplateProps(TempView, Relationship, NodeType); } foreach (CswNbtMetaDataObjectClass ObjClass in _CswNbtResources.MetaData.getObjectClasses() .Where(oc => false == oc.IsDesign() || _CswNbtResources.Permit.can(CswEnumNbtActionName.Design)) // case 31533 .OrderBy(ObjClass => ObjClass.ObjectClass.Value)) { CswNbtViewRelationship Relationship = TempView.AddViewRelationship(ObjClass, true); //CswNbtViewNode foundNode = CurrentView.FindViewNodeByArbitraryId( Relationship.ArbitraryId ); Return.Step2.Relationships.Add(Relationship); foreach (CswNbtMetaDataNodeType NodeType in ObjClass.getNodeTypes() .Where(nt => _CswNbtResources.Permit.canNodeType(CswEnumNbtNodeTypePermission.View, nt))) { _addNameTemplateProps(TempView, Relationship, NodeType); } } foreach (CswNbtMetaDataPropertySet PropSet in _CswNbtResources.MetaData.getPropertySets() .OrderBy(PropSet => PropSet.Name)) { CswNbtViewRelationship Relationship = TempView.AddViewRelationship(PropSet, true); //CswNbtViewNode foundNode = CurrentView.FindViewNodeByArbitraryId( Relationship.ArbitraryId ); Return.Step2.Relationships.Add(Relationship); foreach (CswNbtMetaDataObjectClass ObjClass in PropSet.getObjectClasses() .Where(oc => false == oc.IsDesign() || _CswNbtResources.Permit.can(CswEnumNbtActionName.Design))) // case 31533 { foreach (CswNbtMetaDataNodeType NodeType in ObjClass.getNodeTypes() .Where(nt => _CswNbtResources.Permit.canNodeType(CswEnumNbtNodeTypePermission.View, nt))) { _addNameTemplateProps(TempView, Relationship, NodeType); } } } }
public Figure(PropSet propSet) { this.propSet = propSet; listMarker = new List <Marker>() { new Marker() { x = x1 - 5, y = y1 - 5 }, new Marker() { x = x2 - 5, y = y1 - 5 }, new Marker() { x = x2 - 5, y = y2 - 5 }, new Marker() { x = x1 - 5, y = y2 - 5 } }; }
public Line(PropSet propSet) : base(propSet) { }
void Awake() { propSet = GetComponent <PropSet>(); }
public Rect(PropSet propSet) : base(propSet) { }
public Ellipse(PropSet propSet) : base(propSet) { }