예제 #1
0
        public static void setValueLambdaHtml(AnyUiUIElement el, object o)
        {
            var dc = (el.DisplayData as AnyUiDisplayDataHtml)?._context;

            if (dc != null)
            {
                var sessionNumber = dc._bi.sessionNumber;
                var found         = findSession(sessionNumber);
                if (found != null)
                {
                    lock (dc.htmlDotnetLock)
                    {
                        while (found.htmlDotnetEventIn)
                        {
                            ;
                        }
                        found.htmlEventInputs.Clear();
                        found.htmlDotnetEventType = "setValueLambda";
                        found.htmlDotnetEventInputs.Add(el);
                        found.htmlDotnetEventInputs.Add(o);
                        found.htmlDotnetEventIn = true;
                    }
                }
            }
        }
예제 #2
0
        public static void specialActionContextMenuHtml(AnyUiUIElement el, AnyUiSpecialActionContextMenu cntlcm)
        {
            var dc = (el.DisplayData as AnyUiDisplayDataHtml)?._context;

            if (dc != null)
            {
                var sessionNumber = dc._bi.sessionNumber;
                var found         = findSession(sessionNumber);
                if (found != null)
                {
                    lock (dc.htmlDotnetLock)
                    {
                        while (found.htmlDotnetEventIn)
                        {
                            ;
                        }
                        found.htmlEventInputs.Clear();
                        found.htmlDotnetEventType = "contextMenu";
                        found.htmlDotnetEventInputs.Add(el);
                        found.htmlDotnetEventInputs.Add(cntlcm);
                        found.htmlDotnetEventIn = true;
                    }
                }
            }
        }
예제 #3
0
 public static void SetColumnSpan(AnyUiUIElement el, int value)
 {
     if (el != null)
     {
         el.GridColumnSpan = value;
     }
 }
예제 #4
0
 public static void SetRow(AnyUiUIElement el, int value)
 {
     if (el != null)
     {
         el.GridRow = value;
     }
 }
예제 #5
0
        /// <summary>
        /// Allows setting the name for a control.
        /// </summary>
        /// <param name="cntl"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static AnyUiUIElement NameControl(
            AnyUiUIElement cntl, string name)
        {
            // access
            if (cntl == null)
            {
                return(null);
            }

            // set
            cntl.Name = name;
            return(cntl);
        }
예제 #6
0
 public static void specialActionContextMenuHtml(AnyUiUIElement el, AnyUiSpecialActionContextMenu cntlcm)
 {
     lock (htmlDotnetLock)
     {
         while (htmlDotnetEventIn)
         {
             ;
         }
         htmlDotnetEventType = "contextMenu";
         htmlDotnetEventInputs.Add(el);
         htmlDotnetEventInputs.Add(cntlcm);
         htmlDotnetEventIn = true;
     }
 }
예제 #7
0
 public static void setValueLambdaHtml(AnyUiUIElement el, object o)
 {
     lock (htmlDotnetLock)
     {
         while (htmlDotnetEventIn)
         {
             ;
         }
         htmlDotnetEventType = "setValueLambda";
         htmlDotnetEventInputs.Add(el);
         htmlDotnetEventInputs.Add(o);
         htmlDotnetEventIn = true;
     }
 }
예제 #8
0
        /// <summary>
        /// This function attaches the above lambdas accordingly to a given user control.
        /// It is to be used, when an abstract AnyUi... is being created and the according WPF element
        /// will be activated later.
        /// Note: use of this is for legacy reasons; basically the class members can be used directly
        /// </summary>
        /// <param name="cntl">User control (passed thru)</param>
        /// <param name="setValue">Lambda called, whenever the value is changed</param>
        /// <param name="takeOverLambda">Lamnda called at the end of a modification</param>
        /// <returns>Passes thru the user control</returns>
        public static AnyUiUIElement RegisterControl(
            AnyUiUIElement cntl, Func <object, AnyUiLambdaActionBase> setValue,
            AnyUiLambdaActionBase takeOverLambda = null)
        {
            // access
            if (cntl == null)
            {
                return(null);
            }

            // crude test
            cntl.setValueLambda = setValue;
            cntl.takeOverLambda = takeOverLambda;

            return(cntl);
        }
예제 #9
0
 /// <summary>
 /// Tries to revert changes in some controls.
 /// </summary>
 /// <returns>True, if changes were applied</returns>
 public virtual bool CallUndoChanges(AnyUiUIElement root)
 {
     return(false);
 }