本文整理汇总了C#中Zetbox类的典型用法代码示例。如果您正苦于以下问题:C# Zetbox类的具体用法?C# Zetbox怎么用?C# Zetbox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Zetbox类属于命名空间,在下文中一共展示了Zetbox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ObjectReferencePropertyTemplate
public ObjectReferencePropertyTemplate(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string moduleNamespace, string ownInterface, string name, string implNameUnused, string eventName, string fkBackingName, string fkGuidBackingName, string referencedInterface, string referencedImplementation, string associationNameUnused, string targetRoleNameUnused, string positionPropertyName, string inverseNavigatorName, bool inverseNavigatorIsList, bool notifyInverseCollection, bool eagerLoading, bool relDataTypeExportable, bool callGetterSetterEvents, bool isCalculated, bool disableExport)
: base(_host)
{
this.ctx = ctx;
this.serializationList = serializationList;
this.moduleNamespace = moduleNamespace;
this.ownInterface = ownInterface;
this.name = name;
this.implNameUnused = implNameUnused;
this.eventName = eventName;
this.fkBackingName = fkBackingName;
this.fkGuidBackingName = fkGuidBackingName;
this.referencedInterface = referencedInterface;
this.referencedImplementation = referencedImplementation;
this.associationNameUnused = associationNameUnused;
this.targetRoleNameUnused = targetRoleNameUnused;
this.positionPropertyName = positionPropertyName;
this.inverseNavigatorName = inverseNavigatorName;
this.inverseNavigatorIsList = inverseNavigatorIsList;
this.notifyInverseCollection = notifyInverseCollection;
this.eagerLoading = eagerLoading;
this.relDataTypeExportable = relDataTypeExportable;
this.callGetterSetterEvents = callGetterSetterEvents;
this.isCalculated = isCalculated;
this.disableExport = disableExport;
}
示例2: ToImage
public System.Drawing.Image ToImage(Zetbox.App.GUI.Icon icon)
{
if (icon == null) return null;
if (icon.ObjectState == DataObjectState.New) return null;
try
{
System.Drawing.Image bmp;
if (!_cache.TryGetValue(icon.ExportGuid, out bmp))
{
var realIcon = Context.FindPersistenceObject<Zetbox.App.GUI.Icon>(icon.ExportGuid);
if (realIcon.Blob == null)
{
Logging.Log.WarnFormat("Icon#{0} has no associated request", realIcon.ID);
return null;
}
bmp = System.Drawing.Image.FromStream(realIcon.Blob.GetStream());
_cache[icon.ExportGuid] = bmp;
}
return bmp;
}
catch (Exception ex)
{
Logging.Log.Info("Error while loading Icon", ex);
return null;
}
}
示例3: CreateFilterModel
public static void CreateFilterModel(Zetbox.App.GUI.MonthFilterConfiguration obj, MethodReturnEventArgs<IFilterModel> e, Zetbox.API.IZetboxContext ctx)
{
var mdl = MonthValueFilterModel.Create(FrozenContext, obj.GetLabel(), FilterValueSource.FromProperty(obj.Property), obj.IsCurrentMonthDefault ?? false);
mdl.Required = obj.Required;
mdl.RefreshOnFilterChanged = obj.RefreshOnFilterChanged;
e.Result = mdl;
}
示例4: Template
public Template(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.App.Base.Module module)
: base(_host)
{
this.ctx = ctx;
this.module = module;
}
示例5: CreateReport
public void CreateReport(Zetbox.App.SchemaMigration.MigrationProject obj)
{
this._obj = obj;
NewHeading1("Summary");
foreach (var s in obj.StagingDatabases)
{
RenderTableMappings(s);
}
foreach (var s in obj.StagingDatabases)
{
foreach (var tbl in s.SourceTables.Where(i => i.DestinationObjectClass != null).OrderBy(i => i.Name))
{
var r = new SourceTableMappingReport(Section);
r.CreateReport(tbl);
}
foreach (var tbl in s.SourceTables.Where(i => i.DestinationObjectClass == null && i.Status != MappingStatus.Ignored).OrderBy(i => i.Name))
{
var r = new SourceTableMappingReport(Section);
r.CreateReport(tbl);
}
}
}
示例6: Open
public static void Open(Zetbox.App.GUI.Icon obj)
{
if (obj.Blob != null)
{
obj.Blob.Open();
}
}
示例7: ChooseTypeRefFromAssembly
/// <summary>
/// Opens a dialog to let the user choose a type references from the specified assembly.
/// </summary>
/// <param name="assembly">the assembly to choose from</param>
protected void ChooseTypeRefFromAssembly(Zetbox.App.Base.Assembly assembly)
{
var regenerateCmd = ViewModelFactory.CreateViewModel<RegenerateTypeRefsCommand.Factory>().Invoke(DataContext, Parent, this);
var selectionTask = ViewModelFactory.CreateViewModel<DataObjectSelectionTaskViewModel.Factory>().Invoke(
DataContext,
Parent,
typeof(TypeRef).GetObjectClass(FrozenContext),
() => DataContext.GetQuery<Zetbox.App.Base.TypeRef>(),
(chosen) =>
{
if (chosen != null)
{
this.ParentType.Value = chosen.FirstOrDefault();
}
},
new List<CommandViewModel>() { regenerateCmd }
);
//var filter = selectionTask.ListViewModel.Filter.Single(i => i.Property.ExportGuid == new Guid("885BFA97-3D43-48BB-A0AA-1049298714FF"));
//filter.Value = filter.PossibleValues
// .Cast<KeyValuePair<DataObjectViewModel, string>>()
// .Where(m => m.Key != null)
// .FirstOrDefault(m => m.Key.Object == assembly)
// .Key;
regenerateCmd.ListModel = selectionTask.ListViewModel;
ViewModelFactory.ShowDialog(selectionTask);
}
示例8: CreateFilterModel
public static void CreateFilterModel(Zetbox.App.GUI.SinglePropertyFilterConfiguration obj, MethodReturnEventArgs<IFilterModel> e)
{
var mdl = new SingleValueFilterModel();
mdl.Label = obj.GetLabel();
mdl.Required = obj.Required;
mdl.ValueSource = FilterValueSource.FromProperty(obj.Property);
mdl.ViewModelType = obj.ViewModelDescriptor;
mdl.RequestedKind = obj.RequestedKind;
mdl.FilterArguments.Add(new FilterArgumentConfig(obj.Property.GetDetachedValueModel(true), /*cfg.ArgumentViewModel ?? */ obj.Property.ValueModelDescriptor));
if (obj.Property is StringProperty)
{
mdl.Operator = FilterOperators.Contains;
}
else if (obj.Property is EnumerationProperty)
{
mdl.RefreshOnFilterChanged = true;
}
else if (obj.Property is ObjectReferenceProperty)
{
mdl.RefreshOnFilterChanged = true;
}
e.Result = mdl;
}
示例9: Call
public static new void Call(Arebis.CodeGeneration.IGenerationHost host, IZetboxContext ctx, DataType implementor, Zetbox.App.Base.Method m, int index)
{
if (host == null) { throw new ArgumentNullException("host"); }
string indexSuffix = index == 0 ? String.Empty : index.ToString();
string eventName = "On" + m.Name + indexSuffix + "_" + implementor.Name;
host.CallTemplate("ObjectClasses.InvokeServerMethod", ctx, implementor, m, index, indexSuffix, eventName);
}
示例10: HandleBlobChange
public static void HandleBlobChange(at.dasz.DocumentManagement.Document obj, MethodReturnEventArgs<Zetbox.App.Base.Blob> e, Zetbox.App.Base.Blob oldBlob, Zetbox.App.Base.Blob newBlob)
{
if (oldBlob != null && !obj.Revisions.Contains(oldBlob))
{
obj.Revisions.Add(oldBlob);
}
e.Result = newBlob;
}
示例11: ValueCollectionProperty
public ValueCollectionProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, Property prop)
: base(_host)
{
this.ctx = ctx;
this.serializationList = serializationList;
this.prop = prop;
}
示例12: WrappedZetboxCommand
/// <summary>
/// Initializes a new instance of the WrappedZetboxCommand class.
/// </summary>
/// <param name="cmd">the command to wrap</param>
public WrappedZetboxCommand(Zetbox.Client.Presentables.ICommandViewModel cmd)
: base(cmd == null ? String.Empty : cmd.Label, typeof(WrappedZetboxCommand))
{
if (cmd == null) { throw new ArgumentNullException("cmd", "No command to wrap"); }
_command = cmd;
_command.CanExecuteChanged += (sender, args) => CommandManager.InvalidateRequerySuggested();
}
示例13: NotifyPreSave
public static void NotifyPreSave(Zetbox.App.Base.Method obj)
{
// TODO: replace with constraint
if (!System.CodeDom.Compiler.CodeGenerator.IsValidLanguageIndependentIdentifier(obj.Name))
{
throw new ArgumentException(string.Format("Method Name {0} has some illegal chars", obj.Name));
}
}
示例14: GetSummaryReport
public static void GetSummaryReport(Projekt obj, MethodReturnEventArgs<System.Object> e, string title, Zetbox.App.Base.DateTimeRange range)
{
using (var rpt = _rptFactory())
{
ProjectReport.Call(rpt);
rpt.Open("ProjectReport.pdf");
}
}
示例15: HandleBlobChange
public static void HandleBlobChange(ImportedFile obj, MethodReturnEventArgs<Zetbox.App.Base.Blob> e, Zetbox.App.Base.Blob oldBlob, Zetbox.App.Base.Blob newBlob)
{
if (oldBlob != null && newBlob != oldBlob)
{
throw new InvalidOperationException("Changing blob on imported files is not allowed");
}
e.Result = newBlob;
}