Exemplo n.º 1
0
        internal void UpdateSnapBehavior()
        {
            if (!(_itemsView.ItemsLayout is ItemsLayout itemsLayout))
            {
                return;
            }

            var snapPointsType = itemsLayout.SnapPointsType;

            // Clear our the existing snap helper (if any)
            DetachSnapHelper();

            if (snapPointsType == SnapPointsType.None)
            {
                return;
            }

            var alignment = itemsLayout.SnapPointsAlignment;

            // Create a new snap helper
            _snapHelper = CreateSnapHelper(snapPointsType, alignment);

            // And attach it to this RecyclerView
            _snapHelper.AttachToRecyclerView(_recyclerView);
        }
Exemplo n.º 2
0
        public override void OnCreate(object hook)
        {
            _context        = hook as IAppContext;
            this.m_caption  = "旋转要素";
            this.m_category = "编辑器";
            this.m_name     = "Edit_RotateFeature";
            this._key       = "Edit_RotateFeature";
            this.m_message  = "旋转要素";
            this.m_toolTip  = "旋转要素";
            this.m_bitmap   = Properties.Resources.icon_edit_rotate;
            this.m_cursor   = new System.Windows.Forms.Cursor(new MemoryStream(Resource.Digitise));
            this.bool_2     = false;

            this.cursor_0 =
                new System.Windows.Forms.Cursor(
                    base.GetType()
                    .Assembly.GetManifestResourceStream("Yutai.Plugins.Editor.Resources.Cursor.RotateFeature.cur"));

            this.isimpleMarkerSymbol_0.Style   = esriSimpleMarkerStyle.esriSMSCircle;
            this.isimpleMarkerSymbol_0.Size    = 8.0;
            this.isimpleMarkerSymbol_0.Outline = true;
            this.isimpleMarkerSymbol_0.Color   = ColorManage.GetRGBColor(0, 255, 255);
            this.cursor_1 =
                new System.Windows.Forms.Cursor(
                    base.GetType()
                    .Assembly.GetManifestResourceStream("Yutai.Plugins.Editor.Resources.Cursor.VertexEdit.cur"));
            this.m_cursor = this.cursor_0;

            DisplayStyleYT                   = DisplayStyleYT.Image;
            base.TextImageRelationYT         = TextImageRelationYT.ImageAboveText;
            base.ToolStripItemImageScalingYT = ToolStripItemImageScalingYT.None;
            _itemType         = RibbonItemType.Button;
            this.snapHelper_0 = new SnapHelper(_context.FocusMap as IActiveView,
                                               _context.Config.EngineSnapEnvironment);
        }
Exemplo n.º 3
0
        public override void OnCreate(object hook)
        {
            _context                       = hook as IAppContext;
            this.m_caption                 = "跟踪";
            this.m_category                = "编辑器";
            this.m_name                    = "Edit_FollowAlong";
            this._key                      = "Edit_FollowAlong";
            this.m_message                 = "跟踪";
            this.m_toolTip                 = "跟踪";
            this.m_bitmap                  = Properties.Resources.icon_edit_track;
            this.m_cursor                  = new System.Windows.Forms.Cursor(new MemoryStream(Resource.Digitise));
            this.bool_2                    = false;
            this.iconstructCurve_0         = new Polyline() as IConstructCurve;
            this.isimpleLineSymbol_0       = new SimpleLineSymbol();
            this.isimpleLineSymbol_0.Width = 1.0;
            this.isegmentGraph_0           = new SegmentGraph();

            DisplayStyleYT                   = DisplayStyleYT.Image;
            base.TextImageRelationYT         = TextImageRelationYT.ImageAboveText;
            base.ToolStripItemImageScalingYT = ToolStripItemImageScalingYT.None;
            _itemType = RibbonItemType.Button;

            if (_context is IApplicationEvents)
            {
                (_context as IApplicationEvents).OnActiveHookChanged +=
                    new OnActiveHookChangedHandler(this.AppContext_ActiveHookChanged);
            }
            if (this.iactiveViewEvents_Event_0 != null)
            {
                try
                {
                    this.iactiveViewEvents_Event_0.AfterDraw -=
                        new IActiveViewEvents_AfterDrawEventHandler(ActiveView_AfterDraw);
                }
                catch
                {
                }
            }
            if (_context.FocusMap != null)
            {
                this.iactiveViewEvents_Event_0            = (_context.ActiveView as IActiveViewEvents_Event);
                this.iactiveViewEvents_Event_0.AfterDraw +=
                    new IActiveViewEvents_AfterDrawEventHandler(ActiveView_AfterDraw);
                this.snapHelper_0 = new SnapHelper(_context);
            }
        }
Exemplo n.º 4
0
 void DetachSnapHelper()
 {
     _snapHelper?.AttachToRecyclerView(null);
     _snapHelper?.Dispose();
     _snapHelper = null;
 }