コード例 #1
0
        public void app_ClosingLinks(object sender, ProgressChangedEventArgs e)
        {
            if (Globals.data != null)
            {
//        var openingLinksNames = new List<string>();
//        foreach (ModelPath modelPath in Globals.data)
//        {
//          var filePath = ModelPathUtils.ConvertModelPathToUserVisiblePath(modelPath);
//          openingLinksNames.Add(Path.GetFileNameWithoutExtension(filePath));
//        }
                // get document from event args
//        if (openingLinksNames.Any(file => e.Caption.Contains(file)))
                var state = e.Caption;
                if ((state.StartsWith("Loading") || state.StartsWith("Загрузка")) && !state.Contains(Globals.data))
                {
//          if (file.Length > 0)
//          {
//            if (!state.Contains(Globals.data))
//            {
                    if (e.Cancellable)
                    {
                        Debug.Write(state);
                        e.Cancel();
                    }
//            }
//          }
                }
            }
        }