Esempio n. 1
0
        /// <summary>
        /// Deserializing constructor.
        /// </summary>
        public Workspace(SerializationInfo info, StreamingContext context)
        {
            Int32 version = info.GetInt32("WorkspaceVersion");
            InternalID = info.GetUInt64("m_internalID");

            // This is an old workspace which needs to be rebuilt.
            if (version < 5)
            {
                FileKwsDeserializer dsr = (FileKwsDeserializer)KwmSpawner.Instance.KwmDsr.CurKwsDsr;

                // Get the folder information.
                try
                {
                    dsr.FolderID = UInt64.Parse(info.GetString("m_parentFolderID").Substring(6));
                    dsr.FolderIndex = info.GetInt32("m_indexInFolder");
                }

                catch (Exception)
                {
                }

                // Update the credentials.
                CoreData.Credentials = ((Credentials)info.GetValue("credentials", typeof(Credentials))).newCreds;

                // Set the rebuild information.
                MainStatus = KwsMainStatus.RebuildRequired;
                KwsRebuildInfo rebuildInfo = CoreData.RebuildInfo;
                rebuildInfo.DeleteCachedEventsFlag = true;
                rebuildInfo.DeleteLocalDataFlag = false;
                rebuildInfo.UpgradeFlag = true;

                if (version >= 3)
                {
                    AppKfs appKfs = (AppKfs)info.GetValue("m_appKfs", typeof(AppKfs));
                    appKfs.Share.CompatLastKwsEventID = info.GetUInt64("m_lastEventID");
                    appKfs.Initialize(this);
                    AppTree[KAnpType.KANP_NS_KFS] = appKfs;
                }
            }

            // Pre-desintermediation and later.
            else
            {
                MainStatus = (KwsMainStatus)info.GetValue("MainStatus", typeof(KwsMainStatus));
                KAnpState = (KwsKAnpState)info.GetValue("KAnpState", typeof(KwsKAnpState));
                CoreData = (KwsCoreData)info.GetValue("CoreData", typeof(KwsCoreData));
                UserTask = (KwsTask)info.GetValue("UserTask", typeof(KwsTask));

                // Post-desintermediation.
                if (version >= 6)
                {
                    KasLoginHandler = (KwsKasLoginHandler)info.GetValue("KasLoginHandler", typeof(KwsKasLoginHandler));
                    AppException = (Exception)info.GetValue("AppException", typeof(Exception));
                }
            }

            // Create a temporary KAS object.
            Kas = new WmKas(CoreData.Credentials.KasID);
        }
Esempio n. 2
0
 public LoginHandlerPwdPromptGer(KwsKasLoginHandler handler, String kwsName, String kwsPwd, bool failedFlag)
 {
     m_handler = handler;
     m_kwsName = kwsName;
     m_kwsPwd = kwsPwd;
     m_failFlag = failedFlag;
 }