本文整理汇总了C#中IServerConnection类的典型用法代码示例。如果您正苦于以下问题:C# IServerConnection类的具体用法?C# IServerConnection怎么用?C# IServerConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IServerConnection类属于命名空间,在下文中一共展示了IServerConnection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AppendUsageCommonFields
/// <summary>
/// Appends the usage common fields.
/// </summary>
/// <param name="uriBuilder">The URI.</param>
/// <param name="serverConnection">The server connection.</param>
public static void AppendUsageCommonFields(this UriBuilder uriBuilder, IServerConnection serverConnection)
{
AppendQuery(uriBuilder, StringTable.ApiKey, serverConnection.ClientId);
AppendQuery(uriBuilder, StringTable.AppName, serverConnection.AppName);
AppendQuery(uriBuilder, StringTable.Version, serverConnection.AppVersion);
AppendQuery(uriBuilder, StringTable.Udid, serverConnection.Udid);
}
开发者ID:alexguo88,项目名称:Kfstorm.DoubanFM.Core,代码行数:12,代码来源:UriHelper.cs
示例2: HandleDrop
public bool HandleDrop(IServerConnection conn, string file, string folderId)
{
try
{
var wb = Workbench.Instance;
var exp = wb.ActiveSiteExplorer;
var fs = ObjectFactory.CreateFeatureSource(conn, "OSGeo.SQLite"); //NOXLATE
string fileName = Path.GetFileName(file);
string resName = Path.GetFileNameWithoutExtension(file);
int counter = 0;
string resId = folderId + resName + ".FeatureSource"; //NOXLATE
while (conn.ResourceService.ResourceExists(resId))
{
counter++;
resId = folderId + resName + " (" + counter + ").FeatureSource"; //NOXLATE
}
fs.ResourceID = resId;
fs.SetConnectionProperty("File", StringConstants.MgDataFilePath + fileName); //NOXLATE
conn.ResourceService.SaveResource(fs);
using (var stream = File.Open(file, FileMode.Open))
{
fs.SetResourceData(fileName, OSGeo.MapGuide.ObjectModels.Common.ResourceDataType.File, stream);
}
return true;
}
catch (Exception ex)
{
ErrorDialog.Show(ex);
return false;
}
}
开发者ID:kanbang,项目名称:Colt,代码行数:34,代码来源:SltFileHandler.cs
示例3: EncryptingConnection
/// <summary>
/// Initialise a new <see cref="EncryptingConnection"/>.
/// </summary>
/// <param name="innerConnection">The connection for sending messages.</param>
public EncryptingConnection(IServerConnection innerConnection)
{
this.innerConnection = innerConnection;
innerConnection.SendMessageCompleted += PassOnSendMessageCompleted;
innerConnection.RequestSending += PassOnRequestSending;
innerConnection.ResponseReceived += PassOnResponseReceived;
}
开发者ID:ImaginaryDevelopment,项目名称:CruiseControl.NET,代码行数:11,代码来源:EncryptingConnection.cs
示例4: HandleDrop
public bool HandleDrop(IServerConnection conn, string file, string folderId)
{
try
{
if (!MessageService.AskQuestion(Strings.ConfirmLoadPackage, Strings.Confirm))
return false;
var wb = Workbench.Instance;
var exp = wb.ActiveSiteExplorer;
var optDiag = new PackageUploadOptionDialog();
optDiag.ShowDialog();
DialogResult res;
if (optDiag.Method == PackageUploadMethod.Transactional)
{
res = PackageProgress.UploadPackage(wb, conn, file);
}
else
{
res = PackageProgress.StartNonTransactionalUploadLoop(wb, conn, file);
}
if (res == System.Windows.Forms.DialogResult.OK)
{
exp.RefreshModel(conn.DisplayName);
}
return false; //Already refreshed if successful
}
catch (Exception ex)
{
ErrorDialog.Show(ex);
return false;
}
}
开发者ID:kanbang,项目名称:Colt,代码行数:32,代码来源:PackageFileHandler.cs
示例5: HandleDrop
public bool HandleDrop(IServerConnection conn, string file, string folderId)
{
try
{
var wb = Workbench.Instance;
var exp = wb.ActiveSiteExplorer;
//The easiest way to tell if this XML file is legit
var res = ResourceTypeRegistry.Deserialize(File.ReadAllText(file));
int counter = 0;
string name = Path.GetFileNameWithoutExtension(file);
string resId = folderId + name + "." + res.ResourceType.ToString(); //NOXLATE
while (conn.ResourceService.ResourceExists(resId))
{
counter++;
resId = folderId + name + " (" + counter + ")." + res.ResourceType.ToString(); //NOXLATE
}
res.ResourceID = resId;
conn.ResourceService.SaveResource(res);
return true;
}
catch (Exception ex)
{
ErrorDialog.Show(ex);
return false;
}
}
开发者ID:kanbang,项目名称:Colt,代码行数:31,代码来源:XmlResFileHandler.cs
示例6: ResourceEditorServiceBase
/// <summary>
/// Initializes a new instance of the <see cref="ResourceEditorServiceBase"/> class.
/// </summary>
/// <param name="resourceID">The resource ID.</param>
/// <param name="conn">The conn.</param>
/// <remarks>
/// The editor service does not do live edits of the resource you pass in to this constructor
///
/// When an editor is modifying a resource, it is not modifying the resource you specify here. It is instead modifying a
/// session-based copy of the resource that is created internally by the editor service. On a save action (a call to
/// <see cref="M:Maestro.Editors.ResourceEditorServiceBase.Save"/>), the session-based copy is copied back into the resource
/// id you specified, overwriting its contents and data files.
///
/// This provides an extra level of safety against unintentional edits, as such edits will only apply to the session-copy, only
/// being committed back to the resource id you specified on an explicit save action.
/// </remarks>
protected ResourceEditorServiceBase(string resourceID, IServerConnection conn)
{
this.IsNew = ResourceIdentifier.IsSessionBased(resourceID);
this.ResourceID = resourceID;
_conn = conn;
this.PreviewLocale = "en"; //NOXLATE
}
开发者ID:kanbang,项目名称:Colt,代码行数:23,代码来源:ResourceEditorServiceBase.cs
示例7: ProfilingDialog
/// <summary>
/// Initializes a new instance of the ProfilingDialog class
/// </summary>
/// <param name="item"></param>
/// <param name="resourceId"></param>
/// <param name="connection"></param>
public ProfilingDialog(IResource item, string resourceId, IServerConnection connection)
: this()
{
m_connection = connection;
m_item = item;
m_resourceId = resourceId;
}
开发者ID:kanbang,项目名称:Colt,代码行数:13,代码来源:ProfilingDialog.cs
示例8: PrepareSymbolDrawingSource
/// <summary>
/// Extracts the DWF symbol data store from the given symbol library to a new session-based drawing source
/// </summary>
/// <param name="conn"></param>
/// <param name="symResId"></param>
/// <returns></returns>
public static IDrawingSource PrepareSymbolDrawingSource(IServerConnection conn, string symResId)
{
//Extract the symbols.dwf resource data and copy to a session based drawing source
var dwf = conn.ResourceService.GetResourceData(symResId, "symbols.dwf"); //NOXLATE
if (!dwf.CanSeek)
{
//House in MemoryStream
var ms = new MemoryStream();
Utility.CopyStream(dwf, ms);
ms.Position = 0L;
//Replace old stream with new
dwf.Dispose();
dwf = ms;
}
var ds = OSGeo.MapGuide.ObjectModels.ObjectFactory.CreateDrawingSource(conn);
ds.SourceName = "symbols.dwf"; //NOXLATE
ds.ResourceID = "Session:" + conn.SessionID + "//" + Guid.NewGuid() + ".DrawingSource"; //NOXLATE
conn.ResourceService.SaveResource(ds);
using (dwf)
{
conn.ResourceService.SetResourceData(ds.ResourceID, "symbols.dwf", OSGeo.MapGuide.ObjectModels.Common.ResourceDataType.File, dwf); //NOXLATE
}
return ds;
}
开发者ID:kanbang,项目名称:Colt,代码行数:32,代码来源:ImageSymbolConverter.cs
示例9: ResourceEditorService
internal ResourceEditorService(string resourceID, IServerConnection conn, IUrlLauncherService launcher, ISiteExplorer siteExp, OpenResourceManager orm)
: base(resourceID, conn)
{
_siteExp = siteExp;
_launcher = launcher;
_orm = orm;
}
开发者ID:kanbang,项目名称:Colt,代码行数:7,代码来源:ResourceEditorService.cs
示例10: SymbolPicker
/// <summary>
/// Initializes a new instance of the <see cref="SymbolPicker"/> class.
/// </summary>
/// <param name="symbolLibrary">The symbol library.</param>
/// <param name="conn">The conn.</param>
public SymbolPicker(string symbolLibrary, IServerConnection conn)
: this(conn)
{
if (ResourceIdentifier.GetResourceType(symbolLibrary) != OSGeo.MapGuide.MaestroAPI.ResourceTypes.SymbolLibrary)
throw new ArgumentException(string.Format(Strings.ErrorInvalidSymbolLibraryResourceId, symbolLibrary));
txtSymbolLibrary.Text = symbolLibrary;
}
开发者ID:kanbang,项目名称:Colt,代码行数:13,代码来源:SymbolPicker.cs
示例11: MapPreviewWindow
public MapPreviewWindow(IServerConnection conn)
{
InitializeComponent();
_conn = conn;
new MapViewerController(viewer, legend, this, propertyPane, toolbar);
this.Disposed += OnDisposed;
}
开发者ID:kanbang,项目名称:Colt,代码行数:8,代码来源:MapPreviewWindow.cs
示例12: SessionTests
public SessionTests()
{
var mock = new Mock<IAuthentication>();
mock.Setup(a => a.Authenticate()).ReturnsAsync(UserInfoExample);
BasicAuthenticationMock = mock.Object;
BasicServerConnectionMock = new Mock<IServerConnection>().Object;
}
开发者ID:alexguo88,项目名称:Kfstorm.DoubanFM.Core,代码行数:8,代码来源:SessionTests.cs
示例13: StartRequestingForFiles
public StartRequestingForFiles(
IServerConnection serverConnection,
ICurrentContext currentContext,
IEventAggregator eventAggregator)
{
_serverConnection = serverConnection;
_currentContext = currentContext;
_eventAggregator = eventAggregator;
}
开发者ID:jsikorski,项目名称:Internet-Communicator,代码行数:9,代码来源:StartRequestingForFiles.cs
示例14: ImageSymbolConverter
/// <summary>
/// Initializes a new instance of the ImageSymbolConverter class
/// </summary>
/// <param name="conn"></param>
/// <param name="symbolLibId"></param>
public ImageSymbolConverter(IServerConnection conn, string symbolLibId)
{
Check.NotNull(conn, "conn"); //NOXLATE
Check.NotEmpty(symbolLibId, "symbolLibId"); //NOXLATE
Check.Precondition(ResourceIdentifier.GetResourceType(symbolLibId) == ResourceTypes.SymbolLibrary, "ResourceIdentifier.GetResourceType(symbolLibId) == ResourceTypes.SymbolLibrary"); //NOXLATE
Check.Precondition(Array.IndexOf(conn.Capabilities.SupportedServices, (int)ServiceType.Drawing) >= 0, "Array.IndexOf(conn.Capabilities.SupportedServices, (int)ServiceType.Drawing) >= 0"); //NOXLATE
_symbolLibId = symbolLibId;
_conn = conn;
}
开发者ID:kanbang,项目名称:Colt,代码行数:14,代码来源:ImageSymbolConverter.cs
示例15: PackageEditorDialog
/// <summary>
/// Initializes a new instance of the <see cref="PackageEditorDialog"/> class.
/// </summary>
/// <param name="filename">The filename.</param>
/// <param name="conn">The conn.</param>
public PackageEditorDialog(string filename, IServerConnection conn)
: this()
{
_conn = conn;
m_filename = filename;
m_resources = new Dictionary<string, ResourceItem>();
ResourceTree.ImageList = RepositoryIcons.CreateImageList(); //owner.ResourceEditorMap.SmallImageList;
ResourceDataFileList.SmallImageList = RepositoryIcons.CreateImageList(); //ResourceEditors.ShellIcons.ImageList;
}
开发者ID:kanbang,项目名称:Colt,代码行数:14,代码来源:PackageEditorDialog.cs
示例16: StartRequestingForConferencialMessages
public StartRequestingForConferencialMessages(
ICurrentContext currentContext,
IServerConnection serverConnection,
IEventAggregator eventAggregator)
{
_currentContext = currentContext;
_serverConnection = serverConnection;
_eventAggregator = eventAggregator;
}
开发者ID:jsikorski,项目名称:Internet-Communicator,代码行数:9,代码来源:StartRequestingForConferencialMessages.cs
示例17: StartRequestingForMessages
public StartRequestingForMessages(
IServerConnection serverConnection,
IEventAggregator eventAggregator,
ICurrentContext currentContext)
{
_serverConnection = serverConnection;
_eventAggregator = eventAggregator;
_currentContext = currentContext;
}
开发者ID:jsikorski,项目名称:Internet-Communicator,代码行数:9,代码来源:StartRequestingForMessages.cs
示例18: Connect
public Connect(
IServerConnection serverConnection,
string serverAddress,
IEventAggregator eventAggregator)
{
_serverConnection = serverConnection;
_serverAddress = serverAddress;
_eventAggregator = eventAggregator;
}
开发者ID:jsikorski,项目名称:Internet-Communicator,代码行数:9,代码来源:Connect.cs
示例19: CloseEditors
/// <summary>
/// Closes the editor instances for the given resource id
/// </summary>
/// <param name="conn"></param>
/// <param name="resourceId"></param>
/// <param name="discardChanges"></param>
public void CloseEditors(IServerConnection conn, string resourceId, bool discardChanges)
{
string key = ComputeResourceKey(resourceId, conn);
if (_openItems.ContainsKey(key))
{
var ed = _openItems[key];
ed.Close(discardChanges);
}
}
开发者ID:kanbang,项目名称:Colt,代码行数:15,代码来源:OpenResourceManager.cs
示例20: CopyMoveToServerDialog
/// <summary>
/// Initializes a new instance of the <see cref="CopyMoveToServerDialog"/> class.
/// </summary>
/// <param name="source">The source.</param>
/// <param name="target">The target.</param>
public CopyMoveToServerDialog(IServerConnection source, IServerConnection target)
: this()
{
_source = source;
_target = target;
cmbAction.SelectedItem = _lastAction;
chkOverwrite.Checked = _overwrite;
}
开发者ID:kanbang,项目名称:Colt,代码行数:14,代码来源:CopyMoveToServerDialog.cs
注:本文中的IServerConnection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论