public string GetFileLabel(Stream stream, string inputFileName) { if (this.engine == null) { return(null); } try { var handler = this.engine.CreateFileHandler(stream, inputFileName); LateValue <ContentLabel> lateContentLabel = new LateValue <ContentLabel>(); handler.GetLabelAsync(lateContentLabel); ContentLabel contentLabel = lateContentLabel.AwaitValue(); if (contentLabel != null) { return(contentLabel.Label.Name); } return(null); } catch (Exception ex) { throw; } }
public FileApi( ITokenProvider tokenProvider, string applicationId, string applicationName, string storagePath) { this.authDelegate = new AuthDelegateImpl(tokenProvider); var applicationInfo = new ApplicationInfo( applicationId, applicationName); var settings = new FileProfile.Settings(storagePath, false, authDelegate, applicationInfo); var lateFileProfile = new LateValue <FileProfile>(); FileProfile.LoadAsync(settings, lateFileProfile); this.profile = lateFileProfile.AwaitValue(); FileEngine.Settings engineSettings = new FileEngine.Settings("1234", ""); var lateFileEngine = new LateValue <FileEngine>(); this.profile.AddEngineAsync(engineSettings, lateFileEngine); this.engine = lateFileEngine.AwaitValue(); }
public static IFluentContinuation <TViewModel, TPropertyValue> EqualTo <TViewModel, TPropertyValue>( this IFluentOperator <TViewModel, TPropertyValue> instance, LateValue <TPropertyValue> lateValue) where TViewModel : ViewModelBase { var implementerInstance = (FluentImplementer <TViewModel, TPropertyValue>)instance; implementerInstance.EnsureContextCurrentPropertyIsNotNull(); implementerInstance.AddToken(ExpressionNode.EqualToLateValue(implementerInstance.Context.CurrentProperty, () => lateValue())); return((IFluentContinuation <TViewModel, TPropertyValue>)instance); }
public static IFluentContinuation <TViewModel, TPropertyValue> GreaterThanOrEqualTo <TViewModel, TPropertyValue>( this IFluentOperator <TViewModel, TPropertyValue> instance, LateValue <TPropertyValue> lateValue) where TViewModel : ViewModelBase where TPropertyValue : IComparable { var implementerInstance = (FluentImplementer <TViewModel, TPropertyValue>)instance; implementerInstance.EnsureContextCurrentPropertyIsNotNull(); implementerInstance.AddToken(ExpressionNode.OpenParenthesis()); implementerInstance.AddToken(ExpressionNode.GreaterThanLateValue(implementerInstance.Context.CurrentProperty, () => lateValue())); implementerInstance.AddToken(ExpressionNode.Or()); implementerInstance.AddToken(ExpressionNode.EqualToLateValue(implementerInstance.Context.CurrentProperty, () => lateValue())); implementerInstance.AddToken(ExpressionNode.CloseParenthesis()); return((IFluentContinuation <TViewModel, TPropertyValue>)instance); }
public bool SetFileLabel(string filePath, string outputFile, string labelId) { if (engine == null) { return(false); } try { FileHandler handler = engine.CreateFileHandler(filePath); handler.SetLabel(labelId, new LabelingOptions(AssignmentMethod.Privileged, string.Empty)); LateValue <bool> lateResult = new LateValue <bool>(); handler.CommitAsync(outputFile, lateResult); bool wasCommitted = lateResult.AwaitValue(); return(wasCommitted); } catch (Exception ex) { return(false); //throw; } }
public static EqualToExpression EqualToLateValue(IViewModelProperty property, LateValue <object> lateValue) { var leftValueProvider = new Func <object>(property.GetValue); var rightValueProvider = new Func <object>(() => lateValue()); return(EqualToGeneric(leftValueProvider, rightValueProvider)); }
public static LessThanExpression LessThanLateValue(IViewModelProperty property, LateValue <object> lateValue) { var leftValueProvider = new Func <object>(property.GetValue); var rightValueProvider = new Func <object>(() => lateValue()); return(LessThanGeneric(leftValueProvider, rightValueProvider)); }
public Shellcode64 PushLateInt64(out LateValue <long> lateValue) { lateValue = PushLateInt64(); return(this); }
public Shellcode64 MovRegisterALatePointer(out LateValue <long> latePointer) { latePointer = MovRegisterALatePointer(); return(this); }
public Shellcode64 MovLateInt64Register9(out LateValue <long> lateValue) { lateValue = MovLateInt64Register9(); return(this); }