示例#1
0
        // use MultiService factory

        public ScrollableContainer(XControlContainer parent, XNameContainer nameContainer, XComponentContext context = null, XMultiComponentFactory parentMCF = null)
        {
            MXDlgModelNameContainer = nameContainer;
            if (context != null)
            {
                MXContext = context;
            }
            parentCnt      = parent;
            this.parentMCF = parentMCF;
        }
示例#2
0
 /// <summary>
 /// Sets a named property of an XNameAccess object.
 /// </summary>
 /// <param name="obj">The obj.</param>
 /// <param name="propName">Name of the property.</param>
 /// <param name="value">The new value.</param>
 public static void SetNamedProperty(XNameContainer obj, String propName, Object value)
 {
     if (obj != null)
     {
         if (obj.hasByName(propName))
         {
             obj.replaceByName(propName, Any.Get(value));
         }
         else
         {
             obj.insertByName(propName, new uno.Any(value.ToString()));
         }
     }
 }
示例#3
0
        public OpenOffice()
        {
            /// This will start a new instance of OpenOffice.org if it is not running,
            /// or it will obtain an existing instance if it is already open.
            context = uno.util.Bootstrap.bootstrap();

            /// The next step is to create a new OpenOffice.org service manager
            service = (XMultiServiceFactory)context.getServiceManager();

            /// Create a new Desktop instance using our service manager
            component = (XComponentLoader)service.createInstance("com.sun.star.frame.Desktop");

            // Getting filters
            XNameContainer filters = (XNameContainer)service.createInstance("com.sun.star.document.FilterFactory");

            foreach (string filter in filters.getElementNames())
            {
                this.filters.Add(filter);
            }
        }
        // use MultiService factory

        public ScrollableContainer(XControlContainer parent, XNameContainer nameContainer, XComponentContext context = null, XMultiComponentFactory parentMCF = null)
        {
            MXDlgModelNameContainer = nameContainer;
            if (context != null) MXContext = context;
            parentCnt = parent;
            this.parentMCF = parentMCF;
        }
 /// <summary>
 /// Sets a named property of an XNameAccess object.
 /// </summary>
 /// <param name="obj">The obj.</param>
 /// <param name="propName">Name of the property.</param>
 /// <param name="value">The new value.</param>
 public static void SetNamedProperty(XNameContainer obj, String propName, Object value)
 {
     if (obj != null)
     {
         if (obj.hasByName(propName))
         {
             obj.replaceByName(propName, Any.Get(value));
         }
         else
         {
             obj.insertByName(propName, new uno.Any(value.ToString()));
         }
     }
 }