Ejemplo n.º 1
0
        public static void OnGluxLoaded()
        {
            // todo todo todo
            // This needs to move to plugins eventually
            LocalizationControl.Self.PopulateFromLocalizationManager();

            string essFileName = SettingsSaveFileName;

            if (File.Exists(essFileName))
            {
                try
                {
                    glueViewSettings = GlueViewSettings.Load(essFileName);
                }
                catch
                {
                    // do nothing? It's just a settings file
                }
            }

            if (glueViewSettings?.CollapsedPlugins != null)
            {
                ignoreCollapseChange = true;
                CollapsibleFormHelper.Self.SetCollapsedItems(glueViewSettings.CollapsedPlugins);
                ignoreCollapseChange = false;
            }

            InteractiveConnection.Initialize();

            WcfManager.Self.Initialize();
        }
Ejemplo n.º 2
0
        private static void SelectEntity()
        {
            var cursor = GuiManager.Cursor;

            if (cursor.WindowOver != null)
            {
                return;
            }

            if (!cursor.PrimaryPush)
            {
                return;
            }

            if (GluxManager.CurrentElement == null)
            {
                return;
            }

            if (GluxManager.CurrentElementHighlighted != null)
            {
                foreach (var item in
                         GluxManager.CurrentElement.ContainedElements.Where(item => item.IsMouseOver(cursor) && GluxManager.CurrentElementHighlighted == item).Where(item => InteractiveConnection.Initialized()))
                {
                    InteractiveConnection.Callback.SelectNamedObjectSave(item.ContainerName, item.FieldName);
                    if (item.AssociatedNamedObjectSave.HasCustomVariable("X") && item.AssociatedNamedObjectSave.HasCustomVariable("Y"))
                    {
                        cursor.ObjectGrabbed = item;
                    }
                    return;
                }

                foreach (var item in
                         GluxManager.CurrentElement.ElementsInList.Where(item => item.IsMouseOver(cursor) && GluxManager.CurrentElementHighlighted == item).Where(elementRuntime => InteractiveConnection.Initialized()))
                {
                    InteractiveConnection.Callback.SelectNamedObjectSave(item.ContainerName, item.FieldName);
                    if (item.AssociatedNamedObjectSave.HasCustomVariable("X") && item.AssociatedNamedObjectSave.HasCustomVariable("Y"))
                    {
                        cursor.ObjectGrabbed = item;
                    }
                    return;
                }
            }

            foreach (var item in
                     GluxManager.CurrentElement.ContainedElements.Where(item => item.IsMouseOver(cursor)).Where(item => InteractiveConnection.Initialized()))
            {
                InteractiveConnection.Callback.SelectNamedObjectSave(item.ContainerName, item.FieldName);
                if (item.AssociatedNamedObjectSave.HasCustomVariable("X") && item.AssociatedNamedObjectSave.HasCustomVariable("Y"))
                {
                    cursor.ObjectGrabbed = item;
                }
                return;
            }

            foreach (var item in
                     GluxManager.CurrentElement.ElementsInList.Where(item => item.IsMouseOver(cursor)).Where(elementRuntime => InteractiveConnection.Initialized()))
            {
                InteractiveConnection.Callback.SelectNamedObjectSave(item.ContainerName, item.FieldName);
                if (item.AssociatedNamedObjectSave.HasCustomVariable("X") && item.AssociatedNamedObjectSave.HasCustomVariable("Y"))
                {
                    cursor.ObjectGrabbed = item;
                }
                return;
            }
        }