Ejemplo n.º 1
0
Archivo: KfsShare.cs Proyecto: tmbx/kwm
        /// <summary>
        /// This method contains the code that has to be executed both on 
        /// deserialization and on construction of this object. This method
        /// should not throw an exception.
        /// </summary>
        public void Initialize()
        {
            String shareRoot;
            if (Misc.ApplicationSettings.KfsStorePath == "") shareRoot = Misc.GetKfsDefaultStorePath();
            else shareRoot = Misc.ApplicationSettings.KfsStorePath;
            SharePath = Path.Combine(shareRoot, App.Helper.GetKwsUniqueName()) + "\\";

            InitialScanStatus = InitScanStatus.None;
            InitialScanDate = DateTime.MinValue;

            StaleFsEventDate = DateTime.MinValue;
            PartialScanDate = DateTime.MinValue;
            ScanRunningFlag = false;

            ServerOpAppDate = DateTime.MinValue;
            ServerOpRunningFlag = false;

            LocalUpdateFlag = true;
            LocalUpdateDate = DateTime.MinValue;
            ActiveFlag = false;

            StatusViewStaleDate = DateTime.MinValue;
            UpdateStatusViewFlag = false;

            TypeConflictFlag = false;

            ReportErrorToUserFlag = false;

            AllowedOp = InitialAllowedOp = AllowedOpStatus.None;

            TransferOrderID = 1;

            FileTransferTree = new SortedDictionary<String, UInt32>();

            TransferErrorArray = new List<KfsTransferError>();

            new KfsStatusView(this);
            new KfsPipeline(this);
            new KfsGate(this);
            new KfsDownloadManager(this);
            new KfsUploadManager(this);
            new KfsMetaDataManager(this);

            m_phase1Events = new SortedDictionary<UInt64, List<KfsServerOp>>();
        }
Ejemplo n.º 2
0
Archivo: KfsShare.cs Proyecto: tmbx/kwm
        /// <summary>
        /// This method is called to stop the share. It returns true when the
        /// share is ready to stop.
        /// </summary>
        public bool TryStop()
        {
            // Eventually make the scanner thread cancellable.
            StopWatcher();
            CancelAllNetworkOperations();
            InitialScanStatus = InitScanStatus.None;
            ReportErrorToUserFlag = false;
            AllowedOp = AllowedOpStatus.None;
            InitialAllowedOp = AllowedOpStatus.None;

            return (Gate.EntryCount == 0 &&
                    !ScanRunningFlag &&
                    DownloadManager.Status == DownloadManagerStatus.Idle &&
                    UploadManager.Status == UploadManagerStatus.Idle &&
                    MetaDataManager.Status == MetaDataManagerStatus.Idle);
        }
Ejemplo n.º 3
0
Archivo: KfsShare.cs Proyecto: tmbx/kwm
        /// <summary>
        /// This method should be called to disallow user operations. The method
        /// will only allow operations for the mininum of AllowedOp and
        /// requestedLevel.
        /// </summary>
        public void DisallowUserOp(String reason, AllowedOpStatus requestedLevel)
        {
            if (requestedLevel == AllowedOpStatus.None)
                AllowedOp = AllowedOpStatus.None;

            else if (requestedLevel == AllowedOpStatus.Download)
                if (AllowedOp == AllowedOpStatus.All)
                    AllowedOp = AllowedOpStatus.Download;

            if (InitialAllowedOp != AllowedOp)
                RequestStatusViewUpdate("DisallowUserOp, AllowedOp == " + AllowedOp);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// This method contains the code that has to be executed both on 
        /// deserialization and on construction of this object. This method
        /// should not throw an exception.
        /// </summary>
        public void Initialize()
        {
            m_licenseRestrictionError = false;

            InitialScanStatus = InitScanStatus.None;
            InitialScanDate = DateTime.MinValue;

            StaleFsEventDate = DateTime.MinValue;
            PartialScanDate = DateTime.MinValue;
            ScanRunningFlag = false;

            ServerOpAppDate = DateTime.MinValue;
            ServerOpRunningFlag = false;

            LocalUpdateFlag = true;
            LocalUpdateDate = DateTime.MinValue;
            ActiveFlag = false;

            StatusViewStaleDate = DateTime.MinValue;
            UpdateStatusViewFlag = false;

            TypeConflictFlag = false;

            ReportErrorToUserFlag = false;

            AllowedOp = InitialAllowedOp = AllowedOpStatus.None;

            TransferOrderID = 1;

            FileTransferTree = new SortedDictionary<String, UInt32>(KfsPath.Comparer);

            TransferErrorArray = new List<KfsTransferError>();

            new KfsStatusView(this);
            new KfsPipeline(this);
            new KfsGate(this);
            new KfsDownloadManager(this);
            new KfsUploadManager(this);
            new KfsMetaDataManager(this);

            m_phase1Events = new SortedDictionary<UInt64, List<KfsServerOp>>();
        }