本文整理汇总了C#中ValueWrapper类的典型用法代码示例。如果您正苦于以下问题:C# ValueWrapper类的具体用法?C# ValueWrapper怎么用?C# ValueWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueWrapper类属于命名空间,在下文中一共展示了ValueWrapper类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IfNull
public IfNull(
object firstValue, ValueObjectType firstValueType,
object secondValue, ValueObjectType secondValueType)
{
this.Value1 = new ValueWrapper(firstValue, firstValueType);
this.Value2 = new ValueWrapper(secondValue, secondValueType);
}
示例2: GroupConcat
public GroupConcat(bool distinct, ValueWrapper value, string separator, OrderByList orderBy)
{
this.Distinct = distinct;
this.Value = value;
this.Separator = separator;
this.OrderBy = orderBy;
}
示例3: Add
public Add(
object value1, ValueObjectType valueType1,
object value2, ValueObjectType valueType2)
{
this.Value1 = new ValueWrapper(value1, valueType1);
this.Value2 = new ValueWrapper(value2, valueType2);
}
示例4: Divide
public Divide(
object value1,
object value2
)
{
this.Value1 = new ValueWrapper(value1, ValueObjectType.Value);
this.Value2 = new ValueWrapper(value2, ValueObjectType.Value);
}
示例5: OnException
private bool OnException(object sender, Exception ex)
{
var result = new ValueWrapper<bool>(false);
if (Exception != null) Exception(sender, new EventArgs<Exception, ValueWrapper<bool>>(ex, result));
return result.Value;
}
示例6: Multiply
public Multiply(
object value1,
object value2
)
{
this.Value1 = new ValueWrapper(value1, ValueObjectType.Value);
this.Value2 = new ValueWrapper(value2, ValueObjectType.Value);
}
示例7: Replace
public Replace(
object source, ValueObjectType sourceType,
string searchTableName, string searchColumn,
string replaceWithTableName, string replaceWithColumn)
{
this.SourceValue = new ValueWrapper(source, sourceType);
this.SearchValue = new ValueWrapper(searchTableName, searchColumn);
this.ReplaceWithValue = new ValueWrapper(replaceWithTableName, replaceWithColumn);
}
示例8: OperationsViewModel
public OperationsViewModel(IUnityContainer unityContainer, IInitData initData, ISettingsService settingsService)
{
InitData = initData;
SettingsService = settingsService;
IsOperationsViewEnabled = true;
IsCancellationRequested = new ValueWrapper<bool>(false);
GenerateDataGrid();
UnityContainer = unityContainer;
}
示例9: when_TryGetValue_called_with_nonexistent_key__should_return_false
public void when_TryGetValue_called_with_nonexistent_key__should_return_false()
{
var mruCache = new MruCache<ValueWrapper<int>, object>(12);
object added = new object();
var key = new ValueWrapper<int>(0);
mruCache.Add(key, added);
object res;
Assert.IsFalse(mruCache.TryGetValue(new ValueWrapper<int>(1), out res));
Assert.IsNull(res);
}
示例10: when_TryGetValue_called_with_existing_key__should_return_what_it_was_provided
public void when_TryGetValue_called_with_existing_key__should_return_what_it_was_provided()
{
var mruCache = new MruCache<ValueWrapper<int>, object>(12);
object added = new object();
var key = new ValueWrapper<int>(0);
mruCache.Add(key, added);
object res;
Assert.IsTrue(mruCache.TryGetValue(new ValueWrapper<int>(0), out res));
Assert.AreEqual(added, res);
}
示例11: AnalyzeAllPDFs
public IEnumerable<IRowModel> AnalyzeAllPDFs(IEnumerable<IRowModel> filesToAnalyze, string[] wordsToAnalysis, string sourceFolder,
ValueWrapper<bool> isCancellationRequested, ReportProgessEvent reportProgress)
{
foreach (var file in filesToAnalyze)
{
if (isCancellationRequested.Value)
{
return filesToAnalyze;
}
try
{
if (file.Descriptions.Any())
{
file.Descriptions.Clear();
}
var dms = wordsToAnalysis.Select(x => new DescriptionModel {Word = x, Occurances = 0});
foreach (var descriptionModel in dms)
{
file.Descriptions.Add(descriptionModel);
}
var pdfReader = new PdfReader(Path.Combine(sourceFolder, file.FileName));
string text = string.Empty;
int numberOfPages = pdfReader.NumberOfPages;
for (int page = 1; page < numberOfPages; page++)
{
text = PdfTextExtractor.GetTextFromPage(pdfReader, page);
foreach (var word in file.Descriptions)
{
word.Occurances += Regex.Matches(text, word.Word).Count;
}
}
file.Analyzed = true;
pdfReader.Close();
}
catch (Exception)
{
continue;
}
if (OnFileAnalyzed != null)
{
OnFileAnalyzed.Invoke(file);
}
}
return filesToAnalyze;
}
示例12: DownloadFiles
public void DownloadFiles(IEnumerable<Uri> links, string destinationPath, ReportProgessEvent reportProgess, ValueWrapper<bool> isCancellationRequested)
{
var client = new WebClient();
var linksList = links.ToList();
int counter = 0;
string filename;
foreach (var link in linksList)
{
if (isCancellationRequested.Value)
{
return;
}
filename = Path.GetFileName(link.LocalPath);
reportProgess(counter++*100/linksList.Count);
try
{
client.DownloadFile(link, filename);
Thread.Sleep(500);
}
catch (Exception)
{
//zakladam ze wsyzstkie pliki sie pobiora bez przypalow.
}
var path = Path.Combine(destinationPath, filename);
if (File.Exists(path))
{
File.Delete(path);
}
File.Copy(filename, path);
if (OnFileDownloaded != null)
{
OnFileDownloaded.Invoke(path);
}
}
}
示例13: SceneManager
/// <summary>
/// The default Constructor.
/// </summary>
public SceneManager(GameWindow gameWindow, Camera camera, FontLibrary fontLibrary, string fontPath, IDirectoryHandler directoryHandler, IGameSettings gameSettings, ValueWrapper<bool> debug)
{
GameWindow = gameWindow;
SceneList = new List<Scene>();
_scenesToAdd = new List<Scene>();
_scenesToRemove = new List<Scene>();
Directories = directoryHandler;
FontPath = fontPath;
GameFontLibrary = fontLibrary;
DefaultFont = GameFontLibrary.GetFirstOrDefault(GameFontType.Default);
FontDrawing = new QFontDrawing();
FontDrawing.ProjectionMatrix = camera.ScreenProjectionMatrix;
ScreenCamera = camera;
ScreenCamera.Center = Vector2.Zero;
ScreenCamera.MaximumScale = new Vector2(10000, 10000);
GameSettings = gameSettings;
Debug = debug;
}