Exemple #1
0
        /// <summary>
        /// Creates a set of windows (a GUI layout) from the information in the specified XML.
        /// </summary>
        /// <param name="source">
        /// String holding the XML source
        /// </param>
        /// <param name="callback">
        /// PropertyCallback function to be called for each Property element loaded from the layout.  This is
        /// called prior to the property value being applied to the window enabling client code manipulation of
        /// properties.
        /// </param>
        /// <param name="userdata">
        /// Client code data pointer passed to the PropertyCallback function.
        /// </param>
        /// <returns>
        /// Pointer to the root Window object defined in the layout.
        /// </returns>
        public Window LoadLayoutFromString(string source, PropertyCallback callback = null, object userdata = null)
        {
            // log the fact we are about to load a layout
            System.GetSingleton()
            .Logger.LogEvent("---- Beginning loading of GUI layout from string ----", LoggingLevel.Informative);

            // create handler object
            var handler = new GuiLayoutXmlHandler(callback, userdata);

            // do parse (which uses handler to create actual data)
            try
            {
                System.GetSingleton()
                .GetXMLParser()
                .ParseXmlString(handler, source, GuiLayoutSchemaName);
            }
            catch
            {
                System.GetSingleton()
                .Logger.LogEvent("WindowManager::loadLayoutFromString - loading of layout from string failed.",
                                 LoggingLevel.Errors);
                throw;
            }

            // log the completion of loading
            System.GetSingleton()
            .Logger.LogEvent("---- Successfully completed loading of GUI layout from string ----");

            return(handler.GetLayoutRootWindow());
        }
Exemple #2
0
        /// <summary>
        /// Creates a set of windows (a GUI layout) from the information in the specified XML file.
        /// </summary>
        /// <param name="filename">
        /// String object holding the filename of the XML file to be processed.
        /// </param>
        /// <param name="resourceGroup">
        /// Resource group identifier to be passed to the resource provider when loading the layout file.
        /// </param>
        /// <param name="callback">
        /// PropertyCallback function to be called for each Property element loaded from the layout.  This is
        /// called prior to the property value being applied to the window enabling client code manipulation of
        /// properties.
        /// </param>
        /// <param name="userdata">
        /// Client code data pointer passed to the PropertyCallback function.
        /// </param>
        /// <returns>
        /// Pointer to the root Window object defined in the layout.
        /// </returns>
        /// <exception cref="InvalidRequestException">
        /// thrown if a filename appears to be invalid.
        /// </exception>
        public Window LoadLayoutFromFile(string filename,
                                         string resourceGroup      = "",
                                         PropertyCallback callback = null,
                                         object userdata           = null)
        {
            if (String.IsNullOrEmpty(filename))
            {
                throw new InvalidRequestException("Filename supplied for gui-layout loading must be valid.");
            }

            // log the fact we are about to load a layout
            System.GetSingleton()
            .Logger.LogEvent("---- Beginning loading of GUI layout from '" + filename + "' ----",
                             LoggingLevel.Informative);

            // create handler object
            var handler = new GuiLayoutXmlHandler(callback, userdata);

            // do parse (which uses handler to create actual data)
            try
            {
                System.GetSingleton()
                .GetXMLParser()
                .ParseXmlFile(handler, filename, GuiLayoutSchemaName,
                              String.IsNullOrEmpty(resourceGroup) ? d_defaultResourceGroup : resourceGroup);
            }
            catch
            {
                System.GetSingleton()
                .Logger.LogEvent(
                    "WindowManager::loadLayoutFromFile - loading of layout from file '" + filename +
                    "' failed.",
                    LoggingLevel.Errors);
                throw;
            }

            // log the completion of loading
            System.GetSingleton()
            .Logger.LogEvent("---- Successfully completed loading of GUI layout from '" + filename + "' ----");

            return(handler.GetLayoutRootWindow());
        }
 public new void useCallback(PropertyCallback callback)
 {
     yarpPINVOKE.TypedReaderProperty_useCallback(swigCPtr, PropertyCallback.getCPtr(callback));
     if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve();
 }
Exemple #4
0
 public static extern void PropertyCallback_director_connect(HandleRef jarg1, PropertyCallback.SwigDelegatePropertyCallback_0 delegate0, PropertyCallback.SwigDelegatePropertyCallback_1 delegate1);
Exemple #5
0
 internal static HandleRef getCPtr(PropertyCallback obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
 public static extern void GetCamJsonProperties(PropertyCallback callback);
 public new void useCallback(PropertyCallback callback)
 {
     yarpPINVOKE.BufferedPortProperty_useCallback__SWIG_0(swigCPtr, PropertyCallback.getCPtr(callback));
     if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve();
 }
Exemple #8
0
        /*!
         * \brief
         *  Creates a set of windows (a GUI layout) from the information in the specified XML.
         *
         * \param source
         *  RawDataContainer holding the XML source
         *
         * \param callback
         *  PropertyCallback function to be called for each Property element loaded from the layout.  This is
         *  called prior to the property value being applied to the window enabling client code manipulation of
         *  properties.
         *
         * \param userdata
         *  Client code data pointer passed to the PropertyCallback function.
         *
         * \return
         *  Pointer to the root Window object defined in the layout.
         */

        public Window LoadLayoutFromContainer(RawDataContainer source, PropertyCallback callback = null,
                                              object userdata = null)
        {
            throw new NotImplementedException();
        }