This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contact contact = new Contact | |
{ | |
CustomFields = new GenericObject | |
{ | |
GenericFields = new GenericField[] | |
{ | |
new GenericField | |
{ | |
name = "c", | |
dataType = DataTypeEnum.OBJECT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// show the form as a toast notification | |
/// </summary> | |
/// <param name="parent">the parent form, we'll use this as a position guide</param> | |
/// <param name="xOffset">amount to offset in the X direction</param> | |
/// <param name="yOffset">amount to offset in the Y direction</param> | |
public void Toast(Form parent, int xOffset = 6, int yOffset = 6) | |
{ | |
this.Show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern alias dnb2; | |
//other usings | |
using DevComponents.DotNetBar.Rendering; | |
using DevComponents.DotNetBar; | |
namespace DNB2Sample | |
{ | |
class WorkspaceControl_DotNetBar : UserControl | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 'assign to me' button has been clicked. set the assigned field to the current account | |
/// </summary> | |
private void button_assign_Click(object sender, EventArgs e) | |
{ | |
if (incidentRecord != null) | |
{ | |
incidentRecord.Assigned.AcctID = globalContext.AccountId; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// the workspace has finished loading the data, get a reference to the incident data | |
/// </summary> | |
internal void LoadData() | |
{ | |
//check that we're on the correct type of workspace | |
if (recordContext.WorkspaceType == WorkspaceRecordType.Incident) | |
{ | |
//grab the incident | |
incidentRecord = recordContext.GetWorkspaceRecord(WorkspaceRecordType.Incident) as IIncident; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// the workspace has finished loading. load the account from CWS | |
/// </summary> | |
internal void LoadData() | |
{ | |
//make sure we connected successfully | |
if (RightNowSoapClient.Instance.IsConnected) | |
{ | |
//get the account from CWS | |
RightNowSoapClient.Instance.client.GetAsync( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// init the add-in and connect to the SOAP API | |
/// </summary> | |
/// <param name="context"></param> | |
/// <returns></returns> | |
public bool Initialize(IGlobalContext context) | |
{ | |
globalContext = context; | |
//it would be nice to be able to check context.CanAccessPublicSoap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region singleton | |
/// <summary> | |
/// singleton initializer using the Lazy<<> class | |
/// </summary> | |
private static readonly Lazy<RightNowSoapClient> _instance = new Lazy<RightNowSoapClient>(() => new RightNowSoapClient()); | |
/// <summary> | |
/// singleton access | |
/// </summary> | |
public static RightNowSoapClient Instance { get { return _instance.Value; } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// create the connection based on the global context | |
/// </summary> | |
/// <param name="context">global context of the site you're connecting to</param> | |
internal void Init(IGlobalContext context) | |
{ | |
try | |
{ | |
//get the end point address from the global context | |
EndpointAddress endPointAddr = new EndpointAddress(context.GetInterfaceServiceUrl(ConnectServiceType.Soap)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// AddIn constructor: stores the design mode flag | |
/// and lets the standard constructor create the UI | |
/// </summary> | |
/// <param name="inDesignMode">true if we're on a workspace designer</param> | |
public WorkspaceControl(bool inDesignMode) : this() | |
{ | |
this.inDesignMode = inDesignMode; | |
} |
NewerOlder