当前位置: 首页>>代码示例>>C#>>正文


C# ScatterViewItem.GetType方法代码示例

本文整理汇总了C#中ScatterViewItem.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ScatterViewItem.GetType方法的具体用法?C# ScatterViewItem.GetType怎么用?C# ScatterViewItem.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ScatterViewItem的用法示例。


在下文中一共展示了ScatterViewItem.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveFromScreen

        public void RemoveFromScreen(ScatterViewItem item)
        {
            if (!hasClosedLabel)
            {
                if (MyScatterView.Items.Contains(item))
                {

                    if (item is MagnifyingGlass)
                    {
                        this.mags.Remove((MagnifyingGlass)item);
                    }
                    else if (item is PushPin)
                    {
                        this.pushPins.Remove((PushPin)item);
                    }
                    else if (item is Entry)
                    {
                        this.entries.Remove((Entry)item);
                    }
                    else if (item is MagicLens)
                    {
                        this.lenses.Remove((MagicLens)item);
                    }
                    else if (item is Ruler)
                    {
                        this.rulers.Remove((Ruler)item);
                    }
                    else if (item is PaperClip)
                    {
                        this.paperClips.Remove((PaperClip)item);
                    }
                    else if (item is FilterTile)
                    {
                        this.filters.Remove((FilterTile)item);

                    }
                    else if (item is Note)
                    {
                        this.notes.Remove(item);
                    }
                    else
                    {
                        Console.WriteLine("Error trying to Remove something to global access of type: " + item.GetType().ToString());
                    }

                    MyScatterView.Dispatcher.BeginInvoke(new Action(() => MyScatterView.Items.Remove(item)));
                    //MyScatterView.Items.Remove(item);
                }
            }

            hasClosedLabel = false;

        }
开发者ID:prgoodwin,项目名称:HabilisX,代码行数:53,代码来源:surfacewindow1.xaml.cs

示例2: swipeToDelete

        //If scatterviewitem (Part, DS, Seq) swipe to delete
        public void swipeToDelete(ScatterViewItem svi)
        {
            if (svi.Center.X > (L0.Width - 100) || svi.Center.X < 100)
            {
                if (svi.GetType() == typeof(Part) || svi.GetType() == typeof(L1Module))
                {
                    ScatterView palette = new ScatterView();

                    if (svi.GetType() == typeof(Part))
                    {
                        Part p = (Part)svi;
                        palette = (ScatterView)p.MyClone.Parent;
                        palette.Items.Remove(p.MyClone);
                    }
                    if (svi.GetType() == typeof(L1Module))
                    {
                        L1Module l = (L1Module)svi;
                        palette = (ScatterView)l.MyClone.Parent;
                        palette.Items.Remove(l.MyClone);
                    }

                    List<ScatterViewItem> storeSVIList = new List<ScatterViewItem>();
                    foreach (ScatterViewItem m in palette.Items)
                    {
                        storeSVIList.Add(m);
                    }
                    palette.Items.Clear();
                    foreach (ScatterViewItem o in storeSVIList)
                    {
                        palette.Items.Add(o);
                        o.Center = SetPosition(o);
                    }
                    return;
                }
                L0.L0_SV.Items.Remove(svi);
                L1.L1_SV.Items.Remove(svi);
                L2.L2_SV.Items.Remove(svi);
                if (pd1 != null) pd1.MainSV.Items.Remove(svi);
                if (pd2 != null) pd2.MainSV.Items.Remove(svi);
            }
        }
开发者ID:WellelseyHCILab,项目名称:MoCloPlanner100,代码行数:42,代码来源:SurfaceWindow1.xaml.cs

示例3: AddToScreen

        public void AddToScreen(ScatterViewItem item)
        {
            if (item is MagnifyingGlass)
            {
                this.mags.Add((MagnifyingGlass)item);
            }
            else if (item is PushPin)
            {
                this.pushPins.Add((PushPin)item);
            }
            else if (item is Entry)
            {
                this.entries.Add((Entry)item);
            }
            else if (item is MagicLens)
            {
                this.lenses.Add((MagicLens)item);
            }
            else if (item is Ruler)
            {
                this.rulers.Add((Ruler)item);
            }
            else if (item is PaperClip)
            {
                this.paperClips.Add((PaperClip)item);
            }
            else if (item is FilterTile)
            {
                this.filters.Add((FilterTile)item);

            }
            else if (item is Note)
            {
                this.notes.Add(item);
            }
            else
            {
                Console.WriteLine("Error trying to add something to global access of type: " + item.GetType().ToString());
            }

            MyScatterView.Items.Add(item);
        }
开发者ID:prgoodwin,项目名称:HabilisX,代码行数:42,代码来源:surfacewindow1.xaml.cs


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