Ejemplo n.º 1
0
 public LazyQueryOperation(QueryOperation queryOperation, Action <QueryResult> afterQueryExecuted, NameValueCollection headers)
 {
     this.queryOperation     = queryOperation;
     this.afterQueryExecuted = afterQueryExecuted;
     this.headers            = headers;
 }
Ejemplo n.º 2
0
 public QueryDemoVersionEvent(QueryOperation operation, byte immediate, ushort argument)
 {
     Operation = operation;
     Immediate = immediate;
     Argument  = argument;
 }
Ejemplo n.º 3
0
 public QueryChosenVerbEvent(QueryOperation operation, byte immediate, TriggerType triggerType)
 {
     Operation   = operation;
     Immediate   = immediate;
     TriggerType = triggerType;
 }
Ejemplo n.º 4
0
 public QueryHasItemEvent(QueryOperation operation, byte immediate, ItemId itemId)
 {
     Operation = operation;
     Immediate = immediate;
     ItemId    = itemId;
 }
Ejemplo n.º 5
0
 public static string Convert(QueryOperation select, Expression where, QueryOrder order, int?skip, int?take, Graph graph, ModelDetail modelDetail)
 {
     return(instance.ConvertInternal(select, where, order, skip, take, graph, modelDetail));
 }
Ejemplo n.º 6
0
 public QueryYieldStream(AsyncDocumentSession parent, IAsyncEnumerator <RavenJObject> enumerator, QueryOperation queryOperation)
     : base(parent, enumerator)
 {
     this.queryOperation = queryOperation;
 }
Ejemplo n.º 7
0
 public QueryConsciousEvent(QueryOperation operation, byte immediate, PartyMemberId partyMemberId)
 {
     Operation     = operation;
     Immediate     = immediate;
     PartyMemberId = partyMemberId;
 }
Ejemplo n.º 8
0
 public LazyQueryOperation(InMemoryDocumentSessionOperations session, QueryOperation queryOperation, Action <QueryResult> afterQueryExecuted)
 {
     _session            = session;
     _queryOperation     = queryOperation;
     _afterQueryExecuted = afterQueryExecuted;
 }
Ejemplo n.º 9
0
 public static IEnumerable <IFeature> QueryFeatures(string layer, string prop, QueryOperation operation, object param)
 {
     return(MapControl.Current.AllMaps.SelectMany(x => x.Layers[layer].Features).Where(x => FeatureSelector(x, prop, operation, param)).ToList());
 }
