void CDockablePropertyGridViews::PrepTabPropertyGrid(const SGV::CGraphViewCtrl * globalGraphView, const SGV::CGraphViewCtrl * activeGraphView) { ColTypeMap colTypeMap; CUniqueIDCStringStringMap properties; CComPtr<ITable> vertexData = CreateISparseTable(); CComPtr<ITable> edgeData = CreateISparseTable(); LoadProperties(globalGraphView, properties); LoadProperties(activeGraphView, properties); for(CUniqueIDCStringStringMap::iterator itr = properties.begin(); itr != properties.end(); ++itr) { switch (itr->first.GetCategory().GetCategory()) { case XGMML_CAT_VERTEX: LoadDataIntoTable(itr->first, &itr->second, colTypeMap, vertexData); break; case XGMML_CAT_EDGE: LoadDataIntoTable(itr->first, &itr->second, colTypeMap, edgeData); break; } } SetTabPropertyGrid(_T("Vertices"), vertexData); SetTabPropertyGrid(_T("Edges"), edgeData); }
void CDialogProperty::Apply() { // Copy back m_parent->get_config_prop().get_val() = m_dup_prop_map; m_parent->update_script(); LoadProperties(); }
void pkgObject::LoadObject() { try { dword range = ExportItem.SerialOffset + ExportItem.SerialSize; pkgArchive& A = *Serializer; A.Seek( ExportItem.SerialOffset ); if( A.Tell() >= range ) return; if( Flags.HasFlag(ObjectFlags::HasStack) ) { StateFrame = new pkgStateFrame; A >> *StateFrame; } if( A.Tell() >= range ) return; if( ExportItem.Class == 0 ) { Class = new pkgClass; A >> *Class; if( !Class->HasScript() ) LoadProperties(); }
void mitk::ShaderRepository::Shader::LoadProperties(const std::string& path) { vtkProperty *p = vtkProperty::New(); p->LoadMaterial(path.c_str()); LoadProperties(p); p->Delete(); }
/* void GetStringFromName (in wstring aName, out wstring aResult); */ NS_IMETHODIMP nsStringBundle::GetStringFromName(const PRUnichar *aName, PRUnichar **aResult) { NS_ENSURE_ARG_POINTER(aName); NS_ENSURE_ARG_POINTER(aResult); nsresult rv; rv = LoadProperties(); if (NS_FAILED(rv)) return rv; nsAutoCMonitor(this); *aResult = nsnull; nsAutoString tmpstr; rv = GetStringFromName(nsDependentString(aName), tmpstr); if (NS_FAILED(rv)) { #if 0 // it is not uncommon for apps to request a string name which may not exist // so be quiet about it. NS_WARNING("String missing from string bundle"); printf(" '%s' missing from bundle %s\n", NS_ConvertUTF16toUTF8(aName).get(), mPropertiesURL.get()); #endif return rv; } *aResult = ToNewUnicode(tmpstr); NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY); return NS_OK; }
bool j1Map::LoadLayer(pugi::xml_node& node, MapLayer* layer) { bool ret = true; layer->name = node.attribute("name").as_string(); layer->width = node.attribute("width").as_int(); layer->height = node.attribute("height").as_int(); LoadProperties(node, layer->properties); pugi::xml_node layer_data = node.child("data"); if(layer_data == NULL) { LOG("Error parsing map xml file: Cannot find 'layer/data' tag."); ret = false; RELEASE(layer); } else { layer->data = new uint[layer->width*layer->height]; memset(layer->data, 0, layer->width*layer->height); int i = 0; for(pugi::xml_node tile = layer_data.child("tile"); tile; tile = tile.next_sibling("tile")) { layer->data[i++] = tile.attribute("gid").as_int(0); } } return ret; }
LRESULT CDialogProperty::OnImportBnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl) { pfc::string8 filename; if (uGetOpenFileName(m_hWnd, "Property files|*.wsp|All files|*.*", 0, "wsp", "Import from", NULL, filename, FALSE)) { file_ptr io; abort_callback_dummy abort; try { filesystem::g_open_read(io, filename, abort); prop_kv_config::g_load(m_dup_prop_map, io.get_ptr(), abort); } catch (std::exception &) { return 0; } // Refresh display LoadProperties(false); } return 0; }
void COXChildFrameState::Serialize(CArchive& ar) { ASSERT_VALID(this); // Check the version // (If version == -1, the version is unknown, this occurs when Serialize() is called directly) if (ar.IsLoading()) { m_nSerializeSchemaVersionLoad = (int)ar.GetObjectSchema(); if (m_nSerializeSchemaVersion < m_nSerializeSchemaVersionLoad) { TRACE1("COXChildFrameState::Serialize : Unexpected schema version : %i, throwing CArchiveException\n", m_nSerializeSchemaVersionLoad); AfxThrowArchiveException(CArchiveException::badSchema); } } // Call base class implementation CObject::Serialize(ar); // Serialize all data if (ar.IsStoring()) StoreProperties(ar); else LoadProperties(ar); ASSERT_VALID(this); }
STDMETHODIMP CAddIn::Init(IDispatch *pConnection) { AFX_MANAGE_STATE(AfxGetStaticModuleState()) m_iErrorLog = NULL; pConnection->QueryInterface(IID_IErrorLog,(void **)&m_iErrorLog); /* CString csProfileName = "AddIn Profile Name"; m_iProfile = NULL; pConnection->QueryInterface(IID_IPropertyProfile,(void **)&m_iProfile); m_iProfile->RegisterProfileAs(csProfileName.AllocSysString()); */ m_iStatusLine = NULL; pConnection->QueryInterface(IID_IStatusLine,(void **)&m_iStatusLine); m_iAsyncEvent = NULL; pConnection->QueryInterface(IID_IAsyncEvent,(void **)&m_iAsyncEvent); // TODO: Add your implementation code here if (LoadProperties() == FALSE) return E_FAIL; return S_OK; }
void cLayerProperties::CreateGridElems() { LoadProperties(); if ( 0 == mGenGrid->Count() ) { AddCellClick( NULL ); } else { mGenGrid->GetCell( 0 )->Select(); } }
// Loads an entity from the given xml node. void EntitySerializer::Load(Entity *entity, const rapidxml::xml_node<lean::utf8_t> &node, beCore::ParameterSet ¶meters, beCore::SerializationQueue<beCore::LoadJob> &queue) const { ComponentSerializer<Entity>::Load(entity, node, parameters, queue); entity->SetPersistentID( EntitySerializer::GetID(node) ); // Properties LoadProperties(*entity, node); // Controllers SetEntityParameter(parameters, entity); LoadControllers(entity, node, parameters, queue); }
LRESULT CDialogProperty::OnInitDialog(HWND hwndFocus, LPARAM lParam) { DlgResize_Init(); // Subclassing m_properties.SubclassWindow(GetDlgItem(IDC_LIST_PROPERTIES)); m_properties.ModifyStyle(0, LBS_SORT | LBS_HASSTRINGS); m_properties.SetExtendedListStyle(PLS_EX_SORTED | PLS_EX_XPLOOK); LoadProperties(); return TRUE; // set focus to default control }
NS_IMETHODIMP nsStringBundle::GetSimpleEnumeration(nsISimpleEnumerator** elements) { if (!elements) return NS_ERROR_INVALID_POINTER; nsresult rv; rv = LoadProperties(); if (NS_FAILED(rv)) return rv; if (mOverrideStrings) return GetCombinedEnumeration(mOverrideStrings, elements); return mProps->Enumerate(elements); }
HRESULT PropExtCL::Initialize(IStream *pstream,DWORD grfMode) { HRESULT hresult; if(initialized) { return HRESULT_FROM_WIN32(ERROR_ALREADY_INITIALIZED); } readOnlyMode= grfMode==STGM_READ; contentStream=pstream; hresult=LoadProperties(); if(!SUCCEEDED(hresult)) { return hresult; } return S_OK; }
//-------------------------------------------------------------------------- bool EntityS::OnLoad() { VeUInt32 u32Res = LoadProperties(); switch(u32Res) { case DBBusiness::RESULT_OK: OnAfterLoad(false); return true; case DBBusiness::RESULT_CREATE: OnAfterLoad(true); return true; default: printf("Load entity properties faile\n"); return false; } }
/* void GetStringFromID (in long aID, out wstring aResult); */ NS_IMETHODIMP nsStringBundle::GetStringFromID(PRInt32 aID, PRUnichar **aResult) { nsresult rv; rv = LoadProperties(); if (NS_FAILED(rv)) return rv; *aResult = nsnull; nsAutoString tmpstr; rv = GetStringFromID(aID, tmpstr); NS_ENSURE_SUCCESS(rv, rv); *aResult = ToNewUnicode(tmpstr); NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY); return NS_OK; }
void mitk::ShaderRepository::Shader::LoadProperties(std::istream& stream) { std::string content; content.reserve(2048); char buffer[2048]; while (stream.read(buffer, sizeof(buffer))) { content.append(buffer, sizeof(buffer)); } content.append(buffer, static_cast<std::size_t>(stream.gcount())); if (content.empty()) return; this->SetMaterialXml(content); vtkProperty *p = vtkProperty::New(); p->LoadMaterialFromString(content.c_str()); LoadProperties(p); p->Delete(); }
// this function supports at most 10 parameters.. see below for why NS_IMETHODIMP nsStringBundle::FormatStringFromName(const PRUnichar *aName, const PRUnichar **aParams, PRUint32 aLength, PRUnichar **aResult) { NS_ENSURE_ARG_POINTER(aName); NS_ASSERTION(aParams && aLength, "FormatStringFromName() without format parameters: use GetStringFromName() instead"); NS_ENSURE_ARG_POINTER(aResult); nsresult rv; rv = LoadProperties(); if (NS_FAILED(rv)) return rv; nsAutoString formatStr; rv = GetStringFromName(nsDependentString(aName), formatStr); if (NS_FAILED(rv)) return rv; return FormatString(formatStr.get(), aParams, aLength, aResult); }
SidePanel::SidePanel( char *name ) : FadingWindow(name), m_expanded(false), m_moving(false), m_mode(ModeUnitPlacement), m_currentFleetId(-1), m_previousUnitCount(0), m_fontsize(13.0f) { //SetMovable(false); SetSize( 100, 400 ); if( g_windowManager->WindowH() > 480 ) { SetPosition( 0, 100 ); } else { SetPosition( 0, 0 ); } LoadProperties( "WindowUnitCreation" ); }
WFileList::WFileList(class WCryptoTE* parent) : wxListCtrl(parent, wxID_ANY), wmain(parent) { metasettings.show_filename = metasettings.show_size = metasettings.show_compressed = metasettings.show_compression = metasettings.show_encryption = metasettings.show_mtime = metasettings.show_ctime = metasettings.show_author = metasettings.show_subject = 50; UpdateDisplayMode(0); droptarget = new WFileListDropTarget(parent); SetDropTarget(droptarget); BuildImageList(); LoadProperties(); }
//================================================================================ ATHObject* ATHObjectManager::GenerateObject(rapidxml::xml_node<>* pRootObjNode) { ATHObject* pReturnObject = nullptr; rapidxml::xml_attribute<>* currObjName = pRootObjNode->first_attribute("Name"); pReturnObject = new ATHObject(); // Assign a name to the object if (currObjName) pReturnObject->m_strName = currObjName->value(); else pReturnObject->m_strName = "Object"; // Handle Property setup LoadProperties( pReturnObject, pRootObjNode->first_node("Properties") ); ATHRenderNode* pRenderNode = GenerateRenderNode(pRootObjNode); b2Body* pBody = GenerateB2Body(pRootObjNode); pReturnObject->Init(pRenderNode, pBody); return pReturnObject; }
//-------------------------------------------------------------------------- void Server::Start() { VeXMLElement* pkServer = m_kConfig.RootElement()->FirstChildElement("Server"); const VeChar8* pcVersion = pkServer->FirstChildElement("Version")->GetText(); { VeZeroMemory(&m_kVersion, sizeof(Version)); VeChar8 acBuffer[64]; VeStrcpy(acBuffer, 64, pcVersion); VeChar8* pcContext; const VeChar8* pcTemp = VeStrtok(acBuffer, ".", &pcContext); VeUInt32 i(0); while(pcTemp && i < 4) { m_kVersion.m_au8Version[i] = VeAtoi(pcTemp); pcTemp = VeStrtok(NULL, ".", &pcContext); ++i; } } VeUInt16 u16Port; VE_ASSERT_EQ(VeStringA(pkServer->FirstChildElement("ServerPort")->GetText()).To(u16Port), true); VeUInt16 u16MaxConnections; VE_ASSERT_EQ(VeStringA(pkServer->FirstChildElement("MaxConnections")->GetText()).To(u16MaxConnections), true); VeUInt32 u32TimeOut; VE_ASSERT_EQ(VeStringA(pkServer->FirstChildElement("TimeOut")->GetText()).To(u32TimeOut), true); const VeChar8* pcPassword = pkServer->FirstChildElement("Password")->GetText(); m_pkPeer->SetIncomingPassword(pcPassword, (VeInt32)VeStrlen(pcPassword)); m_pkPeer->SetTimeoutTime(u32TimeOut, UNASSIGNED_SYSTEM_ADDRESS); SocketDescriptor akSocketDesc[2]; akSocketDesc[0].port = u16Port; akSocketDesc[0].socketFamily = AF_INET; akSocketDesc[1].port = u16Port; akSocketDesc[1].socketFamily = AF_INET6; bool bRes = m_pkPeer->Startup(u16MaxConnections, akSocketDesc, 2, 30) == VENET_STARTED; m_pkPeer->SetMaximumIncomingConnections(u16MaxConnections); if(bRes) { printf("%s Server Started, Waiting For Connections.\n", m_kName); } else { bRes = m_pkPeer->Startup(u16MaxConnections, akSocketDesc, 1, 30) == VENET_STARTED; if(!bRes) { VeChar8 acBuffer[256]; VeSprintf(acBuffer, 256, "%s Server failed to start. Terminating.", m_kName); puts(acBuffer); exit(1); } printf("%s Server Started, Waiting For Connections.\n", m_kName); } m_pkPeer->SetOccasionalPing(true); m_pkPeer->SetUnreliableTimeout(1000); DataStructures::List< VENetSmartPtr<VENetSocket> > kSockets; m_pkPeer->GetSockets(kSockets); for(VeUInt32 i(0); i < kSockets.Size(); ++i) { printf("Ports Used By :%i. %i\n", i+1, kSockets[i]->boundAddress.ToString(true)); } for(VeUInt32 i(0); i < m_pkPeer->GetNumberOfAddresses(); ++i) { printf("\n本机可提供服务的IP :\n%i. %s\n", i+1, m_pkPeer->GetLocalIP(i)); } printf("%s Server GUID is %s\n", m_kName, m_pkPeer->GetGuidFromSystemAddress(UNASSIGNED_SYSTEM_ADDRESS).ToString()); { VeXMLElement* pkDBLink = m_kConfig.RootElement()->FirstChildElement("DBLink"); VeStringA kAccount = pkDBLink->FirstChildElement("Account")->GetText(); VeStringA kPassword = pkDBLink->FirstChildElement("Password")->GetText(); VeStringA kDBSource = pkDBLink->FirstChildElement("DBSource")->GetText(); printf("\nDBSource :%s\n", pkDBLink->FirstChildElement("DBSource")->GetText()); m_kDatabase = VE_NEW DBBusiness(kAccount,kPassword,kDBSource); } LoadProperties(); m_u64ServerStartTime = m_u64ServerTime; AttachByDelay(TIMER(_SyncToDatabase), SAVE_DB_DELAY); OnStart(); }
void NewDistributionWindow::on_clearButton_clicked() { distribution->clear(); LoadProperties(fileFormat); }
void mitk::ShaderRepository::Shader::LoadPropertiesFromPath() { LoadProperties(path); }