public static void SetCircleAlignment(IBaseItem circle, params ItemAlignment[] alignment) { List <ItemAlignment> list = new List <ItemAlignment>(alignment.ToArray()); int offset = circle.GetWidth() / 3; if (list.Contains(ItemAlignment.Top)) { circle.SetMargin(circle.GetMargin().Left, circle.GetMargin().Top - offset + 10, circle.GetMargin().Right, circle.GetMargin().Bottom); } if (list.Contains(ItemAlignment.Bottom)) { circle.SetMargin(circle.GetMargin().Left, circle.GetMargin().Top, circle.GetMargin().Right, circle.GetMargin().Bottom - offset); } if (list.Contains(ItemAlignment.Left)) { circle.SetMargin(circle.GetMargin().Left - offset, circle.GetMargin().Top, circle.GetMargin().Right, circle.GetMargin().Bottom); } if (list.Contains(ItemAlignment.Right)) { circle.SetMargin(circle.GetMargin().Left, circle.GetMargin().Top, circle.GetMargin().Right - offset, circle.GetMargin().Bottom); } }
public override IBaseItem Add(IBaseItem item) { IList<string> myValues = new List<string>(); IBlogEntry myEntry = item as IBlogEntry; myValues.Add(myEntry.Title); myValues.Add(myEntry.Subtitle); myValues.Add(myEntry.Content); myValues.Add(myEntry.DateCreated.ToString()); myValues.Add(myEntry.CreatedBy); using (SqlCeConnection myConnection = DataAccess.Connection()) { myConnection.Open(); using (SqlCeCommand myCommand = myConnection.CreateCommand()) { myCommand.CommandText = FillItem(INSERT_SQL, myValues); myCommand.ExecuteNonQuery(); myConnection.Close(); } } return Get(item); }
public void SelectedElement_GetsHighlight() { IBaseItem child = Substitute.For <IBaseItem>(); string name = "some name"; child.Name.Returns(name); string someUrl = "some url"; child.Url.Returns(someUrl); _context.GetHomeItem <IBaseItem>().Children.Returns(new List <IBaseItem> { child }); ViewResult result = _sut.Index() as ViewResult; var resultCollection = result.Model as IEnumerable <Models.NavElement>; resultCollection.Should().HaveCount(1); var model = resultCollection.First(); model.Text.Should().Be(name); model.Href.Should().Be(someUrl); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected override IItemVisualSettings GetSettingsInner(IBaseItem pItem, IItemVisualSettings pDefault, bool pFillWithDefault) { var sett = new ItemVisualSettingsStandard(); if (pFillWithDefault) { sett.FillWith(pDefault, false); } else { sett.TextSize = TextSize; sett.TextColor = TextColor; sett.TextFont = TextFont; sett.ArrowIconColor = ArrowIconColor; sett.ToggleIconColor = ToggleIconColor; sett.BackgroundColor = BackgroundColor; sett.EdgeColor = EdgeColor; sett.HighlightColor = HighlightColor; sett.SelectionColor = SelectionColor; sett.SliderTrackColor = SliderTrackColor; sett.SliderFillColor = SliderFillColor; sett.SliderTickColor = SliderTickColor; } sett.Renderer = GetRendererForItem(pItem); return(sett); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private static Type GetRendererForItem(IBaseItem pItem) { if ((pItem as ISelectorItem) != null) { return(typeof(UiItemSelectRenderer)); } if ((pItem as IStickyItem) != null) { return(typeof(UiItemStickyRenderer)); } if ((pItem as ICheckboxItem) != null) { return(typeof(UiItemCheckboxRenderer)); } if ((pItem as IRadioItem) != null) { return(typeof(UiItemRadioRenderer)); } if ((pItem as ISliderItem) != null) { return(typeof(UiItemSliderRenderer)); } if ((pItem as ITextItem) != null) { return(typeof(UiItemTextRenderer)); } return(typeof(UiItemSelectRenderer)); }
/// <summary> /// This is a wrapper for IBaseItem, for the IsDerived method. /// </summary> /// <param name="baseItem"></param> /// <param name="templateId"></param> /// <returns></returns> public static bool IsDerived(this IBaseItem baseItem, ID templateId) { var context = new SitecoreContext(); var item = context.GetItem <Item>(baseItem.Id); return(item.IsDerived(templateId)); }
public IBaseItem GetBaseItem(string strName) { IBaseItem pBaseItem = null; foreach (IBaseItem one in this.BaseItems) { if (one.Name == strName) { pBaseItem = one; } else { ICollectionItem2 pCollectionItem2 = one as ICollectionItem2; if (pCollectionItem2 != null) { pBaseItem = pCollectionItem2.GetBaseItem(strName); } } // if (pBaseItem != null) { break; } } // return(pBaseItem); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private static Type GetRendererForItem(IBaseItem pItem) { if ( pItem != null && pItem.Id == ItemHierarchy.NavigateBackItemId ) { return typeof(UiPalmNavBackRenderer); } if ( (pItem as IParentItem) != null ) { return typeof(UiItemParentRenderer); } if ( (pItem as ISelectorItem) != null ) { return typeof(UiItemSelectRenderer); } if ( (pItem as IStickyItem) != null ) { return typeof(UiItemStickyRenderer); } if ( (pItem as ICheckboxItem) != null ) { return typeof(UiItemCheckboxRenderer); } if ( (pItem as IRadioItem) != null ) { return typeof(UiItemRadioRenderer); } if ( (pItem as ISliderItem) != null ) { return typeof(UiItemSliderRenderer); } if ( (pItem as ITextItem) != null ) { return typeof(UiItemTextRenderer); } return typeof(UiItemSelectRenderer); }
/*--------------------------------------------------------------------------------------------*/ public override IItemVisualSettings GetSettings(IBaseItem pItem) { if (vDefaultSettings == null) { vDefaultItem = new SelectorItem(); vDefaultSettings = GetSettingsInner(vDefaultItem, null, false); vSettingsMap.Add(vDefaultItem, vDefaultSettings); } if (pItem == null) { return(vDefaultSettings); } if (vSettingsMap.ContainsKey(pItem)) { return(vSettingsMap[pItem]); } if (IsDefaultSettingsComponent) { IItemVisualSettings sett = TryGetCustomItem(pItem); if (sett != null) { vSettingsMap.Add(pItem, sett); return(sett); } } return(GetVerifyAndSaveSettings(pItem, vDefaultSettings, true)); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected override IItemVisualSettings GetSettingsInner(IBaseItem pItem, IItemVisualSettings pDefault, bool pFillWithDefault) { var sett = new ItemVisualSettingsStandard(); if ( pFillWithDefault ) { sett.FillWith(pDefault, false); } else { sett.TextSize = TextSize; sett.TextColor = TextColor; sett.TextFont = TextFont; sett.ArrowIconColor = ArrowIconColor; sett.ToggleIconColor = ToggleIconColor; sett.BackgroundColor = BackgroundColor; sett.EdgeColor = EdgeColor; sett.HighlightColor = HighlightColor; sett.SelectionColor = SelectionColor; sett.SliderTrackColor = SliderTrackColor; sett.SliderFillColor = SliderFillColor; sett.SliderTickColor = SliderTickColor; sett.ExpandSize = ExpandSize; } sett.Renderer = GetRendererForItem(pItem); return sett; }
public IBaseItem GetBaseItem2(string strName) { IBaseItem pBaseItem = null; foreach (IBaseItem one in this.m_BasePopupList) { if (one.Name == strName) { pBaseItem = one; } else { ICollectionItem3 pCollectionItem3 = one as ICollectionItem3; if (pCollectionItem3 != null) { pBaseItem = pCollectionItem3.GetBaseItem2(strName); } } // if (pBaseItem != null) { break; } } // return(pBaseItem); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private static Type GetRendererForItem(IBaseItem pItem) { if ( (pItem as ISelectorItem) != null ) { return typeof(UiItemSelectRenderer); } if ( (pItem as IStickyItem) != null ) { return typeof(UiItemStickyRenderer); } if ( (pItem as ICheckboxItem) != null ) { return typeof(UiItemCheckboxRenderer); } if ( (pItem as IRadioItem) != null ) { return typeof(UiItemRadioRenderer); } if ( (pItem as ISliderItem) != null ) { return typeof(UiItemSliderRenderer); } if ( (pItem as ITextItem) != null ) { return typeof(UiItemTextRenderer); } return typeof(UiItemSelectRenderer); }
/*--------------------------------------------------------------------------------------------*/ private bool IsItemTreeActive(ItemTree pTree) { IBaseItem baseItem = pTree.Item.Item; return(baseItem.IsVisible && baseItem.IsEnabled && baseItem.IsAncestryVisible && baseItem.IsAncestryEnabled); }
/*--------------------------------------------------------------------------------------------*/ protected override IItemVisualSettings GetSettingsInner(IBaseItem pItem, IItemVisualSettings pDefault, bool pFillWithDefault) { vDefaultSettings = (ItemVisualSettingsStandard)pDefault; HandleValueChanged(null); return(vHueSettings); }
public static BaseLookupItem FromItem(IBaseItem item) { return(new BaseLookupItem() { Id = item.Id, Name = item.Name, }); }
public IBaseItem RemoveItem(int index) { IBaseItem item = items[index]; items.RemoveAt(index); CallChangeEvent(); return(item); }
public void AddOfferLine(IBaseItem myItem, int quantity) { IExtendOfferLine newOfferLine = new OfferLine(myItem, quantity); OfferLines.Add(newOfferLine); newOfferLine.APWC += NotifyPropertyChanged; string[] propertiesChanged = { nameof(OfferTotal), nameof(NoOfTotalPackages), nameof(NoOfTotalPallets), nameof(OfferLinesSubtotal), nameof(TotalDiscountedPrice), nameof(TotalPercentDiscount) }; NotifyPropertiesChanged(propertiesChanged); }
/*--------------------------------------------------------------------------------------------*/ protected internal override IItemVisualSettings GetVerifyAndSaveSettings(IBaseItem pItem, IItemVisualSettings pDefault, bool pFillWithDefault) { IItemVisualSettings sett = GetSettingsInner(pItem, pDefault, pFillWithDefault); CustomUtil.VerifyRenderer <TRend>(sett.Renderer, pItem.Label, GetDomain(), GetRendererUnit()); vSettingsMap.Add(pItem, sett); return(sett); }
public static SubtractFigure GetCircleCenterEffect(IBaseItem circle) { float scale = 0.4f; int diameter = (int)(circle.GetHeight() * scale); SubtractFigure effect = new SubtractFigure( new CustomFigure(true, GraphicsMathService.GetEllipse(diameter, diameter, 0, 0, 64))); effect.SetAlignment(ItemAlignment.VCenter, ItemAlignment.HCenter); return(effect); }
public void Show(IItem sender, MouseArgs args) { InitElements(); IBaseItem item = sender as IBaseItem; SetPosition(item.GetX() + item.GetWidth(), item.GetY()); SetHeight(item.GetHeight()); SetWidth(_label.GetTextWidth() + _label.GetMargin().Left + _label.GetMargin().Right); Show(); }
#pragma warning restore CS0612 // 类型或成员已过时 public UploadDangerResourceFileCtrlAction(IBaseItem caller) : base(caller) { try { m_Application = Application.ActiveApplication; } catch (Exception ex) { Log.OutputBox(ex); } }
#pragma warning restore CS0612 // 类型或成员已过时 public FilesManagerCtrlAction(IBaseItem caller) : base(caller) { try { m_Application = Application.ActiveApplication; } catch (Exception ex) { Log.OutputBox(ex); } }
#pragma warning restore CS0612 // 类型或成员已过时 public DeviceLocationCtrlAction(IBaseItem caller) : base(caller) { try { m_Application = Application.ActiveApplication; } catch (Exception ex) { Log.OutputBox(ex); } }
public static void InitEffects(IBaseItem cRed, IBaseItem cGreen, IBaseItem cBlue) { circleEffectsLayout = new Dictionary <IBaseItem, IEffect>(); circleEffectsLayout.Add(cRed, ItemsFactory.GetCircleEffect(cRed, cBlue)); circleEffectsLayout.Add(cGreen, ItemsFactory.GetCircleEffect(cGreen, cRed)); circleEffectsLayout.Add(cBlue, ItemsFactory.GetCircleEffect(cBlue, cGreen)); circleCenterEffectsLayout = new Dictionary <IBaseItem, IEffect>(); circleCenterEffectsLayout.Add(cRed, ItemsFactory.GetCircleCenterEffect(cRed)); circleCenterEffectsLayout.Add(cGreen, ItemsFactory.GetCircleCenterEffect(cGreen)); circleCenterEffectsLayout.Add(cBlue, ItemsFactory.GetCircleCenterEffect(cBlue)); }
public void Initialize(Inventory inventory, int index) { //Set values this.inventory = inventory; inventoryIndex = index; //Setup the display IBaseItem item = inventory.Items[inventoryIndex]; image.sprite = Resources.Load <Sprite>($"Sprites/Items/{item.Sprite}"); title.text = $"{item.Name} x{item.GetAmount()}"; }
public override bool RemoveItem(IBaseItem item) { if (item is MenuItem) { _itemList.Remove(item); return(ComboBoxItem.RemoveItem(item)); } else { return(base.RemoveItem(item)); } }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public void SetData(IBaseItem pItem, T pData) { int key = pItem.AutoId; if (!vMap.ContainsKey(key)) { vMap.Add(key, pData); } else { vMap[key] = pData; } }
override public void Run() { //To do your work. //Example: IBaseItem baseItem = this.Caller; if (baseItem != null) { String itemType = baseItem.GetType().ToString().Replace("SuperMap.Desktop.", ""); MessageBox.Show(String.Format("This is a \"{0}\"!", itemType)); } }
override public void Run() { //To do your work. //Example: IBaseItem baseItem = this.Caller; if (baseItem != null) { String itemType = baseItem.GetType().ToString().Replace("SuperMap.Desktop.", ""); Form attrImp = new Store.Up.Views.Forms.Store_Up_AttributeImportant_Form(); attrImp.ShowDialog(); } }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public BaseItemState(IBaseItem pItem, BaseInteractionSettings pSettings) { Item = pItem; vSettings = pSettings; vPoints = new BaseItemPointsState(); vCursorWorldPosMap = new ListMap<CursorType, Vector3?>( EnumIntKeyComparer.CursorType, false, true); vHighlightDistanceMap = new ListMap<CursorType, float>(EnumIntKeyComparer.CursorType); vHighlightProgressMap = new ListMap<CursorType, float>(EnumIntKeyComparer.CursorType); vIsNearestHighlightMap = new ListMap<CursorType, bool>(EnumIntKeyComparer.CursorType); vPreventSelectionViaDisplayMap = new ListMap<string, bool>(null); ResetAllCursorInteractions(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public BaseItemState(IBaseItem pItem, BaseInteractionSettings pSettings) { Item = pItem; vSettings = pSettings; vPoints = new BaseItemPointsState(); vCursorWorldPosMap = new Dictionary <CursorType, Vector3?>(); vHighlightDistanceMap = new Dictionary <CursorType, float>(); vHighlightProgressMap = new Dictionary <CursorType, float>(); vIsNearestHighlightMap = new Dictionary <CursorType, bool>(); vPreventSelectionViaDisplayMap = new Dictionary <string, bool>(); ResetAllCursorInteractions(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public BaseItemState(IBaseItem pItem, BaseInteractionSettings pSettings) { Item = pItem; vSettings = pSettings; vPoints = new BaseItemPointsState(); vCursorWorldPosMap = new Dictionary<CursorType, Vector3?>(); vHighlightDistanceMap = new Dictionary<CursorType, float>(); vHighlightProgressMap = new Dictionary<CursorType, float>(); vIsNearestHighlightMap = new Dictionary<CursorType, bool>(); vPreventSelectionViaDisplayMap = new Dictionary<string, bool>(); ResetAllCursorInteractions(); }
override public void Run() { //To do your work. //Example: IBaseItem baseItem = this.Caller; if (baseItem != null) { String itemType = baseItem.GetType().ToString().Replace("SuperMap.Desktop.", ""); Form attrImp = new Store.Up.Views.Forms.AttributeHookForm(); attrImp.ShowDialog(); MessageBox.Show("这是一个{0}", itemType); } }
public override bool RemoveItem(IBaseItem item) { if (base.RemoveItem(item)) { Contact contact = item as Contact; if (contact != null) { _contacts.Remove(contact); } CalculateAlphaStep(); UpdateLayout(); return(true); } return(false); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public BaseItemState(IBaseItem pItem, BaseInteractionSettings pSettings) { Item = pItem; vSettings = pSettings; vPoints = new BaseItemPointsState(); vCursorWorldPosMap = new ListMap <CursorType, Vector3?>( EnumIntKeyComparer.CursorType, false, true); vHighlightDistanceMap = new ListMap <CursorType, float>(EnumIntKeyComparer.CursorType); vHighlightProgressMap = new ListMap <CursorType, float>(EnumIntKeyComparer.CursorType); vIsNearestHighlightMap = new ListMap <CursorType, bool>(EnumIntKeyComparer.CursorType); vPreventSelectionViaDisplayMap = new ListMap <string, bool>(null); ResetAllCursorInteractions(); }
public override IBaseItem Get(IBaseItem item) { string mySql = string.Empty; IBlogEntry myEntry = item as IBlogEntry; IList<string> myValues = new List<string>(); if (item.Id == null) { myValues.Add(myEntry.Title); myValues.Add(myEntry.Subtitle); myValues.Add(myEntry.DateCreated.ToString()); mySql = FillItem(GET_SQL_NO_ID, myValues); } else { myValues.Add(myEntry.Id.ToString()); mySql = FillItem(GET_SQL_ID, myValues); } using (SqlCeConnection myConnection = DataAccess.Connection()) { myConnection.Open(); using (SqlCeCommand myCommand = myConnection.CreateCommand()) { myCommand.CommandText = mySql; using (SqlCeDataReader myReader = myCommand.ExecuteReader()) { while (myReader.Read()) { myEntry = new BlogEntry(); myEntry.Id = Convert.ToInt32(myReader[FIELD_ID]); myEntry.Title = myReader[FIELD_TITLE].ToString(); myEntry.Subtitle = myReader[FIELD_SUBTITLE].ToString(); myEntry.Content = myReader[FIELD_CONTENT].ToString(); myEntry.DateCreated = DateTime.Parse(myReader[FIELD_CREATED].ToString()); myEntry.CreatedBy = myReader[FIELD_CREATED_BY].ToString(); } } myConnection.Close(); } } return myEntry; }
public override void AddItem(IBaseItem item) { Contact contact = item as Contact; if (contact != null) { _contacts.Add(contact); if (_isInit) { base.AddItem(contact); } contact.UpdateSize(ItemRadius); } CalculateAlphaStep(); UpdateLayout(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected internal abstract IItemVisualSettings GetVerifyAndSaveSettings(IBaseItem pItem, IItemVisualSettings pDefault, bool pFillWithDefault);
/// <summary> /// Puts video frame into the grid /// </summary> /// <param name="item"></param> public void Process(IBaseItem item) { if (m_root == null) { throw new NullReferenceException("Root node must be valid"); } m_queue.Post(item); }
private void InnerHandle(IBaseItem item) { m_root.Handle(item); }
protected virtual void ContinueHandling(IBaseItem item) { foreach (var node in m_successors) { node.Handle(item); } }
/// <summary> /// Process next video frame /// </summary> /// <returns></returns> protected abstract void Process(IBaseItem input);
/// <summary> /// /// </summary> /// <param name="item"></param> internal virtual void Handle(IBaseItem item) { IBaseItem result = item; Process(result); if (IsLeaf || !result.ShouldContinueProcessing) { result.Dispose(); return; } if (result.ShouldContinueProcessing) { ContinueHandling(result); } }
public virtual IBaseItem Updates(IBaseItem item) { throw new NotImplementedException(); }
public override IEnumerable<IBaseItem> GetRows(IBaseItem item) { List<IBlogEntry> myEntries = new List<IBlogEntry>(); using (SqlCeConnection myConnection = DataAccess.Connection()) { myConnection.Open(); using (SqlCeCommand myCommand = myConnection.CreateCommand()) { myCommand.CommandText = GET_ROWS_SQL; using (SqlCeDataReader myReader = myCommand.ExecuteReader()) { while (myReader.Read()) { IBlogEntry myEntry = new BlogEntry(); myEntry.Id = Convert.ToInt32(myReader[FIELD_ID]); myEntry.Title = myReader[FIELD_TITLE].ToString(); myEntry.Subtitle = myReader[FIELD_SUBTITLE].ToString(); myEntry.Content = myReader[FIELD_CONTENT].ToString(); myEntry.DateCreated = DateTime.Parse(myReader[FIELD_CREATED].ToString()); myEntry.CreatedBy = myReader[FIELD_CREATED_BY].ToString(); myEntries.Add(myEntry); } } myConnection.Close(); } } return myEntries; }
/*--------------------------------------------------------------------------------------------*/ protected abstract IItemVisualSettings GetSettingsInner(IBaseItem pItem, IItemVisualSettings pDefault, bool pFillWithDefault);
public virtual IBaseItem Delete(IBaseItem item) { throw new NotImplementedException(); }
public virtual IEnumerable<IBaseItem> GetRows(IBaseItem item) { throw new NotImplementedException(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public abstract IItemVisualSettings GetSettings(IBaseItem pItem);
/*--------------------------------------------------------------------------------------------*/ protected override IItemVisualSettings GetSettingsInner(IBaseItem pItem, IItemVisualSettings pDefault, bool pFillWithDefault) { vDefaultSettings = (ItemVisualSettingsStandard)pDefault; HandleValueChanged(null); return vHueSettings; }