Ejemplo n.º 10
0
 /// <inheritdoc />
 public IEnumerator <T> GetEnumerator()
 {
     InitSync();
     return(QueryOperation.Complete <T>().GetEnumerator());
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Prompts the user to chose an operation and routes it to the appropriate dialog
        /// </summary>
        /// <param name="context">IDialogContext</param>
        /// <returns>Task</returns>
        private async Task routeOperation(IDialogContext context)
        {
            //initialize a new operation on the context
            context.NewOperation();

            //check the entity type to determine the valid operations
            var entity = context.ConversationData.GetDialogEntity();
            List <QueryOperation> operations = QueryOperation.GetEntityResourceTypes(entity.entityType);

            //prepare the prompt
            string prompt = "What would like to lookup for you?";

            if (entity.entityType != EntityType.Me)
            {
                prompt = String.Format("What would like to lookup for {0}?", entity.text);
            }

            //add start over
            operations.Add(new Models.QueryOperation()
            {
                Text = "(Start over)", Type = Models.OperationType.StartOver
            });

            //let the user select an operation
            PromptDialog.Choice(context, async(IDialogContext opContext, IAwaitable <QueryOperation> opResult) =>
            {
                //check the operation selected and route appropriately
                var operation = await opResult;
                switch (operation.Type)
                {
                case OperationType.StartOver:
                    await this.MessageReceivedAsync(opContext, null);
                    break;

                case OperationType.Manager:
                    await opContext.Forward(new ResourceTypes.ManagerDialog(), OperationComplete, true, CancellationToken.None);
                    break;

                case OperationType.DirectReports:
                    await opContext.Forward(new ResourceTypes.DirectReportsDialog(), OperationComplete, true, CancellationToken.None);
                    break;

                case OperationType.Files:
                    await opContext.Forward(new ResourceTypes.FilesDialog(), OperationComplete, true, CancellationToken.None);
                    break;

                case OperationType.Members:
                    await opContext.Forward(new ResourceTypes.MembersDialog(), OperationComplete, true, CancellationToken.None);
                    break;

                case OperationType.Contacts:
                case OperationType.Conversations:
                case OperationType.Events:
                case OperationType.Groups:
                case OperationType.Mail:
                case OperationType.Notebooks:
                case OperationType.People:
                case OperationType.Photo:
                case OperationType.Plans:
                    await opContext.Forward(new PlanLookupDialog(), OnPlanLookupDialogResumeAsync, new Plan(), CancellationToken.None);
                    break;

                case OperationType.Tasks:
                    await opContext.Forward(new TasksDialog(), OperationComplete, true, CancellationToken.None);
                    break;

                case OperationType.TrendingAround:
                case OperationType.WorkingWith:
                    await opContext.PostAsync("Operation not yet implemented");
                    opContext.Wait(MessageReceivedAsync);
                    break;
                }
            }, operations, prompt);
        }
Ejemplo n.º 12
0
 public MemoryDbObjectQuery(MemoryTable table)
 {
     this.table = table;
     query      = new QueryOperation();
 }
Ejemplo n.º 13
0
 public QueryNpcActiveOnMapEvent(QueryOperation operation, byte npcNumber, MapId mapId)
 {
     Operation = operation;
     NpcNumber = npcNumber;
     MapId     = mapId;
 }
Ejemplo n.º 14
0
 public QueryMapEvent(QueryOperation operation, byte immediate, MapId mapId)
 {
     Operation = operation;
     Immediate = immediate;
     MapId     = mapId;
 }
Ejemplo n.º 15
0
 public QueryEventUsedEvent(QueryOperation operation, byte immediate, ushort argument)
 {
     Operation = operation;
     Immediate = immediate;
     Argument  = argument;
 }
Ejemplo n.º 16
0
        private static Task <Tuple <QueryResult, List <T> > > ProcessEnumerator(QueryOperation currentQueryOperation)
        {
            var list = currentQueryOperation.Complete <T>();

            return(Task.FromResult(Tuple.Create(currentQueryOperation.CurrentQueryResults, list)));
        }
Ejemplo n.º 17
0
 public QuerySwitchEvent(QueryOperation operation, byte immediate, SwitchId switchId)
 {
     Operation = operation;
     Immediate = immediate;
     SwitchId  = switchId;
 }
Ejemplo n.º 18
0
 public LazyQueryOperation(QueryOperation queryOperation, Action <QueryResult> afterQueryExecuted, HashSet <string> includes)
 {
     this.queryOperation     = queryOperation;
     this.afterQueryExecuted = afterQueryExecuted;
     this.includes           = includes;
 }
Ejemplo n.º 19
0
 public QueryDemoVersionEvent(ushort argument, QueryOperation operation, byte immediate)
 {
     Argument  = argument;
     Operation = operation;
     Immediate = immediate;
 }
Ejemplo n.º 20
0
 public QueryTriggerTypeEvent(QueryOperation operation, byte immediate, ushort argument)
 {
     Operation = operation;
     Immediate = immediate;
     Argument  = argument;
 }
Ejemplo n.º 21
0
 public QueryTickerEvent(TickerId tickerId, QueryOperation operation, byte immediate)
 {
     TickerId  = tickerId;
     Operation = operation;
     Immediate = immediate;
 }
Ejemplo n.º 22
0
 public LazyQueryOperation(DocumentConventions conventions, QueryOperation queryOperation, Action <QueryResult> afterQueryExecuted)
 {
     _conventions        = conventions;
     _queryOperation     = queryOperation;
     _afterQueryExecuted = afterQueryExecuted;
 }
 public OperationAttribute(string name, QueryOperation op)
 {
Ejemplo n.º 24
0
 public LazyQueryOperation(QueryOperation queryOperation, Action <QueryResult> afterQueryExecuted)
 {
     this.queryOperation     = queryOperation;
     this.afterQueryExecuted = afterQueryExecuted;
 }
Ejemplo n.º 25
0
 protected override void GenerateEnding(QueryOperation select, Graph graph, ModelDetail modelDetail, ref CharWriteBuffer sb)
 {
 }
Ejemplo n.º 26
0
 public QueryChainActiveEvent(QueryOperation operation, byte immediate, ushort argument)
 {
     Operation = operation;
     Immediate = immediate;
     Argument  = argument;
 }
Ejemplo n.º 27
0
 private DynamicQueryParam CreateParam(QueryOperation opt, string field, object value)
 {
     return(new DynamicQueryParam {
         Operator = opt, Field = field, Value = value
     });
 }
Ejemplo n.º 28
0
 public QueryYieldStream(AsyncDocumentSession parent, IAsyncEnumerator <RavenJObject> enumerator, QueryOperation queryOperation, CancellationToken token = default(CancellationToken))
     : base(parent, enumerator, token)
 {
     this.queryOperation = queryOperation;
 }
        private void listCapabilities_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.listCapabilities.SelectedIndex == -1)
            {
                return;
            }
            DeviceCapability cap = (DeviceCapability)this.listCapabilities.SelectedItem;

            this.listValues.Items.Clear();

            this.lblCapType.Text = _device.Controller.GetCapabilityTwainType(cap).ToString();

            QueryOperation operations = _device.GetQueryOperations(cap);

            FillOperationList(operations);

            if ((operations & QueryOperation.TWQC_GET) == QueryOperation.TWQC_GET)
            {
                TwainCapability capability = new TwainCapability(cap, TwainContainer.TWON_DONTCARE16, IntPtr.Zero);
                if (_device.Controller.SendCommand(TwainTriplet.CapabilityGet, _device.Identity, capability) == TwainReturnCode.TWRC_SUCCESS)
                {
                    this.lblGetContainer.Text = capability.ContainerType.ToString();

                    // Always use a TwainMemory object when working with memory returned from a driver.
                    TwainMemory memory = _device.Controller.CreateTwainMemory(capability.Data);
                    try
                    {
                        object vals = _device.Controller.ReadTwainContainerData(capability.ContainerType, memory);

                        FillValueList(vals, cap);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("ReadTwainContainerData failed for " + cap.ToString() + "\r\n\r\n" + ex.Message + "\r\n" + ex.StackTrace);
                    }
                    finally
                    {
                        memory.Dispose();
                    }
                }
                else
                {
                    this.lblGetContainer.Text = "Unknown";
                }
            }
            else
            {
                this.lblGetContainer.Text = "Not Supported";
            }

            if ((operations & QueryOperation.TWQC_GETCURRENT) == QueryOperation.TWQC_GETCURRENT)
            {
                TwainCapability capability = new TwainCapability(cap, TwainContainer.TWON_DONTCARE16, IntPtr.Zero);
                if (_device.Controller.SendCommand(TwainTriplet.CapabilityGet, _device.Identity, capability) == TwainReturnCode.TWRC_SUCCESS)
                {
                    this.lblGetCurrentContainer.Text = capability.ContainerType.ToString();

                    // Don't forget to free the memory allocated by the driver.
                    _device.Controller.FreeTwainMemory(capability.Data);
                }
                else
                {
                    this.lblGetContainer.Text = "Unknown";
                }
            }
            else
            {
                this.lblGetCurrentContainer.Text = "Not Supported";
            }
        }
Ejemplo n.º 30
0
 public QueryScriptDebugModeEvent(ushort argument, QueryOperation operation, byte immediate)
 {
     Argument  = argument;
     Operation = operation;
     Immediate = immediate;
 }