OnStartPublish(Count: Integer);
OnStartPublish(Count: integer);
Count. Number of published objects.
The OnStartPublish method implements an event that occurs at the beginning of publishing a mobile application.
The event that occurs after publishing is implemented by the IMobileApplicationPublishCallBack.OnEndPublish method.
The example describes a custom class that is an event handler. Add a link to the Mobile system assembly.
Class MobileAppCallback: Object, IMobileApplicationPublishCallBack
// Constructor
Public Constructor Create;
Begin
End Constructor Create;
// Event that occurs during export
Public Sub OnProgress(Value: Double);
Var
r: Double;
Begin
r := Value * 100;
Debug.WriteLine("Exported (%): " + r.ToString);
End Sub OnProgress;
// Event that occurs at the beginning of object export
Public Sub OnStartExportObject(ObjectDesc: IMetabaseObject);
Var
s: String;
Begin
s := ObjectDesc.Name + "(" + ObjectDesc.Id + ")";
Debug.WriteLine("Exported object: " + s);
Debug.Indent;
End Sub OnStartExportObject;
// Event that occurs at the end of object export
Public Sub OnEndExportObject(Result: MobilePublishObjectResult);
Begin
Debug.Unindent;
If Result = MobilePublishObjectResult.OK Then
Debug.WriteLine("Object is successfully exported");
Else
Debug.WriteLine("Object is exported with error");
End If;
Debug.WriteLine("");
End Sub OnEndExportObject;
// Event, that occurs at the beginning of mobile application export
Public Sub OnStartExport(ObjectCount: Integer);
Begin
Debug.WriteLine("Export of mobile application started");
Debug.Indent;
Debug.WriteLine("Number of exported objects: " + ObjectCount.ToString);
End Sub OnStartExport;
// Event that occurs at the end of mobile application export
Public Sub OnEndExport;
Begin
Debug.Unindent;
Debug.WriteLine("Export of mobile application ended");
End Sub OnEndExport;
// Event that occurs at the beginning of mobile application publication
Public Sub OnStartPublish(Count: Integer);
Begin
Debug.WriteLine("Publication of mobile application started");
Debug.WriteLine(" Number of published elements: " + Count.ToString);
End Sub OnStartPublish;
// Event that occurs at the end of mobile application publication
Public Sub OnEndPublish;
Begin
Debug.WriteLine("Publication of mobile application ended");
End Sub OnEndPublish;
// Event that occurs during publication
Public Sub OnPublishProgress(Value: Double);
Var
r: Double;
Begin
r := Value * 100;
Debug.WriteLine(" Published (%): " + r.ToString);
End Sub OnPublishProgress;
End Class MobileAppCallback;
The class use for handling events is given in the Fore example for IMobileApplication.CreatePublicator.
The example describes a custom class that is an event handler.
Imports Prognoz.Platform.Interop.Mobile;
Public Class MobileAppCallback: Object, IMobileApplicationPublishCallBack
// Constructor
Public Constructor Create();
Begin
End Constructor Create;
// Event that occurs during export
Public Sub OnProgress(Value: Double);
Var
r: Double;
Begin
r := Value * 100;
System.Diagnostics.Debug.WriteLine("Exported (%): " + r.ToString());
End Sub OnProgress;
// Event that occurs at the beginning of object export
Public Sub OnStartExportObject(ObjectDesc: IMetabaseObject);
Var
s: String;
Begin
s := ObjectDesc.Name + "(" + ObjectDesc.Id + ")";
System.Diagnostics.Debug.WriteLine("Exported object: " + s);
System.Diagnostics.Debug.Indent();
End Sub OnStartExportObject;
// Event that occurs at the end of object export
Public Sub OnEndExportObject(Result: MobilePublishObjectResult);
Begin
System.Diagnostics.Debug.Unindent();
If Result = MobilePublishObjectResult.mporOK Then
System.Diagnostics.Debug.WriteLine("Object is successfully exported");
Else
System.Diagnostics.Debug.WriteLine("Object is exported with error");
End If;
System.Diagnostics.Debug.WriteLine("");
End Sub OnEndExportObject;
// Event that occurs at the beginning of mobile application export
Public Sub OnStartExport(ObjectCount: Integer);
Begin
System.Diagnostics.Debug.WriteLine("Export of mobile application started");
System.Diagnostics.Debug.Indent();
System.Diagnostics.Debug.WriteLine("Number of exported objects: " + ObjectCount.ToString());
End Sub OnStartExport;
// Event that occurs at the end of mobile application export
Public Sub OnEndExport();
Begin
System.Diagnostics.Debug.Unindent();
System.Diagnostics.Debug.WriteLine("Export of mobile application ended");
End Sub OnEndExport;
// Event that occurs at the beginning of mobile application publication
Public Sub OnStartPublish(Count: Integer);
Begin
System.Diagnostics.Debug.WriteLine("Publication of mobile application started");
System.Diagnostics.Debug.WriteLine(" Number of published elements: " + Count.ToString());
End Sub OnStartPublish;
// Event that occurs at the end of mobile application publication
Public Sub OnEndPublish();
Begin
System.Diagnostics.Debug.WriteLine("Publication of mobile application ended");
End Sub OnEndPublish;
// Event that occurs during publication
Public Sub OnPublishProgress(Value: Double);
Var
r: Double;
Begin
r := Value * 100;
System.Diagnostics.Debug.WriteLine(" Published (%): " + r.ToString());
End Sub OnPublishProgress;
End Class MobileAppCallback;
The class use for handling events is given in the Fore example for IMobileApplication.CreatePublicator.
See also:
IMobileApplicationPublishCallBack