Ejemplo n.º 1
0
        // Methods

        protected override void Awake()
        {
            base.Awake();

            Cursors.Add(lookCursor.Type, lookCursor);
            defaulLookCursorScale = lookCursor.transform.localScale;
        }
        /*--------------------------------------------------------------------------------------------*/
        public void Update()
        {
            gameObject.GetComponentsInChildren(true, vCursorsForInput);

            Cursors.Clear();
            SelectableCursors.Clear();
            ExcludedCursors.Clear();
            vCursorMap.Clear();

            for (int i = 0; i < vCursorsForInput.Count; i++)
            {
                ICursorDataForInput cursor = vCursorsForInput[i];

                if (vCursorMap.ContainsKey(cursor.Type))
                {
                    ExcludedCursors.Add(cursor);
                    continue;
                }

                Cursors.Add(cursor);
                vCursorMap.Add(cursor.Type, cursor);

                if (cursor.CanCauseSelections)
                {
                    SelectableCursors.Add(cursor);
                }
            }
        }
        // MonoBehaviour methods

        protected override void Awake()
        {
            base.Awake();
            foreach (var cursor in cursors)
            {
                Cursors.Add(cursor.Type, cursor);
            }
        }
Ejemplo n.º 4
0
 public void BindCursorResult(IAnalysisResult cursorResult, IParser parser)
 {
     if (!Cursors.ContainsKey(cursorResult.Name))
     {
         Cursors.Add(cursorResult.Name, cursorResult);
     }
     else
     {
         parser.ReportSyntaxError(cursorResult.LocationIndex, cursorResult.LocationIndex + cursorResult.Name.Length, string.Format("Module cursor {0} defined more than once.", cursorResult.Name), Severity.Error);
     }
 }
Ejemplo n.º 5
0
        } // LoadFonts

        #endregion

        #region Load Cursors

        #if (WINDOWS)
        /// <summary>
        /// Load cursors information.
        /// </summary>
        private static void LoadCursorsDescription()
        {
            if (skinDescription.Resource.Element("Skin").Element("Cursors") == null)
            {
                return;
            }

            foreach (var cursor in skinDescription.Resource.Element("Skin").Element("Cursors").Elements())
            {
                SkinCursor skinCursor = new SkinCursor
                {
                    Name     = ReadAttribute(cursor, "Name", null, true),
                    Filename = ReadAttribute(cursor, "Asset", null, true)
                };
                Cursors.Add(skinCursor);
            }
        }     // LoadCursors
Ejemplo n.º 6
0
        /// <summary>
        /// Initialise the reader
        /// </summary>
        /// <returns></returns>
        public async Task InitAsync(CancellationToken cancellationToken)
        {
            // Behavior is only saved to be used here in this Init method; we don't need to check or enforce it again
            // elsewhere since the logic below is already enforcing it.
            // For SingleRow we additionally rely on the user to only read one row and then dispose of everything.
            bool earlyQuit = (Behavior == CommandBehavior.SingleResult || Behavior == CommandBehavior.SingleRow);

            // we're saving all the cursors from the original reader here, then disposing of it
            // (we've already checked in CanDereference that there are at least some cursors)
            using (originalReader)
            {
                // Supports 1x1 1xN Nx1 and NXM patterns of cursor data.
                // If just some values are cursors we follow the pre-existing pattern set by the Oracle drivers, and dereference what we can.
                while (await originalReader.ReadAsync(cancellationToken))
                {
                    for (int i = 0; i < originalReader.FieldCount; i++)
                    {
                        if (originalReader.GetDataTypeName(i) == "refcursor")
                        {
                            // cursor name can potentially contain " so stop that breaking us
                            // TO DO: document how/why
                            Cursors.Add(originalReader.GetString(i).Replace(@"""", @""""""));
                            if (earlyQuit)
                            {
                                break;
                            }
                        }
                    }
                    if (earlyQuit)
                    {
                        break;
                    }
                }
            }

            // initialize
            await NextResultAsync(cancellationToken);
        }