Beispiel #1
0
        public Sidebar(Sidebars sidebars, SidebarAnchor anchor)
        {
            this.sidebars = sidebars;
            this.anchor   = anchor;

            e = new EventWrapper(this);
        }
Beispiel #2
0
        protected Widget(TCanvas canvas, TItem item)
        {
            Ensure.That(nameof(canvas)).IsNotNull(canvas);
            Ensure.That(nameof(item)).IsNotNull(item);

            this.canvas = canvas;

            this.item = item;

            e = new EventWrapper(GetType());

            // Micro optimization
            hasDescriptor = item.HasDescriptor();

            if (hasDescriptor)
            {
                DescriptorProvider.instance.AddListener(item, CacheDescription);
            }
        }
Beispiel #3
0
        protected Canvas(TGraph graph)
        {
            Ensure.That(nameof(graph)).IsNotNull(graph);

            this.graph = graph;

            e = new EventWrapper(GetType());

            selection = new GraphSelection();

            widgetProvider = new WidgetProvider(this);

            graph.elements.CollectionChanged += Recollect;

            widgets                     = new WidgetList <IWidget>(this);
            elementWidgets              = new WidgetList <IGraphElementWidget>(this);
            widgetsByAscendingZ         = new WidgetList <IWidget>(this);
            visibleWidgetsByAscendingZ  = new WidgetList <IWidget>(this);
            visibleWidgetsByDescendingZ = new WidgetList <IWidget>(this);
        }