SetProperties() public méthode

public SetProperties ( object Properties ) : void
Properties object
Résultat void
Exemple #1
0
        // To set record context: Pass 1 parameter
        // Param 1: The ID of the current SLX record
        // Param 2: An optional reference to a callback function, set in SLX passing "FunctionName" as a string where FunctionName accepts two params
        //          'Sample callback function in VBScript
        //          Function CallbackFunction(EventName, EventData)
        //          End Function
        public object Run(object[] Args)
        {
            ExtensionProperties.SetProperties(Args);

            if (ExtensionProperties.RecordID == string.Empty)
            {
                throw new ApplicationException("Invalid properties passed");
            }

            this.Initialize();
            this.ShowDialog();
            return(null);
        }
Exemple #2
0
        /// <summary>
        /// Receives am argument Array of objects and forwards it to
        /// set the ExtensionProperties. If the arguments are identified
        /// as for a command to be executed they will again be forwarded to
        /// the command dispatcher to finally execute the service command.
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public object Run(object[] args)
        {
            object result = null;

            ExtensionProperties.SetProperties(args);

            if (ExtensionProperties.ExtensionState == ExtensionState.ExcuteCommand)
            {
                var res = (ServiceResult)DispatchServiceCommand(ExtensionProperties.Command, ExtensionProperties.CommandArgs);
                result = res.Result;
            }

            return(result);
        }
Exemple #3
0
        // To initialize: Pass 4 parameters (must be in the following order)
        // Param 1: The handle/hwnd of the container to embed the control
        // Param 2: A boolean indicating whether or not to resize the control to fill the container (default: false)
        // Param 3: A boolean indicating whether to force the control to embed to the SLX form's parent container tab instead of the form itself
        // Param 4: An optional reference to a callback function, set in SLX passing "FunctionName" as a string where FunctionName accepts two params
        //          'Sample callback function in VBScript
        //          Function CallbackFunction(EventName, EventData)
        //          End Function
        //--------------------------------------------------------------
        // To set record context: Pass 1 parameter
        // Param 1: The ID of the current SLX record
        public object Run(object[] Args)
        {
            ExtensionProperties.SetProperties(Args);

            if (ExtensionProperties.ParentHandle == IntPtr.Zero)
            {
                throw new ApplicationException("Invalid properties passed");
            }

            switch (ExtensionProperties.ExtensionState)
            {
            case ExtensionState.Initialize:
                this.Initialize();
                this.Show();
                Win32.SetParent(this.Handle, ExtensionProperties.ParentHandle);
                if (ExtensionProperties.FillParent)
                {
                    Fill(ExtensionProperties.ParentHandle);
                }
                break;

            case ExtensionState.SetContext:
                if (SalesLogixRecordChanged != null)
                {
                    SalesLogixRecordChanged(ExtensionProperties.RecordID);
                }
                break;

            case ExtensionState.ExcuteCommand:
                switch (ExtensionProperties.Command)
                {
                case "RESIZE":
                    if (ExtensionProperties.FillParent)
                    {
                        Fill(ExtensionProperties.ParentHandle);
                    }
                    break;
                }
                break;
            }

            return(null);
        }