本文整理汇总了C#中RC类的典型用法代码示例。如果您正苦于以下问题:C# RC类的具体用法?C# RC怎么用?C# RC使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RC类属于命名空间,在下文中一共展示了RC类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ShowMessages
public ShowMessages(RC.Gmail.GmailAtomFeed.AtomFeedEntryCollection aGMailFeed)
{
InitializeComponent();
setGridViewStyle();
try
{
if (aGMailFeed.Count != 0)
{
for (int i = 0; i < aGMailFeed.Count; i++)
{
gridViewMessages.Rows.Add(i + 1, aGMailFeed[i].Subject, aGMailFeed[i].FromEmail);
gridViewMessages.Rows[gridViewMessages.Rows.Count - 1].Tag = aGMailFeed[i].Link;
}
labelNoNewMessages.Visible = false;
}
else
{
Melissa.Say("You have no new messages!");
gridViewMessages.Visible = false;
labelNoNewMessages.Visible = true;
}
}
catch { }
}
开发者ID:ModernSteward,项目名称:plugins,代码行数:26,代码来源:ShowMessages.cs
示例2: MessagingManager
public MessagingManager( AuthInfo authInfo,
EmailServiceDescription emailServiceDescription,
OpenPGPRing openPgpRing,
XmppServiceDescription xmppServiceDescription,
OTRKeyRing otrKeyring,
ContactManager contactManager,
Logger logger,
int inboxCheckIntervall,
bool isInMinutes)
{
m_AuthInfo = authInfo;
m_EmailServiceDescription = emailServiceDescription;
m_OpenPgpRing = openPgpRing;
m_XmppServiceDescription = xmppServiceDescription;
m_OtrKeyRing = otrKeyring;
m_Logger = logger;
m_InboxCheckIntervall = inboxCheckIntervall;
m_bIsIntervallInMinutes = isInMinutes;
m_ConversationManager = new ConversationManager ();
m_ContactManager = contactManager;
RC rcMail = initEmailManager();
RC rcXmpp = initXmppManager();
m_Status = RC.RC_OK;
if (rcMail != RC.RC_OK) {
m_Status = RC.RC_COULD_NOT_INIT_EMAIL;
}
if (rcXmpp != RC.RC_OK) {
m_Status = RC.RC_COULD_NOT_INIT_XMPP;
}
}
开发者ID:crypto-ink,项目名称:CryptoInkLib,代码行数:32,代码来源:MessagingManager.cs
示例3: find
private static void find(RC A, RC B, RC C, RC D, RC K, int i, int j, out char symbol)
{
if (A.r == i && A.c == j)
{
symbol = 'A';
}
else if (B.r == i && B.c == j)
{
symbol = 'B';
}
else if (C.r == i && C.c == j)
{
symbol = 'C';
}
else if (D.r == i && D.c == j)
{
symbol = 'D';
}
else if (K.r == i && K.c == j)
{
symbol = 'K';
}
else if ((i + j) % 2 == 0)
{
symbol = '+';
}
else
{
symbol = '-';
}
}
开发者ID:Alex223124,项目名称:High-Quality-Code,代码行数:31,代码来源:Program.cs
示例4: PackagesFromUndumpBuffer
public static int PackagesFromUndumpBuffer(out byte data, int len, RC.ChannelAndSubdFn channel_callback, RC.PackageDelegate package_callback, RC.PackageMatchDelegate lock_callback) {
RCSharp.ChannelAndSubdFnWrapper channel_callback_wrapper = new RCSharp.ChannelAndSubdFnWrapper (channel_callback);
RCSharp.PackageDelegateWrapper package_callback_wrapper = new RCSharp.PackageDelegateWrapper (package_callback);
RCSharp.PackageMatchDelegateWrapper lock_callback_wrapper = new RCSharp.PackageMatchDelegateWrapper (lock_callback);
int raw_ret = rc_extract_packages_from_undump_buffer(out data, len, channel_callback_wrapper.NativeDelegate, package_callback_wrapper.NativeDelegate, lock_callback_wrapper.NativeDelegate, IntPtr.Zero);
int ret = raw_ret;
return ret;
}
开发者ID:joeshaw,项目名称:libredcarpet,代码行数:8,代码来源:Extract.cs
示例5: PackagesFromDebianFile
public static int PackagesFromDebianFile(string filename, RC.Channel channel, RC.PackageDelegate cb) {
IntPtr filename_as_native = GLib.Marshaller.StringToPtrGStrdup (filename);
RCSharp.PackageDelegateWrapper cb_wrapper = new RCSharp.PackageDelegateWrapper (cb);
int raw_ret = rc_extract_packages_from_debian_file(filename_as_native, channel == null ? IntPtr.Zero : channel.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
int ret = raw_ret;
GLib.Marshaller.Free (filename_as_native);
return ret;
}
开发者ID:joeshaw,项目名称:libredcarpet,代码行数:8,代码来源:Extract.cs
示例6: PackagesFromDirectory
public static int PackagesFromDirectory(string path, RC.Channel channel, RC.Packman packman, bool recursive, RC.PackageDelegate cb) {
IntPtr path_as_native = GLib.Marshaller.StringToPtrGStrdup (path);
RCSharp.PackageDelegateWrapper cb_wrapper = new RCSharp.PackageDelegateWrapper (cb);
int raw_ret = rc_extract_packages_from_directory(path_as_native, channel == null ? IntPtr.Zero : channel.Handle, packman == null ? IntPtr.Zero : packman.Handle, recursive, cb_wrapper.NativeDelegate, IntPtr.Zero);
int ret = raw_ret;
GLib.Marshaller.Free (path_as_native);
return ret;
}
开发者ID:joeshaw,项目名称:libredcarpet,代码行数:8,代码来源:Extract.cs
示例7: ApiExit
public static RC ApiExit(Context ctx, RC rc)
{
// If the ctx handle is not NULL, then we must hold the connection handle mutex here. Otherwise the read (and possible write) of db->mallocFailed is unsafe, as is the call to sqlite3Error().
Debug.Assert(ctx == null || MutexEx.Held(ctx.Mutex));
if (ctx != null && (ctx.MallocFailed || rc == RC.IOERR_NOMEM))
{
Error(ctx, RC.NOMEM, null);
ctx.MallocFailed = false;
rc = RC.NOMEM;
}
return (RC)((int)rc & (ctx != null ? ctx.ErrMask : 0xff));
}
开发者ID:BclEx,项目名称:GpuStructs,代码行数:12,代码来源:Main.cs
示例8: OnSubworldRemoved
protected virtual void OnSubworldRemoved (RC.World subworld)
{
GLib.Value ret = GLib.Value.Empty;
GLib.ValueArray inst_and_params = new GLib.ValueArray (2);
GLib.Value[] vals = new GLib.Value [2];
vals [0] = new GLib.Value (this);
inst_and_params.Append (vals [0]);
vals [1] = new GLib.Value (subworld);
inst_and_params.Append (vals [1]);
g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
foreach (GLib.Value v in vals)
v.Dispose ();
}
开发者ID:joeshaw,项目名称:libredcarpet,代码行数:13,代码来源:WorldMulti.cs
示例9: Form1
public Form1()
{
scene = new Scene();
scene.redraw += new EventHandler(scene_redraw);
InitializeComponent();
simpleOpenglControl1.InitializeContexts();
scene.Initialize();
Otros.LoadTexture();
scene.element=new Lugar();//new Base111(new Point3D(0,-2.6,-20),7,new float[]{1.0f,0.4f,0.2f,1.0f});
rc=new RC(this);
rc.Show();
}
开发者ID:jesantana,项目名称:ConcesionarioVirtual,代码行数:14,代码来源:Form1.cs
示例10: Error
//public static void Error(Context ctx, RC rc, int noString) { Error(ctx, rc, (rc == 0 ? null : string.Empty)); }
public static void Error(Context ctx, RC rc, string fmt, params object[] args)
{
if (ctx != null && (ctx.Err != null || (ctx.Err = Vdbe.ValueNew(ctx)) != null))
{
ctx.ErrCode = rc;
if (fmt != null)
{
string z = C._vmtagprintf(ctx, fmt, args);
Vdbe.ValueSetStr(ctx.Err, -1, z, TEXTENCODE.UTF8, C.DESTRUCTOR_DYNAMIC);
}
else
Vdbe.ValueSetStr(ctx.Err, 0, null, TEXTENCODE.UTF8, C.DESTRUCTOR_STATIC);
}
}
开发者ID:BclEx,项目名称:GpuStructs,代码行数:15,代码来源:Main.cs
示例11: ptrmapPutOvflPtr
internal void ptrmapPutOvflPtr(byte[] pCell, ref RC pRC)
{
if (pRC != 0)
return;
var info = new CellInfo();
Debug.Assert(pCell != null);
btreeParseCellPtr(pCell, ref info);
Debug.Assert((info.nData + (this.HasIntKey ? 0 : info.nKey)) == info.nPayload);
if (info.iOverflow != 0)
{
Pgno ovfl = ConvertEx.Get4(pCell, info.iOverflow);
this.Shared.ptrmapPut(ovfl, PTRMAP.OVERFLOW1, this.ID, ref pRC);
}
}
开发者ID:JiujiangZhu,项目名称:feaserver,代码行数:14,代码来源:MemPage+AutoVacuum.cs
示例12: pager_error
internal RC pager_error(RC rc)
{
var rc2 = (RC)((int)rc & 0xff);
Debug.Assert(rc == RC.OK ||
#if SQLITE_OMIT_MEMORYDB
0==MEMDB
#else
0 == this.memDb
#endif
);
Debug.Assert(this.errCode == RC.FULL || this.errCode == RC.OK || ((int)this.errCode & 0xff) == (int)RC.IOERR);
if (rc2 == RC.FULL || rc2 == RC.IOERR)
{
this.errCode = rc;
this.eState = PAGER.ERROR;
}
return rc;
}
开发者ID:JiujiangZhu,项目名称:feaserver,代码行数:18,代码来源:Pager+Pager.cs
示例13: ptrmapPutOvflPtr
static void ptrmapPutOvflPtr(MemPage page, byte[] cell, ref RC rcRef)
{
if (rcRef != RC.OK) return;
Debug.Assert(cell != null);
var info = new CellInfo();
btreeParseCellPtr(page, cell, ref info);
Debug.Assert((info.Data + (page.IntKey ? 0 : info.Key)) == info.Payload);
if (info.Overflow != 0)
{
Pid ovfl = ConvertEx.Get4(cell, info.Overflow);
ptrmapPut(page.Bt, ovfl, PTRMAP.OVERFLOW1, page.ID, ref rcRef);
}
}
开发者ID:BclEx,项目名称:GpuStructs,代码行数:13,代码来源:Btree.cs
示例14: ptrmapPut
static void ptrmapPut(BtShared bt, Pid key, PTRMAP type, Pid parent, ref RC rcRef)
{
if (rcRef != RC.OK) return;
Debug.Assert(MutexEx.Held(bt.Mutex));
// The master-journal page number must never be used as a pointer map page
Debug.Assert(!PTRMAP_ISPAGE(bt, PENDING_BYTE_PAGE(bt)));
Debug.Assert(bt.AutoVacuum);
if (key == 0)
{
rcRef = SysEx.CORRUPT_BKPT();
return;
}
var ptrmapIdx = PTRMAP_PAGENO(bt, key); // The pointer map page number
var page = (IPage)new PgHdr(); // The pointer map page
var rc = bt.Pager.Acquire(ptrmapIdx, ref page, false);
if (rc != RC.OK)
{
rcRef = rc;
return;
}
var offset = (int)PTRMAP_PTROFFSET(ptrmapIdx, key); // Offset in pointer map page
if (offset < 0)
{
rcRef = SysEx.CORRUPT_BKPT();
goto ptrmap_exit;
}
Debug.Assert(offset <= (int)bt.UsableSize - 5);
var ptrmap = Pager.GetData(page); // The pointer map page
if (type != (PTRMAP)ptrmap[offset] || ConvertEx.Get4(ptrmap, offset + 1) != parent)
{
TRACE("PTRMAP_UPDATE: %d->(%d,%d)\n", key, type, parent);
rcRef = rc = Pager.Write(page);
if (rc == RC.OK)
{
ptrmap[offset] = (byte)type;
ConvertEx.Put4(ptrmap, offset + 1, parent);
}
}
ptrmap_exit:
Pager.Unref(page);
}
开发者ID:BclEx,项目名称:GpuStructs,代码行数:45,代码来源:Btree.cs
示例15: copyNodeContent
static void copyNodeContent(MemPage from, MemPage to, ref RC rcRef)
{
if (rcRef == RC.OK)
{
BtShared bt = from.Bt;
var fromData = from.Data;
var toData = to.Data;
int fromHdr = from.HdrOffset;
int toHdr = (to.ID == 1 ? 100 : 0);
Debug.Assert(from.IsInit);
Debug.Assert(from.Frees >= toHdr);
Debug.Assert(ConvertEx.Get2(fromData, fromHdr + 5) <= (int)bt.UsableSize);
// Copy the b-tree node content from page pFrom to page pTo.
int data = ConvertEx.Get2(fromData, fromHdr + 5);
Buffer.BlockCopy(fromData, data, toData, data, (int)bt.UsableSize - data);
Buffer.BlockCopy(fromData, fromHdr, toData, toHdr, from.CellOffset + 2 * from.Cells);
// Reinitialize page pTo so that the contents of the MemPage structure match the new data. The initialization of pTo can actually fail under
// fairly obscure circumstances, even though it is a copy of initialized page pFrom.
to.IsInit = false;
var rc = btreeInitPage(to);
if (rc != RC.OK)
{
rcRef = rc;
return;
}
// If this is an auto-vacuum database, update the pointer-map entries for any b-tree or overflow pages that pTo now contains the pointers to.
#if !OMIT_AUTOVACUUM
if (bt.AutoVacuum)
rcRef = setChildPtrmaps(to);
#endif
}
}
开发者ID:BclEx,项目名称:GpuStructs,代码行数:36,代码来源:Btree.cs
示例16: insertCell
static void insertCell(MemPage page, uint i, byte[] cell, ushort size, byte[] temp, Pid childID, ref RC rcRef)
{
if (rcRef != RC.OK) return;
Debug.Assert(i <= page.Cells + page.Overflows);
Debug.Assert(page.Cells <= MX_CELL(page.Bt) && MX_CELL(page.Bt) <= 10921);
Debug.Assert(page.Overflows <= page.Ovfls.Length);
Debug.Assert(MutexEx.Held(page.Bt.Mutex));
// The cell should normally be sized correctly. However, when moving a malformed cell from a leaf page to an interior page, if the cell size
// wanted to be less than 4 but got rounded up to 4 on the leaf, then size might be less than 8 (leaf-size + pointer) on the interior node. Hence
// the term after the || in the following assert().
Debug.Assert(size == cellSizePtr(page, cell) || (size == 8 && childID > 0));
int skip = (childID != 0 ? 4 : 0);
if (page.Overflows != 0 || size + 2 > page.Frees)
{
if (temp != null)
{
Buffer.BlockCopy(cell, skip, temp, skip, size - skip);
cell = temp;
}
if (childID != 0)
ConvertEx.Put4(cell, childID);
int j = page.Overflows++;
Debug.Assert(j < page.Ovfls.Length);
page.Ovfls[j].Cell = cell;
page.OvflIdxs[j] = (ushort)i;
}
else
{
RC rc = Pager.Write(page.DBPage);
if (rc != RC.OK)
{
rcRef = rc;
return;
}
Debug.Assert(Pager.Iswriteable(page.DBPage));
var data = page.Data; // The content of the whole page
uint cellOffset = page.CellOffset; // Address of first cell pointer in data[]
uint end = cellOffset + 2U * page.Cells; // First byte past the last cell pointer in data[]
uint ins = cellOffset + 2U * i; // Index in data[] where new cell pointer is inserted
uint idx = 0; // Where to write new cell content in data[]
rc = allocateSpace(page, size, ref idx);
if (rc != RC.OK) { rcRef = rc; return; }
// The allocateSpace() routine guarantees the following two properties if it returns success
Debug.Assert(idx >= end + 2);
Debug.Assert(idx + size <= (int)page.Bt.UsableSize);
page.Cells++;
page.Frees -= (ushort)(2 + size);
Buffer.BlockCopy(cell, skip, data, (int)(idx + skip), size - skip);
if (childID != 0)
ConvertEx.Put4(data, idx, childID);
{
//uint8 *ptr = &data[end]; // Used for moving information around in data[]
//uint8 *endPtr = &data[ins]; // End of the loop
//_assert((PTR_TO_INT(ptr) & 1) == 0); // ptr is always 2-byte aligned
//while (ptr > endPtr)
//{
// *(uint16*)ptr = *(uint16*)&ptr[-2];
// ptr -= 2;
//}
for (uint j = end; j > ins; j -= 2)
{
data[j + 0] = data[j - 2];
data[j + 1] = data[j - 1];
}
}
ConvertEx.Put2(data, ins, idx);
ConvertEx.Put2(data, page.HdrOffset + 3, page.Cells);
#if !OMIT_AUTOVACUUM
if (page.Bt.AutoVacuum)
{
// The cell may contain a pointer to an overflow page. If so, write the entry for the overflow page into the pointer map.
ptrmapPutOvflPtr(page, cell, ref rcRef);
}
#endif
}
}
开发者ID:BclEx,项目名称:GpuStructs,代码行数:77,代码来源:Btree.cs
示例17: IsFatalError
static bool IsFatalError(RC rc)
{
return (rc != RC.OK && rc != RC.BUSY && C._ALWAYS(rc != RC.LOCKED));
}
开发者ID:BclEx,项目名称:GpuStructs,代码行数:4,代码来源:Backup.cs
示例18: StatusToString
public static string StatusToString(RC.PackageStatus status) {
IntPtr raw_ret = rc_package_status_to_string((int) status);
string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
return ret;
}
开发者ID:joeshaw,项目名称:libredcarpet,代码行数:5,代码来源:Package.cs
示例19: Equal
public bool Equal(RC.PackageMatch match2) {
bool raw_ret = rc_package_match_equal(Handle, match2 == null ? IntPtr.Zero : match2.Handle);
bool ret = raw_ret;
return ret;
}
开发者ID:joeshaw,项目名称:libredcarpet,代码行数:5,代码来源:PackageMatch.cs
示例20: SetImportance
public void SetImportance(RC.PackageImportance importance, bool match_gteq) {
rc_package_match_set_importance(Handle, (int) importance, match_gteq);
}
开发者ID:joeshaw,项目名称:libredcarpet,代码行数:3,代码来源:PackageMatch.cs
注:本文中的RC类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论