コード例 #1
0
ファイル: jewelbuilder.cs プロジェクト: tralivali1234/IL2JS
        /// <summary>
        /// This method executes the build process
        /// </summary>
        /// <param name="jewelId">The CUI ID for this Jewel</param>
        /// <returns>The Jewel object</returns>
        public bool BuildJewel(string jewelId)
        {
            if (InQuery)
            {
                return(false);
            }

            if (IsIdTrimmed(jewelId))
            {
                return(true); /* no error, so return true */
            }
            JewelBuildContext jbc = new JewelBuildContext();

            jbc.JewelId = jewelId;
            InQuery     = true;
            DataQuery query = new DataQuery();

            query.TabQuery  = false;
            query.Id        = jbc.JewelId;
            query.QueryType = DataQueryType.Root;
            query.Handler   = new DataReturnedEventHandler(OnReturnJewel);
            query.Data      = jbc;
            this.DataSource.RunQuery(query);
            return(true);
        }
コード例 #2
0
ファイル: jewelbuilder.cs プロジェクト: tralivali1234/IL2JS
        private void OnReturnJewel(DataQueryResult dqr)
        {
            JewelBuildContext jbc = (JewelBuildContext)dqr.ContextData;

            // Apply any extensions to the data.
            dqr.QueryData = ApplyDataExtensions(dqr.QueryData);

            JSObject jewelNode = DataNodeWrapper.GetFirstChildNodeWithName(dqr.QueryData, DataNodeWrapper.JEWEL);

            Jewel = BuildJewelInternal(jewelNode, jbc);
            Jewel.JewelBuilder = this;
            BuildClient.OnComponentCreated(Jewel, Jewel.Id);

            if (JewelBuildOptions.AttachToDOM)
            {
                Jewel.AttachInternal(true);
            }
            else
            {
                Jewel.RefreshInternal();
                Placeholder.AppendChild(Jewel.ElementInternal);
                Utility.EnsureCSSClassOnElement(Placeholder, "loaded");
            }
            OnRootBuilt(Jewel);
            BuildClient.OnComponentBuilt(Jewel, Jewel.Id);
        }
コード例 #3
0
ファイル: toolbar.cs プロジェクト: tralivali1234/IL2JS
        internal void AttachAndBuildJewelFromData(object jewelData)
        {
            if (!_hasJewel)
            {
                return;
            }

            _elmJewelPlaceholder.Style.Display = "block";

            JewelBuildContext jbc = new JewelBuildContext();

            jbc.JewelId = DataNodeWrapper.GetAttribute(jewelData, "Id");

            // Build Jewel
            JewelBuildOptions options = new JewelBuildOptions();

            options.TrimmedIds = _builder.Options.TrimmedIds;
            JewelBuilder builder = new JewelBuilder(options,
                                                    _elmJewelPlaceholder,
                                                    _builder.BuildClient);

            builder.BuildJewelFromData(jewelData, jbc);

            this.Jewel = builder.Jewel;
        }
コード例 #4
0
ファイル: jewelbuilder.cs プロジェクト: tralivali1234/IL2JS
        internal void BuildJewelFromData(object dataNode, JewelBuildContext jbc)
        {
            DataQueryResult dqr = new DataQueryResult();

            dqr.Success     = true;
            dqr.QueryData   = dataNode;
            dqr.ContextData = jbc;
            OnReturnJewel(dqr);
        }
コード例 #5
0
ファイル: jewelbuilder.cs プロジェクト: tralivali1234/IL2JS
        private Jewel BuildJewelInternal(object data, JewelBuildContext jbc)
        {
            if (CUIUtility.IsNullOrUndefined(data))
            {
                throw new ArgumentNullException("No Jewel element was present in the data");
            }

            Jewel = new Jewel(DataNodeWrapper.GetAttribute(data, "Id"),
                              DataNodeWrapper.GetNodeAttributes(data).To <JewelProperties>());

            // Handle the Jewel Menu Launcher control
            JewelMenuLauncher jml = BuildJewelMenuLauncher(data, jbc);

            Jewel.AddChild(jml.CreateComponentForDisplayMode("Default"));
            Jewel.JewelMenuLauncher = jml;

            return(Jewel);
        }
