コード例 #1
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            try
            {
                base.OnActivityCreated(savedInstanceState);
                InitComponent(View);
                InitToolbar(View);
                SetRecyclerViewAdapters();

                var doubleClickHelper = new DoubleClickHandler(500);

                LikeButton.Click    += (s, e) => doubleClickHelper.HandleDoubleClick(LikeButtonOnClick);
                DesLikeButton.Click += (s, e) => doubleClickHelper.HandleDoubleClick(DesLikeButtonOnClick);
                UndoButton.Click    += (s, e) => doubleClickHelper.HandleDoubleClick(UndoButtonOnClick);

                PopularityImage.Click += PopularityImageOnClick;
                FilterButton.Click    += FilterButtonOnClick;

                StartApiService();

                Runnable = new ApiPostUpdaterHelper(GlobalContext, MainHandler);
                //Start Updating the news feed every few minus
                MainHandler.PostDelayed(Runnable, PostUpdaterInterval);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #2
0
        public override DoubleClickHandler GetDoubleClickHandler()
        {
            var dch = new DoubleClickHandler()
            {
                Name = "MagoRunnerPlugin.Doubleclick"
            };

            dch.Command = (instance) => RunMago(instance);
            return(dch);
        }
コード例 #3
0
        public static void Attach(object doubleClickTarget, DoubleClickHandler function)
        {
            var instance = new DoubleClickHelper();
            var target = doubleClickTarget as UIElement;

            target.MouseLeftButtonUp += instance.MouseUp;
            target.MouseLeftButtonDown += instance.MouseDown;

            instance.callback = function;
        }
コード例 #4
0
 internal IHitTestObject HitTest(HitTestPointData parentCoord, DoubleClickHandler AxisScaleEditorMethod, DoubleClickHandler AxisStyleEditorMethod, DoubleClickHandler AxisLabelMajorStyleEditorMethod, DoubleClickHandler AxisLabelMinorStyleEditorMethod)
 {
     foreach (var axisStyle in _axisStyles)
     {
         var hit = axisStyle.HitTest(parentCoord, AxisScaleEditorMethod, AxisStyleEditorMethod, AxisLabelMajorStyleEditorMethod, AxisLabelMinorStyleEditorMethod);
         if (null != hit)
         {
             return(hit);
         }
     }
     return(null);
 }
コード例 #5
0
        private void OnMouse_DoubleClick(object sender, MouseEventArgs mouseEventArgs)
        {
            if (mouseEventArgs.Clicks < 2)
            {
                return;
            }
            OLVColumn column;
            var       listItem    = GetItemAt(mouseEventArgs.X, mouseEventArgs.Y, out column);
            var       clickedNode = listItem.RowObject as ConnectionInfo;

            if (clickedNode == null)
            {
                return;
            }
            DoubleClickHandler.Execute(clickedNode);
        }
コード例 #6
0
        private void OnMouse_DoubleClick(object sender, MouseEventArgs mouseEventArgs)
        {
            if (mouseEventArgs.Clicks < 2)
            {
                return;
            }
            // ReSharper disable once NotAccessedVariable
            OLVColumn column;
            var       listItem = GetItemAt(mouseEventArgs.X, mouseEventArgs.Y, out column);

            if (!(listItem?.RowObject is ConnectionInfo clickedNode))
            {
                return;
            }
            DoubleClickHandler.Execute(clickedNode);
        }
コード例 #7
0
 public ScintillaControl(string fullpath)
 {
     try
     {
         IntPtr lib = WinAPI.LoadLibrary(fullpath);
         hwndScintilla = WinAPI.CreateWindowEx(0, "Scintilla", "", WS_CHILD_VISIBLE_TABSTOP, 0, 0, this.Width, this.Height, this.Handle, 0, new IntPtr(0), null);
         directPointer = (int)SlowPerform(2185, 0, 0);
         UpdateUI += new UpdateUIHandler(OnBraceMatch);
         DoubleClick += new DoubleClickHandler(OnBlockSelect);
         CharAdded += new CharAddedHandler(OnSmartIndent);
         Resize += new EventHandler(OnResize);
         directPointer = DirectPointer;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #8
0
        private void OnMouse_DoubleClick(object sender, MouseEventArgs mouseEventArgs)
        {
            if (mouseEventArgs.Clicks < 2)
            {
                return;
            }
            OLVColumn column;
            var       listItem    = GetItemAt(mouseEventArgs.X, mouseEventArgs.Y, out column);
            var       clickedNode = listItem?.RowObject as ConnectionInfo;

            if (clickedNode == null)
            {
                return;
            }

            if (Control.ModifierKeys == Keys.Control)
            {
                _connectionInitiator.OpenConnection(clickedNode, ConnectionInfo.Force.DoNotJump);
                return;
            }
            DoubleClickHandler.Execute(clickedNode);
        }
コード例 #9
0
ファイル: AxisStyle.cs プロジェクト: olesar/Altaxo
        public IHitTestObject HitTest(HitTestPointData parentCoord, DoubleClickHandler AxisScaleEditorMethod, DoubleClickHandler AxisStyleEditorMethod, DoubleClickHandler AxisLabelMajorStyleEditorMethod, DoubleClickHandler AxisLabelMinorStyleEditorMethod)
        {
            IHitTestObject hit;

            if (null != (hit = _axisTitle?.HitTest(parentCoord)))
            {
                return(hit);
            }

            if (IsAxisLineEnabled && null != (hit = _axisLineStyle.HitTest(parentCoord, false)))
            {
                hit.DoubleClick = AxisScaleEditorMethod;
                return(hit);
            }

            // hit testing the axes - secondly now with the ticks
            // in this case the TitleAndFormat editor for the axis should be shown
            if (IsAxisLineEnabled && null != (hit = _axisLineStyle.HitTest(parentCoord, true)))
            {
                hit.DoubleClick = AxisStyleEditorMethod;
                return(hit);
            }

            if (null != (hit = _majorLabelStyle?.HitTest(parentCoord)))
            {
                hit.DoubleClick = AxisLabelMajorStyleEditorMethod;
                return(hit);
            }

            if (null != (hit = _minorLabelStyle?.HitTest(parentCoord)))
            {
                hit.DoubleClick = AxisLabelMinorStyleEditorMethod;
                return(hit);
            }

            return(null);
        }
コード例 #10
0
ファイル: AxisStyle.cs プロジェクト: Altaxo/Altaxo
		public IHitTestObject HitTest(HitTestPointData parentCoord, DoubleClickHandler AxisScaleEditorMethod, DoubleClickHandler AxisStyleEditorMethod, DoubleClickHandler AxisLabelMajorStyleEditorMethod, DoubleClickHandler AxisLabelMinorStyleEditorMethod)
		{
			IHitTestObject hit;
			if (null != (hit = _axisTitle?.HitTest(parentCoord)))
				return hit;

			if (this.IsAxisLineEnabled && null != (hit = _axisLineStyle.HitTest(parentCoord, false)))
			{
				hit.DoubleClick = AxisScaleEditorMethod;
				return hit;
			}

			// hit testing the axes - secondly now with the ticks
			// in this case the TitleAndFormat editor for the axis should be shown
			if (this.IsAxisLineEnabled && null != (hit = _axisLineStyle.HitTest(parentCoord, true)))
			{
				hit.DoubleClick = AxisStyleEditorMethod;
				return hit;
			}

			if (null != (hit = _majorLabelStyle?.HitTest(parentCoord)))
			{
				hit.DoubleClick = AxisLabelMajorStyleEditorMethod;
				return hit;
			}

			if (null != (hit = _minorLabelStyle?.HitTest(parentCoord)))
			{
				hit.DoubleClick = AxisLabelMinorStyleEditorMethod;
				return hit;
			}

			return null;
		}
コード例 #11
0
 public ScintillaControl(string fullpath)
 {
     try
     {
         if (Win32.ShouldUseWin32())
         {
             LoadLibrary(fullpath);
             hwndScintilla = CreateWindowEx(0, "Scintilla", "", WS_CHILD_VISIBLE_TABSTOP, 0, 0, this.Width, this.Height, this.Handle, 0, new IntPtr(0), null);
             directPointer = (int)SlowPerform(2185, 0, 0);
             directPointer = DirectPointer;
         }
         UpdateUI += new UpdateUIHandler(OnUpdateUI);
         UpdateUI += new UpdateUIHandler(OnBraceMatch);
         UpdateUI += new UpdateUIHandler(OnCancelHighlight);
         DoubleClick += new DoubleClickHandler(OnBlockSelect);
         CharAdded += new CharAddedHandler(OnSmartIndent);
         Resize += new EventHandler(OnResize);
         this.InitScrollBars(this);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #12
0
 public ScintillaControl(string fullpath)
 {
     try
     {
         if (Win32.ShouldUseWin32())
         {
             IntPtr lib = LoadLibrary(fullpath);
             hwndScintilla = CreateWindowEx(0, "Scintilla", "", WS_CHILD_VISIBLE_TABSTOP, 0, 0, this.Width, this.Height, this.Handle, 0, new IntPtr(0), null);
             directPointer = (IntPtr)SlowPerform(2185, 0, 0);
             IntPtr sciFunctionPointer = GetProcAddress(new HandleRef(null, lib), "Scintilla_DirectFunction");
             if (sciFunctionPointer == IntPtr.Zero) sciFunctionPointer = GetProcAddress(new HandleRef(null, lib), "_Scintilla_DirectFunction@16");
             if (sciFunctionPointer == IntPtr.Zero)
             {
                 string msg = "The Scintilla module has no export for the 'Scintilla_DirectFunction' procedure.";
                 throw new Win32Exception(msg, new Win32Exception(Marshal.GetLastWin32Error()));
             }
             _sciFunction = (Perform)Marshal.GetDelegateForFunctionPointer(sciFunctionPointer, typeof(Perform));
             directPointer = DirectPointer;
         }
         UpdateUI += new UpdateUIHandler(OnUpdateUI);
         UpdateUI += new UpdateUIHandler(OnBraceMatch);
         UpdateUI += new UpdateUIHandler(OnCancelHighlight);
         DoubleClick += new DoubleClickHandler(OnBlockSelect);
         CharAdded += new CharAddedHandler(OnSmartIndent);
         Resize += new EventHandler(OnResize);
         this.InitScrollBars(this);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }