本文整理汇总了C#中IJob类的典型用法代码示例。如果您正苦于以下问题:C# IJob类的具体用法?C# IJob怎么用?C# IJob使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IJob类属于命名空间,在下文中一共展示了IJob类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public override StateEnums.Status Initialize ( IJob _job )
{
job = _job;
log.InfoFormat(_job.KeyHash, "GenevaLoadablesXmlValidator initialized.");
CheckEmptyValue = false;
return StateEnums.Status.Success;
}
示例2: Point
public Point(IJob job, int parentNumber)
{
this.job = job;
this.parentNumber = parentNumber;
Initialize();
}
示例3: Initialize
public override StateEnums.Status Initialize(IJob _job)
{
job = _job;
log.InfoFormat(_job.KeyHash, "SmtpMailer initialized.");
return StateEnums.Status.Success;
}
示例4: EncodeJobNotification
public EncodeJobNotification(IJob[] jobsReady, string OriginalAssetName, ILocator[] Locators, string UrlForClientStreaming)
{
myJobList = jobsReady;
myAssetName = OriginalAssetName;
myLocators = Locators;
myUrlForClientStreaming = UrlForClientStreaming;
}
示例5: UpdateFrom
/// <summary>
/// Updates mutable properties from the data of the specified IJob.
/// </summary>
/// <param name="job"></param>
public void UpdateFrom(IJob job)
{
Id = job.Id;
Status = job.Status;
Executable = job.Executable;
Arguments = job.Arguments;
}
示例6: ReturnJob
public void ReturnJob(IJob job)
{
if (job == null)
return;
_container.Release(job);
}
示例7: ModuleExecutor
public ModuleExecutor(IChannel chan, IJob curJob, int pointNum)
{
_assemblyFullPath = curJob.FileName;
_channel = chan;
_currentJob = curJob;
_pointNum = pointNum;
}
示例8: JobHost
public JobHost(IJob job)
{
this.job = job;
this.timer = new Timer(this.DoAction);
HostingEnvironment.RegisterObject(this);
}
示例9: ProcessItem
public override void ProcessItem(IJob job, IJobItem item)
{
var bitRate = job.Preset.BitRate;
var sampleRate = job.Preset.SampleRate;
var tempdir = Path.GetTempPath();
var tempfile = Path.Combine(tempdir, DateTime.Now.Ticks + "." + job.Preset.Extension);
var subType = this.GetAudioSubtypeForExtension(job.Preset.Extension);
var waveFormat = new WaveFormat(sampleRate, 2);
var mediaType = MediaFoundationEncoder.SelectMediaType(subType, waveFormat, bitRate);
if (mediaType != null)
{
using (var decoder = new MediaFoundationReader(item.LastFile))
{
using (var encoder = new MediaFoundationEncoder(mediaType))
{
encoder.Encode(tempfile, decoder);
}
}
}
item.TemporaryFiles.Add(tempfile);
}
示例10: JobViewModel
public JobViewModel(IJob job)
{
this.id = job.id;
this.title = job.title;
this.description = job.description;
this.date_posted = job.date_posted;
this.group = job.group;
this.groupDesc = StringHelpers.UppercaseFirst(job.groupDesc);
this.specialization = job.specialization;
this.specializationDesc = StringHelpers.UppercaseFirst(job.specializationDesc);
this.workbase = job.workbase;
this.workbaseDesc = StringHelpers.UppercaseFirst(job.workbaseDesc);
this.entryLevel = job.entryLevel;
this.hot = job.hot;
this.sequence = job.sequence;
if (!string.IsNullOrEmpty(job.metaDescription))
{
this.metaDescription = job.metaDescription;
}
if (!string.IsNullOrEmpty(job.metaTags))
{
this.metaTags = job.metaTags;
}
}
示例11: Start
/// <summary>
/// Starts this instance.
/// </summary>
/// <exception cref="System.InvalidOperationException">Job already started.</exception>
public static void Start()
{
if (_job != null)
throw new InvalidOperationException("Job already started.");
var evidence = new Evidence(AppDomain.CurrentDomain.Evidence);
var setup = new AppDomainSetup
{
ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
ShadowCopyFiles = "false"
};
_appDomain = AppDomain.CreateDomain("eSync-" + Guid.NewGuid(), evidence, setup);
try
{
var assembly = _appDomain.Load(typeof(SyncServiceJob).Assembly.GetName());
var jobTypeName = typeof(SyncServiceJob).FullName;
_job = (IJob)_appDomain.CreateInstanceAndUnwrap(assembly.FullName, jobTypeName);
_job.Start();
}
catch
{
_job = null;
AppDomain.Unload(_appDomain);
_appDomain = null;
throw;
}
}
示例12: JobRunner
/// <summary>
/// Initializes a new instance of the <see cref="JobRunner"/> class.
/// </summary>
public JobRunner(IJobConfiguration configuration, Type jobType, JobLockProvider jobLockProvider, JobHistoryProvider jobHistoryProvider, IDependencyResolver dependencyResolver)
{
_id = Guid.NewGuid().ToString("N").Substring(0, 10).ToLower();
_isBusy = new Synchronized<bool>();
_lastResult = new Synchronized<string>();
_lastRunStartTime = new Synchronized<DateTime>();
_lastRunFinishTime = new Synchronized<DateTime>();
_lastStatus = new Synchronized<JobStatus>();
_nextRunTime = new Synchronized<DateTime>();
_status = new Synchronized<JobStatus>();
_runLock = new object();
_name = configuration.Name;
_description = configuration.Description;
_group = configuration.Group;
_interval = configuration.Interval;
_isTimeOfDay = configuration.IsTimeOfDay;
_keepAlive = configuration.KeepAlive;
_arguments = configuration.Arguments;
_jobType = jobType;
_jobLockProvider = jobLockProvider ?? new DefaultJobLockProvider();
_dependencyResolver = dependencyResolver ?? new DefaultDependencyResolver();
_jobHistoryProvider = jobHistoryProvider;
_instance = null;
_timer = new Timer(OnTimerCallback);
if (_jobHistoryProvider != null)
_jobHistoryProvider.RestoreHistory(this);
Trace.TraceInformation("Job {0} created on {1}.", Name, Environment.MachineName);
}
示例13: ProcessItem
public override void ProcessItem(IJob job, IJobItem item)
{
foreach (var file in item.TemporaryFiles)
{
File.Delete(file);
}
}
示例14: MultipleProcessor
public MultipleProcessor(CloudMediaContext context, IJob myJob = null)
{
InitializeComponent();
this.Icon = Bitmaps.Azure_Explorer_ico;
_context = context;
_myJob = myJob;
buttonTaskOptions1.Initialize(_context, true);
buttonTaskOptions2.Initialize(_context, true);
buttonTaskOptions3.Initialize(_context, true);
buttonTaskOptions4.Initialize(_context, true);
buttonTaskOptions5.Initialize(_context, true);
buttonTaskOptions1.Click += ButtonTaskOptions_Click;
buttonTaskOptions2.Click += ButtonTaskOptions_Click;
buttonTaskOptions3.Click += ButtonTaskOptions_Click;
buttonTaskOptions4.Click += ButtonTaskOptions_Click;
buttonTaskOptions5.Click += ButtonTaskOptions_Click;
if (_myJob != null) // we are in resubmit mode
{
textBoxConfiguration1.Text = _myJob.Tasks.FirstOrDefault().GetClearConfiguration();
radioButtonSingleJobForAllInputAssets.Checked = true;
panelJobMode.Enabled = false;
numericUpDownTasks.Enabled = false;
SelectedAssets = myJob.InputMediaAssets.ToList();
}
labelWarningJSON1.Text = labelWarningJSON2.Text = labelWarningJSON3.Text = labelWarningJSON4.Text = labelWarningJSON5.Text = string.Empty;
init = false;
}
示例15: OnSubJobDone
protected override void OnSubJobDone(IJob job)
{
this.RemoveSubJob(job);
if (this.SubJobs.Count == 0)
SetStatus(JobStatus.Done);
}