コード例 #6
0
ファイル: jewelbuilder.cs プロジェクト: modulexcite/IL2JS
        /// <summary>
        /// This method executes the build process
        /// </summary>
        /// <param name="jewelId">The CUI ID for this Jewel</param>
        /// <returns>The Jewel object</returns>
        public bool BuildJewel(string jewelId)
        {
            if (InQuery)
                return false;

            if (IsIdTrimmed(jewelId))
                return true; /* no error, so return true */

            JewelBuildContext jbc = new JewelBuildContext();
            jbc.JewelId = jewelId;
            InQuery = true;
            DataQuery query = new DataQuery();
            query.TabQuery = false;
            query.Id = jbc.JewelId;
            query.QueryType = DataQueryType.Root;
            query.Handler = new DataReturnedEventHandler(OnReturnJewel);
            query.Data = jbc;
            this.DataSource.RunQuery(query);
            return true;
        }
コード例 #7
0
ファイル: jewelbuilder.cs プロジェクト: tralivali1234/IL2JS
        private JewelMenuLauncher BuildJewelMenuLauncher(object data, JewelBuildContext jbc)
        {
            JewelMenuLauncherProperties properties =
                DataNodeWrapper.GetNodeAttributes(data).To <JewelMenuLauncherProperties>();

            JSObject[] children = DataNodeWrapper.GetNodeChildren(data);

            Menu menu = null;

            MenuLauncherControlProperties launcherProperties =
                DataNodeWrapper.GetNodeAttributes(data).To <MenuLauncherControlProperties>();

            if (!Utility.IsTrue(launcherProperties.PopulateDynamically))
            {
                menu = BuildMenu(children[0], jbc, false);
            }

            JewelMenuLauncher jml = new JewelMenuLauncher(Jewel,
                                                          properties.Id,
                                                          properties,
                                                          menu);

            return(jml);
        }
コード例 #8
0
ファイル: toolbar.cs プロジェクト: modulexcite/IL2JS
        internal void AttachAndBuildJewelFromData(object jewelData)
        {
            if (!_hasJewel)
            {
                return;
            }

            _elmJewelPlaceholder.Style.Display = "block";

            JewelBuildContext jbc = new JewelBuildContext();
            jbc.JewelId = DataNodeWrapper.GetAttribute(jewelData, "Id");

            // Build Jewel
            JewelBuildOptions options = new JewelBuildOptions();
            options.TrimmedIds = _builder.Options.TrimmedIds;
            JewelBuilder builder = new JewelBuilder(options,
                 _elmJewelPlaceholder,
                 _builder.BuildClient);

            builder.BuildJewelFromData(jewelData, jbc);

            this.Jewel = builder.Jewel;
        }
コード例 #9
0
ファイル: jewelbuilder.cs プロジェクト: modulexcite/IL2JS
 internal void BuildJewelFromData(object dataNode, JewelBuildContext jbc)
 {
     DataQueryResult dqr = new DataQueryResult();
     dqr.Success = true;
     dqr.QueryData = dataNode;
     dqr.ContextData = jbc;
     OnReturnJewel(dqr);
 }
コード例 #10
0
ファイル: jewelbuilder.cs プロジェクト: modulexcite/IL2JS
        private JewelMenuLauncher BuildJewelMenuLauncher(object data, JewelBuildContext jbc)
        {
            JewelMenuLauncherProperties properties =
                DataNodeWrapper.GetNodeAttributes(data).To<JewelMenuLauncherProperties>();

            JSObject[] children = DataNodeWrapper.GetNodeChildren(data);

            Menu menu = null;

            MenuLauncherControlProperties launcherProperties =
                DataNodeWrapper.GetNodeAttributes(data).To<MenuLauncherControlProperties>();

            if (!Utility.IsTrue(launcherProperties.PopulateDynamically))
                menu = BuildMenu(children[0], jbc, false);

            JewelMenuLauncher jml = new JewelMenuLauncher(Jewel,
                                                          properties.Id,
                                                          properties,
                                                          menu);
            return jml;
        }
コード例 #11
0
ファイル: jewelbuilder.cs プロジェクト: modulexcite/IL2JS
        private Jewel BuildJewelInternal(object data, JewelBuildContext jbc)
        {
            if (CUIUtility.IsNullOrUndefined(data))
                throw new ArgumentNullException("No Jewel element was present in the data");

            Jewel = new Jewel(DataNodeWrapper.GetAttribute(data, "Id"),
                              DataNodeWrapper.GetNodeAttributes(data).To<JewelProperties>());

            // Handle the Jewel Menu Launcher control
            JewelMenuLauncher jml = BuildJewelMenuLauncher(data, jbc);
            Jewel.AddChild(jml.CreateComponentForDisplayMode("Default"));
            Jewel.JewelMenuLauncher = jml;

            return Jewel;
        }