本文整理汇总了C#中DigitalPlatform.rms.Client.RmsChannel.DoDir方法的典型用法代码示例。如果您正苦于以下问题:C# RmsChannel.DoDir方法的具体用法?C# RmsChannel.DoDir怎么用?C# RmsChannel.DoDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DigitalPlatform.rms.Client.RmsChannel
的用法示例。
在下文中一共展示了RmsChannel.DoDir方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsDatabaseExist
// 数据库是否已经存在?
// return:
// -1 error
// 0 not exist
// 1 exist
// 2 其他类型的同名对象已经存在
int IsDatabaseExist(
RmsChannel channel,
string strDatabaseName,
out string strError)
{
strError = "";
// 看看数据库是否已经存在
ResInfoItem[] items = null;
long lRet = channel.DoDir("",
"zh",
"", // style
out items,
out strError);
if (lRet == -1)
{
strError = "列服务器 " + channel.Url + " 下全部数据库目录的时候出错: " + strError;
return -1;
}
for (int i = 0; i < items.Length; i++)
{
if (items[i].Name == strDatabaseName)
{
if (items[i].Type == ResTree.RESTYPE_DB)
{
strError = "数据库 " + strDatabaseName + " 已经存在。";
return 1;
}
else
{
strError = "和数据库 " + strDatabaseName + " 同名的非数据库类型对象已经存在。";
return 2;
}
}
}
return 0;
}
示例2: Fill
// 递归
public int Fill(TreeNode node)
{
TreeNodeCollection children = null;
if (node == null)
{
children = this.Nodes;
}
else
{
children = node.Nodes;
}
int i;
// 填充根
if (node == null)
{
children.Clear();
TreeNode nodeNew = new TreeNode(this.ServerUrl, ResTree.RESTYPE_SERVER, ResTree.RESTYPE_SERVER);
ResTree.SetLoading(nodeNew);
NodeInfo nodeinfo = new NodeInfo();
nodeinfo.TreeNode = nodeNew;
nodeinfo.Expandable = true;
nodeinfo.DefElement = GetDefElementString(nodeNew.ImageIndex);
nodeinfo.NodeState |= NodeState.Object;
nodeNew.Tag = nodeinfo;
if (EnabledIndices != null
&& StringUtil.IsInList(nodeNew.ImageIndex, EnabledIndices) == false)
nodeNew.ForeColor = ControlPaint.LightLight(nodeNew.ForeColor);
children.Add(nodeNew);
return 0;
}
// 根以下的节点类型
ResPath respath = new ResPath(node);
string strPath = respath.Path;
//if (node != null)
// strPath = TreeViewUtil.GetPath(node);
this.channel = Channels.GetChannel(this.ServerUrl);
Debug.Assert(channel != null, "Channels.GetChannel() 异常");
ResInfoItem [] items = null;
string strError = "";
DigitalPlatform.Stop stop = null;
if (stopManager != null)
{
stop = new DigitalPlatform.Stop();
stop.Register(this.stopManager, true); // 和容器关联
stop.OnStop += new StopEventHandler(this.DoStop);
stop.Initial("正在列目录: " + this.ServerUrl + "?" + strPath);
stop.BeginLoop();
}
long lRet = channel.DoDir(strPath,
this.Lang,
null, // 不需要列出全部语言的名字
out items,
out strError);
if (stopManager != null)
{
stop.EndLoop();
stop.OnStop -= new StopEventHandler(this.DoStop);
stop.Initial("");
stop.Unregister(); // 和容器关联
}
this.channel = null;
if (lRet == -1)
{
try
{
MessageBox.Show(this, "Channel::DoDir() Error: " + strError);
}
catch
{
// this可能已经不存在
return -1;
//.........这里部分代码省略.........
示例3: BuildRealObjects
//.........这里部分代码省略.........
// string strStyle = "attachment,data,timestamp,outputpath";
string strStyle = "content,data,timestamp,outputpath";
using (MemoryStream stream = new MemoryStream())
{
long lRet = channel.GetRes(strPath,
stream,
null, // stop,
strStyle,
null, // byte [] input_timestamp,
out strMetaData,
out baTimeStamp,
out strOutputPath,
out strError);
if (lRet == -1)
{
// obj.SetData(null);
obj.TimeStamp = null;
return 0; // 继续处理
}
obj.SetData(stream);
obj.TimeStamp = baTimeStamp;
}
}
if (obj.Type == ResTree.RESTYPE_DB
|| obj.Type == ResTree.RESTYPE_FOLDER)
{
this.channel = Channels.GetChannel(this.ServerUrl);
Debug.Assert(channel != null, "Channels.GetChannel() 异常");
ResInfoItem[] items = null;
DigitalPlatform.Stop stop = null;
if (stopManager != null)
{
stop = new DigitalPlatform.Stop();
stop.Register(this.stopManager, true); // 和容器关联
stop.OnStop += new StopEventHandler(this.DoStop);
stop.Initial("正在列目录: " + this.ServerUrl + "?" + strPath);
stop.BeginLoop();
}
long lRet = channel.DoDir(strPath,
this.Lang,
null, // 不需要返回全部语言的名字
out items,
out strError);
if (stopManager != null)
{
stop.EndLoop();
stop.OnStop -= new StopEventHandler(this.DoStop);
stop.Initial("");
stop.Unregister(); // 和容器关联
}
this.channel = null;
if (lRet == -1)
return -1;
if (items == null)
return 0;
for (int i = 0; i < items.Length; i++)
{
// 忽略from类型节点
if (items[i].Type == ResTree.RESTYPE_FROM)
continue;
DatabaseObject child = new DatabaseObject();
child.Name = items[i].Name;
child.Type = items[i].Type;
child.Style = items[i].Style;
child.Parent = obj;
obj.Children.Add(child);
int nRet = CreateObject(child,
strPath + "/" + items[i].Name,
out strError);
if (nRet == -1)
return -1;
}
}
return 0;
}
示例4: GetDbStyle
int GetDbStyle(string strDbName,
out string strError)
{
strError = "";
this.channel = Channels.GetChannel(this.ServerUrl);
Debug.Assert(channel != null, "Channels.GetChannel() 异常");
ResInfoItem[] items = null;
DigitalPlatform.Stop stop = null;
if (stopManager != null)
{
stop = new DigitalPlatform.Stop();
stop.Register(this.stopManager, true); // 和容器关联
stop.OnStop += new StopEventHandler(this.DoStop);
stop.Initial("正在获得数据库 " + strDbName + "的风格参数");
stop.BeginLoop();
}
long lRet = channel.DoDir("", // 列出全部数据库
this.Lang,
null, // 不需要列出全部语言的名字
out items,
out strError);
if (stopManager != null)
{
stop.EndLoop();
stop.OnStop -= new StopEventHandler(this.DoStop);
stop.Initial("");
stop.Unregister(); // 和容器关联
}
this.channel = null;
if (lRet == -1)
return -1;
if (items == null)
return 0; // 数据库不存在
for (int i = 0; i < items.Length; i++)
{
// 忽略非数据库类型节点
if (items[i].Type != ResTree.RESTYPE_DB)
continue;
if (items[i].Name == strDbName)
return items[i].Style;
}
return 0; // 数据库不存在
}
示例5: Fill
// 递归
public int Fill(TreeNode node,
out string strError)
{
strError = "";
TreeNodeCollection children = null;
if (node == null)
{
children = this.Nodes;
}
else
{
children = node.Nodes;
}
int i;
// 填充根
if (node == null)
{
children.Clear();
for(i=0;i<Servers.Count;i++)
{
Server server = (Server)Servers[i];
TreeNode nodeNew = new TreeNode(server.Url, RESTYPE_SERVER, RESTYPE_SERVER);
SetLoading(nodeNew);
if (EnabledIndices != null
&& StringUtil.IsInList(nodeNew.ImageIndex, EnabledIndices) == false)
nodeNew.ForeColor = ControlPaint.LightLight(nodeNew.ForeColor);
children.Add(nodeNew);
}
return 0;
}
// 根以下的节点类型
ResPath respath = new ResPath(node);
this.channel = Channels.GetChannel(respath.Url);
Debug.Assert(channel != null, "Channels.GetChannel() 异常");
/*
int nStart = 0;
int nPerCount = -1;
int nCount = 0;
*/
ResInfoItem [] items = null;
#if NO
DigitalPlatform.Stop stop = null;
if (stopManager != null)
{
stop = new DigitalPlatform.Stop();
stop.Register(this.stopManager, true); // 和容器关联
stop.OnStop += new StopEventHandler(this.DoStop);
stop.Initial("正在列目录: " + respath.FullPath);
stop.BeginLoop();
}
#endif
DigitalPlatform.Stop stop = PrepareStop("正在列目录: " + respath.FullPath);
long lRet = 0;
try
{
lRet = channel.DoDir(respath.Path,
this.Lang,
null, // 不需要列出全部语言的名字
out items,
out strError);
}
finally
{
EndStop(stop);
}
#if NO
if (stopManager != null)
{
stop.EndLoop();
stop.OnStop -= new StopEventHandler(this.DoStop);
stop.Initial("");
stop.Unregister(); // 和容器关联
}
#endif
this.channel = null;
if (lRet == -1)
//.........这里部分代码省略.........